Hello,
I am wondering how exactly I can add a link to the navigation (Header) template that only certain usergroups can see?
Lets say I want to add a link next to 'Search' called 'Staff Forums', How would I make it so only admins (GID 4) can see it?
Thanks.
Using template conditionals:
PHP Code:
<if $mybb->usergroup['gid'] == 4 then><a href="doom.php">Click here</a></if>
|
Perfect thanks mate. I knew I would need a way of getting PHP into templates but I guess common sense searching failed me :L.
(02-24-2011 09:28 AM)RateU Wrote: [ -> ]Template Conditional plugin link?
http://mybbhacks.zingaburga.com/showthread.php?tid=464
Thanks anyways I just meant I was to stupid to search :L
Question, if I wanted to make admins, mods and super mods to see that link it would be
PHP Code:
<if $mybb->usergroup['gid'] == 4 || $mybb->usergroup['gid'] == 6 || $mybb->usergroup['gid'] == 3 then><a href="doom.php">Click here</a></if>
|
Correct?
(02-24-2011 09:40 AM)ccalby Wrote: [ -> ]Thanks anyways I just meant I was to stupid to search :L
Sorry for misunderstood you
(02-24-2011 09:40 AM)ccalby Wrote: [ -> ]Question, if I wanted to make admins, mods and super mods to see that link it would be
PHP Code:
<if $mybb->usergroup['gid'] == 4 || $mybb->usergroup['gid'] == 6 || $mybb->usergroup['gid'] == 3 then><a href="doom.php">Click here</a></if>
|
Correct?
You can use array in Template Conditional for simpler code.
What you mean? I have no clue here
What I mean is, Template Conditional accept array in the <if...... then> function.
Great thanks for your help, heres some cookies