Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Force Style for Selected Users or Groups Details »»
Force Style for Selected Users or Groups
Version: 3.7.006, by Mosh Mosh is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.7.x Rating:
Released: 12-24-2007 Last Update: 08-28-2008 Installs: 67
Uses Plugins
Re-useable Code Translations  
No support by the author.

Hack Support

This hack is now discontinued - this means that while it will remain available for download and use, there will be no further updates, nor will support be provided as the thread is no longer monitored. But not to worry, you can now check out the new 3.8.x version of this hack, as it also works with v3.7.4 and v3.6.12 (and maybe even earlier versions).

Please click Mark as Installed if you are using this hack.


vBulletin Version Compatibility

This hack can be used with v3.6.10 and v3.7.x. This has not been tested with earlier versions of v3.6.x, but should work.


What Does This Hack Do?

This hack allows you to force a style to certain usergroup(s), secondary usergroup(s), and/or certain user(s) or any combination of the three. It is a update of my v3.6.x hack available here, with new functionality added.

Scenario

The setup on my forums is that I use the default style as the parent to all my other styles which makes modifying the templates easy for me, I just edit my default style and the child styles inherit the changes.

I wanted to use a child style as the standard style for visitors and members, but not have them have a choice of the default style at all, but as soon as you logged out you were presented with the default style that you did not want guests to see.

This hack rectifies that. It also allows you to let others use the forum wide default style (selected via Style & Language Settings -> Default Style in the vBulletin Options of the AdminCP) while forcing the usergroup(s)/member(s) to the one style you selected, except in cases where you have specifically assigned a custom style to a forum in Forum Manager and override the users' style choice for that forum (it will use the custom style assigned to that forum, unless you select to override that too).


Installation Instructions
  1. Import the ms_force_style.xml into vB using the AdminCP Product Manager. If upgrading from an earlier version, then set Allow Overwrite to Yes.
  2. In vBulletin Options > Force Styles for Selected Users or Groups, change Force Styles for Selected Users or Groups - Enable to Yes to turn it on.
  3. In the other boxes, select all usergroups or specify the usergroup(s), member(s) and the style id you want to force on those usergroups or members, if you want to override individual forum styles (specified in Forum Manager), and the Style ID

Uninstall Instructions
  1. Uninstall the product in vB using the AdminCP Product Manager.


What if you need custom style permissions as well?

This question has been asked a few times: What if you need custom style permissions so that you can control which usergroups see/select what styles? The hack I use is Andreas's Restrict Style to Usergroup hack which he released for v3.5.x. It is because of that hack that this one exists, and I have tested it on v3.5.x, v3.6.x and v3.7.x, and it works for three versions and works fine with my hacks as well.

For instance on my forum I need to use both hacks, as the style I force on my guests and normal members is not selectable nor do I allow them permission to use it, and is also not my default style (all my other styles are child styles of my default one), so without Andreas's hack I would not be able to do this.

But just to let you know that Andreas's hack is unsupported and is not likely to ever be supported (unless it is a proven bug), so if you have problems with it, you are on your own.


Version History

v3.7.006 - Friday 29th August 2008
-- Final Release
-- Fixed: Usergroup permission checkboxes not working with vBulletin v 3.6.x
-- Changed: Removed dependency, now works with v3.6.10

v3.7.005 - Thursday 28th August 2008
-- Fixed: bug where guests forced to style because user id set to '0'
-- Changed: Check boxes for usergroup selection now, instead of comma separated numbers
-- Added: New plugin, for processing usergroup permissions

v3.7.004 - Thursday 26th June 2008
-- Changed: Total code rewrite
-- Added: AdminCP option to force style on all usergroups
-- Added: AdminCP option to override custom style for individual forum

v3.7.003 - Tuesday 13th May 2008
-- Changed: Product name
-- Changed: Version numbering
-- Added: AdminCP Options input validation

v2.1.0 - Thursday 7th February 2008
-- Changed: Install code

v2.0.0 - Wednesday 26th December 2007
-- Initial Release


Thanks

Thanks go out to Paul M who gave me permission to use some of his install code.


Show Your Appreciation

Although not required, if you have enjoyed the benefits of this hack, and would like show your appreciation for my efforts, then please feel free to click on the Support Developer link and donate any amount you feel is appropriate.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 05-25-2008, 07:19 PM
Silviu's Avatar
Silviu Silviu is offline
 
