Forum Moderators: coopster

Message Too Old, No Replies

Using PHP to conditionally display Google ads.

         

Linda_A

11:05 pm on Nov 7, 2005 (gmt 0)

10+ Year Member



I am trying to use PHP to make sure that the Google ads on my Invision Board are only displayed on pages that fall within their terms of service and to keep them off non-content pages such as search, login, etc. However, none the suggestions I have received so far for getting it to work have solved the issue.

This was the last thing I tried:

<?php
if ($_GET['showtopic'] ¦¦ $_GET['sf'])
{
<div class="sidebarad">
GOOGLE AD CODE
</div>
}
?>

It resulted in this error: Parse error: parse error, unexpected '<' in /path/Google_Referral_120x60.php on line 4

The pages I want it displayed on (board index, forum view and topic view) have urls like this:

Index: domain.com or domain.com/index.php?act=idx

Forum: domain.com/index.php?showforum=1

Topic: domain.com/index.php?showtopic=38&pid=248&st=0&#entry248

Does anyone have any suggestions for how to accomplish this? My knowledge of PHP is, unfortunately, limited to handling basic includes.

Linda_A

1:20 am on Nov 8, 2005 (gmt 0)

10+ Year Member



Problem solved. Turns out exec.url wouldn't do it, but exec.file would. :)