I have a link to this page just below my news block on the main page, but it can go wherever you like.
Create a file news-archive.php and add this code
require_once "backend/functions.php";
dbconn(false);
loggedinonly();
stdhead();
begin_frame("News Archive");
$query = 'SELECT news.id, news.title, news.userid, news.added, news.body, users.username FROM news INNER JOIN users ON users.id = news.userid ORDER BY added DESC';
$resu = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($resu))
{
$numcomm = number_format(get_row_count("comments", "WHERE news='".$row['id']."'"));
begin_frame("" . $row['title'] . "");
print("<I>Posted By " . $row['username'] . "</i> On " . $row['added'] . "\n");
echo"<BR>" . format_comment($row["body"],0) ." <BR><BR>Comments (<a href=comments.php?type=news&id=".$row['id'].">".$numcomm."</a>)";
end_frame();
}
end_frame();
stdfoot();
?>
Then link to that page using normal <a href...> from wherever you want. This code formats the news items and includes the comment links as on the main page.
Cheers
Simon
Create a file news-archive.php and add this code
<?require_once "backend/functions.php";
dbconn(false);
loggedinonly();
stdhead();
begin_frame("News Archive");
$query = 'SELECT news.id, news.title, news.userid, news.added, news.body, users.username FROM news INNER JOIN users ON users.id = news.userid ORDER BY added DESC';
$resu = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($resu))
{
$numcomm = number_format(get_row_count("comments", "WHERE news='".$row['id']."'"));
begin_frame("" . $row['title'] . "");
print("<I>Posted By " . $row['username'] . "</i> On " . $row['added'] . "\n");
echo"<BR>" . format_comment($row["body"],0) ." <BR><BR>Comments (<a href=comments.php?type=news&id=".$row['id'].">".$numcomm."</a>)";
end_frame();
}
end_frame();
stdfoot();
?>
Then link to that page using normal <a href...> from wherever you want. This code formats the news items and includes the comment links as on the main page.
Cheers
Simon