A few things to know before progressing.
We are assuming you already have articles showing on external pages. If not read through this http://www.phpbb.com/community/viewtopic.php?f=71&t=587812&hilit=picture+attachments&start=645
This is what you would add to the OUTPUT step of any of the previous methods mentioned on there but please please realize this is just the core, you will have to tweak it in order to get it working with your news script or post here for help from me.
So the basic mysql step is:
- Code: Select all
$replies_query = "
SELECT poster_id, post_text, post_time
FROM phpbb_posts
WHERE topic_id = " . $post[topic_id] . "
AND post_subject LIKE 'Re:%'
ORDER BY post_time DESC
LIMIT 0 , 30
";
//die('<pre>' . $query );
$replies_query = $db->sql_query( $replies_query );
Then to output the data:
- Code: Select all
while( $replies_row = $db->sql_fetchrow($replies_query) )
{
$phpbb_root_path = '/forums/';
$phpbb_root_path = $_SERVER['DOCUMENT_ROOT'] . '/forums/';
// Send data to output var
$reply_output .= date("M d, Y - g:ia", $replies_row['post_time']) . " - " . $replies_row['poster_id'];
$reply_output .= $replies_row['post_text'] . "<br />";
$reply_output .= '<br />';
}
// print the output
print( $reply_output );
To get the poster_id into the actual username use:
- Code: Select all
$reply_username = get_username_string('username', $replies_row['poster_id'], 0);
echo $reply_username;
This is the basic core. Just add these code to your output area and change the valuables if the valuables are different and it will work
Happy Days!
Since every forum news/thread display differently on external pages and use different script to achieve that, this is just a simple nudge in the right direction if you don't know how to get there.