Announcement

Collapse
No announcement yet.

How do i show diffrent templates depending on usergroup?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do i show diffrent templates depending on usergroup?

    Like if i put $menu in the header template it should check if the user is logged in or not, and if he is logged in then the template menuloggedin should show and if the user is not logged in then the template menulogin should show.

    I've tried for like 1hour to edit the global.php so this would work but i was unsuccefull, but as i see it it should be like 5lines of code, and not so hard to make if you know php good.

  • #2
    $bbuserinfo[userid] -> 0 = guest; >0 = member
    $bbuserinfo[usergroupid] -> see usergroup table for full list

    That should get you going.

    Comment


    • #3
      Heh had no luck, tried putting this in global.php but it didnt work, any ideas?

      PHP Code:
        if ($bbuserinfo['usergroupid']!=1) {
          eval(
      "\$menu = \"".gettemplate("menulogin")."\";");
        } else {
          eval(
      "\$menu = \"".gettemplate("menuloggedin")."\";");
        } 

      Comment


      • #4
        That looks ok off hand, so I can only assume you're evaluating your templates after the template you want to put it in (I assume the header).

        Comment

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