
08/05/2004, 07:31
|
| | Fecha de Ingreso: noviembre-2003
Mensajes: 114
Antigüedad: 21 años, 4 meses Puntos: 0 | |
function cmp ($a, $b) {
$tmp[0]=strtoupper($a);
$tmp[1]=strtoupper($b);
sort($tmp);
return (strcmp(strtoupper($tmp[1]) , strtoupper($b))) ? 1 : -1;
}
function getDirByLetter ($dirName) {
static $result_array=array();
$d = dir($dirName);
while($entry = $d->read()) {
if ($entry != "." && $entry != "..") {
if (is_dir($dirName."/".$entry)){
array_push($result_array,$entry);
}
}
}
$d->close();
usort($result_array, "cmp");
return $result_array;
}
//AQUI PONES EL DIRECTORIO
$AllTheDirectories = getDirByLetter("./modules/Galeria/galleries/");
$array_quotient=count($AllTheDirectories) / 2; //AQUILA CANTIDAD DE COLUMNAS
$array_quotient=ceil($array_quotient);
$Column = 0;
$FirstCol = "no";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\"><td valign=\"top\" nowrap>";
for ($i=0;$i<count($AllTheDirectories);$i++) {
if($Column == $array_quotient) {
$Column = 0;
if ($FirstCol = "yes") {
echo "</td>";
}
echo "<td valign=\"top\" nowrap>";
$FirstCol = "yes";
}
$Column++;
echo "AQUI EL CODIGO";
EJEMPLO: = "<b><a href=ARCHIVO.PHP?dir=".rawurlencode($AllTheDirecto ries[$i])."><img border=0 src=\"modules/My_eGallery/galleries/".$AllTheDirectories[$i].".gif\" alt=\"".$AllTheDirectories[$i]."\"><br></a><a href=modules.php?name=My_eGallery&show=categories& dir=".rawurlencode($AllTheDirectories[$i])." title=\"".$AllTheDirectories[$i]."\">".str_replace(".", " ",$AllTheDirectories[$i])."</a></b><br><br>";
}
echo "</font></table></td></tr></table>";
}
LO COMENTE A VELOCIDAD LUZ Y EN EL CUANDRO DE RESPUESTA RAPIDA TIENE UN MONTON DE CODIGO PERO FUNCIONA, ESO ESPERO A MI ME FUNCIONA.
__________________ Soporte y Creaciones PHP-Nuke: NukeProjects.Net
if($Necesitas=="Ayuda"){
echo "No dudes en pedirla";
} |