here's the portion of the code(gallery.php) that generates the images and links
PHP Code:
if(!$_GET['album_name'])
{}
else
{
$album_name=$_GET['album_name'];
$max=$_GET['max'];
if(!isset($_GET['pic_num'])) $_GET['pic_num']=0;
$pic_num=$_GET['pic_num'];
require('db_login_details.php');
$connection=mysql_connect($db_hostname, $db_username, $db_password);
if(!$connection)
die("Failed to connect to database".mysql_error());
// for previous
if(!$pic_num)
$previous="#nogo";
else
{$temp=$pic_num-9;
$previous="gallery.php?album_name=$album_name&pic_num=".$temp."&max=$max" ;
}
$query="SELECT pic_num,pic_name,pic_thumb,pic_full,pic_size,pic_desc FROM wizkid_mysite.gallery_$album_name where pic_num > '$pic_num'";
// echo"\n<br/>pic_num = $pic_num <br/>$query";
$query_result=mysql_query($query);
echo"\n<div class=\"gallery\"><ul>";
if(!$query_result)
{
die("<br/>table ".mysql_error());
}
$i=0;
while(($row=mysql_fetch_row(($query_result)))&&($i++<9))
{
echo"\n<li>
\n
\n<a href=\"$row[3]\">
\n<img src=\"$row[2]\" width=\"100px\" height=\"100px\" alt=\"$row[5]\"/>
\n</a>
\n</li> ";
$for_next=$row[0];
}
// if(!($row=mysql_fetch_row(($query_result)))&&$i++<9)
while(($i)%3!=0)
{
$i++;
echo"\n<li style=\"visibility:hidden;\"><a><img></a></li>";
}
echo"\n</ul></div>";
// for next
// echo"<br/>for_next= $for_next max=$max<br/>";
if($for_next<$max)
$next=htmlentities($_SERVER['PHP_SELF'])."?album_name=$album_name&pic_num=$for_next&max=$max";
else
$next="#nogo";
echo"\n<br/><p class=\"album_nav\">
\n<a href=\"".$previous."\">previous</a> \n<a href=\"".$next."\">next</a>
\n<a href=\"".htmlentities($_SERVER['PHP_SELF'])."\">Change ALbum</a>
\n</p>";
mysql_close($connection);
}