Hi all does anyone know how to get phpbb latest posts to show on a html index page e.g the last 5 forum posts ?

Any help would be great

Thanks for the reply php isnt my best subject really , i dont really get how to put it in to a certain place on my site , if you look at the Tottenham Page in my sig, there is a latest post box , any idea how i would get it into there ?

What you need to do is first select where you want it to show up in your preffered editor. Then copy everything from:

<? 
#database info, or include a config.php file$
db_host='localhost'; #change to your host

To:

$text
<div align=\"right\">Replies: {$r['topic_replies']}</div>
<hr>"; 
} 
?>

Then edit:

$db_host = 'localhost'
; #change to your host
$db_user = 'username'; #change to your user name
$db_password= 'password'; #change to your password
$db_name = 'database_name'; #change to your db name

Following the comments.
And then in this code:

$result = mysql_query("SELECT DISTINCT t.topic_id, t.topic_title, t.topic_replies, u.user_id, u.username, s.post_text
FROM phpbb_posts p, phpbb_topics t, phpbb_users u, phpbb_posts_text s
WHERE p.topic_id = t.topic_id AND t.topic_poster = u.user_id AND t.topic_first_post_id = s.post_id AND t.forum_id != 1 AND u.user_id != -1
ORDER BY p.post_time DESC LIMIT 10");

Change the LIMIT 10 to how ever many topics you want to show up there.

Oh and also you may need to change

echo "<a href=\"/forum/viewtopic.php?t={$r['topic_id']}\" target=\"_blank\">{$r['topic_title']}</a><br>
by: <a href=\"/forum/profile.php?mode=viewprofile&u={$r['user_id']}\" target=\"_blank\">{$r['username']}</a>

If your forum location isn't yourwebsite.com/forum/, just change both links to whatever the forums location is.

I hope I've explained it all ok for you. If you need any more help with it, please post again.

Wow that was really good thanks ,, but :) ive managed to get it to show if you type the .php address but it wont show where i want it to on my page ? any ideas

You need to have your default page extension as .php, but if you really don't want to, I suppose you could use iFrames, but not really sure on how to use them myself.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.