vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Show Permission (https://vborg.vbsupport.ru/showthread.php?t=311215)

CaptainAwesome 05-10-2014 08:25 AM

Show Permission
 
While looking and editing the Nav bar, i came across:

This determines which variable(s) in the vBulletin $show array will be used to decide if the element should be displayed. For instance 'member' means it will only display if $show['member'] is true. Multiple variables can be specified by joining them with a dot. All of them must then be true for the element to display.

Does this mean i could limit who sees the articles/blog based on their user group? And if so, does that mean only they can see the button or could everyone see it but just not access the content?

Thanks

kh99 05-10-2014 09:56 AM

You *could* use that feature to control which usergroups can see the Article or Blog tabs, if there were a $show variable that was either true or false. You'd need a plugin to check a user's group and set a variable in $show.

But that only controls the display of the tabs or other navigation elements. It wouldn't stop a user from going there if there's a link somewhere else (or if they know the url).

CaptainAwesome 05-10-2014 10:34 AM

Thanks for the info :)

tipoboy 05-13-2014 03:06 PM

you would add our plugin and use the hook location

Code:

load_show_variables
then your plugin would be
Code:

if (is_member_of(vB::$vbulletin->userinfo, 6, 7, 2, 5))
{
    $show['xxxxx'] = true;
}

changing the usergroups the the usergroups you wish to see the tab and changing the 'xxxxx' in the code to your unique forum permission name for use when adding your tab

HTH


All times are GMT. The time now is 05:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00903 seconds
  • Memory Usage 1,710KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete