Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 4 Years, 3 Months ago If Variable?
#1
Solved: 4 Years, 3 Months ago
Hey everyone. Smile

I'm adding a "tab" in my profiles just for moderation options, and I was wondering if there was a variable I could put before the <div> that would check if the user is currently a moderator so that the tab would not show to anyone unless they are in a certain usergroup. Thanks. Smile
Reply
#2
Solved: 4 Years, 3 Months ago
If you want to add another tab to the Moderator Options in the profiles you can edit "member_profile_modoptions" in the Members template of Templates & Styles.

It is the mod menu that is already in the profiles.
Reply
#3
Solved: 4 Years, 3 Months ago
I meant putting the moderation options into a tab, not adding another tab. (It doesn't even have tabs to begin with?)

<div class="panel panel-3">
					<h2>Signature</h2>
					<p>{$signature}</p>
				</div>

The above is my code which is the third tab of the profile, which looks like so:

[Image: Gkuxaeh.png?1]

Now I want to add another tab, which I can do. However what I need help with is trying to figure out how I can restrict that tab to a certain member group only, I figured ya'll have a {if} statement of some kind.
Reply
#4
Solved: 4 Years, 3 Months ago
This should tell you everything about template conditioning.

http://mybbhacks.zingaburga.com/showthread.php?tid=260
Reply
#5
Solved: 4 Years, 3 Months ago
Use this rather than the one mentioned above: http://mybbhacks.zingaburga.com/showthread.php?tid=464

its the simple/lite version of "PHP in Templates" which is linked in above post...

then you can use a conditional like this....

<if $mybb->user['usergroup'] == 4 then>
//content to show only for admin
</if>


<if in_array($GLOBALS['mybb']->user['usergroup'], array(3,4,6)) then>
//content to show for all default mod/admin groups
</if> 
We can't help everyone, but everyone can help someone - Ronald Reagan
Did you know? Your question has already been answered. But you haven't seen it yet.
Don’t  Forget to “Mark as Solved” after the fix
Reply
#6
Solved: 4 Years, 3 Months ago
You are awesome mmadhankumar!! Thank you! Smile
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)