vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Style Chooser & usergroups? (https://vborg.vbsupport.ru/showthread.php?t=284378)

qpurser 06-13-2012 12:28 PM

Style Chooser & usergroups?
 
I would like to make the style chooser option available to certain user groups (some user groups allowed to change the style and the other user groups should only have the "standard" style with no options.

I probably could do this with a conditional in the footer template?
How would the conditional have to be coded?

THX for any help.

This is the code from the footer:
Code:

<vb:if condition="$show['quickchooser']">
                        <select name="styleid" onchange="switch_id(this, 'style')">
                                <optgroup label="{vb:rawphrase quick_style_chooser}"><option class="hidden"></option></optgroup>
                                <vb:if condition="$quickchooserbits1">
                                        <vb:if condition="$quickchooserbits2">
                                        <optgroup label="&nbsp;{vb:rawphrase standard_styles}">
                                        </vb:if>                               
                                        {vb:raw quickchooserbits1}
                                        <vb:if condition="$quickchooserbits2">
                                        </optgroup>
                                        </vb:if>                                       
                                </vb:if>


kh99 06-13-2012 12:35 PM

I think you could just change the first line like this:

Code:

<vb:if condition="$show['quickchooser'] AND is_member_of($bbuserinfo, 1, 2, 3)">

where you'd change 1, 2, 3 to the list of group IDs that can see the chooser. If you'd rather list the groups that can't see it, you can change it to

Code:

<vb:if condition="$show['quickchooser'] AND !is_member_of($bbuserinfo, 1, 2, 3)">

This doesn't actually stop a user from using a style, it just takes away the control. I believe any user could still put &styleid=X on the url, if they know the styleid.

qpurser 06-13-2012 12:43 PM

WOW. That was a quick reply. thx so much.

Works perfect this way.

It is OK if they would know the style ID and using it. Don't think that many users on our forum will be that smart...lol


All times are GMT. The time now is 09:19 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.01177 seconds
  • Memory Usage 1,714KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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