Отправлено 30.10.2006, 08:53
(Сообщение последний раз редактировалось: 30.10.2006, 08:54 Andeque.)
* Andeque подает в суд на штакета за спижженный скрипт )
смени
на
смени
Код:
<?
$the_array = Array();
$handle = opendir('.');
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && $file != "index.php" && $file != "thumbs.php") {
$the_array[] = $file;
}
}
closedir($handle);
sort ($the_array);
reset ($the_array);
while (list ($key, $val) = each ($the_array)) {
echo "<a href=\"$val\"><img src=\"./thumbs.php?im=$val&w=25&h=25&g=\">$val</a>
";
}
?>на
Код:
<?
$the_array = Array();
$handle = opendir('.');
while (false !== ($file = readdir($handle))) {
if ( stristr($file, ".jpg") OR stristr($file, ".gif") ) {
$the_array[] = $file;
}
}
closedir($handle);
sort ($the_array);
reset ($the_array);
echo "<title>Equand's Gallery Script 1.5b</title><html>\n";
$iter = 3;
$i = 1;
$l = 1;
echo "<table>\n";
while (list ($key, $val) = each ($the_array)) {
if ( $i == $l ) {
echo "<tr>\n";
echo "<td><a href=\"$val\"><img src=\"./thumbs.php?im=$val&w=25&h=25&g=\">
$val</a></td>\n";
$l = $l + $iter;
} elseif ( $i != 1 && $i == $l - 1 ) {
echo "<td><a href=\"$val\"><img src=\"./thumbs.php?im=$val&w=25&h=25&g=\">
$val</a></td>\n";
echo "</tr>\n";
} else {
echo "<td><a href=\"$val\"><img src=\"./thumbs.php?im=$val&w=25&h=25&g=\">
$val</a></td>\n";
}
$i++;
}
echo "</table></html>\n";
?>
Don't fuck with Wendy Testaburger!
