vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=108623

Force Style to Certain Usergroup(s) and/or User(s)
by Mosh
22 Feb 2006 15:01

1 Attachment(s)
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.

RoryF 22 Feb 2006 15:58

Exactly what i need. Thankyou for making this hack :D. Well done :).

WAR 22 Feb 2006 19:34

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?

Mosh 22 Feb 2006 22:24

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 :)

Mosh 22 Feb 2006 23:36

Now Zip file has now been updated to deal with Secondary Usergroups.

christianjunk 27 Feb 2006 12:12

Hi!

There's an error in your code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You forgot a closing ")" in the if-statement (before "{") ...

Regards,
Christian

Mosh 27 Feb 2006 14:09

Quote:

Originally Posted by christianjunk
Hi!

There's an error in your code:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You forgot a closing ")" in the if-statement (before "{") ...

Regards,
Christian

Thanks for noticing that typo :) updated the zip file.

ToyotaDiesel 19 Apr 2006 14:09

.......

ToyotaDiesel 19 Apr 2006 18:20

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

ToyotaDiesel 19 Apr 2006 18:52

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)

ToyotaDiesel 20 Apr 2006 13:46

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.

Mosh 20 Apr 2006 17:05

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:

ToyotaDiesel 20 Apr 2006 18:04

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

Mosh 21 Apr 2006 01:27

Try this instead:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Tell me if that works.

ToyotaDiesel 21 Apr 2006 14:17

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


All times are GMT. The time now is 04:33.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.