// Connects to the database include("database.inc"); // COMIC VARIABLES $comic_title = ""; // The title for the comic. $comic_date = ""; // The date for the comic. $comic_id = ""; // The ID for the comic. Used to determine if there are comics before and after, and what their links are. $comic_link = ""; // Link to the image of the comic. $comic_desc = ""; // Description of the comic. $comic_desclink = ""; // Link that appears below the description of the comic. (Where the user goes. $comic_desclink_label =""; // Text that is displayed for $comic_desclabel. (What the user sees) // ARCHIVE COMIC VARIABLES $comic_archive_previous_id = ""; $comic_archive_next_id = ""; // // Checks to see if we have an ID, if so, populate page based on the ID // ******************************************************************** // if ( isset($_REQUEST['id'])) { // Populate the comic // ****************** $comic_id = $_REQUEST['id']; $query = "SELECT * FROM comics WHERE id='$comic_id'"; $result = mysql_query($query) or die("Query failed at data retrieval stage. (a1)"); // Transfer the data into a variable $data = mysql_fetch_array($result); // Populate the variables with the data pulled from database $comic_title = $data["title"]; $comic_date = $data["date"]; $comic_link = $data["link"]; $comic_desc = $data["description"]; $comic_desclink = $data["desc_link"]; $comic_desclink_label = $data["desc_link_label"]; $view_count = $data["view_count"]; //cka edit $cka_forumid = $data["cka_forumid"]; // Find out if there is a comic after the current one, and sets the previous [<] button to the correct link // ****************** // // We select the ID that is smaller than the current comic_id and order it ascending so we get the id with the lest difference $query = "SELECT * FROM comics WHERE id<'$comic_id' ORDER BY id DESC LIMIT 1";; $result = mysql_query($query) or die("Query failed at data retrieval stage. (a2)"); // Transfer the data into a variable $data = mysql_fetch_array($result); $comic_archive_previous_id = $data['id']; // Find out if there is a comic after the current one, and sets the next [>] button to the correct link // ****************** // // We select the ID that is bigger than the current comic_id and order it descending so we get the id with the lest difference $query = "SELECT * FROM comics WHERE id>'$comic_id' ORDER BY id ASC LIMIT 1"; $result = mysql_query($query) or die("Query failed at data retrieval stage. (a3)"); // Transfer the data into a variable $data = mysql_fetch_array($result); $comic_archive_next_id = $data['id']; // Add one to the view count $query = "UPDATE comics SET comics.view_count=comics.view_count +1 WHERE comics.id=$comic_id"; mysql_query($query) or die("Query failed at data retrieval stage. (a4)"); } ?>
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Filibuster Cartoons version 3.0 - Design copyright 2003 Jaco Joubert - All original images copyright 2001-2003 JJ McCullough - Non-original images copyright their respective owner. News powered by Coronto |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||