Welcome to the ArcterCam
Home
FAQ
Howto
Gallery
UF-Cams

Gallery of a Geek

(Yes, there are still some bugs in the gallery, but you can deal with it for now)


corny-2-small.jpg




All graphics, text, funny faces, and flatulence is copyright it's owner. That would be me. So don't steal it without permission ok?

Here's the source code you wanted....

<?php
function print_head() {
    
readfile("head.ssi");
}

function 
print_tail() {
    
readfile("tail.ssi");
    print 
"</CENTER>";
}

print_head();
?>

<BR>
<CENTER>
<STRONG><FONT SIZE="+2">Gallery of a Geek</STRONG></FONT>
<P>
(Yes, there are still some <A HREF="gallery.php?show=1#source">bugs</A> in the gallery, but you can deal with it for
now)
<HR NOSHADE WIDTH="70%"> </CENTER>
<P>

<?php

$font 
"<FONT face=\"Verdana, Arial, Helvetica\" SIZE=\"-1\">";

$picname $_GET["picname"];
$show $_GET["show"];
$picnum $_GET["pic"];

if (
$picnum == "" && $picname == "") {
    
$picnum 1;
}

$p $picnum-1;
$n $picnum+1;
# create the array
$filearray = array();

# open and load 
$handle=opendir('gallery');
while (
$file readdir($handle)) {
    if (
$file != "." && $file != ".." && $file != "") {
        
$filearray[] = $file;
    }
}
closedir($handle); 

$total count($filearray)-1;

if (
$picnum != "") {
    
$thefile $filearray[$picnum];
}
else {
    
$thefile $picname;
}

$tablestart "<TABLE WIDTH=\"100%\" BORDER=\"0\"><TR>";
$tableend   "</TR></TABLE>";
if (
$picnum <= or $picnum "") {
    
$verystart  "<TD ALIGN=\"LEFT\">$font<STRONG><IMG SRC=\"images/arctercam-start2.jpg\" BORDER=\"0\"></STRONG></TD>";
} else {
    
$verystart  "<TD ALIGN=\"LEFT\"><A HREF=\"gallery.php?pic=1\"><IMG SRC=\"images/arctercam-start.jpg\" BORDER=\"0\"></A></TD>";
}
if (
$picnum >= $total or $picnum "") {
    
$veryend  "<TD ALIGN=\"RIGHT\"><IMG SRC=\"images/arctercam-end2.jpg\" BORDER=\"0\"></TD>";
} else {
    
$veryend  "<TD ALIGN=\"RIGHT\"><A HREF=\"gallery.php?pic=$total\"><IMG SRC=\"images/arctercam-end.jpg\" BORDER=\"0\"></A></TD>";
}

#print the pic
if (!file_exists("gallery/$thefile") || $picnum $total) {
    echo 
"<CENTER>$font<STRONG>Ooops!  ArcterCam pic $picnum doesn't
    exist.<BR><BR>Feel free however, to choose another<BR><BR></CENTER>\n"
;
}
else {
    if (
$pic != "") {
        echo 
"<CENTER>$font<STRONG>$thefile</STRONG><P><IMG SRC=\"gallery/$thefile\"></CENTER>\n";
    } 
    else {
        echo 
"<CENTER>$font<STRONG>$thefile</STRONG><P><IMG SRC=\"gallery/$thefile\"></CENTER>\n";
    }
}

# set up the next/prev
if (file_exists("gallery/$filearray[$p]") && $filearray[$p] != "." &&
$filearray[$p] != ".." && $p && $p <= $total) {
    
$prevstring "<TD ALIGN=\"LEFT\">$font<STRONG><A HREF=\"gallery.php?pic=$p\"><IMG SRC=\"images/arctercam-back.jpg\" BORDER=\"0\"></STRONG></TD>\n";
}
else {
    
$prevstring "<TD ALIGN=\"LEFT\">$font<STRONG><IMG SRC=\"images/arctercam-back2.jpg\" BORDER=\"0\"></FONT></STRONG></TD>\n";
}

if (
file_exists("gallery/$filearray[$n]") && $filearray[$n] != "" &&
$filearray[$n] != "." && $filearray[$n] != ".." && $n <= $total) {
    
$nextstring =  "<TD ALIGN=\"RIGHT\">$font<STRONG><A HREF=\"gallery.php?pic=$n\"><IMG SRC=\"images/arctercam-next.jpg\" BORDER=\"0\"></FONT></STRONG></TD>\n";
}
else {
    
$nextstring "<TD ALIGN=\"RIGHT\">$font<STRONG><FONT COLOR=\"gray\"><IMG SRC=\"images/arctercam-next2.jpg\" BORDER=\"0\"></FONT></STRONG></TD>\n";
}

# ... and print it out
print "$tablestart $verystart $prevstring $nextstring $veryend $tableend";

print_tail();

if (
$show != "") {
    print 
"<A NAME=\"source\"><H3>Here's the source code you wanted....</H3></A>";
    
show_source('gallery.php');
}
?>