", " - ",$titletext); $newtitle = str_replace("
", ": ",$newtitle); return $newtitle; } //Function to redirect bad or invalid requests. //Simply 301's them to the gallery page function redirect_request() { header("HTTP/1.0 301 Moved Permanently"); header("Location: gallery.html"); header("Connection: close"); exit; } $meta_description = ""; $meta_keywords = ""; $page_title = ""; require_once('includes/constants.inc.php'); @ $db = mysql_pconnect($host_name, $database_user, $database_pass); if (!$db) { echo 'Error: Could not connect to database. Please try again later.'; exit; } mysql_select_db('skoworg_gallery'); @ $id = $_GET['id']; @ $cat = $_GET['cat']; //Do some error checking here //Category checking if (isset($cat)) { //Is $cat a number and greater than 1? if ($cat >= 1) { $query = "select * from gallery WHERE cat LIKE $cat"; $result = mysql_query($query); $num_results = mysql_num_rows($result); //Check that the category number is valid and not too high if ($num_results == 0) { //If number too high, redirect to home page. redirect_request(); } } else { //If $cat is not a number, or is less than 1, redirect to home page. redirect_request(); } } //ID checking if (isset($id)) { //Is $cat a number and greater than 1? if ($id >= 1) { $query = "select * from gallery WHERE id LIKE $id"; $result = mysql_query($query); $num_results = mysql_num_rows($result); //Check that the ID number is valid and not too high if ($num_results == 0) { //If number too high, redirect to home page. redirect_request(); } } else { //If $id is not a number, or is less than 1, redirect to home page. redirect_request(); } } if (isset($id) && ($id >= 1)) { $page_title = 'Image Gallery (Image ' . $id . ')'; require_once('includes/header/header_gallery.inc.php'); ?>


'; if (stripslashes($row['sound']) == '' ) { echo '
'; } else { if ( ($row['sound']) == (substr($row['image'], 0, 3)) ) { echo '  Download sound clip'; } else { echo '  Download sound file'; } } echo '

'; echo stripslashes($row['dialogue']) . ''; echo '
'; echo stripslashes($row['trivia']) . ''; } } else if ( isset($cat) && ($cat >= 1) ) { $page_title = 'Image Gallery (Chapter ' . $cat . ')'; require_once('includes/header/header_page.inc.php'); ?>
'; for ($i=0; $i < $num_results; $i++) { $row = mysql_fetch_array($result); if ( ((($i) % 4) == 0) && ($i <> 0) ) { echo ''; } $image_url = ''; $image_url = '/images/gallerythumbs/' . addzeros($row['cat']) . '/' . $row['image']; $sound_url = ''; $sound_url = '/downloads/mp3/' . addzeros($row['cat']) . '/' . $row['sound'] . '.mp3'; echo ''; } echo '
Image Gallery - Chapter

Click on a thumbnail for an enlarged image. 

image contains scene dialogue (hover mouse over icon for dialogue)
sound clip of dialogue is available.
sound clip continues.
' . stripslashes(maketitle($row['dialogue'])) . ''; //echo ''; echo '
Image ' . ($i+1) . '/' . $num_results; if (stripslashes($row['dialogue']) == '' ) { echo '
'; } else { echo '
dialogue'; } echo ''; if (stripslashes($row['sound']) == '' ) { echo ''; } else { //Check for previous file if ( ($row['sound']) == (substr($row['image'], 0, 3)) ) { echo 'sound clip'; } else { echo ''; } } echo '
'; } else { $page_title = 'Image Gallery'; require_once('includes/header/header_page.inc.php'); ?>
'; require_once('includes/right/right_main.inc.php'); } ?>