PDA

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


Mosh
04-01-2007, 10:00 PM
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 which will work with v3.7.x, as well as with 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 both vBulletin v3.6.x and v3.7.x


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 port/update of my v3.5.x hack available here, apart from the fact that settings are now controlled from the AdminCP.

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

This hack rectifies that. It also allows you to let others use the Default Style while forcing the usergroup(s)/member(s) to the one style you selected.

Note: There is no upgrade path from my v3.5.x version, you have to uninstall that one first before installing this one.


Installation Instructions

Import the product-jd_20070403.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 the usergroup(s), member(s) and the style id you want to force on those usergroups or members


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

v1.01 - Wednesday 11th April 2007
-- Final Release
-- Added: AdminCP option

v1.00 - Tuesday 3rd April 2007
-- 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.

Barakat
04-02-2007, 10:17 PM
install thanks .

Hornstar
04-02-2007, 11:05 PM
Hey cool, i also do the same thing with having all the child templates taking hold from the default template, makes it so much easier in editing templates.

I'm sure ill find a use for this hack in the near future. thanks.

Mosh
04-03-2007, 01:20 AM
Hey cool, i also do the same thing with having all the child templates taking hold from the default template, makes it so much easier in editing templates.

I'm sure ill find a use for this hack in the near future. thanks.
Cool :)

But don't forget that if you do use it, remember to click on Mark as Installed please.

kall
04-03-2007, 01:36 AM
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.

This modification rectifies that.

... as would taking the tick out of the Default Style and clicking Save Display Order. ;)

Mosh
04-03-2007, 01:42 AM
... as would taking the tick out of the Default Style and clicking Save Display Order. ;)
Ah, yes, but then you would not be able to have certain groups apart from admins being able to use the Default Style, which is one of the reasons this exists.

For instance, on my own forum, guests and normal members get the same child style, but members who have been promoted to another group, have a selection of styles including the Default Style and your method would not work in this situation.

kall
04-03-2007, 01:48 AM
Well, you didn't say that, now did you. :)

In that case, this mod is perfect. :D

Mosh
04-03-2007, 02:09 AM
Well, you didn't say that, now did you. :)

In that case, this mod is perfect. :D
Thanks mate :)

I better put this in the original post to clarify :D

Cyricx
04-03-2007, 04:30 PM
O the pain you can put a banned or restricted user through with a mod like this is just delicious! :D

AMG021
04-04-2007, 03:10 AM
excellent hack

|Jordan|
04-11-2007, 04:47 AM
Theres nothing on the plugin options where i can enable it. Here's all i see:

Mosh
04-11-2007, 07:04 AM
Theres nothing on the plugin options where i can enable it. Here's all i see:
It it was missing, for some reason the setting was assigned to another of my hacks I have now rectified that, just update to the newest version and it will give you the setting.

farukcan
04-11-2007, 01:45 PM
offf, :(:(

not run... :(

|Jordan|
04-11-2007, 05:39 PM
It it was missing, for some reason the setting was assigned to another of my hacks I have now rectified that, just update to the newest version and it will give you the setting.

Any chance you can add an option that restricts users to more then 1 style ?

Pretty Please with a cherry on top :)

rjmjr69
04-12-2007, 06:03 AM
Excellent hack thank you

Mosh
04-12-2007, 06:10 AM
Any chance you can add an option that restricts users to more then 1 style ?

Pretty Please with a cherry on top :)
That is not the intention of this hack, and a user can only have one style assigned to them at the same time.

What you need is a custom permissions to allow a user to have some styles but not others, and the only one that comes to mind is KirbyDE's Restrict Style to Usergroup hack which he released for v3.5.x before he became Andreas the vBulletin Developer. It is because of that hack that this one exists, and I have tested it on both v3.5.x and v3.6.x and it works for both and works fine with my hacks for both versions as well, but just to let you know that it is unsupported and is not likely to ever be supported, so if you have problems with it, you are on your own.

|Jordan|
04-12-2007, 05:37 PM
Ah thx!

chompychan
04-14-2007, 10:28 AM
I am amazed this isn't a default feature of vBulletin. It's so useful.

Thanks.

Mum
06-27-2007, 01:43 AM
Thank you :) works perfectly!

lostgirl815
09-22-2007, 08:39 AM
I love this hack, as some of my board members like the styles to be different in each forum and others hate the styles changing on them. I've been using it for some time now.

One thing I would love to be able to do is create a joinable usergroup that would allow someone to set themselves on style override. But for some reason this only works if a person is only a member of one single group. If anybody has any idea how I could get around that quirk, I'd appreciate knowing it.

Mosh
09-23-2007, 08:06 AM
One thing I would love to be able to do is create a joinable usergroup that would allow someone to set themselves on style override. But for some reason this only works if a person is only a member of one single group. If anybody has any idea how I could get around that quirk, I'd appreciate knowing it.
Unfortunately, that is not the goal of this hack.

It is something I wrote for my forum and decided to release here.

I have no desire to expand this hack at all, as it does exactly what I need it do it, and I hope others benefit from this as it is.

