Location: PHPKode > projects > Phpfastnews > phpfastnews/forum_view.php
<?php
/*	Copyright (c) 2001-02 by Ken Williams (hide@address.com)*/
/*	http://phpfastnews.sourceforge.net/ & http://www.phpfastnews.com*/
/*									*/
/*	You can redistribute and/or modify the following code under the	*/
/*	terms of the GNU General Public License as published by the	*/
/*	the Free Software Foundation.					*/
/*									*/
/*	All code by Ken Williams (HDwebdev) unless otherwise noted	*/
/* This is an alpha test release -- not intended for live site	use	*/

$pg = "forum_view";
$tpl = "forum.tpl";
require('Lib/prependphpfn.php');

$r->set_block('TPL','FORUM_VIEW');

$r->set_block('FORUM_VIEW', 'THREADS', 'threads');

$query = "select * from fn_fposts,fn_forum,fn_user where (forum_idfk = $f_id) and (parent = '0') and (user_id2 = user_idfk) and (forum_idfk = forum_id)";
$db->query($query);
	
	$r->set_var(array(
			"thSUBJECT" => "SUBJECT: ",
			"thPOSTEDBY" => "POSTED BY: ",
			"thPOSTCOUNT"	=> "# of replies",
			"thLATESTPOSTBY" => "LATEST POST: "
			));

while ($db->next_record())	{
        $r->set_var(array(

			"NEWOLDICON"	=> "NEW/OLD<br>ICON",
			"SUBJECT"	=> "<a href=forum_posts.php?f_id=" . $db->f('forum_id') . "&r_id=" .
			                		$db->f('post_id') . ">" . $db->f("subject") . "</a>",
			"POSTEDBY"	=> $db->f("handle"),
			"POSTCOUNT"	=> $db->f("fp_replies"),
			"LATESTPOSTEDBY"=> "test",
			"LATESTPOSTTIME"=> $ndate($db->f("fp_ldate"))
			)
		  );

		 if(!$r->get_var(POSTEDBY)) { $r->set_var("POSTEDBY",$db->f("username")); }

		$r->parse('threads', 'THREADS',true);
	}

$r->parse('body','FORUM_VIEW',true);

require('Lib/appendphpfn.php');
?>
Return current item: Phpfastnews