vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Setting style/skin for individual users via admin CP when users can't normally choose (https://vborg.vbsupport.ru/showthread.php?t=153877)

gef 07-31-2007 10:09 AM

Setting style/skin for individual users via admin CP when users can't normally choose
 
Hi!

I've run into a head-scratcher here.

I run a 3.6.5 forum (licence renewal and update imminent) here, and it has two skins - one dark, set to default, and one (mostly broken) test skin.

Users cannot select skins, so everyone is using the default.

Can I set specific users to use the other "test" skin? In the admin CP, if I find a user and edit their settings, there is a drop down for style, which gives me the options of default, the dark skin, and the broken test skin.

However, if I select the test skin, the user still sees the dark one. Logging out, clearing cookies etc doesn't work, the default is the default, despite their profile saying they are using the test skin.

I need a handful of members to use the test skin, but not everybody.

Have I missed a setting? Do I need to rebuild a database or something to force the change? Or, despite the user-specific setting change via the admin CP, does the disallowing user selection override everything?

Is there a way around this?

Many thanks!

Gef

MaestroX 07-31-2007 10:15 AM

Make sure in your vbulletin settings under Style & Language Settings you have "Allow Users To Change Styles" set to yes otherwise users will only be able to use the style set as "Default"

gef 07-31-2007 10:20 AM

Ah.

That's actually what I want to avoid, as I only want about 6 people to use the test skin, and everyone else to use the default.

Is there a way around it?

MaestroX 07-31-2007 10:31 AM

Unless you make them admins you can't really avoid it.

What I would do it put these users into a new usergroup, allow the "Allow Users To Change Styles" option and in your footer template, wrap the style chooser drop down in a conditional to only let the new usergroup see it.

gef 07-31-2007 10:46 AM

Sounds great, thanks. Can you give me some more info on what I need to edit in the footer template (and where)? I'm a bit new to this!

MaestroX 07-31-2007 10:57 AM

Sure,

Go to: Styles & Templates -> Style Manager -> Your Style -> Edit Templates

in your footer template find:

Code:

<if condition="$show['quickchooser']">
  <td class="tfoot">
  <select name="styleid" onchange="switch_id(this, 'style')">
    <optgroup label="$vbphrase[quick_style_chooser]">
    $quickchooserbits
    </optgroup>
  </select>
  </td>
 </if>

and change it to:

Code:


<if condition="is_member_of($vbulletin->userinfo, x)">
 <if condition="$show['quickchooser']">
  <td class="tfoot">
  <select name="styleid" onchange="switch_id(this, 'style')">
    <optgroup label="$vbphrase[quick_style_chooser]">
    $quickchooserbits
    </optgroup>
  </select>
  </td>
 </if>
</if>

change x to the usergroup id of the the users who you want to let use the new style

Andreas 07-31-2007 11:27 AM

That won't stop users from using the style - if just hides the chooser.

Check my profile for Restrict Style to Usergroup - that might do what you want.

MaestroX 07-31-2007 11:34 AM

True, members can use the style if they know the style id (most users won't). You might need to use the same conditional to hide the style switch in the UserCP.

Quote:

An order has been placed!
Ah the perfect solution, nice on Andreas

gef 07-31-2007 12:34 PM

Hiding the chooser will do me - if someone manages to work out the style ID (if they even know there is more than one style), good on them!

However, the conditional does need to be used in the UserCP as well - it's hidden on the main forum with the footer template edit but now appears in the UserCP. I'll see if I can find the template myself this time!

Brilliant job though - thanks very much indeed! Very useful!

Ah hang on, I'm lost in the UserCP templates. By making the edit suggested by MaestroX, or by using Andreas's Restrict Styles product, the style selector is still viewable in all UserCPs.

So...where in the template can I snip it out?


All times are GMT. The time now is 10:31 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.00995 seconds
  • Memory Usage 1,732KB
  • 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)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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