Location: PHPKode > projects > ComicFlow > serieslist.php
<?php session_start();

// GETS VALUES FROM THE URL DATA
$urldata = explode("/",$_SERVER["PATH_INFO"]);

// GET HEADER AND PAGE TEMPLATE FILE
include("header.php");
$tpl->assignInclude("content", "themes/$themes/tpl/comiclist.tpl");

// PREPARE THE TEMPLATE
$tpl->prepare();

// GET THE MENU AND LANGUAGE FILES
include("./lang/$language/general.lang.php");
include("./lang/$language/browse.lang.php");
include("./lang/$language/error.lang.php");
include("menu.php");

// ASSIGN NEEDED TAMPLATE VALUES
$tpl->assignGlobal("theme", $themes);
$tpl->assignGlobal("pmcurl", $siteurl);
$tpl->assignGlobal("sitetitle", $sitetitle);
$tpl->assignGlobal("imgfolder", "themes/$themes/img");
$tpl->assign("version", $version);

if($_GET['error'] == '01') {
	$tpl->assign("error_message", "<div class=\"errormsg\">$lang_error_noissues</div>");
} else {
	$tpl->assign("error_message", "");
}

if(!isset($_GET['page'])) {
	$page = 1;
} else {
	$page = $_GET['page'];
}

$max_results = $paginate;

$from = (($page * $max_results) - $max_results);

// CHECK IF USER LOGGED IN :: APPLY SELECT ALL DELETE
if($_SESSION['loggedin'] == 'yes')
	{
		$tpl->assign("select_delete", "<button type=\"Submit\" name=\"Submit\" value=\"delete\" class=\"formbutton\" title=\"Delete Selected\">Delete</button>");
	} else {
		$tpl->assign("select_delete", "");
	}

      
// MYSQL QUERY :: GET ISSUES AFTER A SERIES
$select = mysql_query("SELECT * FROM pmc_comic WHERE title = '". mysql_real_escape_string($urldata[1]) ."' ORDER BY title, issue, issueltr LIMIT $from, $max_results") or die("DIED!");

$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM pmc_comic WHERE title = '". mysql_real_escape_string($urldata[1]) ."'"),0);
	

			
		
	
	$total_pages = ceil($total_results / $max_results);
	
	if($page > 1) {
		$prev = ($page - 1);
		$tpl->assign("prev_page", "<a href=\"serieslist.php/$urldata[1]?page=$prev\">$lang_page_prev</a> - ");
	}
	
	for($i = 1; $i <= $total_pages; $i++) {
		if(($page) == $i) {
			$get_pages[] = "$i";
		} else {
			$get_pages[] = "<a href=\"serieslist.php/$urldata[1]?page=$i\">$i</a>";
		}		
		$all_pages = implode(' - ', $get_pages);
		$tpl->assign("all_page", $all_pages);
	}
	
	if($page < $total_pages) {
		$next = ($page + 1);
		$tpl->assign("next_page", " - <a href=\"serieslist.php/$urldata[1]?page=$next\">$lang_page_next</a>");
	}
		   	
while ($get_issues = mysql_fetch_array($select))
	{
		// GET VALUES FROM DB
      	$uid = $get_issues['uid'];
      	$name = $get_issues['title'];
      	$story = stripslashes($get_issues['story']);
      	$vol = $get_issues['volume'];
      	$issue = $get_issues['issue'];
      	$issueltr = $get_issues['issueltr'];
      	$variation = $get_issues['variation'];

      	// OPEN TEMPLATE BLOCK :: COMIC_LIST
      	$tpl->newBlock("comic_list");      	
      
      	// GET THE SERIES REAL NAME
      	$select_issuename = mysql_query("SELECT * FROM pmc_artist WHERE uid = '$name'") or die("Select series name failed!");      			
      	$get_issuename = mysql_fetch_assoc($select_issuename);
      	$seriesname = $get_issuename['name'];
      	$stype = $get_issuename['comtype'];
      	$seriesvolume = $get_issuename['volume'];
      	$tpl->assign("pmc_name", $seriesname);      			

      	// GET THE COMIC TYPE
      	$select_issuetype = mysql_query("SELECT * FROM pmc_artist WHERE uid = '$stype'") or die("Select series type failed!");
		$get_issuetype = mysql_fetch_assoc($select_issuetype);
      	$seriestype = $get_issuetype['name'];
      	$tpl->assign("pmc_type", $seriestype);

      	// GET THE ISSUE VARIATION
      	$select_issuevariation = mysql_query("SELECT * FROM pmc_artist WHERE uid = '$variation'") or die("Select series variation failed!");
      	$get_issuevariation = mysql_fetch_assoc($select_issuevariation);
      	$seriesvariation = $get_issuevariation['name'];
      	$tpl->assign("pmc_variation", $seriesvariation);

      	$tpl->assign("pmc_uid", $uid);
      	$tpl->assign("pmc_issue", $issue);
      	$tpl->assign("pmc_issueltr", $issueltr);
      	$tpl->assign("pmc_volume", $seriesvolume);
      	$tpl->assign("pmc_story", $story);      
	}
	



// PRINT RESULT TO SCREEN
$tpl->printToScreen();

?>
Return current item: ComicFlow