<?
/**************************************************************
| WEBCOMIC INTERFACE REVISION 17 by --==N-N-T-B==-- |
| Code fixing and revisions by Blackstripe |
| This script will be called as Ep.php?comic=0001 where |
| 0001 is the number on the file Ep0001.jpg and so on. To view |
| the latest comic you would call this script as just Ep.php |
**************************************************************/
$comic = $HTTP_GET_VARS["comic"];
$file = 'Ep' . $comic . '.jpg';
$path = 'http://nntb.port5.com/Image/'; //the path to your images directory, must have the trailing slash
$latest = '00002'; //change the number on this when you make a new comic
if (!isset($comic)) {
$comic = $latest;
?>
<img src="<?php echo $path . 'Ep' . $latest . '.jpg'; ?>" alt="The latest comic">
<?php //
}
else if (file_exists($path . $file)) { //else if (fopen($path . $file, "r")) {
?>
<img src="<?php echo $path . $file; ?>" alt="Comic Number <?php echo $comic; ?>">
<?php
}
else {
?><img src=ComicError.png><br><?php
echo('AAAAAAAAAAAAA what did you do!!! i cant find the ep your looking for???'); ?><br><?php
echo($file . ' does not exist'); ?><br><?php
echo('other information'); ?><br><?php
echo('comic = ' . $comic); ?><br><?php
echo('file = ' . $file); ?><br><?php
echo('path = ' . $path); ?><br><?php
echo('thanks for taking your time');
}
/*
To go to another comic, the comic number must be increased or decreased. However,
the format of the GET value comic does not allow for the number to simply be 1 or 2.
Instead, the number must be formatted as 00001 or 00002.
*/
$comic_minus = $comic - 1; // Used for the previous comic
$comic_plus = $comic + 1; // Used for the next comic
while ( strlen($comic_minus) < 5 && strlen($comic_plus) < 5){
$comic_minus = "0".$comic_minus;
$comic_plus = "0".$comic_plus;
}
echo "<center>";
if ($comic == $latest){
echo "<a href=\"Ep.php?comic=00001\">First</a> | ";
echo "<a href=\"Ep.php?comic=".$comic_minus."\">Previous</a>";
}
else if ($comic > 1){
echo "<a href=\"Ep.php?comic=".$comic_minus."\">Previous</a> | ";
echo "<a href=\"Ep.php?comic=00001\">First</a> | ";
echo "<a href=\"Ep.php?comic=".$comic_plus."\">Next</a> | ";
echo "<a href=\"Ep.php\">Latest</a>";
}
echo "</center>";
?>
ok i was told to use Fopen insted of file_exists, but eather way i get the same error message.
when i use fopen its "Warning: fopen("http://nntb.port5.com/Image/Ep00001.jpg","r") - A socket must be already connected. in /host/n/n/t/p/o/r/nntb.port5.com/Ep.php on line 23" and with file_exists i get Page not found or somthing. could some one please help me? thanks