MyBB Community Forums

Full Version: getting things to display in postbit.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how do i get $post['mycountry'] to show under $post['userfields'] in the postbit?

Smile
i don't exactly get what your trying to do

but i think if you hook into showthread start and call the variable in the function

then you can just add {$post['mycountry']} in the postbit template depending on where you want it

sorry if this isn't what your looking for
I tried
$plugins->add_hook("postbit", "mycountry");

Then

function mycountry($post)
{
	global $mybb, $theme, $post, $lang, $db, $flag;

		
		$query = $db->simple_select("userfields", $mycountry, "ufid = ".$mybb->user['uid']);
		$fid = $db->fetch_field($query, $mycountry);

		$flag = $db->query("SELECT code FROM ".TABLE_PREFIX."countries WHERE name = '".$fid."'");
			
		$post['mycountry'] = $br."<img src=\"./images/mycountry/flags/".$flag.".png\" title=\"".$flag."\" align=\"center\">&nbsp;";
	}

I tried showthread_start as thee hook too Sad