include("path.php");
list(,$dir,$name,$page,$thumbdir,$focus) = explode("/",$_SERVER["PATH_INFO"]);
$scriptname = "screens.php";
$name = stripslashes($name);
$page = "$page";
$tdir = "$thumbdir";
if($tdir == "") { $tdir = "thumbs"; }
$game = "$dir";
if($game=="") { print "No game specified, exiting."; exit; }
$dir = @dir("".$path."/screens/$game/$tdir/") or die("
Can't open thumbnail directory, click here to go back.");
$dir->rewind();
for ($i=1; $file=$dir->read(); ++$i)
{
if ($file != "." && $file != ".." && $file != "description.txt")
{
$screenshots[] = $file;
}
}
$dir->close;
@rsort($screenshots);
function show_screenshots()
{
global $screenshots,$game,$name,$page,$focus,$nextshot,$prevshot,$ppage,$npage,$scriptname,$tdir,$no_ads;
$bleh = count($screenshots);
$hex = '
';
if(!$page) { $g = 0; $max = 6; $page=1; }
if($page == 1) { $g = 0; $max = 6; }
if($page == 2) { $g = 6; $max = $g + 6; }
if($page > 2) { $g = 6 * $page; $g = $g - 6; $max = $g + 6; }
for($g=$g; $g<$max; ++$g)
{
$old = $g - 1;
$h = $g + 1;
$j = $g + 2;
$i = $g + 3;
$old = str_replace("thumb_","",$screenshots[$old]);
$newfile = str_replace("_t","",$screenshots[$g]);
$newfile2 = str_replace("_t","",$screenshots[$h]);
$newfile3 = str_replace("_t","",$screenshots[$j]);
$newfile4 = str_replace("_t","",$screenshots[$i]);
$chex=$bleh-$g;
if($chex >= "3")
{
$hex = $hex . "\n" .
"\n | " .
"\n | " .
"\n | ";
if($focus == $newfile){ $nextshot = "$newfile2"; $prevshot = "$old"; if($max-$g == 6) { $ppage = $page-1; $npage = $page; } else {$npage = $page; $ppage = $page; } }
if($focus == $newfile2) { $nextshot = "$newfile3"; $prevshot = "$newfile"; $npage = $page; $ppage = $page;}
if($focus == $newfile3) { $nextshot = "$newfile4"; $prevshot = "$newfile2"; if($max-$g == 3) { $npage = $page +1; $ppage = $page; } else {$npage = $page; $ppage = $page; } }
}
if($chex == "2")
{
$hex = $hex . "\n" .
"\n | " .
"\n | ";
if($focus == $newfile) { $nextshot = "$newfile2"; if($max-$g < 6) { $prevshot = $old; $ppage = $page; $npage = $page; } else { $prevshot = $old; $ppage = $page-1; $npage = $page; } }
if($focus == $newfile2) { $nextshot = "$newfile3"; if($max-$g < 6) { $prevshot = $newfile; $ppage = $page; $npage = $page; } else { $prevshot = $old; $ppage = $page-1; $npage = $page; } }
}
if($chex == "1")
{
$hex = $hex . "\n " .
"\n | ";
if($focus == $newfile) { if($max-$g < 6) { $nextshot = "$newfile2"; $prevshot = $old; $ppage = $page; $npage = $page;} else { $nextshot = "$newfile2"; $prevshot = $old; $ppage = $page-1; $npage = $page; } }
}
else
{
$hex = $hex. "";
}
$g = $g + 2;
}
$hex = $hex. " | $ad_include |
";
$pages = $bleh / 6;
$pages = $pages + 0.4;
$pages = round($pages);
$hex = $hex. "
[ ";
for($h=0; $h<$pages; ++$h)
{
$h2 = $h + 1;
if($h2 == $page) { $hex = $hex. "page $h2 "; }
else { $hex = $hex. "page $h2 "; }
}
$hex = $hex. " ]
";
return $hex;
}
$test = show_screenshots();
if(strlen($focus) < 1)
{
$fullsize = " ";
}
elseif($ppage == 0)
{
$fullsize = "
";
}
elseif(strlen($nextshot) < 1)
{
$fullsize = "
";
}
else
{
$fullsize = "
";
}
if(strlen($focus) >= 1)
{
$fullsize = "";
}
// LOAD TEMPLATE
$name = str_replace("+"," ",$name);
if($name)
{
$name2 = "Game Title: $name";
}
else
{
$name2 = " ";
}
include("".$path."/templates/screens.header.php");
?>
Image Gallery:
echo $fullsize; ?>
echo $test; ?>
include("".$path."/templates/screens.footer.php"); ?>