MyBB Community Forums

Full Version: Integrating the latest posts into my website
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I've had a quick search through the forum, just to make sure theres no answer for this already.

My question, as the subject suggests is that i'd like to incorporate the latests posts off the MyBB forum i have onto a blank table in my seperate website. My MyBB forum version is 1.4.13.

Any more info please ask

Thanks alot

Rich
Is your seperate website constructed from PHP, and you have access to edit the files? If so, then all you have to do is query the mybb_posts table and grab the latest information. If not, it'll be pretty difficult to do.

Something like this should be OK...

$query = $db->query("
	SELECT pid, subject, uid, username, dateline, message
	FROM <database_name>.mybb_posts
	WHERE visible = '1' AND fid IN (1,2,3,4,5)
	ORDER BY dateline DESC
	GROUP BY tid
	LIMIT 0, 10
");

This will grab all the latest visible posts in forums 1, 2, 3, 4 and 5.
You could do it without PHP via an RSS feed and a javascript reader. But while simplier, it is Java script.