Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

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
  #12  
Old 04-20-2006, 12:46 PM
ToyotaDiesel ToyotaDiesel is offline
 
Join Date: Jan 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone? I'm getting by using the user level version, but the usergroup script would make it alot easier to see whos in the group and whos not.
Reply With Quote
  #13  
Old 04-20-2006, 04:05 PM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Post the Style ID you want to restrict to certain groups, and the primary and secondary membergroups you want to limit. And I will PM you the script with the appropriate info already in it.

So do it as:

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

thanks. This is what I was using

if (in_array($vbulletin->userinfo['usergroupid'], array()) || (in_array($vbulletin->userinfo['membergroupids'], array(29))))
{
$styleid = 9;
}

Style ID: 9
Primary Groups: none
Secondary Groups: 29
Reply With Quote
  #15  
Old 04-21-2006, 12:27 AM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this instead:

Code:
if (in_array($vbulletin->userinfo['membergroupids'], array(29)))
{ 
$styleid = 9; 
}
Tell me if that works.
Reply With Quote
  #16  
Old 04-21-2006, 01:17 PM
ToyotaDiesel ToyotaDiesel is offline
 
Join Date: Jan 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. I get this at the top of the page with that line

Parse error: parse error, unexpected '{' in /home/public_html/forums/global.php(233) : eval()'d code on line 2
Reply With Quote
  #17  
Old 04-21-2006, 01:24 PM
ToyotaDiesel ToyotaDiesel is offline
 
Join Date: Jan 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I added a close parenthesis, and it fixed the parse error listed above, but otherwise the code is working the same.

It works fine with all secondary usergroups with an id# of less than 12.
Reply With Quote
  #18  
Old 04-21-2006, 01:33 PM
ToyotaDiesel ToyotaDiesel is offline
 
Join Date: Jan 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Usergroup ids 13-16 were deleted. Would this lack of ID #s cause a problem? Seems like thats where the problem starts. Nothing greater than that block of deleted ids will work.
Reply With Quote
  #19  
Old 04-23-2006, 01:19 AM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You may need to rebuild your Styles to get this to work.

Code:
Maintenance -> Update Counters - > Rebuild Styles.

Select Yes for both Check For Styles With No Parent and Renumber all templates from 1.
.

If that does not work, then I do not have a clue, as it should work as advertised.
Reply With Quote
  #20  
Old 04-24-2006, 12:07 AM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ToyotaDiesel, I had a thought, if you are using this mod with Restrict Style to Usergroup(s) by Andreas, then make sure the style you are using for this secondary member group has the correct permissions for the group to be able to use it.
Reply With Quote
  #21  
Old 05-07-2006, 04:31 AM
Warlock40 Warlock40 is offline
 
Join Date: Mar 2006
Location: Ontario Canada
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ToyotaDiesel
Usergroup ids 13-16 were deleted. Would this lack of ID #s cause a problem? Seems like thats where the problem starts. Nothing greater than that block of deleted ids will work.

Initially I had the same problem. I could not get a specific style to work.
My problem was that I had the style set as "not user selectable"
so members could not pick it.

So to get have my cake and eat it to. I uploaded andreas hack https://vborg.vbsupport.ru/showthread.php?t=95910
and then allowed the style to be select by a specific user group, and then used this hack to set it as a default for that user group.

I also had this set as a default for a cmps page different from my home but in order to keep that I then just created a child and set that to non user selectable and pointed it to my cmps page so that it could get style (as the other was restricted.

So now members who are new or visit the specific page or forum area or are part of a specified usergroup can enjoy this style.

Thanks for the hack.

Oh and if there is an easier way to make this so it can be used by non user selectable styles I'll be happy to change it all back..it will save me some keystrokes down the road.
Reply With Quote
Reply

Thread Tools

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 03:51 PM.


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.06673 seconds
  • Memory Usage 2,303KB
  • 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
  • (2)bbcode_code
  • (1)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
  • (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