Code section works again. Turns out I do need to go back to
- Code: Select all
$phpbb_root_path = $_SERVER['DOCUMENT_ROOT'] . '/Forum/';
after the
- Code: Select all
$phpbb_root_path = '/./Forum/';
$message = bbcode_nl2br($message);
$message = smiley_text($message);
So the entire code is
- Code: Select all
<?php
//-- Fetch the data from the specified fora
$bbcode = new bbcode();
$news_fora_id = array( '9' ); // Change in the fora id's you need
$topic_count = '9'; // Change in the number of topics you want to show.
$query = "
SELECT p.topic_id, p.forum_id, p.post_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, u.user_id, u.username, u.user_rank, u.user_colour, t.topic_replies, t.topic_title,
(
SELECT COUNT( post_id )
FROM " . POSTS_TABLE . "
WHERE topic_id = p.topic_id
) AS aantal_posts
FROM " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u, " . TOPICS_TABLE . " AS t
WHERE " . $db->sql_in_set( 'p.forum_id', $news_fora_id ) . "
AND u.user_id = p.poster_id
AND t.topic_id = p.topic_id
AND t.topic_first_post_id = p.post_id
GROUP BY topic_id
ORDER BY post_time DESC
LIMIT 0, {$topic_count}
";
//die('<pre>' . $query );
$result = $db->sql_query( $query );
while( $row = $db->sql_fetchrow($result) )
{
// Parse the message and subject
$message = censor_text($row['post_text']);
// Second parse bbcode here
if ($row['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
$phpbb_root_path = $BeerVariableAbsolute;
$message = bbcode_nl2br($message);
$message = smiley_text($message);
$phpbb_root_path = $BeerVariableRoot;
// Send data to output var
//Subject
$output .= "<h2 class='beertitle'>" . censor_text($row['post_subject'])."</h2>";
//Date
$output .= "<h3 class='beerdate'>";
$output .= date("M d, Y - g:ia", $row['post_time']);
$output .= "</h3>";
//Main portion
$output .= "<div class='beermainnews'>" . $message;
$output .= "</div>";
//Footer
$output .= "<div class='beerpostbottom'><p>";
$output .= "Posted by: " . $row['username'];
$output .= "| ";
$output .= "<a href=\"" . $BeerVariableAbsolute . "viewtopic.php?f={$row['forum_id']}&t={$row['topic_id']}\" title=\"" . censor_text($row['post_subject']) . "\">";
$output .= "Comments: (";
$output .= $row['topic_replies'];
$output .= ")</a>";
$output .= "</p></div>";
}
// print the output
print( $output );
?>
Edited May 28, 2008. Updated code to most current version