ok heres the deal this script thumbnails an adds a desc of products from a dir i want it to only list 10 items per page then add the appropriate # of links in this format prev 1 2 3 4 next
can anyone help ??
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?
function CreateThumbs($thumb_dir) {
$dir_name = "$thumb_dir";
$dir = opendir($dir_name);
$a = "0";
echo "<table>";
while ($file_name = readdir($dir)) {
if (($file_name != ".") && ($file_name != "..")
&& (!preg_match("/.htm/i", "$file_name"))
&& (!preg_match("/.txt/i", "$file_name"))
&& (!preg_match("/.zip/i", "$file_name"))
&& (!preg_match("/.php/i", "$file_name")))
{
$image_file = "$dir_name/$file_name";
$divided = $a / 3;
if (is_integer($divided)) { $thumb_list .= "<tr>"; }
$thumb_list .= "<td><a href=\"$dir_name/$file_name\" target=\"_blank\"><img src=\"$dir_name/$file_name\" width=\"100\"
height=\"65\" border=\"0\" alt=\"\"></a><br>" . AddTXT("$file_name.txt") . "</td>";
$a = $a + 1;
}
}
echo "$thumb_list";
echo "</tr></table>";
closedir($dir);
}
function AddTXT($filename)
{
if (empty($filename))
return;
if (!file_exists($filename))
return;
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
return $contents;
}
?>
</head>
<body>
<? CreateThumbs("./"); ?>
</body>
</html>