2015-06-14, 09:16 PM
Hello!
I am all a bit new to plugin development.
I am trying to modify the avatar template to add a secondary image next to it.
But i cannot seem to find the right hook or something along those lines.
this is what i'm trying to do:
Template: postbit_avatar
I don't know how easy that is to follow, but i'd really appreciate the help, i don't quite get the eval thing haha.
plus it's getting late and i've been working for quite a while now haha.
Thank you in advance
I am all a bit new to plugin development.
I am trying to modify the avatar template to add a secondary image next to it.
But i cannot seem to find the right hook or something along those lines.
this is what i'm trying to do:
$plugins->add_hook("usercp_avatar_start", "plugin_avatarUpdate");
function plugin_avatarUpdate()
{
global $db, $mybb, $templates, $avatarUpdate, $lang, $headerinclude, $header, $footer, $usercpnav;
$action = $mybb->input['action'];
$sgids = $mybb->user['groupsin'];
if ($sgids!="")
{
$avatarquery = $db->query("SELECT * FROM ".TABLE_PREFIX."avatarUpdate WHERE sgid IN ($sgids) ORDER BY name ASC");
while($avatarData = $db->fetch_array($avatarquery))
{
eval("\$avatarList .= \"".$templates->get("postbit_avatar")."\";");
}
}
}
Template: postbit_avatar
<div class="author_avatar"><a href="{$post['profilelink_plain']}"><img src="{$useravatar['image']}" alt="" {$useravatar['width_height']} /></a><a href="{$post['profilelink_plain']}"><img src="{$avatarData['logo']}"/></a></div>
I don't know how easy that is to follow, but i'd really appreciate the help, i don't quite get the eval thing haha.
plus it's getting late and i've been working for quite a while now haha.
Thank you in advance