vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   User session information outside of vBulletin. (https://vborg.vbsupport.ru/showthread.php?t=198574)

MjrGaelic 12-10-2008 10:13 PM

User session information outside of vBulletin.
 
What I'm trying to do is disable ads sitewide for subscribers (premium members).

I'm able to do this within vBulletin templates and I'm trying to do so for the mainsite as well and am having some challenges. I think it's a matter of syntax which I'm not very good with at all so I'm reaching out for some help =).

In my header file I have:
Code:

chdir('./forums');
require_once('./global.php');
chdir('../');

The part that is killing me now is:
Code:

<if condition="!$bbuserinfo['field9']">
        banner image code
</if>

So that users in my user group don't see the banner code. Now it works in my vBulletin but doesn't in the other files.. I think it has something to do with the way I'm using IF but if someone could suggest or point me in the right direction I'd be elated.

The rest of the code I'm using is located here

Cheers and thanks in advance.

Dismounted 12-11-2008 03:20 AM

The "<if>" construct is one specified and used by the vBulletin template parser only. Try using traditional PHP conditionals in your custom file.

Also, $bbuserinfo is only used in templates - use $vbulletin->userinfo everywhere else.

MjrGaelic 12-11-2008 06:25 AM

Thanks for the nudge in the right direction.. Unfortunatley, after a few rounds of battle I'm still not any further ahead =).

How would you translate:
Code:

<if condition="!$bbuserinfo['field9']">
        banner image code
</if>

into a traditional php statement?

Alternately and to be more precise I'm looking for - if the user is a member of group id9 then display nothing.. otherwise display the banner code.

Dismounted 12-11-2008 08:18 AM

PHP Code:

if (!is_member_of($vbulletin->userinfo9))
{
    
// echo code here



MjrGaelic 12-11-2008 01:18 PM

That did the trick thank you =0..

When the site is done I'll make sure you get a free premium account 4evar =) (it's a flash arcade)


All times are GMT. The time now is 02:29 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.01123 seconds
  • Memory Usage 1,720KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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