Quote:
Originally Posted by baze22
I'm trying to get adsense integrated into my forum. I only want the ads showing in showthread displays and forumdisplays and I want to exclude certain (non-public) forums. I've used the following:
Code:
<if condition="THIS_SCRIPT == 'showthread' || THIS_SCRIPT == 'forumdisplay'">
<if condition="(f <> 6) && (f <> 7)">
ad here
</if>
</if>
It restricts it to the page but still shows for all forums. I'm not sure of the right variable name to use for the forumid (I have tried forumid). Is there a list somewhere listing variables available to use in the conditional statements.
thanks,
basil
|
Try this. In PHPINCLUDE_START place this in by itself
PHP Code:
$display_ad = false;
if ($foruminfo['forumid']) // This determines if we are in a forum at all.
// If we're not in a forum this evaluates false.
{
if ($foruminfo['forumid']<>'6' AND $foruminfo['forumid']<>'7')
{$display_ad = true;}
}
Later on you can add forums to the list of adless forums by adding to the second conditional.
Meanwhile, back in whatever template is getting this ad simply put
HTML Code:
<if conditional="$display_ad">ad</if>
Footnote, the f=# you see on the top bar isn't a variable, but it is contained in one; $_GET. You shouldn't go calling $_GET inside your templates though - it might leave your setup vulnerable to certain hacks.