MyBB Hacks

Full Version: User logged in and profile
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys, I'm willing to put one button in the member_profile and this button need to appear ONLY if the user that is viewing the profile is the owner of the profile.
Like if Skiilz is seeing Skiilz's profile the button will appear, if Skiilz is viewing RateU's profile then the button won't appear.

Any help?


Thank you.
I think you can use Template Conditional for that.
i think he needs something like postbit plugin that you made for me, rateu. which hides the add buddy option when i view my profile. but he needs in reverse. he wants to see his profile button when he is on own profile and hide when we visits others.
(11-22-2010 04:00 AM)RateU Wrote: [ -> ]I think you can use Template Conditional for that.
I think, but I don't know how to do that :/

(11-22-2010 04:11 AM)1master1 Wrote: [ -> ]i think he needs something like postbit plugin that you made for me, rateu. which hides the add buddy option when i view my profile. but he needs in reverse. he wants to see his profile button when he is on own profile and hide when we visits others.
You got it Smile
You can add the button using PHP template Conditional Plugin.
Like;

PHP Code:
if ($mybb->user['uid'] == $memprofile['uid'])
{
$button = "<img src=\"images/something.gif\">";
}
else
{
$button = "";
}

Temaplte Conditionals:

PHP Code:
<if $GLOBALS['mybb']->user['uid'] == $memprofile['uid'] then>
<img src="images/something.gif">
<else>
<!--NOTHING!-->
</if>


That did it. Thank you for the base code.

Your's welcome Smile
Reference URL's