PDA

View Full Version : Restrict Style Changes To Specific Usergroups


NTLDR
01-17-2004, 10:00 PM
Author: NTLDR
Version: 1.0.0
Requested By: restless (here)
vB Compatibility: vB3 Gamma, RC1, RC2

Description:

This hack will allow you to restrict users ability to change the board style based on there usergroup, usefull for premium members etc. Note, this will mean members not in these groups will only have access to ONE style, the default board one (or a forum specific one).

File Edits:

In global.php find:


// is style in the forum/thread set?
if ($codestyleid)
{

Add before (replace X, Y, Z with the a comma seperated list of the usergroupid's that should have access to the styles):

if (!in_array($bbuserinfo['usergroupid'], array(X, Y, Z))) {
$vboptions['allowchangestyles'] = 0;
}

restless
01-18-2004, 06:24 PM
excellent stuff.

M1th
01-18-2004, 06:58 PM
Yep, I've already got this working. But what would be cool is the ability to enable/disable a specified style on a usergroup basis.

DiscussAnything
01-25-2004, 02:15 AM
Does this work on vb2 as well? I just tried it on a 2.3.0 but a test user not in a usergroup in the array could change styles. I would love to have this on vb2. If its a slight difference with the above, please let me know. thanks!

would this work?

in member.php:

if ($allowchangestyles==1 AND (in_array($bbuserinfo['usergroupid'], array(5, 6, 7))) ) {
$stylesets=$DB_site->query("SELECT * FROM style WHERE userselect=1 ORDER BY title");
if ( !isset($bbuserinfo['realstyleid']) ) {
$bbuserinfo['realstyleid'] = $bbuserinfo['styleid'];
}

M.C.
01-25-2004, 12:49 PM
there is spetial hack for 2.3.0 same to this one just search in Code Modification vB2 -> Full Releases

NTLDR, is any chanse to make it work throgh AdminCP? I now it need to make database queries but...

Thanks

NTLDR
01-25-2004, 04:17 PM
When Kura has released the HTL hack I'll create another version that has an ACP setting, untill then you manually need to enter the code.

neo|d3fx
05-20-2004, 01:16 AM
Is there a way to modify it to allow only certain usergroups to have access to certain styles?

For example, a selection of premuim styles for members that donate money, and a selection for normal members?

ImportPassion
05-20-2004, 01:47 AM
hmm...i was going to add this, the i thought, what happens when their premium membership runs out. they won't be able to access it anymore and it will be left at the last one they selected cause of the cookie it sets.

This is a good idea, but I think needs better integration and defineable by usergroup on which styles they are allowed to choose.

neo|d3fx
05-20-2004, 02:09 AM
wouldn't it be the same as if the style was disabled? Then it would revert to the default forum style?

ImportPassion
05-20-2004, 02:11 AM
i don't think so, from what i have seen as soon as u change it, even with a link and not by the dropdown, it sets a cookie.
i don't think this will stop them from just appending &styleid=5 in the url ether tho.

pgowder
06-15-2004, 05:34 PM
Will this hack allow me to do the following?

I want unregistered/guests to see a certain style. The rest of the usergroups can see another one.

NTLDR
06-15-2004, 06:18 PM
Yes it will, provided the default style is the one for guests to see.

pgowder
06-15-2004, 07:16 PM
Ok, then I'm confused. How do I configure it that way?

Freezerator
07-27-2004, 06:07 PM
Will you upgrade this hack in the future, so i can select for instance, style 1 and 2 for usergroup x, and style 3, and 4 for usergroup y?

noonespecial
08-06-2004, 09:48 AM
yah, what I am looking for is to have one style that doesn't include any of my advertisers, banners, etc, on it - and allow members who donate the possiblity to select that style - if say i move them into a certain usergroup - any ideas??

beano33
09-20-2004, 09:24 PM
This hack only appears to grant permission to change styles when the usergroup is that users primary usergroup. At least that's the way it's working on my board. My subscription system is based on alternate usergroups. Is there any way to make it grant permission to change styles if the user belongs to an alternate usergroup that should have permisssion?

sonic3d
09-20-2004, 10:10 PM
thank you very much. i wanted this so much.

later
sonic

bjornstrom
10-02-2004, 05:11 PM
This is perfect, thank you very much!

/Martin

DarrinM
01-05-2005, 09:30 PM
Would love a MOD that simply allows Admin to set a style for each usergroup

!!!

Cheers

FWF
01-11-2005, 07:56 PM
indeed id like see this via Admin CP

beano33
03-10-2005, 06:05 PM
*bump*
Anyone know how to change the conditional so it allows subscribers in alternate usergroups the same privilege?

GoTTi
06-01-2005, 11:35 PM
when i put this code in the global.php the dropdown for the styles disappears. any ideas?

Andreas
06-01-2005, 11:56 PM
Well, that's what this hack is all about:
It removes the ability to change styles if you are not a primary member of the specified usergroups.

@beano33
Use

if (!is_member_of($bbuserinfo, X) AND !is_member_of($bbuserinfo, Y) AND !is_member_of($bbuserinfo, Z))

as the if-condition.
Or apply this hack (https://vborg.vbsupport.ru/showthread.php?t=61149) (I really feel this should become factory code as it is needed often) so is_member_of() can check for several usergroup IDs:

if (!is_member_of($bbuserinfo, X, Y, Z))

GoTTi
06-02-2005, 02:19 AM
i want a option to allow users in certain groups to be able to select certain skins/styles.

amykhar
06-02-2005, 02:25 AM
i want a option to allow users in certain groups to be able to select certain skins/styles.
Then you're in the wrong thread :D

GoTTi
06-02-2005, 05:06 AM
can u point me in the right direction

Justice
12-15-2005, 07:03 AM
does this work with 3.5.2? seems very simple to install