The idea behind this code is to pick a month, then display all the pictures located in that month. The problem is, it's only displaying the first three, then failing the while check. Ack!
<?
session_start();
require_once( "../warningg_db_fns.php" );
require_once( "../warningg_html_fns.php" );
require_once( "../warningg_news_fns.php" );
$playeraccess = get_access($playername);
do_header($playername, $playeraccess);
if (!$month)
{
echo "Select Month:<p>";
$dir = opendir("/home/shared/www/demo.warningg.com/lan/lanphotos/");
while ($file = readdir($dir))
{
if ($file != "." && $file != "..")
{
echo "<a href='lan-photos.php?month=" . $file . "'>" . ucfirst($file) . "</a><br>";
}
}
closedir($dir);
do_footer();
}
else
{
echo '<table border="0" cellpadding="0" cellspacing="0" width="100%">';
$thumbdirectory = "/home/shared/www/demo.warningg.com/lan/lanphotos/" . $month;
$dir = opendir($thumbdirectory);
rewinddir($dir);
$file = readdir($dir);
$file = readdir($dir);
$file = readdir($dir);
while ($file != 0);
{
echo "<tr width='100%'>";
for ($i = 1; $i <= 3; $i++)
{
echo "<td width='33%'>";
echo "<img src='/lan/lanphotos/" . $month . "/" . $file . "'>";
echo "</td>";
$file = readdir($dir);
}
echo "</tr>";
}
echo "</table>";
do_footer();
}
exit;