0) $row = mysql_fetch_array($result); else { header("HTTP/1.0 404 Not Found"); exit("Error 404: Image not found"); } //update views if ($row['lastviewer_ip'] != $_SERVER['REMOTE_ADDR']) { $ip = mysql_real_escape_string($_SERVER['REMOTE_ADDR']); $update = "UPDATE site_images SET views = views+1, lastviewer_ip = '$ip', date = date WHERE id = '$id'"; mysql_query($update); } switch($row['generator']) { case 'dumbledore': $query = "SELECT type, text FROM `site_images`, `img_dumbledore` WHERE site_images.id = '$id' AND site_images.img_id = img_dumbledore.id"; $result = mysql_query($query); if (mysql_num_rows($result) > 0) { $rij = mysql_fetch_array($result); $text = $rij['text']; $type = $rij['type']; include "./dumbledore/image.php"; } else echo "Error: Image not found"; break; case 'bad_comment': $query = "SELECT text FROM `site_images`, `img_bad_comment` WHERE site_images.id = '$id' AND site_images.img_id = img_bad_comment.id"; $result = mysql_query($query); if (mysql_num_rows($result) > 0) { $rij = mysql_fetch_array($result); $text = $rij['text']; include "./bad_comment/image.php"; } else echo "Error: Image not found"; break; case 'newscaster': $query = "SELECT headline, text FROM `site_images`, `img_newscaster` WHERE site_images.id = '$id' AND site_images.img_id = img_newscaster.id"; $result = mysql_query($query); if (mysql_num_rows($result) > 0) { $rij = mysql_fetch_array($result); $headline = $rij['headline']; $text = $rij['text']; include "./newscaster/image.php"; } else echo "Error: Image not found"; break; case 'mp_vs_towelguy': $query = "SELECT text FROM `site_images`, `img_mp_vs_towelguy` WHERE site_images.id = '$id' AND site_images.img_id = img_mp_vs_towelguy.id"; $result = mysql_query($query); if (mysql_num_rows($result) > 0) { $rij = mysql_fetch_array($result); $text = $rij['text']; include "./mp_vs_towelguy/image.php"; } else echo "Error: Image not found"; break; case 'napoleon': $query = "SELECT text_left, text_right FROM `site_images`, `img_napoleon` WHERE site_images.id = '$id' AND site_images.img_id = img_napoleon.id"; $result = mysql_query($query); if (mysql_num_rows($result) > 0) { $rij = mysql_fetch_array($result); $text_left = $rij['text_left']; $text_right = $rij['text_right']; include "./napoleon/image.php"; } else echo "Error: Image not found"; break; case 'clippy': $query = "SELECT question, option1, option2, option3, option4 FROM `site_images`, `img_clippy` WHERE site_images.id = '$id' AND site_images.img_id = img_clippy.id"; $result = mysql_query($query); if (mysql_num_rows($result) > 0) { $rij = mysql_fetch_array($result); //verdere variabelen worden gedaan in clippy/image.php include "./clippy/image.php"; } else echo "Error: Image not found"; break; case 'bush_door': $query = "SELECT text FROM site_images, img_bush_door WHERE site_images.id = '$id' AND site_images.img_id = img_bush_door.id"; $result = mysql_query($query); if (mysql_num_rows($result) > 0) { $row = mysql_fetch_array($result); $text = $row['text']; include "./bush_door/image.php"; } else echo "Error: Image not found"; break; case 'magic8ball': $query = "SELECT text FROM site_images, img_magic8ball WHERE site_images.id = '$id' AND site_images.img_id = img_magic8ball.id"; $result = mysql_query($query); if (mysql_num_rows($result) > 0) { $row = mysql_fetch_array($result); $text = $row['text']; include "./magic8ball/image.php"; } else echo "Error: Image not found"; break; default: echo "Error: Image not found"; break; } } else { $picture = imagecreatefromgif("./images/etc/hotlink_base.gif"); $textcolor = ImageColorAllocate($picture, 0, 0, 0); $textsize = 8; $text = "http://www.imageGenerator.net/$id/"; $font = "./fonts/verdana.ttf"; header("Content-type: image/gif"); imagettftext($picture, $textsize, 0, 4, 25, $textcolor, $font, $text); Imagegif($picture); ImageDestroy($picture); } mysql_close(); ?>