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
  #2  
Old 02-22-2006, 02:58 PM
RoryF RoryF is offline
 
Join Date: Apr 2005
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Exactly what i need. Thankyou for making this hack . Well done .
Reply With Quote
  #3  
Old 02-22-2006, 06:34 PM
WAR WAR is offline
 
Join Date: Jan 2004
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just to clarify, you said that this works just fine in conjunction with Andreas' Restrict Style to Usergroup(s) hack without any conflict?

Also: Does this work with secondary usergroups as well?
Reply With Quote
  #4  
Old 02-22-2006, 09:24 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 WAR
Just to clarify, you said that this works just fine in conjunction with Andreas' Restrict Style to Usergroup(s) hack without any conflict?

Also: Does this work with secondary usergroups as well?
Yes, no conflicts at all.

Not in it's current state, but I will put that in, in a bit for you
Reply With Quote
  #5  
Old 02-22-2006, 10:36 PM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now Zip file has now been updated to deal with Secondary Usergroups.
Reply With Quote
  #6  
Old 02-27-2006, 11:12 AM
christianjunk christianjunk is offline
 
Join Date: Feb 2006
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi!

There's an error in your code:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
	<plugin active="1" product="vbulletin">
		<title>Force Styles for Selected Usergroups</title>
		<hookname>style_fetch</hookname>
		<phpcode><![CDATA[if (in_array($vbulletin->userinfo['usergroupid'], array(a,b,c)) || (in_array($vbulletin->userinfo['membergroupids'], array(d,e,f)))
{ 
$styleid = 8; 
}]]></phpcode>
	</plugin>
</plugins>
You forgot a closing ")" in the if-statement (before "{") ...

Regards,
Christian
Reply With Quote
  #7  
Old 02-27-2006, 01:09 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 christianjunk
Hi!

There's an error in your code:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
	<plugin active="1" product="vbulletin">
		<title>Force Styles for Selected Usergroups</title>
		<hookname>style_fetch</hookname>
		<phpcode><![CDATA[if (in_array($vbulletin->userinfo['usergroupid'], array(a,b,c)) || (in_array($vbulletin->userinfo['membergroupids'], array(d,e,f)))
{ 
$styleid = 8; 
}]]></phpcode>
	</plugin>
</plugins>
You forgot a closing ")" in the if-statement (before "{") ...

Regards,
Christian
Thanks for noticing that typo updated the zip file.
Reply With Quote
  #8  
Old 04-19-2006, 01:09 PM
ToyotaDiesel ToyotaDiesel is offline
 
Join Date: Jan 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

.......
Reply With Quote
  #9  
Old 04-19-2006, 05:20 PM
ToyotaDiesel ToyotaDiesel is offline
 
Join Date: Jan 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have secondary usergroups that i can't get it to work with.

for instance:

Works with Usergroup 12 and 2, not with 17, 24, and 29.

Is there a cap on usergroup id#s?

Thanks
Reply With Quote
  #10  
Old 04-19-2006, 05:52 PM
ToyotaDiesel ToyotaDiesel is offline
 
Join Date: Jan 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cannot get it to work with a usergroupid higher than 12. (my usergroups jump from 12 to 17 btw)

Works on 12. down.

Doesnt work on 17, up.

(I'm trying secondary usergroups btw)
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 02:45 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.08161 seconds
  • Memory Usage 2,299KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_code
  • (2)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