No announcement yet.

possible to limit "New Posts" in navbar to certain usergroups?

  • Filter
  • Time
  • Show
Clear All
new posts

  • possible to limit "New Posts" in navbar to certain usergroups?

    i would like the navbar "New Posts" to only appear for certain usergroups, rather then 'members'... is this possible? basically, i have the themplate mod that shows total new posts with a number, which includes posts from the administration sections. a lot of users don't have access to this section for moderators only, so when they click on the navbar new posts and expect to see all these new posts - it only shows for example, 10 new posts instead of the navbar number which may show around 20.

    Edited to fix my english.
    Last edited by GearTripper; Fri 30 Sep '05, 3:43pm.

  • #2
    Admin CP -> Styles & Templates -> Style Manager -> « » -> Navigation / Breadcrumb Templates -> navbar

    Add the red code:

    			<if condition="in_array($bbuserinfo[usergroupid], array(X,Y,Z))">
    				<td class="vbmenu_control"><a href="search.php?$session[sessionurl]do=getnew" accesskey="2">$vbphrase[new_posts_nav]</a></td>
    Where X,Y,Z is a comma list of primary usergroupids for which the link will show.

    There should be 3 instances of this code in that template.


    • #3
      what about secondary user groups

      ie group id>7. i have a usergroup id 9 which is not working...

      PHP Code:
      <if condition="in_array($bbuserinfo[usergroupid],array(9,5,6,7))"

      doesn't work for usergroupid 9


      • #4
        Additional usergroups are harder to check as they are handled a bit differently. This works if they are a member of 1 additional usergroup, or the number you are checking appears first in the field.
        <if condition="in_array($bbuserinfo[usergroupid], array(X,Y,Z)) OR in_array($bbuserinfo[membergroupids], array(J,K,L))">


        • #5
          lats, thank you.

          do you know the equivalent expression for secondary groups in php?

          i want to check if the user belongs to group 9. my expression only works for the primary user groups for me..


          • #6
            Err, just change either J,K or L above to a 9 - that will pick them up.


            • #7
              That shouldn't work with secondary groups. You have to call is_member_of() for each group:

              <if condition="is_member_of($bbuserinfo, X) OR is_member_of($bbuserinfo, Y) OR is_member_of($bbuserinfo, Z)">
              Where X, Y, and Z are usergroupids of secondary groups.


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