Archive for September, 2009

Listar en nombre de archivos de un directorio con PHP

Tags:

if ($handle = opendir($path)) {

$ret = ”;
while (false !== ($file = readdir($handle))) {
if($file!=”.” && $file!=”..”){
$ret =  $ret . ‘<li>
<a class=”thumb” href=”‘.$path.’/’.”$file\n”.’” title=”your image title”>
<img src=”‘.$path.’/’.”$file\n”.’” alt=”‘.$titulo.’” />
</a>
<div class=”caption”>
‘.$titulo.’
</div>
</li>’;
}

}
closedir($handle);
return $ret;

}

Continue reading » No comments

Crear un efecto realista Hover con jQuery

Tags:

¿Te gustaría crear un efecto realista Hover con jQuery ?
Añade un efecto hover a un conjunto de enlaces utilizando el efecto jQuery Animate. En pocas palabras, el JS añade el reflejo / sombra a cada <li>, a continuación, anima a la posición y la opacidad de estos elementos y los iconos de los links en [...]

Continue reading » No comments

Función PHP para forzar la descarga de archivos

Tags: ,

function force_download($file)
{
if ((isset($file))&&(file_exists($file)))
{
header(“Content-length: “.filesize($file));
header(‘Content-Type: application/octet-stream’);
header(‘Content-Disposition: attachment; filename=”‘ . $file . ‘”‘);
readfile(“$file”);
}
else
{
echo “No se ha seleccionado ningún fichero”;
}
}

Continue reading » No comments

Acceder a Google Weather en PHP

Tags: , ,

Interesante clase para acceder de un modo sencillo al servicio metereológico de Google.Ejemplo:

<?php class GoogleWeatherAPI {
private $city_code = ”;
private $city = ”;
private $domain = ‘www.google.com’;
private $prefix_images = ”;
private $current_conditions = array();
private $forecast_conditions = array();
private $is_found = true;

/** * Class constructor
* @param $city_code is the label of the city
* @param $lang the lang of the [...]

Continue reading » No comments

CSS hack para safari y chrome

Tags: ,

@media screen and (-webkit-min-device-pixel-ratio:0)
{
div
{
color: red; /* The text will appear red only in Safari and Google Chrome */
}
}

Continue reading » No comments