Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 using conditionals for Users to view only their own profile
b.h. Offline
Junior Member
**
Posts: 9
Joined: Aug 2010
Post: #1
using conditionals for Users to view only their own profile
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 08:35 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: using conditionals for Users to view only their own profile

Code:
<if $memprofile['uid'] == $mybb->user['uid'] then>
<!-- template code -->
</if>


My Blog
04-10-2014 11:00 AM
Find all posts by this user Quote this message in a reply
b.h. Offline
Junior Member
**
Posts: 9
Joined: Aug 2010
Post: #3
RE: using conditionals for 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:09 AM
Find all posts by this user Quote this message in a reply
b.h. Offline
Junior Member
**
Posts: 9
Joined: Aug 2010
Post: #4
RE: using conditionals for 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>


Worked too good, Wink2 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

(This post was last modified: 04-11-2014 01:56 AM by b.h..)
04-11-2014 01:00 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: