Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-02-2004, 01:12 PM
Fking Fking is offline
 
Join Date: Mar 2003
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 09-02-2004, 01:17 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 09-17-2004, 02:42 PM
rockergrrl's Avatar
rockergrrl rockergrrl is offline
 
Join Date: Oct 2001
Location: Michigan
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 09-19-2004, 10:19 PM
rockergrrl's Avatar
rockergrrl rockergrrl is offline
 
Join Date: Oct 2001
Location: Michigan
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?
thx
Reply With Quote
  #5  
Old 09-19-2004, 10:53 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'];
}
Reply With Quote
  #6  
Old 09-20-2004, 01:59 AM
Katman's Avatar
Katman Katman is offline
 
Join Date: Oct 2002
Location: New Glarus, WI
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #7  
Old 09-20-2004, 02:08 AM
mholtum's Avatar
mholtum mholtum is offline
 
Join Date: May 2004
Location: Arizona
Posts: 697
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #8  
Old 09-20-2004, 01:24 PM
hinch's Avatar
hinch hinch is offline
 
Join Date: May 2003
Location: UK
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yup above method works fine got it runnin on furious-angels.com
Reply With Quote
  #9  
Old 09-25-2004, 04:35 AM
venomx's Avatar
venomx venomx is offline
 
Join Date: Apr 2002
Location: Pennsylvania USA
Posts: 441
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:48 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04367 seconds
  • Memory Usage 2,241KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete