MyBB Community Forums

Full Version: show the icons of threads beside their subjects in main page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
any ideas for showing the icons of threads beside their subjects in main page?
In the 'lastpost'-column ?
Exactly !
like vbulletin
Can u guide me?
Open ./inc/functions_forumlist.php

Find
global $fcache,

Change into
global $fcache, $cache,

Find
// Format lastpost date and time

Add Above
// GET THREAD ICON 
$lastpost_icon = "";
$thread = get_thread($lastpost_data['lastposttid']);
$icon_cache = $cache->read("posticons");
if($thread['icon'] > 0 && $icon_cache[$thread['icon']])
{
	$icon = $icon_cache[$thread['icon']];
	$lastpost_icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />&nbsp;";
}

Then open your forumbit_depth2_forum_lastpost template
And add {$lastpost_icon} where you want to display it.
have someone tested this on 1.4?
I used to do this mod for old mybb 1.0.x
I just tried this mod on mybb 1.4
it is working perfectly Big Grin
yes this still works
This worked fine for me in 1.4, but when I updated to 1.4.1, reverted the templates, modified inc/functions_forumlist.php again and did the template modifications above, I got
Fatal error: Call to a member function read() on a non-object in /home/*****/public_html/inc/functions_forumlist.php on line 345
So I added
global $cache;
right above
$icon_cache = $cache->read("posticons");
(as suggested by an admon here, even though $cache is already in the global line at the top of the file as instructed in this thread), and now the error is gone, but the icons don't display. Can someone help me get this working in 1.4.1?
please up!
can some one make a plugin for this?
Yes please, this would be an incredible plugin !
Pages: 1 2