Location: PHPKode > projects > Particle Blogger > particle-blogger/includes/page_footer.php
<?php
// list recent posts
$shortlist = $db->execute("SELECT * FROM " . $dbprefix . "posts WHERE status > 0 AND postdate <= " . time() . " ORDER BY postdate DESC LIMIT 0, " . intval($config["recentposts"]));
if ($shortlist->rows < 1){
	$t->set_var("MENU_RECENT", "There are no recent posts");
} else {
	$t->set_file("listrecentmenu", "list_short.tpl");
	do {
		$t->set_var("POST_TITLE", $shortlist->fields["title"]);
		$t->set_var("POST_LINK", LinkPost($shortlist->fields["ID"]));
		$t->parse("MENU_RECENT", "listrecentmenu", true);
	} while ($shortlist->fields = mysql_fetch_array($shortlist->res));
}

// work out what archived months there are
$ark = $db->execute("SELECT * FROM " . $dbprefix . "posts WHERE status > 0 AND postdate <= " . time() . " ORDER BY postdate DESC");
if ($ark->rows < 1){
	$t->set_var("MENU_ARCHIVES", "There are no archives");
} else {
	$lastpost = "Origin";
	$t->set_file("archiveslist", "list_short.tpl");
	do {
	
		// process each post
		if ($lastpost <> date("F Y", $ark->fields["postdate"])){
			// ok, this is a new archive link
			$t->set_var("POST_TITLE", date("F Y", $ark->fields["postdate"]));
			$t->set_var("POST_LINK", LinkArchive(date("Y", $ark->fields["postdate"]), date("m", $ark->fields["postdate"])));
			$t->parse("MENU_ARCHIVES", "archiveslist", true);
		}
		
		// update lastpost
		$lastpost = date("F Y", $ark->fields["postdate"]);
	
	} while ($ark->fields = mysql_fetch_array($ark->res));
}

// list of tags
$sql = "SELECT * FROM " . $dbprefix . "tags AS t INNER JOIN " . $dbprefix . "posttags AS pt ON t.tagid = pt.tagid GROUP BY t.tagid ORDER BY tag ASC";
$mtl = $db->execute($sql);
if ($mtl->rows > 0){
	$tagcode = "<p><strong>Tags...</strong>";
	do {
		$tagcode .= "<br />\n<a href=\"" . linktag($mtl->fields["slug"]) . "\">" . $mtl->fields["tag"] . "</a>";
	} while ($mtl->loop());
	$tagcode .= "</p>";
	$t->set_var("MENU_TAGS", $tagcode);
}

// work out the link for the RSS feed
if ($config["friendlyurls"] == "1"){
	$t->set_var("RSS_LINK", $config["root"] . "rss.xml");
} else {
	$t->set_var("RSS_LINK", $config["root"] . "backend/rss.php");
}

// set the variables for page header
$t->set_var("MAIN_SITE", $config["mainsite"]);
$t->set_var("MAIN_URL", $config["mainurl"]);
$t->set_var("CURRENT_TIME", date($config["dateformat"]));
$t->set_var("VERSION", $config["version"]);

// parser footer template
if (defined("SIMPLE_PAGE")){
	$t->set_file("page_footer", "simple_footer.tpl");
} else {
	$t->set_file("page_footer", "overall_footer.tpl"); }
$t->parse("page_all", "page_footer", true);

// output entire page
$t->p("page_all");
?>
Return current item: Particle Blogger