Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Hide a style from style chooser Details »
Hide a style from style chooser
Mod Version: 1.0.1, by dartho (Coder/Designer) dartho is offline
Developer Last Online: Apr 2019 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.7.1 Rating: (3 votes - 4.67 average) Installs: 48
Released: 21 Jun 2008 Last Update: 24 Jun 2008 Downloads: 300
Supported Uses Plugins  

A simple plugin which will allow you to hide a specified user selectable style from the Quick Style Chooser which appears at the bottom of every page in vBulletin whilst still allowing the style to be used.

Instructions:
0. If you made modifications to your 'options' template as per previous instructions, you will need to revert the template
1. Import attached plugin via "Products and Plugins"," Download/Upload Plugin"
2. Go into the plugin manager and edit the "Hide Style From Style Chooser" plugin
3. Change the 'x' in '$mo37_hidden_styleid = x' to be the StyleID of the style you wish to hide
4. Set the plugin status to be active
5. Save
The style is now hidden, but still usable by you users.

To disable/uninstall, set the plugin status to not be active or delete the plugin.

If you use the add-on that extends my mobile style, you will not need to do this as it is (soon will be) an option as of version 0.0.3.

See this post for a plugin which hides the chooser in usercp options.


All posts in this thread up to post #9 were in reference to the original way I thought of doing this. I have kept the original contents of this template modification below for reference




**** FOLLOWING INFORMATION KEPT FOR REFERENCE ONLY ****
Originally Posted by dartho
If you have multiple styles installed but wish to 'hide' some from users while still be able to use them you can use this template modification to hide particular styles form the quick chooser:

Edit your 'options' template - the original should look like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and change it to the following:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

where x is the styleid of your mobile style and yyyyyy is the name of your mobile style. The name is case sensative!

This should stop it being added to the drop down list.

If you wish to hide multiple styles , you could extend the conditional as follows:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

where x2 is the 2nd styleid and yyyyyy2 is the 2nd style name.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Nonselectable style on Quick Style Chooser for admin Marco van Herwaarden vBulletin 3.0 Full Releases 8 16 Feb 2005 09:15
Create Style Groups for Style Chooser Wayne Luke vBulletin 3.0 Full Releases 12 19 Jul 2004 10:57

Comments
  #2  
Old 22 Jun 2008, 01:23
ssslippy's Avatar
ssslippy ssslippy is offline
 
Join Date: Jan 2006
If u uncheck the box on the left when view the styles it will prevent users from using that one. Its part of the default.
__________________
Immortal Guild - My Guilds Website
Reply With Quote
  #3  
Old 22 Jun 2008, 03:19
dartho dartho is offline
 
Join Date: Sep 2005
That is true - but there are instances where you want the style available to a user, but you do not wish them to be able to select it. An example is my mobile detection hack. The style must be user selectable for this to work, but you don;t want PC users to select it. Or if you are developing a style on your site and you want a standard user/guest to be able to use it for testing, but don't want it showing up in the style selector..
Reply With Quote
  #4  
Old 22 Jun 2008, 06:58
whitetigergrowl whitetigergrowl is offline
 
Join Date: Jun 2004
Originally Posted by dartho View Post
That is true - but there are instances where you want the style available to a user, but you do not wish them to be able to select it. An example is my mobile detection hack. The style must be user selectable for this to work, but you don;t want PC users to select it. Or if you are developing a style on your site and you want a standard user/guest to be able to use it for testing, but don't want it showing up in the style selector..

Ummm if the box is unchecked and saved, you do realize members still cannot choose it because its hidden....right?!
Reply With Quote
  #5  
Old 22 Jun 2008, 08:18
dartho dartho is offline
 
Join Date: Sep 2005
Yes that is correct. That is why you would make the style user selectable (by checking the box and saving) , but hide it with a template edit such as this. I could then give the user a link, or use rewrites in my htaccess, or write a plugin that selects the style.

Why are people posting to this thread when they seem to have no need for it?

I only released it here as it is something I use and find personally useful and thought others may feel the same.

