PDA

View Full Version : Hiding adsense via styleid


sgtryan
11-18-2005, 12:01 AM
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

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
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.