MyBB Community Forums

Full Version: Recent Threads On Index [Updated 02-09-21]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
Great plugin i was some other persons recent posts on index but this one is great . it also has the latest avatar options.
can i change the template of this recent threads?
(2015-01-20, 11:22 AM)Hamster24 Wrote: [ -> ]Great plugin i was some other persons recent posts on index but this one is great . it also has the latest avatar options.
can i change the template of this recent threads?

You can change the templates how you want, but you may not redistribute them.
thanks for the information
oh ok sorry for bad english in last post. maybe because of cold fingers.
Would really intesting on seeing some pictures of it ,
(2015-01-20, 11:59 AM)dragonexpert Wrote: [ -> ]
(2015-01-20, 11:22 AM)Hamster24 Wrote: [ -> ]Great plugin i was some other persons recent posts on index but this one is great . it also has the latest avatar options.
can i change the template of this recent threads?

You can change the templates how you want, but you may not redistribute them.

It takes a lot of space - you take minify it Big Grin I prefer something like this: 
http://mods.mybb.com/uploads/previews/67...sforum.png

OK, I changed temlate... now it looks better. One thing - I need to show next to the post the forum where it is
Quote:OK, I changed temlate... now it looks better. One thing - I need to show next to the post the forum where it is

There are two ways you can do this. Longer way In the function recentthread_list_threads, globalize the variable $cache. Somewhere in the while($thread = $db->fetch_array($query)) You'll need to add this code:

if(!is_array($forums))
{
$forums = $cache->read("forums");
}
$thread['forum'] = $forums[$thread['fid']]['name'];

The second method is to alter the query itself. Change the query to
SELECT t.*, u.username AS userusername, u.usergroup, u.displaygroup, u.avatar as threadavatar, u.avatardimensions as threaddimensions, lp.usergroup AS lastusergroup, lp.avatar as lastavatar, lp.avatardimensions as lastdimensions, lp.displaygroup as lastdisplaygroup, f.name as forum
			FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."forums f ON (t.fid=f.fid) 
			LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
			LEFT JOIN ".TABLE_PREFIX."users lp ON (t.lastposteruid=lp.uid)
			WHERE 1=1 $where AND t.visible > {$approved} {$unsearchableforumssql} {$ignoreforums}
			ORDER BY t.lastpost DESC
			LIMIT $threadlimit

In your templates you will then use {$thread['forum']} to output the name of the forum the thread is in. I can add this feature in the next release and get rid of the views column.
It would be nice to have it the next version... thank you!
I pushed the edits to the Github branch. If something doesn't work right, let me know.
Ok, thank you. I will check later today, I am not at home now.

Can you add a language support? Now lang string are hard coded in templates, right?
(2015-01-25, 05:31 PM)Eldenroot Wrote: [ -> ]Ok, thank you. I will check later today, I am not at home now.

Can you add a language support? Now lang string are hard coded in templates, right?

A future version, yes I can add language support. It is currently hard coded in templates.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42