vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Using PHPadsnew 2 with Vbulletin 3. (https://vborg.vbsupport.ru/showthread.php?t=75475)

cmiller1014 03-23-2005 12:54 PM

Hey pguy..... if that tossed no error before, you must be pasting the php code within the commented out area that already exists within the phpstart template.

Let me know. If you could set me up an admin that only has template access I can have this working for you in no time

ssanders 03-23-2005 07:22 PM

Michael, where exactly do I get my own invocation code? I can't seem to find a button inside the script.

As for the zones, i dont have any.

Michael Morris 03-24-2005 09:39 AM

To get phpadsnew to generate invocation code you need to go to publisher's & zones - it's in there somewhere.

@pguy> Post the entire contents of your phpinclude_start template into this thread in php bbcode tags, and I'll take a look.

ssanders 03-24-2005 08:06 PM

Ah i figured it out now. But it doesn't quite work on my froums... it shows up, but it gives me a "?>" at the end of the ad, and the banner is not clickable, but the text below it is :-\

Anyway I can talk to you on AIM?

tgmorris 03-26-2005 03:26 AM

I've done this and it makes life easier rotating google ads with regular ads. The problem arises that it's possible to display a google ad on a non-allowed page. Any idea how to best handle this? It's certainly possible to assign the google ads to a separate zone. Dealing with login and register is pretty easy as they are labeled as such by 'THIS_SCRIPT'. However I believe the error pages are labeled as whatever script was running when the error condition was encountered.

tgmorris 03-27-2005 06:32 PM

I did some experimenting and here's what I'm now using in my phpinclude_start template. I'm running phpAdsNew as my banner ad server and have my google ads served from there as well. I originally had things set up so no ads were placed on the google excluded pages but decided to place ads on all pages - just exclude google ads from the specific pages.

PHP Code:

do
{
    
// phpAdsNew stuff
    
if (@include(getenv('DOCUMENT_ROOT').'/phpAdsNew/phpadsnew.inc.php')) {
        if (!isset(
$phpAds_context)) $phpAds_context = array();
        
$phpAds_raw view_raw (''0'''''0'$phpAds_context);
    }
} while (
strpos($phpAds_raw['html'], 'google_') AND
         (
           (
THIS_SCRIPT == 'login')          OR
           (
THIS_SCRIPT == 'register')       OR
           (
THIS_SCRIPT == 'usercp')         OR
           (
THIS_SCRIPT == 'private')        OR
           (
THIS_SCRIPT == 'subscription')   OR
           (
THIS_SCRIPT == 'profile')        OR
           (
THIS_SCRIPT == 'faq')            OR
           (
THIS_SCRIPT == 'sendmessage')    OR
          ((
THIS_SCRIPT == 'calendar')       AND $_REQUEST['do'] == 'add')    OR
          ((
THIS_SCRIPT == 'search')         AND $_REQUEST['searchid'] == '') OR
          ((
THIS_SCRIPT == 'gallery_search') AND $_REQUEST['searchid'] == '') OR
           (
THIS_SCRIPT == 'gallery_upload') OR
           (
THIS_SCRIPT == 'THIS_SCRIPT')
         )
        ); 

It's a bit brute force but eliminates the need for zones and such related to google in phpAdsNew.

The last line in the while looks a bit strange but the current version of vBa gallery comes through with things defined that way for upload at the moment, so this serves as a catchall of sorts.

An alternative approach, if you want to only serve ads on "allowed" pages is to do something like
PHP Code:

if (!(
       (
THIS_SCRIPT == 'login')          OR
       (
THIS_SCRIPT == 'register')       OR
       (
THIS_SCRIPT == 'usercp')         OR
       (
THIS_SCRIPT == 'private')        OR
       (
THIS_SCRIPT == 'subscription')   OR
       (
THIS_SCRIPT == 'profile')        OR
       (
THIS_SCRIPT == 'faq')            OR
       (
THIS_SCRIPT == 'sendmessage')    OR
      ((
THIS_SCRIPT == 'calendar')       AND $_REQUEST['do'] == 'add')    OR
      ((
THIS_SCRIPT == 'search')         AND $_REQUEST['searchid'] == '') OR
      ((
THIS_SCRIPT == 'gallery_search') AND $_REQUEST['searchid'] == '') OR
       (
THIS_SCRIPT == 'gallery_upload') OR
       (
THIS_SCRIPT == 'THIS_SCRIPT')
   ) )
{
  
// do ad stuff here


It's pretty easy to convert the latter one to run in the header using template conditionals.

PuntoPower 03-29-2005 11:26 AM

hi

plz forgive me if this has been asked before....

im using phpadsnew and vb3. i have one campaign with 5 ads, the code for this is in the header for vb3 forum. it works fine randomly displayin the ads on all the sub forums. but i have one section in the forum (a sub forum) i want it to display a certain ad. can i modify the phpadsnew code that is inserted with say an "if" statment to only allow a certain add for a section forum in my forum or is there another way around this

i hope the above makes sense

camoman 03-31-2005 09:38 PM

I think I am looking for a similiar thing.. Basically I want to be able to have a unique zone for each forum... so banners at the top of each forum would be relevent to the forum title. ie. in the boat forum I only want boat related ads showing up, in the snowmobile forum I only want snowmobile ads showing up etc..

Can this be done??

boiboi 04-02-2005 02:43 AM

I've been using phpadsnew for 3 years now with the remote invocation code because I have it in a subdomain. Will this little workaround work on a subdomain? I'm actually planning to move phpadsnew on a remote server.

Michael Morris 04-07-2005 09:23 PM

I don't know - I'm sure there's a way, but it might involve some tinkering with the code.


All times are GMT. The time now is 09:03 AM.

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.01293 seconds
  • Memory Usage 1,758KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete