MyBB Community Forums

Full Version: Using postbit functions outside postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So as the title says,

I'm currently redesigning the User CP, Making it tabbed view.
On the first tab I want to show the user their current information.

Right now I'm kinda stuck on the group image,
Since {$groupimage} doesn't work and {$mybb->user['groupimage]} doesn't do anything.

Also, The signature isn't shown with BB code attributes,
It simply shows: {i} {/i} ( The "{" are "[")

Any help is greatly appreciated.
Regards
Try

{$displaygroup['image']}
Thank you for replying,
But it doesn't work for me.

Any other suggestions?
Bump.
Another Bump.
try this

<img src="{$displaygroup['image']}" alt="{$usertitle}" title="{$usertitle}" />
In order to do this you will need to modify the usercp.php file.
In this I am assueming that the first tab is just usercp.php doesn't contain any GET paramaters.
Open usercp.php find
$usergroup = $groupscache[$mybb->user['usergroup']]['title'];
replace with:
$usergroup = $groupscache[$mybb->user['usergroup']]['title'];
// Get the usergroup's image
$groupimage = $groupscache[$mybb->user['usergroup']]['image'];

	// Find out our options and whether the user has/is allowed a signature
	if($mybb->user['signature'] && ($mybb->user['suspendsignature'] == 0 || $mybb->user['suspendsigtime'] < TIME_NOW))
	{
		$sig_parser = array(
			"allow_html" => $mybb->settings['sightml'],
			"allow_mycode" => $mybb->settings['sigmycode'],
			"allow_smilies" => $mybb->settings['sigsmilies'],
			"allow_imgcode" => $mybb->settings['sigimgcode'],
			"me_username" => $mybb->user['username'],
			"filter_badwords" => 1
		);
		// Get the signature in working order for our templates
		$signature = $parser->parse_message($mybb->user['signature'], $sig_parser);
	}
After that using
<img src="{$groupimage}" alt="$usergroup" title="$usergroup" />
in your template should work.
Using
{$signature}
should display the users' signature like on the profile page.

If you have any more questions please ask, also if anything goes wrong or if it works please say. Smile
Sorry for the late response but thank you alot!