Created
July 25, 2011 05:07
-
-
Save rooven/1103590 to your computer and use it in GitHub Desktop.
Codigo para galeria simple php sin bd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<title>Galería de fotos</title> | |
<style type="text/css">.newStyle1 { | |
font-family: Arial, Helvetica, sans-serif; | |
} | |
.imagen{ | |
width:300px; | |
padding:2em; | |
float:left; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="galeria" class="galeria"> | |
<h2>Galería de imágenes</h2> | |
<?php | |
//Solo tienen que cambiar el directorio de las imagenes en "dir", y en el link del archivo | |
// y ajustar los divs a su diseño, lo importante es el codigo php | |
$NAMEFILE = "galeria.php"; | |
$dir = opendir("imgs/slider/"); | |
while ($file = readdir($dir)) { | |
if ($file != "." && $file != ".." && $file != "$NAMEFILE") { | |
$data[$file]='<div class="grid_3 imagen"><a href="imgs/slider/'.$file.'" target="_blank"><img src="imgs/slider/'.$file.'" alt="'.$file.'" title="'.$file.'" width="90%" height="90%" /></a></div>'; | |
}} | |
rsort($data); | |
while(list($k,$v) = each($data)) { echo $v; } | |
clearstatcache(); | |
echo "<br />"; | |
?> | |
</div> | |
<div><p><small>Cortesía de <a href="http://www.román-paladino.info" rel="external">Roman Paladino, modificado por rooven</a>.</small></p></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Muchisimas gracias.