vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Restrict Style Changes To Specific Usergroups (https://vborg.vbsupport.ru/showthread.php?t=60410)

NTLDR 01-17-2004 10:00 PM

Restrict Style Changes To Specific Usergroups
 
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:

PHP Code:

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

PHP Code:

if (!in_array($bbuserinfo['usergroupid'], array(XYZ))) {
    
$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:

PHP Code:

if ($allowchangestyles==AND (in_array($bbuserinfo['usergroupid'], array(567))) ) {
    
$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
PHP Code:

if (!is_member_of($bbuserinfoX) AND !is_member_of($bbuserinfoY) AND !is_member_of($bbuserinfoZ)) 

as the if-condition.
Or apply this hack (I really feel this should become factory code as it is needed often) so is_member_of() can check for several usergroup IDs:
PHP Code:

if (!is_member_of($bbuserinfoXYZ)) 


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

Quote:

Originally Posted by Da_GoTTi
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


All times are GMT. The time now is 04:43 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.01227 seconds
  • Memory Usage 1,776KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete