The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
problems with integrating phpAdsNew into vb3
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 |
#2
|
|||
|
|||
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.
|
#3
|
||||
|
||||
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: Code:
<?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']; } ?> But I still get this when I hit submit: Quote:
Thanks |
#4
|
||||
|
||||
Anyone?
thx |
#5
|
||||
|
||||
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']; } |
#6
|
||||
|
||||
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> |
#7
|
||||
|
||||
Quote:
|
#8
|
||||
|
||||
yup above method works fine got it runnin on furious-angels.com
|
#9
|
||||
|
||||
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?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|