vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Miscellaneous Hacks - Force Style for Selected Users or Groups (https://vborg.vbsupport.ru/showthread.php?t=166119)

Mosh 12-24-2007 10:00 PM

Force Style for Selected Users or Groups
 
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.

yahoooh 12-26-2007 01:52 AM

is there any ability to make specific style to spider search bots?

Hornstar 12-26-2007 11:03 AM

Yeah that would be really awesome if you could do the above suggestion as well, as always showing a really nice SEO style for search engines would be helpful :)

thanks for the hack tho

Mosh 12-26-2007 09:09 PM

Quote:

Originally Posted by yahoooh (Post 1409202)
is there any ability to make specific style to spider search bots?

Quote:

Originally Posted by hornstar1337 (Post 1409342)
Yeah that would be really awesome if you could do the above suggestion as well, as always showing a really nice SEO style for search engines would be helpful :)

thanks for the hack tho

There may well be, but unfortunately I do not know how.

gforce75 01-18-2008 07:17 PM

lolz, that would probably be a bit of work. Well, when you select a style, doesn't it show up in the url? Maybe force spiders to start indexing with that certain link. hmm...

legionofangels 02-10-2008 01:49 AM

I've been searching through vb.org for about a 1/2 hour now wondering how we are going to set up an advanced style on our forum for a specific usergroup.

I've read you're and Kirby's threads on your similar but different style hacks.

What I've gathered is that yours forces a style on a user, until they gain a higher rank or whatever, at that point all the styles become available.

While Kirby's seems like restrict a style to certain usergroups only.

Tell me if I have this correct?

Mosh 02-10-2008 04:51 AM

Quote:

Originally Posted by legionofangels (Post 1439738)
I've been searching through vb.org for about a 1/2 hour now wondering how we are going to set up an advanced style on our forum for a specific usergroup.

I've read you're and Kirby's threads on your similar but different style hacks.

What I've gathered is that yours forces a style on a user, until they gain a higher rank or whatever, at that point all the styles become available.

While Kirby's seems like restrict a style to certain usergroups only.

Tell me if I have this correct?

Incorrect, Kirby's hack actually allows for style permissions, in which you can choose which usergroups can select or not select a style (by default, a style is selectable or not selectable by all usergroups).

Mine forces a specific style on a user, users or usergroups (regardless of if the style is selectable or not). It has nothing to do with higher ranks etc,.

So, you would use kirby's hack to give permission for only that usergroup to use that style, and if you want to make sure they can select no other style than the advanced style you will also use mine to lock it down.

Wild-Wing 02-10-2008 01:56 PM

Quote:

Originally Posted by hornstar1337 (Post 1409342)
Yeah that would be really awesome if you could do the above suggestion as well, as always showing a really nice SEO style for search engines would be helpful :)

thanks for the hack tho

you would want to use the userid of 0 because thats what guests and spiders show up as

Straightupimp 02-11-2008 11:51 PM

doesnt work 4 me...

Mosh 02-12-2008 04:17 AM

Quote:

Originally Posted by Straightupimp (Post 1441095)
doesnt work 4 me...

Please elaborate, just saying it does not work is not enough.


All times are GMT. The time now is 07:08 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.01335 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete