vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Style Permissions (https://vborg.vbsupport.ru/showthread.php?t=68045)

noonespecial 08-06-2004 09:41 AM

Style Permissions
 
I wanna make it so that certain styles can only be used by members of a certain group. Any suggestions?

Colin F 08-06-2004 10:31 AM

Quote:

Originally Posted by noonespecial
I wanna make it so that certain styles can only be used by members of a certain group. Any suggestions?

What do you want to do exactly?

Do you want to restrict access altogether or do you only want to restrict the options shown on the select menu in the usercp?
If you only restrict access to the select menu, users can still see styles by adding &styleid=x to the URL... but it's less complicated as far as I know :)

Colin F 08-06-2004 10:36 AM

You could try something like this:

in global.php, find:
Code:

        // style specified in user profile
        $styleid = $bbuserinfo['styleid'];

REPLACE WITH:

PHP Code:

    if ($bbuserinfo['styleid'] == AND $bbuserinfo['usergroupid'] != Y)
    {
        
$styleid $vboptions['styleid'];
    }
    else
    {
    
// style specified in user profile
    
$styleid $bbuserinfo['styleid'];
    } 

replace X with the styleid and Y with the usergroup that's allowed to view that style.
(untested)

noonespecial 01-03-2005 01:44 PM

Quote:

Originally Posted by Colin F
You could try something like this:

in global.php, find:
Code:

        // style specified in user profile
        $styleid = $bbuserinfo['styleid'];

REPLACE WITH:

PHP Code:

    if ($bbuserinfo['styleid'] == AND $bbuserinfo['usergroupid'] != Y)
    {
        
$styleid $vboptions['styleid'];
    }
    else
    {
    
// style specified in user profile
    
$styleid $bbuserinfo['styleid'];
    } 

replace X with the styleid and Y with the usergroup that's allowed to view that style.
(untested)

I'll give that a try. Basically, I have 6 or 7 styles right now, and I want to add a new style that doesn't include advertisements and allow users to purchase that style.

infazteam 01-03-2005 01:57 PM

Kodlar biras karışık sanki ?

Carnage 01-03-2005 11:09 PM

you could look at it from another angle and edit the templates. putting in a conditional to display the ads if the usergroup is not the ad-free usergroup might be easier also that would mean that your paying users wouldn't be limited to just one style to gain their benifits.

noonespecial 01-04-2005 10:19 AM

Quote:

Originally Posted by Carnage-
you could look at it from another angle and edit the templates. putting in a conditional to display the ads if the usergroup is not the ad-free usergroup might be easier also that would mean that your paying users wouldn't be limited to just one style to gain their benifits.

that's a great idea! could you help me with what the conditional would look like?

Carnage 01-04-2005 12:04 PM

Code:

<if condition="$bbuserinfo['usergroupid'] != X">Code to display ads</if>
change X to the usergroup id of the group that dosn't display ads you can add multiple groups by doing:

Code:

<if condition="$bbuserinfo['usergroupid'] != X && $bbuserinfo['usergroupid'] != Y">Code to display ads</if>
you can also specify users not to display ads to as well by using $bbuserinfo['userid'] != X

noonespecial 01-05-2005 04:44 AM

Quote:

Originally Posted by Carnage-
Code:

<if condition="$bbuserinfo['usergroupid'] != X">Code to display ads</if>
change X to the usergroup id of the group that dosn't display ads you can add multiple groups by doing:

Code:

<if condition="$bbuserinfo['usergroupid'] != X && $bbuserinfo['usergroupid'] != Y">Code to display ads</if>
you can also specify users not to display ads to as well by using $bbuserinfo['userid'] != X

beautiful, im going to put it into work asap .. hopefully we can generate a litle revenue

warpeditor 03-05-2005 02:00 PM

Quote:

Originally Posted by Colin F
You could try something like this:

in global.php, find:
Code:

        // style specified in user profile
        $styleid = $bbuserinfo['styleid'];

REPLACE WITH:

PHP Code:

    if ($bbuserinfo['styleid'] == AND $bbuserinfo['usergroupid'] != Y)
    {
        
$styleid $vboptions['styleid'];
    }
    else
    {
    
// style specified in user profile
    
$styleid $bbuserinfo['styleid'];
    } 

replace X with the styleid and Y with the usergroup that's allowed to view that style.
(untested)

I got a parse error with this code. All I want to do is give moderators 1 more style to choose. Any ideas?


All times are GMT. The time now is 01:46 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.01092 seconds
  • Memory Usage 1,757KB
  • 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
  • (7)bbcode_code_printable
  • (3)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete