Log in

View Full Version : the bets way to have the last 10 posts


pablo
02-08-2004, 12:37 PM
on vb2.x someone made a cool script to get the last ten threads that had been posted to. called last10.php or something.

Well i want the same effect on my forum home. It seems that with the external.php included with vb3.x you only get the last new threads, as it it is not updated when someone replies to an existing thread.

I've gone looking around the place @ tonyshawk's one and others. What do people use/recommend ?

thanks,
p

pablo
02-09-2004, 03:28 PM
on vb2.x someone made a cool script to get the last ten threads that had been posted to. called last10.php or something.

Well i want the same effect on my forum home. It seems that with the external.php included with vb3.x you only get the last new threads, as it it is not updated when someone replies to an existing thread.

I've gone looking around the place @ tonyshawk's one and others. What do people use/recommend ?

thanks,
p
anyone ??? *bump*

g-force2k2
02-09-2004, 03:58 PM
SELECT DISTINCT t.threadid, t.title,
p.userid, p.username, p.postid
FROM " . TABLE_PREFIX . "post p
LEFT JOIN " . TABLE_PREFIX . "thread t USING (threadid)
ORDER BY dateline DESC LIMIT 10

Perhaps a query like this? Haven't tested it though.

Cheers,
g-forcek2k2

pablo
02-15-2004, 10:29 AM
cheers g-forcek2k2,
But how would i make a php file that I could include it just to call this query and order it in some nice fashion.

I must say I am surprised that nobody has released such a hack yet.