MyBB Community Forums

Full Version: Make something only visible for the client side
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

i have edited the profile look of my forum and added a "edit" icon somewhere. However the icon is currently visible to everyone, except for guests. (The way i made that might be funny too, but i aint a developer and just improvised lol)
I just don't know how i would define a "ignore group 1 " or something. When i tried something from google the page went blank or nothing happened.

Anyway, what i want is like that that the icon does only show up on the client side, like only for the user that views his profile and not for every user profile of the forum which is the case right now.

To the (funny) code i used to prevent guests from seeing it:
	        <if $mybb->user['usergroup'] == 2 then><p class="alignright"><a href="http://SITE/forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
		<if $mybb->user['usergroup'] == 9 then><p class="alignright"><a href="http://SITE//forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
		<if $mybb->user['usergroup'] == 13 then><p class="alignright"><a href="SITE//forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
		<if $mybb->user['usergroup'] == 12 then><p class="alignright"><a href="SITE//forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
		<if $mybb->user['usergroup'] == 3 then><p class="alignright"><a href="SITE//forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
		<if $mybb->user['usergroup'] == 6 then><p class="alignright"><a href="SITE//forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
		<if $mybb->user['usergroup'] == 11 then><p class="alignright"><a href="SITE//forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
		<if $mybb->user['usergroup'] == 10 then><p class="alignright"><a href="SITE//forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
		<if $mybb->user['usergroup'] == 8 then><p class="alignright"><a href="SITE//forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
		<if $mybb->user['usergroup'] == 4 then><p class="alignright"><a href="SITE//forum/usercp.php?action=profile"><font color="white"><i class="fa fa-pencil" aria-hidden="true"></i></a></p></if>
Just added all groups, except guest. Big Grin
I hope someone could tell me how i could make that. (I have template conditionals)
Nice idea, I do the same thing on my forum. This is what you need.

<if $memprofile['uid'] == $mybb->user['uid'] then>
    <div class="float_right"><a href="{$mybb->settings['bburl']}/usercp.php?action=profile">Edit Profile</a></div>
</if>
Thanks! Big Grin