I have viewing profiles turned off for my users. If I turn them on, is there a way to use template conditionals to allow my users to view only their own profile?
(04-10-2014 11:00 AM)ZiNgA BuRgA Wrote: [ -> ]
Code:
<if $memprofile['uid'] == $mybb->user['uid'] then>
<!-- template code -->
</if>
|
Thanks, will give it a try
(04-10-2014 11:00 AM)ZiNgA BuRgA Wrote: [ -> ]
Code:
<if $memprofile['uid'] == $mybb->user['uid'] then>
<!-- template code -->
</if>
|
Worked too good,
forgot I needed an extra conditional to let my admin and Moderators see all profiles and Also wanted to give a note to users trying to view a profile that wasn't there's... so here's my code, seems to work ok
Code:
<if $memprofile['uid'] == $mybb->user['uid'] OR in_array($GLOBALS['mybb']->user['usergroup'], array(3,4,45,46)) then>
<!-- template code -->
<elseif $memprofile['uid'] != $mybb->user['uid'] then>
You may only view your own profile
</if>
|
So that works if anyone else is interested.
Now one thing I did forget, I want my users to be able to see the profiles
of the members of their buddylist. Any help with the code for that would be appreciated. I don't even know if members of buddylist can be identified via mybb?It may not be possible
One other thing, is there a way to identify a groupleader in mybb via code? I'd like to use some conditionals for groupleaders if possible...and on a side note if you are a groupleader does that include you as a member of that group in mybb