View Full Version : problems with integrating phpAdsNew into vb3
Fking
09-02-2004, 01:12 PM
i'm trying to add this code into the header template of vb3.x
<?php
if (@include(getenv('DOCUMENT_ROOT').'/adverts/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('zone:1', 0, '_blank', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>
but i got this error,
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/httpd/hosting/mydomain.com/includes/adminfunctions_template.php(3037) : eval()'d code on line 36
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
i tried also adding it without the <?php ?> tags
but still got error
this the code is generated by phpadsnew ad management script
The header template will not take php code. Use the phpinclude_start template for the php code, then insert $phpAds_raw['html'] where you want it to apper in the header template.
rockergrrl
09-17-2004, 02:42 PM
Sorry to bring up a two week old thread...
But I'm trying to put integrate phpadsnew in a forum of a client of mine.
And I got errors when I tried to do ^^
I put this in the phpinclude_start template:
<?php
if (@include(getenv('DOCUMENT_ROOT').'/myads/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 4, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>
and $phpAds_raw['html'] where I want it in the header...
But I still get this when I hit submit:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/woforums/public_html/includes/adminfunctions_template.php(3055) : eval()'d code on line 9
Any suggestions?
Thanks
rockergrrl
09-19-2004, 10:19 PM
Anyone?
thx
Zachery
09-19-2004, 10:53 PM
none of that <?php ?> stuff, the phpinclude template is already going to be parsed as php
just try
if (@include(getenv('DOCUMENT_ROOT').'/myads/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 4, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
Katman
09-20-2004, 01:59 AM
I've been using phpads for the past couple of years and I've always just used the javascript include in the header template of my forums and it's always worked great.
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.yourwebsite.com/phpads/adjs.php?n=" + phpAds_random);
document.write ("&target=_blank");
document.write ("&exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&referer=" + escape(document.referer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.yourwebsite.com/phpads/adclick.php?n=a1aa6fdf' target='_blank'><img src='http://www.yourwebsite.com/phpads/adview.php?n=a1aa6fdf' border='0' alt=''></a></noscript>
mholtum
09-20-2004, 02:08 AM
I've been using phpads for the past couple of years and I've always just used the javascript include in the header template of my forums and it's always worked great.
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("http://www.yourwebsite.com/phpads/adjs.php?n=" + phpAds_random);
document.write ("&target=_blank");
document.write ("&exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&referer=" + escape(document.referer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.yourwebsite.com/phpads/adclick.php?n=a1aa6fdf' target='_blank'><img src='http://www.yourwebsite.com/phpads/adview.php?n=a1aa6fdf' border='0' alt=''></a></noscript>
You beat me too it. I have always added java as well works like a charm
hinch
09-20-2004, 01:24 PM
yup above method works fine got it runnin on furious-angels.com
venomx
09-25-2004, 04:35 AM
I am using the HTML code but for some reason the first time I goto a page it doesnt show an ad. It shows if I hit refresh or the back button. Any ideas?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.