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

Reply
 
Thread Tools
Force Style to Certain Usergroup(s) and/or User(s) Details »»
Force Style to Certain Usergroup(s) and/or User(s)
Version: 1.02, by Mosh Mosh is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.x Rating:
Released: 02-21-2006 Last Update: 02-26-2006 Installs: 29
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.

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


vBulletin Version Compatibility

This hack has be tested with v3.5.8. This has not been tested with earlier versions, 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).

Background

This is inspired by the hack - Restrict Style to Usergroup(s) by Andreas.
I asked about a mod to restrict styles to certain usergroups and ended up using Andreas's hack, but did not do the job exactly as I need it, see scenario below to see why did not.

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 wanted to use a child style as the standard style for visitors and members, but not have them have a choice of the default template at all, but as soon as you logged out you were presented with the default template that you did not want guests to see.

Solution

I created this hack to rectify that and it works in harmony with Andreas's hack.


Installation Instructions

Instructions and upgrade instructions are in the attachment.

Note: No screenshots are needed, so are not provided.


Version History

v1.02 - Tuesday 28th February 2006
-- Final release
-- Fixed: Plugin typo

v1.01 - Thursday 23rd February 2006
-- Added: Secondary Usergroups permissions

v1.00 - Thursday 23rd February 2006
-- Initial Release


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-08-2006, 11:51 PM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If it can not be selected by the user, it can not be used by that user unfortunately and my mod will not work, it is what permissions is all about.

My mod is used in conjunction with Andrea's one (advanced permissions for each style) to force a particular style on a user or a group of users (but the user or group have to have permissions to select/see the style being forced on them).
Reply With Quote
  #23  
Old 01-30-2007, 07:46 PM
beano33 beano33 is offline
 
Join Date: Feb 2003
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I force a lite style during periods of high server loads. Does anyone know how to add a trigger to this plugin so it would only go active at a defined server load? I suspect it might involve adding another plugin to the global.php hook location. Thanks!
Reply With Quote
  #24  
Old 03-14-2007, 05:04 AM
The Equivocate The Equivocate is offline
 
Join Date: Sep 2004
Location: Chicago
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey, I'm using this hack to implement a "multi-site" shared forum. Because the sites will be referring hits based on style id (I.E. the affiliate has skin id #2 branded with their logos/ads, so they'd use mysite.com/index.php?styleid=2), Unregistered Users need to have all the skins available to them, and their skin defined via the styleid in the URL.

What change would I have to make? I know absolutely nothing about PHP, but here's the change I tried to make to allow Unregs (usergroup ID #1) to view both skin styleid #1 AND #2 (but let's pretend there's going to be about 6 more). It's giving me a parse error and only showing skin #2.:

Code:
if (in_array($vbulletin->userinfo['usergroupid'], array(1)) || (in_array($vbulletin->userinfo['membergroupids'], array(1))))
{ 
$styleid = 1,2; 
}
Reply With Quote
  #25  
Old 03-18-2007, 10:53 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 The Equivocate View Post
Hey, I'm using this hack to implement a "multi-site" shared forum. Because the sites will be referring hits based on style id (I.E. the affiliate has skin id #2 branded with their logos/ads, so they'd use mysite.com/index.php?styleid=2), Unregistered Users need to have all the skins available to them, and their skin defined via the styleid in the URL.

What change would I have to make? I know absolutely nothing about PHP, but here's the change I tried to make to allow Unregs (usergroup ID #1) to view both skin styleid #1 AND #2 (but let's pretend there's going to be about 6 more). It's giving me a parse error and only showing skin #2.:

Code:
if (in_array($vbulletin->userinfo['usergroupid'], array(1)) || (in_array($vbulletin->userinfo['membergroupids'], array(1))))
{ 
$styleid = 1,2; 
}
This is only to force a 1 style on member group(s).

You can not have multiple style ids as you have them, this is what is causing the parse error:

Code:
$styleid = 1,2;
If you want to have guests use all styles then do not use this hack. Only use this hack for the member groups you want to restrict to a particular style.

If you want to restrict say 2 different member groups to one style and say 1 different member group to another style then here is an example of how to do it.
Code:
if (in_array($vbulletin->userinfo['usergroupid'], array(2,3)))
{ 
$styleid = 1; 
}
if (in_array($vbulletin->userinfo['usergroupid'], array(4)))
{ 
$styleid = 2; 
}
Also please click INSTALL, as you said you are using this hack.
Reply With Quote
  #26  
Old 03-23-2007, 05:16 AM
lostgirl815 lostgirl815 is offline
 
Join Date: Apr 2006
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any chance that I can use this with 3.6.4?
Reply With Quote
  #27  
Old 03-24-2007, 08:34 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 lostgirl815 View Post
Is there any chance that I can use this with 3.6.4?
It should work with v3.6.x
Reply With Quote
  #28  
Old 03-24-2007, 08:37 PM
lostgirl815 lostgirl815 is offline
 
Join Date: Apr 2006
Posts: 228
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great! Thanks for your answer!

--------------

Worked like a charm in the test run - thanks so much for this one!
Reply With Quote
  #29  
Old 03-26-2007, 06:26 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 lostgirl815 View Post
Great! Thanks for your answer!

--------------

Worked like a charm in the test run - thanks so much for this one!
You are most welcome
Reply With Quote
  #30  
Old 04-02-2007, 09:11 PM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The official v3.6.x version of this modification is now available from here.

Thanks for your patience, and hope all of you users with v3.6.x will enjoy this ported mod
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 09:04 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.04309 seconds
  • Memory Usage 2,307KB
  • Queries Executed 24 (?)
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_code
  • (3)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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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