Template / hook help?
#1
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:
$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
Reply


Messages In This Thread
Template / hook help? - by Soyabean - 2015-06-14, 09:16 PM
RE: Template / hook help? - by Omar G. - 2015-06-14, 10:06 PM
RE: Template / hook help? - by Soyabean - 2015-06-14, 10:23 PM
RE: Template / hook help? - by Omar G. - 2015-06-15, 06:33 AM
RE: Template / hook help? - by marcus123 - 2015-06-15, 11:52 AM
RE: Template / hook help? - by Soyabean - 2015-06-15, 12:56 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)