Location: PHPKode > projects > Phpfastnews > phpfastnews/news_old_index.php
<?php
$pg = "news_index";
require('lib/prepend.php');

$r->open('news.tpl');
$r->block('NEWS_INDEX');


if ($startrecord == '') { $startrecord = 0; }
$query = "select body, subject, handle, replies, n_cdate, news_id from fn_news,fn_user
				where user_id2 = user_idfk order by n_cdate desc limit $startrecord, $numrecords";

$db->query($query);
$count = 0;
while ($db->next_record())	{
	$count++;
	$replies = $db->f('replies');
	$news_id = $db->f('news_id');
	$r->setv(array(
		'BODY'			=> $db->f('body'),
		'SUBJECT'		=> $db->f('subject'),
		'POSTEDBY'		=> $db->f('handle'),
		'POSTCOUNT'		=> $replies,
		'DATETIME'		=> $ndate($db->f('n_cdate')),
		'lnkREPLY'		=> "<a href=news_reply.php?r_id=" . $news_id . ">Reply</a>"
		));

               	if ($replies) {
		$r->setv('lnkREPLIES' , "<a href=news_view.php?r_id=" . $news_id . ">" . $replies . " Comments</a>");
		}
                if(!$x)  {
                $ralph = $sideblocks->threeup();
                $r->setv('banner',$ralph);
                }
        $r->parse('NEWS_INDEX');
        $r->setv('banner','');
        $x=1;
        $r->setv('lnkREPLIES',''); // <-- keep this to stop Bad Things from happening
}

// Cheesy previous/next link (for now) need to change it to a more efficient one
if ($startrecord)	{
		$centerfooter .= "[<a href=news_index.php?startrecord=" . ($startrecord - $numrecords) . ">PREVIOUS</a>]&nbsp;&nbsp;";
		}
		
if ($count == $numrecords) { $centerfooter .= "[<a href=news_index.php?startrecord=" . ($startrecord + $numrecords) . ">NEXT</a>]"; }

$r->setv('CENTERFOOTER',$centerfooter);
$r->close();
require('lib/append.php');
?>
Return current item: Phpfastnews