Location: PHPKode > projects > Xcomic > Xcomic_0.8.3/includes/LatestComicDisplay.class.php

$Id: LatestComicDisplay.class.php,v 2005/07/22 01:49:07 mikexstudios Exp $

define('IN_XCOMIC', true);


//$xcomicRootPath is defined in the file that includes this file
//Unfortunately, for sites with register_globals turned on, this poses
//a security theat--especially since $xcomicRootPath is being used in include
//statements. Therefore, check for hacking attempts
if ( !defined('IN_XCOMIC') )
	die("Hacking attempt");


class LatestComicDisplay extends ComicDisplay {

	function LatestComicDisplay() {
	function getLatestComicId() {

		global $xcomicDb, $message;
		# [1074866] Bug with index fixed by Tom Parkison (hide@address.com)
		# Problem was pinpointed to MAX() SQL call requiring an 'AS cid' after MAX().
		$sql = 'SELECT MAX(cid) AS cid
		//Make the changes happen
		if(!($result = $xcomicDb->sql_query($sql)))
			echo 'No comic found!';
		//Get the result (only one)
		$row = $xcomicDb->sql_fetchrow($result);
		//Return latest comic id
		return $row['cid'];

//Testing ComicDisplay
$x = new LatestComicDisplay();
echo $x->getFilename();

Return current item: Xcomic