MyBB Community Forums

Full Version: [How] to show icon to index?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I like icon in Display Theard show to Index foum? how to make it?

[attachment=25915]

to

[attachment=25917]
oh! thanks you so much Smile.
This mod does NOT work for MyBB 1.8.0
Any solution?

Well, I found a solution for that ^_^

To add post icon in forum index:

1- Open "functions_forumlist.php" file placed in MyBB "inc" folder.
2- Add $cache variable to the function "build_forumbits" globals list:
function build_forumbits($pid=0, $depth=1)
{
// add here ∇
 global $cache,$db, $fcache, $moderatorcache, $forumpermissions, $theme, $mybb, $templates, $bgcolor, $collapsed, $lang, $showdepth, $plugins, $parser, $forum_viewers;
 static $private_forums;

3- Find this code(line 308 in MyBB 1.8.0 version):
eval("\$lastpost = \"".$templates->get("forumbit_depth{$depth}_forum_lastpost")."\";");

And add this code before it:

$icons = $cache->read("posticons");
$query = $db->simple_select("threads", "icon", "tid ={$lastpost_data['lastposttid']}");
$thread = $db->fetch_array($query);
$icon = $icons[$thread['icon']];

4- Go to Admin CP > Templates & Style > Templates > Your template set > Forum Bit Templates > forumbit_depth2_forum_lastpost And replace all code inside it with code below:

<span class="smalltext">
<img src="{$icon['path']}" alt="{$icon['name']}" title="{$icon['name']}" />
<a href="{$lastpost_link}" title="{$full_lastpost_subject}">{$full_lastpost_subject}</a> <br />
{$lang->forumbit_lastpost} {$lang->by}  {$lastpost_profilelink}<a href="{$lastpost_link}" title="{$full_lastpost_subject}"></a><br /> {$lang->at} {$lastpost_date}
</span>

Demo: [attachment=32685]