Geraldm
08-06-2008, 10:03 AM
Hi,
I'm trying to get asrep working with vbulletin. Basically, under the first post in a thread I display a Google Adsense Ad.
I want to be able to use the asrep fraud prevention feature. So I have done the following.
Created an external php file called displayad1.php in the root of my forum with the following content:
<?php
require_once "asrep/fraudprev.php" ;
# show only if the visitor have seen less than 10 ad displaying pages
# and clicked 2 times or less in the last 1 hour
if(asrep_ipStatsOK(NULL, 0, 1*60*60)){
?>
<script type="text/javascript"><!--
google_ad_client = "<my pubid>";
google_ad_slot = "5185614664";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<?php }else{ ?>
nothing to display
<?php } ?>
Then I create a new plugin which hooks into showthread_start:
<!-- AdSense Code -->
ob_start();
require(DIR . '/displayad1.php');
$displayad1 = ob_get_contents();
ob_end_clean();
At this point I have not added $displayad1 to my template, but if I visit my forum I get the following error message:
Parse error: syntax error, unexpected '<' in /path/to/public_html/forums/showthread.php(102) : eval()'d code on line 1
Can someone please tell me what I am doing wrong?
I'm trying to get asrep working with vbulletin. Basically, under the first post in a thread I display a Google Adsense Ad.
I want to be able to use the asrep fraud prevention feature. So I have done the following.
Created an external php file called displayad1.php in the root of my forum with the following content:
<?php
require_once "asrep/fraudprev.php" ;
# show only if the visitor have seen less than 10 ad displaying pages
# and clicked 2 times or less in the last 1 hour
if(asrep_ipStatsOK(NULL, 0, 1*60*60)){
?>
<script type="text/javascript"><!--
google_ad_client = "<my pubid>";
google_ad_slot = "5185614664";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<?php }else{ ?>
nothing to display
<?php } ?>
Then I create a new plugin which hooks into showthread_start:
<!-- AdSense Code -->
ob_start();
require(DIR . '/displayad1.php');
$displayad1 = ob_get_contents();
ob_end_clean();
At this point I have not added $displayad1 to my template, but if I visit my forum I get the following error message:
Parse error: syntax error, unexpected '<' in /path/to/public_html/forums/showthread.php(102) : eval()'d code on line 1
Can someone please tell me what I am doing wrong?