MyBB Community Forums

Full Version: [How to] Portal - Last threads AND last posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Just a help to figure out something, if possible Smile

Now, in portal, there is a list of last threads (announcment) where you can see the title of the thread and it's first message.

How can I do tho keep that list, but showing last message instead of the first?

I think I should act here:

$query = $db->query("
		SELECT t.tid, t.fid, t.uid, t.lastpost, t.lastposteruid, t.lastposter, t.subject, t.replies, t.views, u.username
		FROM ".TABLE_PREFIX."threads t
		LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
		WHERE 1=1 {$excludeforums}{$tunviewwhere} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
		ORDER BY t.lastpost DESC
		LIMIT 0, ".$mybb->settings['portal_showdiscussionsnum']

table "threads" has either firstpost AND lastpost to lastpost...

The problem is that lastpost  is a 10 digit number that has (apparently) nothing to do with actual pid of last post.

[Image: post.jpg]

In fact, if a change firstopost nothing even shows up.
I don't know if I'm missing something or it has been made on purpose.

Any hint to solve it?

Thank you. Smile