Join Date: Oct 2001
Location: Bucharest, Romania
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Question: what happens if the forced style is set to "Cannot be selected by users"? Can I use this hack to set up a usergroup for internal testing, as it were? Or do I have to enable the style for everyone in order for the hack to work?
Reply With Quote
  #23  
Old 05-25-2008, 08:54 PM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Silviu View Post
Question: what happens if the forced style is set to "Cannot be selected by users"? Can I use this hack to set up a usergroup for internal testing, as it were? Or do I have to enable the style for everyone in order for the hack to work?
It should still work.

BTW, please click Mark as Installed if you are using this hack.
Reply With Quote
  #24  
Old 05-26-2008, 11:56 AM
Selene Selene is offline
 
Join Date: Feb 2005
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

downloaded and clicked *installed*

Now I am running 3.7.0 gold

I entered the usergroup ID's on which I want to force style on and then I added the forum ID too.

Now for the usergroups its working fine, but the problem is when I log out, or the "guests" they see that style too, so its not going back to default style for guests you can say.

I did not enter any ID for guest/unreg usergroup in ur style admin options.

So what can the problem be.
Reply With Quote
  #25  
Old 05-26-2008, 12:44 PM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Selene View Post
downloaded and clicked *installed*

Now I am running 3.7.0 gold

I entered the usergroup ID's on which I want to force style on and then I added the forum ID too.

Now for the usergroups its working fine, but the problem is when I log out, or the "guests" they see that style too, so its not going back to default style for guests you can say.

I did not enter any ID for guest/unreg usergroup in ur style admin options.


So what can the problem be.
This should fix your problem:

Quote:
Originally Posted by Instructions in 1st Post
What if you need custom style permissions as well?

This question has been asked a few times: What if you need custom style permissions so that you can control which usergroups see/select what styles? The hack I use is Andreas's Restrict Style to Usergroup hack which he released for v3.5.x. It is because of that hack that this one exists, and I have tested it on v3.5.x, v3.6.x and v3.7.x, and it works for three versions and works fine with my hacks as well.

For instance on my forum I need to use both hacks, as the style I force on my guests and normal members is not selectable nor do I allow them permission to use it, and is also not my default style (all my other styles are child styles of my default one), so without Andreas's hack I would not be able to do this.

But just to let you know that Andreas's hack is unsupported and is not likely to ever be supported, so if you have problems with it, you are on your own.
Reply With Quote
  #26  
Old 05-26-2008, 06:48 PM
Selene Selene is offline
 
Join Date: Feb 2005
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^ I do not get how it will fix the problem.

I am using your hack and forcing X usergroup to force use style B

Now isnt it obvious that all other usergroups should get the default style? those usergroups who are not geting forced style.

So thatmeans guests should ofcourse see the default vb style that I have set.

That is what I mean.
Reply With Quote
  #27  
Old 06-26-2008, 12:50 PM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Update: v3.7.004
  • Total code rewrite
  • Added option to force style on all usergroups
  • Added option to override custom style for individual forum (as in Style Options in the Forum Manager)
Reply With Quote
  #28  
Old 07-17-2008, 11:04 PM
savingsangel savingsangel is offline
 
Join Date: May 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works excellent! Is it possible to add a *third or fourth* usergroup & style? Can I simply install a separate instance of this mod? GREAT MOD by the way!! Exactly what I was looking for...
Reply With Quote
  #29  
Old 07-18-2008, 03:06 AM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by savingsangel View Post
Works excellent! Is it possible to add a *third or fourth* usergroup & style? Can I simply install a separate instance of this mod? GREAT MOD by the way!! Exactly what I was looking for...
It is possible, but this hack is geared up to only force 1 style. It would probably involve another total rewrite to expand this hack for multiple styles.....I may well look into it in the future.
Reply With Quote
  #30  
Old 08-22-2008, 11:45 AM
Pete C's Avatar
Pete C Pete C is offline
 
Join Date: Aug 2005
Location: South coast, England
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A very useful tool, thank you. *Installed* :up:
Reply With Quote
  #31  
Old 08-27-2008, 03:57 AM
Twilkey's Avatar
Twilkey Twilkey is offline
 
Join Date: Oct 2006
Posts: 314
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just an FYI. If you use the 3.5 version of this mod, then you can set up the groups to have a style per group. All you would need to do is use more then one copy of the plugin.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 07:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06429 seconds
  • Memory Usage 2,318KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete