Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[ADDON] News Archive
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-06-05 10:39:09
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
Unknown User
2008-06-09 16:58:10
Nice!  I was just thinkin about building something like this.  On that note, anyone use any different tool for their news?  Somethin like WordPress or something?
Unknown User
2008-11-20 15:28:57
thanks nice one
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728