PDA

View Full Version : Miscellaneous Hacks - Force Style for Selected Users or Groups


Mosh
25 Dec 2007, 21:45
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

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.
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.
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

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
26 Dec 2007, 03:52
is there any ability to make specific style to spider search bots?

Hornstar
26 Dec 2007, 13:03
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
26 Dec 2007, 23:09
is there any ability to make specific style to spider search bots?

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
18 Jan 2008, 21:17
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
10 Feb 2008, 03:49
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
10 Feb 2008, 06:51
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
10 Feb 2008, 15:56
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
12 Feb 2008, 01:51
doesnt work 4 me...

Mosh
12 Feb 2008, 06:17
doesnt work 4 me...
Please elaborate, just saying it does not work is not enough.

Straightupimp
12 Feb 2008, 11:32
...it doesnt work i entered the style id and the usergroup ids logged out and still could choose all skins

Mosh
13 Feb 2008, 06:06
...it doesnt work i entered the style id and the usergroup ids logged out and still could choose all skins
Did you also add usergroup id 1? That is for guests.

My hack does not stop the style selector from being shown if more than 1 style is selectable, but will not allow another one to be selected from the list.

For the style selector to stop being shown, you will have to also install Andreas's hack (see 1st post for link).

If you require any more support, then you will need to click on Mark as Installed before I will help further, as you are obviously using it.

vmacedonia
17 Feb 2008, 17:29
It will be perfect if there is also an option for force language per usergroup or member.

Mosh
18 Feb 2008, 05:33
It will be perfect if there is also an option for force language per usergroup or member.
Unfortunately, that is not something I plan on doing at the moment, as I only use 1 language on my forums.

Maybe a request posted in the Modification Requests (Unpaid) (http://www.vbulletin.org/forum/forumdisplay.php?f=112) will lead to someone creating this for you.

Stilgar
19 Feb 2008, 17:45
Works great. Thanks :)

Al Gregory
05 May 2008, 23:09
Seems to work fine thank u

Mosh
13 May 2008, 06:24
Update: v3.7.003


Product name changed
Version numbering changed
AdminCP Options input validation

efe
13 May 2008, 16:08
working, thanx.

Mosh
13 May 2008, 23:27
working, thanx.
Then please click Mark as Installed.

hilfe-forum
15 May 2008, 06:39
Top :up:

Silviu
25 May 2008, 21:19
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?

Mosh
25 May 2008, 22:54
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.

Selene
26 May 2008, 13:56
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.

Mosh
26 May 2008, 14:44
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:

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.

Selene
26 May 2008, 20:48
^ 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.

Mosh
26 Jun 2008, 14:50
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)

savingsangel
18 Jul 2008, 01:04
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...

Mosh
18 Jul 2008, 05:06
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.

Pete C
22 Aug 2008, 13:45
A very useful tool, thank you. *Installed* :up:

Twilkey
27 Aug 2008, 05:57
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.

Mosh
28 Aug 2008, 06:57
Update: v3.7.005
-- 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

Mosh
29 Aug 2008, 04:15
Update: v3.7.006
-- Fixed: Usergroup permission checkboxes not working with vBulletin v 3.6.x
-- Changed: Removed dependency, now works with v3.6.10

Jari37
29 Aug 2008, 12:46
At the moment I have one main default style for my forums, but several child styles that I use for the various sub forums. On those forums, I have set them to over-ride users choice.

The problem I have, is that I also have a worksafe/mobile option for my users, but whenever they go into the sub forums they are forced back into the default mode because I have users choice on over ride.

Will this hack help me fix this problem, and if not does anyone have any suggestions?

Thanks.

Mosh
29 Aug 2008, 12:58
At the moment I have one main default style for my forums, but several child styles that I use for the various sub forums. On those forums, I have set them to over-ride users choice.

The problem I have, is that I also have a worksafe/mobile option for my users, but whenever they go into the sub forums they are forced back into the default mode because I have users choice on over ride.

Will this hack help me fix this problem, and if not does anyone have any suggestions?

Thanks.
It may well do, as this hack can over-ride the forum over-rides, but I can not say for certain that it will do exactly what you want it to do, as I have nothing similar to your setup, i.e. the forum over-riding styles, I made some of my styles over-riding styles while developing this hack, but that is about it.

You may well need to experiment to see if it is for you or not. If it does what you want, then you can click Mark as Installed, if it does not, then you can un-install the hack.

Mosh
21 Nov 2008, 03:12
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).