Well the script is still imature as of yet. The version running on that site is different then my latest one. All the HTML is hard coded into the one that is running, however here is what I have done. I added templates for this version to make it easier to work with.
PHP Code:
<?php
chdir( "./forum" );
require( "./global.php" );
chdir( ".." );
/*
Move to CP
$newsForum_ID = 33;
$numberPerPage = 20;
*/
$newsForum_ID = 33;
$numberPerPage = 20;
$newsDateFormat = "l, F d, Y";
$newsTimeFormat = "h:i A";
$stories = $DB_site->query( "
SELECT threadid, dateline, TO_DAYS( FROM_UNIXTIME( dateline,\"%Y-%c-%d\" )) AS day,
postuserid, user.username, user.email, replycount, views, title
FROM thread LEFT JOIN user ON thread.postuserid=user.userid
WHERE forumid=$newsForum_ID AND pollid=0 AND visible=1
ORDER BY day DESC, dateline DESC
LIMIT $numberPerPage;");
$cDay = 0;
while ( $story = $DB_site->fetch_array( $stories ))
{
$date = vbdate( $newsDateFormat, $story[dateline]);
$time = vbdate( $newsTimeFormat, $story[dateline]);
$text = $DB_site->query_first( "SELECT pagetext, dateline FROM post WHERE threadid=$story[threadid] AND userid=$story[postuserid] ORDER BY dateline LIMIT 1;");
$text = bbcodeparse( $text[pagetext], $newsForum_ID );
if ( $cDay != $story[day] )
{
if ( $cDay != 0 )
{
eval( "\$newstext .= \"".gettemplate('news_postdaybit')."\";");
}
eval( "\$newstext .= \"".gettemplate('news_datelinebit')."\";");
eval( "\$newstext .= \"".gettemplate('news_predaybit')."\";");
$cDay = $story[day];
}
eval( "\$newstext .= \"".gettemplate('news_storybit')."\";"); // story text
}
eval( "\$news = \"".gettemplate('news_display')."\";");
?>
Just place that block at the beginning of the news page, it must be placed at the beginning because of cookie settings run through the session.php included from global.php.
Then where I want to put the news I have the line:
PHP Code:
<?php echo"$news"; ?>
I'm adding a lot of stuff to this though, support for announcements and polls.
If you would like email me at:
ryans@ravingaming.com and I'll let you know when I make changes. I figure its the least I can do since I've used your site as an inspiration for my development.
If you need any help with it let me know.