lostgirl815
09-23-2007, 06:18 PM
I wasn't complaining about your hack or asking you to rewrite it - I was trying to use it for x purpose and ran into x problem and wondered if anyone knew a way around it. And although asking questions is normally an exercise in futility on here, every now and again I get lucky, so I ask anyway. :)

yoyoyoyo
09-29-2007, 11:36 AM
it would be nice if this hack didn't override the custom style settings for individual forums in the Forum Manager

giotmuadong
10-25-2007, 09:49 PM
very nice, i like your hack .. thanks!!!

SpankMe
11-20-2007, 06:40 PM
Excellent. I use it on my biker site for users who start flaming. I force them to use a really ghey looking pink style until they calm down :p

Only problem is that the style has to be user selectable to work. Would be good if it worked on styles that are not user selectable. :up:

Mosh
11-21-2007, 09:26 PM
Only problem is that the style has to be user selectable to work. Would be good if it worked on styles that are not user selectable. :up:
Read post #16 (https://vborg.vbsupport.ru/showpost.php?p=1225674&postcount=16), as that hack will fix your problem.

Mosh
12-25-2007, 07:58 PM
it would be nice if this hack didn't override the custom style settings for individual forums in the Forum Manager
The 3.7.x version of this hack has been released here, it rectifies this.

Red Spider
02-05-2008, 08:31 AM
just what i needed - thanks!

I'm running vB 3.7 BETA 4 and it works fine! :)

Forumdayim.Net
03-21-2008, 04:22 PM
I was searching a hack as soon as that..:)

Thanks so much guy.;)

Installed

Ronin Six
03-29-2008, 02:57 PM
Thanks for this mod!! Been using it a little while now.

Just having some issues with guest users seeing a custom style even though I'm not forcing it on them. Here's the situation:

Parent style is the default style. Custom style is a child of the default.
I'm forcing the custom child style on user groups that have been promoted to a certain level.

I'm not forcing the custom child style on the guests, but they're seeing it anyway.

I have a feeling it might be because I'm using it slightly different that you have it for your own forums (your default is a child style, and what you're forcing is the parent). Any help would be appreciated. Thanks!

Mosh
03-30-2008, 07:47 AM
Thanks for this mod!! Been using it a little while now.

Just having some issues with guest users seeing a custom style even though I'm not forcing it on them. Here's the situation:

Parent style is the default style. Custom style is a child of the default.
I'm forcing the custom child style on user groups that have been promoted to a certain level.

I'm not forcing the custom child style on the guests, but they're seeing it anyway.

I have a feeling it might be because I'm using it slightly different that you have it for your own forums (your default is a child style, and what you're forcing is the parent). Any help would be appreciated. Thanks!
I think it may be a problem with style permissions, either a style is selectable or it is not, there are no usergroup permissions for styles by default, well, not without a hack.

The solution for you may be:

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 both v3.5.x, v3.6.x and v3.7.x, and it works for both and works fine with my hacks for both versions as well.

For instance on my own forum I need to use both hacks, as the style I force on my guests and normal members is not selectable or 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.

stamos2003
04-01-2008, 07:02 AM
very good hack, this should be integrated in to VB anyway!

reverse1312
05-01-2008, 07:27 AM
Hello,

I'm with vB 3.6.5
I created a special new style to test it.
in my options styles are not selectable
tried to force a special new secondary group to use this style. Did not work
tried to force a special news main usergroup to use it. Did not work
tried to force 1 user . It succeded. :-)
2 users too but with a third one it did not work...

How is it possible ?

Mosh
05-02-2008, 01:30 AM
Hello,

I'm with vB 3.6.5
I created a special new style to test it.
in my options styles are not selectable
tried to force a special new secondary group to use this style. Did not work
tried to force a special news main usergroup to use it. Did not work
tried to force 1 user . It succeded. :-)
2 users too but with a third one it did not work...

How is it possible ?
Refer to the solution in post #31, it may well solve you issue.

Let me know if it does not.

reverse1312
05-03-2008, 09:28 AM
Let me know if it does not.

You're right, I had to install the other hack ;-)
Thank you very much !

Mosh
05-03-2008, 11:32 AM
You're right, I had to install the other hack ;-)
Thank you very much !
You are most welcome :)

madkeen
06-04-2008, 08:38 AM
Thanks

Mosh
09-03-2008, 04:22 AM
NOTE: 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.7.x version of this hack, as it also works with v3.6.10 (and maybe even earlier versions).

TheMusicMan
09-12-2008, 09:15 AM
Hi All

How would I make this mod work as I want it to thus;

I want to force a Style on a usergroup, but I don't want anyone else to be able to see or select this style unless it is forced on them...?

Sounds unusual - but I have several members who don't want to see the ads AND who want the default vB style (as this is easy on their eyes). I dont want to have to create a derivative/child of my single style for them, so to allow them visibility of the default style containing no ads is the solution. They will have paid to support the site thus entitleing them not to see ads.

Can I configure this hack (with template conditionals I guess) to work for these requirements...?