FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » How to get messages from a particular forum
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
How to get messages from a particular forum [message #30591] Fri, 03 March 2006 14:13 Go to previous message
acollins22 is currently offline  acollins22   United Kingdom
Messages: 11
Registered: June 2005
Location: Leicestershire, England
Karma:
Junior Member
Hi Folks,

I'd like to get the last 20 posts from one articular forum to display on a page.

Having read the various threads here I decided to go the FUDapi way. As there isn't a function to do exactl what I want I'd like to write on based on fud_fetch_recent_msg and that's where I come unglued.

fud_fetch_recent_msg reads as...
function fud_fetch_recent_msg($arg=1)
{
	$range = time() - 86400 * (float) $arg;
	return _fud_msg_multi(0, "SELECT id FROM ".$GLOBALS['DBHOST_TBL_PREFIX']."msg WHERE apr=1 AND post_stamp > ".$range);
}


so I figure I should change arg to be the forum number I want and change the WHERE clause to match the forum_id to $arg and that's the rub, I don't know what the row title is for the forum_id.

What I have is...
function fetch_forum_msg($arg=5)
{
	return _fud_msg_multi(0, "SELECT id FROM ".$GLOBALS['DBHOST_TBL_PREFIX']."msg WHERE apr=1 AND forum_id = ".$arg);
}


Am I on the right track? If so could you please point me at the correct clause syntax?


Thanks.

Andy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: login name
Next Topic: PHP includes
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Oct 21 06:27:24 GMT 2024

Total time taken to generate the page: 0.03985 seconds