vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   problems with integrating phpAdsNew into vb3 (https://vborg.vbsupport.ru/showthread.php?t=69004)

Fking 09-02-2004 01:12 PM

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

Brad 09-02-2004 01:17 PM

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:
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'];
    }
?>

and $phpAds_raw['html'] where I want it in the header...

But I still get this when I hit submit:
Quote:

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 ("&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&amp;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

Quote:

Originally Posted by Katman
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 ("&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&amp;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?


All times are GMT. The time now is 11:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01139 seconds
  • Memory Usage 1,734KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete