vBulletin - Usergroup Conditions on External Pages

Discussion in 'vBulletin' started by Bradley_Wint, Nov 9, 2008.

  1. #1
    Ok, so I am thinking of making a premium members group, with the feature of no adverts while browsing. However I want to extend the feature to my non-vb pages.

    Is there a way (condition) to allow for ads (ad code) to be hidden if a user of a certain group is logged on on external pages? I already have a login script that uses this header include to manage login and logouts.
    Code:

    <?php
    $curdir = getcwd ();
    chdir('/mysite/board');
    require_once('/mysite/board/global.php');
    chdir ($curdir);
    ?>
    
    Code (markup):
    and then the relevant log in box code between the BODY tags
     
    Bradley_Wint, Nov 9, 2008 IP
  2. Logician

    Logician Active Member

    Messages:
    213
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #2
    After you included global.php to your file, you can use "if" conditional in php codes and "<if condition=" in templates:

    inside php:
    if ($vbulletin->userinfo[usergroupid] == 6)
    {
    $dont_show_ads_I_am_an_admin = TRUE;
    }

    inside vb templates:
    <if condition="$bbuserinfo[usergroupid]==6">
    Hello Admin!
    </if>

    Also you might like to check this hack which can make your life much easier on this request:
    http://www.vbulletin.org/forum/showthread.php?t=186644
     
    Logician, Nov 12, 2008 IP