Having a navbar link (or tab) viewable to only certain user group

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brettxw
    Senior Member
    • Feb 2009
    • 262

    Having a navbar link (or tab) viewable to only certain user group

    I would like to have a tab in my navbar viewable to only one user group. What code would I use this to have it appear for (example) usergroup 4 and no other user groups, except for ones I wish to add on later.

    Thanks in advanced.
  • ukindian
    Member
    • Sep 2006
    • 88
    • 3.8.x

    #2
    why u need only one usergroup?? u mean admin group only or any other group too... coz if u apply that conditional that group only will be able to see it..n if u r admin and u need to spicify that group too...
    http://www.weindians.net

    Comment

    • Pandemikk
      Member
      • Apr 2009
      • 68
      • 3.7.x

      #3
      ^He didn't really help, did he?

      Try this:

      HTML Code:
      <if condition="$bbuserinfo['usergroupid'] == 4">
      \\ Your Code goes here
      </if>
      Rap Battles & Hip Hop Music - LyricalThreats

      Sure glad he's former staff. Didn't even bother to validate my license

      Comment

      • brettxw
        Senior Member
        • Feb 2009
        • 262

        #4
        Originally posted by Pandemikk
        ^He didn't really help, did he?

        Try this:

        HTML Code:
        <if condition="$bbuserinfo['usergroupid'] == 4">
        \\ Your Code goes here
        </if>
        Thanks Pandemikk

        Comment

        • brettxw
          Senior Member
          • Feb 2009
          • 262

          #5
          Not sure what I am doing wrong here....

          <if condition="$bbuserinfo['6,7,9,10,13,19,23'] == 4">
          <td><div class="vbmenu_control2"><a href="http://www.blackberryos.com/forums/index.php?styleid=18"><b>VIP Style</b></a></div></td>
          </if>

          The 6,7,9,10,13,19,23 are the user groups I want to be able to view this link.

          Comment

          • Biker
            Senior Member
            • Oct 2003
            • 1261
            • 4.0.0

            #6
            Your usergroup numbers would go where the 4 is located.

            'usergroupid' is somewhat, ummmmmm critical for that to work... Put it back.
            I drank WHAT?! - Socrates

            Comment

            • brettxw
              Senior Member
              • Feb 2009
              • 262

              #7
              So...

              <if condition="$bbuserinfo['usergroupid'] == 6,7,9,10,13,19,23">
              <td><div class="vbmenu_control2"><a href="http://www.blackberryos.com/forums/index.php?styleid=18"><b>VIP Style</b></a></div></td>
              </if>

              Comment

              • brettxw
                Senior Member
                • Feb 2009
                • 262

                #8
                When I submit the above code I get this error :

                The following error occurred when attempting to evaluate the template 'header':

                Parse error: syntax error, unexpected ',' in /home/brettxw/public_html/forums/includes/adminfunctions_template.php(3950) : eval()'d code on line 229

                This is likely caused by a malformed conditional statement.

                Comment

                • brettxw
                  Senior Member
                  • Feb 2009
                  • 262

                  #9
                  anyone?

                  Comment

                  • Lats
                    Senior Member
                    • Mar 2002
                    • 3671

                    #10
                    Try this...
                    Code:
                    <if condition="in_array($bbuserinfo['usergroupid'], array(6,7,9,10,13,19,23))">
                        <td><div class="vbmenu_control2"><a href="[URL]http://www.blackberryos.com/forums/index.php?styleid=18"><b>VIP[/URL] Style</b></a></div></td>
                    </if>
                    Lats...

                    Comment

                    • brettxw
                      Senior Member
                      • Feb 2009
                      • 262

                      #11
                      Oh wow, I would have never of guessed that one. Thanks much lats!

                      Comment

                      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                      Working...