Let me give you a real life scenario which may help you understand where this has a purpose, and indeed why I wrote it.
  • My site has 2 styles which users can choose.
  • My site also has a mobile friendly style.
  • A plugin detects if a mobile device has connected to my site and then changes the style to the mobile style automatically
  • For a plugin (or anything for that matter) to be able to change the style for a non-admin user, the style must be user selectable
  • I don't want desktop PC users to be able to select the mobile friendly style as it looks crap on a desktop PC

Solution?
Hide the styles which I don't want PC users to manually select whilst allowing the system to still assign them.

Thus this template edit.
Reply With Quote
  #6  
Old 22 Jun 2008, 15:58
waza waza is offline
 
Join Date: Apr 2005
The 'option' template is used almost everywhere a select box appears, so not only for the templates.
This leads on a big system that your server will do a huge amount of if(condition) calculations that are not necessary.
__________________
Now available: SAPR, it's like god send an angel
Reply With Quote
  #7  
Old 22 Jun 2008, 22:20
dartho dartho is offline
 
Join Date: Sep 2005
That is true. I've not noticed any performance degradation on my site, that's not to say there won't be any and admins should of course monitor as they would after making any modifications.

I appreciate this type of feedback and I am looking for a more eloquent solution but in the mean time it's this or nothing for me.
Reply With Quote
  #8  
Old 23 Jun 2008, 11:41
Darat Darat is offline
 
Join Date: Aug 2004
Originally Posted by dartho View Post
...snip...[/LIST]
Solution?
Hide the styles which I don't want PC users to manually select whilst allowing the system to still assign them.

Thus this template edit.
Thanks - it's a useful little snippet to have.
Reply With Quote
  #9  
Old 24 Jun 2008, 02:40
BeerLuver's Avatar
BeerLuver BeerLuver is offline
 
Join Date: Mar 2002
Real name: Bob
Thanks dartho. Useful for hiding the default style; but still being able to use it as a basic template to make a new style within the admin panel. As opposed to deleting it outright.
Reply With Quote
  #10  
Old 24 Jun 2008, 07:51
dartho dartho is offline
 
Join Date: Sep 2005
Updated! Installs as a plugin with no template edits and no resource usage concerns as in post #6 and #7.
Reply With Quote
  #11  
Old 24 Jun 2008, 19:25
BeerLuver's Avatar
BeerLuver BeerLuver is offline
 
Join Date: Mar 2002
Real name: Bob
Thanks for the update dartho
Reply With Quote
  #12  
Old 15 Jul 2008, 16:06
mesdar's Avatar
mesdar mesdar is offline
 
Join Date: Jul 2008
thanx
Reply With Quote
  #13  
Old 05 Dec 2008, 00:31
sung sung is offline
 
Join Date: Feb 2002
Is there anyway so that the style is also hidden from the Forum Skin drop down list in the User CP and not just the Quick Style Chooser?
Reply With Quote
  #14  
Old 12 Dec 2008, 20:45
sung sung is offline
 
Join Date: Feb 2002
Originally Posted by sung View Post
Is there anyway so that the style is also hidden from the Forum Skin drop down list in the User CP and not just the Quick Style Chooser?
Made a plugin that does just this. It uses the same variable ($mo37_hidden_styleid) to hide the style, and is inactive by default.

So assuming you're already using dartho's plugin and it is working just upload this one and set it active and the same style will be hidden in the User CP as well.
Attached Files
File Type: xml vbulletin-plugin-hidestyle-usercp.xml (519 Bytes, 36 views)
Reply With Quote
  #15  
Old 31 Dec 2008, 05:06
fta2k fta2k is offline
 
Join Date: Feb 2008
I've installed this and put in ID in the edit but it still shows in the dropdown.



Any ideas?


EDIT:

Ok, I'm an idiot.

I was using skin display number and not skin id. It's all fixed now.


Last edited by fta2k; 31 Dec 2008 at 06:55.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 08:12.

Layout Options | Width: Wide Color: