Any Ideas?
Posted: Tue Mar 30, 2004 5:15 pm
Hey,
Ive got the following code for displaying pictures in specifeid folders
What id like to do is when the thumbnails are displayed instead of just having a next and back buton have the page numbers at the bottom e.g. 1 2 3 4 etc etc, any quick and easy solutions?
Cheers
Slater
Ive got the following code for displaying pictures in specifeid folders
Code: Select all
<?
INCLUDE "conf.php3";
if ((!isset($gal))||(!isset($title[$gal]))){
print "<TITLE>Categories</TITLE>";
include "banner.php3";
print "<h1>Categories</h1>";
$i=0;
while (isset($title[$i])){
print "<h2><a href=$PHP_SELF?gal=$i>$title[$i]</a></h2>";
$i++;
};
}else{
?>
<TITLE><? print $title[$gal]; ?></TITLE>
</HEAD>
<BODY BACKGROUND="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000ff" VLINK="#800080" ALINK="#ff0000" >
<?
error_reporting(63);
include "banner.php3";
?>
<center>
<h1><? print $title[$gal] ?></h1>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?
if (!isset($pg)){
$pg=0;
};
$handle=opendir($dir[$gal]);
$i=0;
while ($file = readdir($handle)) {
if (eregi("jpg$",$file)){
$folder[$i]=$file;
$i=$i+1;
};
};
closedir($handle);
sort($folder);
$a=0;
$count=$row*$col*$pg;
for ($r=1; $r<=$row; $r++) {
print "<tr>";
if ($count>$i-1) {break;};
for ($c=1; $c<=$col; $c++) {
$tnpath=$tndir[$gal]."/".$folder[$count];
print "<td valign="center" align="center"><a href="view.php3?id=$folder[$count]&gal=$gal&pg=$pg&count=$count"><img src="$tnpath" BORDER=0></a><td valign="center">"; $count++;
if ($count>$i-1) {break;};
} ;
print "</tr>";
} ;
print "</table><h2>";
if ($pg>0) {
$tmp=$pg-1;;
print "<a href="$PHP_SELF?pg=$tmp&gal=$gal"><img src="prev.gif" alt="prev" width="30" height="20" border="0"></a>" ;
};
$tmp=$pg+1;
print "       ";
if ($tmp*$row*$col<$i) {
$tmp=$pg+1;
print "<a href="$PHP_SELF?pg=$tmp&gal=$gal"><img src="next.gif" alt="prev" width="30" height="20" border="0"></a>" ;
};
print "</h2>";
};
include "bannerbot.php3";
?>Cheers
Slater