MyBB Community Forums

Full Version: need information
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i need a method with show avatar on index in the forum last post without plugin. and a style nickname

there is a way to not use plugins?
(2015-08-31, 03:39 PM)Mr_Joker Wrote: [ -> ]there is a way to not use plugins?

Everything can vbe done without plugins. Plugins are only a tool to implement changes in MyBB in a structured way, such that the can be installed/activated en uninstalled/deacticvated easily.

Not long ago there was someone with the same wish as you. I will have a look.
This isn't possible without a plugin or core edit I'm afraid.
Add the following lines in script forumdisplay.php line 1314 and on:


$query = $db->simple_select("users", "avatar, avatardimensions, username", "uid = {$thread['lastposteruid']}");
$avatar = $db->fetch_array($query);
$profilelink = get_profile_link($thread['lastposteruid']);
$thread['avatar'] = "";
if ($avatar['avatar'] != "") 
{
    $useravatar = format_avatar($avatar['avatar'], $avatar['avatardimensions'], $mybb->settings['postmaxavatarsize']);
    $thread['avatar'] = '<img src="'.$useravatar['image'].'" '.$useravatar['width_height'].' />'; 
} 


Then add {$thread['avatar']} at the place in template forumdisplay_thread where you want to have the avatar of the last poster.

But it is more elegant to do this with a plugin.
ok thanks