MyBB Hacks

Full Version: display avatar on index
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone help me with this?
I want to show avatar of lastpost threads on index and without use a plugin

I already learn in index there is {$forums} and search in index.php about that string. It's string from functions_forumlist.php in inc folder, how to edit functions_forumlist.php to show avatar lastposter

Please help me
Open functions_forumlist.php and search for

PHP Code:
$lastpost_profilelink = build_profile_link($lastpost_data['lastposter'], $lastpost_data['lastposteruid']);


Insert Below this

PHP Code:
$uid = intval($lastpost_data['lastposteruid']);
$user = get_user($uid);
if ($user['avatar'] != "")
{
$forum['lp_avatar'] = '<img src="'.$user['avatar'].'" height="25" width="25" title="'.$user['username'].' \'s avatar." alt="" />';
}
else
{
$forum['lp_avatar'] = '<img src="images/default_avatar.gif" height="25" width="25" title="Default Avatar" alt="" />';
}


images/default_avatar.gif  =  you have to customize


ACP -->Templates & Style -->Templates -->euer Template --> Forum Bit Templates  -> forumbit_depth2_forum_lastpost

You can use this variable where you want

Code:
{$forum['lp_avatar']}

Ok i will try this later and give feedback, thanks mate
Be prepare to insert yourself into the poor-optimized system of MyBB edits/plugins if you already aren't in.
Reference URL's