vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Hiding adsense via styleid (https://vborg.vbsupport.ru/showthread.php?t=101045)

sgtryan 11-18-2005 12:01 AM

Hiding adsense via styleid
 
I have an option for forum users to upgrade to "premium."

This will offer the advantage of no ads, which works fine except in custom scripting.

I am using this code to hide an ad to those using the "premium" style (Which is available only to premium users).

This is how it goes
Code:

if($vbulletin->userinfo[styleid] !== "18")
{
DISPLAY GOOGLE ADS
}
else
{
DO NOT DISPLAY THE ADS
}

'18' is the style id of the premium users styles.

HOwever, when an admin on my boards switches to the style (or any other person who has premium capabilities) it still shows the ad.

I've tried just about everything.

What on earth am I doing wrong????

Thanks in advance,
Ryan

amykhar 11-18-2005 12:03 AM

Try != instead of !==

Amy

sgtryan 11-26-2005 12:02 AM

Im an idiot, I tried amy's method and it worked.

THANK YOU SO MUCH!!!

Zachery 11-26-2005 08:21 AM

Quote:

Originally Posted by sgtryan
Im an idiot, I tried amy's method and it worked.

THANK YOU SO MUCH!!!

That will only work if the user is using a style via the usercp, if they change it in therir cookie..

merk 11-26-2005 10:03 AM

Better to use usergroups to perform such checks, though you could use the defined constant of "STYLEID" (no $) to determin the styleid being used for the current pageload.


All times are GMT. The time now is 11:12 AM.

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.01291 seconds
  • Memory Usage 1,715KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_quote_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