vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   How to integrate phpadsnew ? (https://vborg.vbsupport.ru/showthread.php?t=64181)

LoOnEyToOnZ 04-21-2004 04:28 AM

How to integrate phpadsnew ?
 
<a href="http://www.phpadsnew.com" target="_blank">www.phpadsnew.com</a>

Anyone know how to integrate this ads script into VB for me to sell banners ?

Thanks !

vbmechanic 04-21-2004 11:26 AM

1) Install phpAdsNew
2) Setup ad campaigns and publisher
3) Get remove javascript invocation code from phpAdsNew
4) Put this invocation code wherever you want the banner to appear

No integration needed...

Logician 04-21-2004 11:29 AM

If your forum is busy, I'd suggest you forget about phpadsnew. With experience I can say that it is killing the server in busy forums with untolerable CPU processes. (Sorry I don't have any alternative suggestion either!)

vbmechanic 04-21-2004 11:33 AM

Quote:

Originally Posted by Logician
If your forum is busy, I'd suggest you forget about phpadsnew. With experience I can say that it is killing the server in busy forums with untolerable CPU processes. (Sorry I don't have any alternative suggestion either!)

I disagree with that... I've used phpAdsNew on sites serving 1 mill+ banners a day. I would not suggest the javascript invocation but rather loading the PHP in that case.

LoOnEyToOnZ 04-21-2004 12:28 PM

Thanks guys for the information

vbmechanic - how do i change it to load the PHP ? Like you mentioned....

vbmechanic 04-21-2004 02:01 PM

Quote:

Originally Posted by LoOnEyToOnZ
Thanks guys for the information

vbmechanic - how do i change it to load the PHP ? Like you mentioned....

Use "Local Mode" invocation instead. Get the code like:

PHP Code:

<?php
    
if (@include(getenv('DOCUMENT_ROOT').'/adserver/phpadsnew.inc.php')) {
        if (!isset(
$phpAds_context)) $phpAds_context = array();
        
$phpAds_raw view_raw (''0'''''0'$phpAds_context);
        echo 
$phpAds_raw['html'];
    }
?>

See up there, it has an include? That includes the ad server software. You can take this PHP code and put it wherever you like-- at the end of global.php or in the php_include part of your header would work as well. Instead of "echoing" the raw variable like:

echo $phpAds_raw['html'];

instead set it to a variable like:

$bannerad = $phpAds_raw['html'];

Then wherever you want the banner ad to appear, you put $bannerad in your template. You can also load multiple ads this way, by calling this set of lines multiple times:

$phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
$banneradtop = $phpAds_raw['html'];

$phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
$banneradmiddle = $phpAds_raw['html'];

$phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
$banneradbottom = $phpAds_raw['html'];

Which would set 3 separate banner ad variables.


As you might guess, the javascript invocation is easier.. hehe

juanchi 04-23-2004 01:24 AM

I tried not to use the javascript method as you mention but when I put the code in index_header and header template, It didn't worked and I switch to the javascript method an it worked, by the way I'm running vbadvanced at my site, local mode worked when I put the variable $bannerad in the index template but I didn't know how to put the banner besides the vb logo so I switch to the header and index_header template but the banner didn't show, but as soon as I started using the javascript it worked.

What I'm doing wrong? I'm a lit bit worried about the javascript, will this bring me problems in the near future?


All times are GMT. The time now is 09:29 PM.

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.01236 seconds
  • Memory Usage 1,729KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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