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)

Michael Morris 03-13-2005 12:05 PM

Quote:

Originally Posted by DistributorTalk
How would the code look if I wanted to call 468x60 banners, and smaller ones at the same time on 2 different areas on a page? I have the large banners showing up but not sure what I need to add to call the small ones.

Each banner requires a different call of the view_raw function

PHP Code:

if (@include(getenv('DOCUMENT_ROOT').'/phpads/phpadsnew.inc.php'))
{
    if (!isset(
$phpAds_context))
    {
        
$phpAds_context = array();
        
$phpAds_raw view_raw ('zone:1'0'''''0'$phpAds_context);

        
$phpAds_context2 = array();
        
$phpAds_raw2 view_raw ('zone:2'0'''''0'$phpAds_context2);
    }


That would do zones 1 & 2. A third zone would require a third call.

cmiller1014 03-13-2005 07:23 PM

Thanks, but then how would I then call each zone onto the page where I want it? For example I decided I am going to have text ads on the main forum page, plus 2 468X60 banners, plus a small banner on the side. If I only use $phpAds_raw[html] in each of these 4 areas, how does it know to call the correct ad for that spot?

Thanks again!

I guess the bigger question is this......

I will always have text ads in the same place (forum home page), I will always have 468x60 ads in the same place (header and footer), and I will always have the small ad in the same place (side column). How would I setup both VB and PHPADSNEW to randomly call an ad of each type and stick it in these spots?

I figured it out! I wasnt as familar with phpadsnew as I thought. I had no zones setup, and was a little mixed up because of the "Advertiser" and "Publisher" terminology. This program is a lot bigger than I expected it to be.

I then figured out how to use multiple calls.... thanks again!

pguy 03-19-2005 05:34 PM

Using the instructions in the original post, I have been unable to get my site off the ground. The local invocation just wont work. However, when I use java invocation, it works just right. However since its a high traffic site, I would prefer local invocation. I have tried every variation and possibility, but no go. Any leads as to what I can do to get the local php invocation working with my VB3

Michael Morris 03-23-2005 02:41 AM

Uhm, well for starters, you are putting the local mode invocation code into the template phpinclude_start yes?

And are you then placing the variable $phpAds_raw[html] in the appropriate spot?

@Distributor Talk: The first call puts the information in $phpAds_raw[html], the second in $phpAds_raw2[html] and so on...

pguy 03-23-2005 04:12 AM

Ahoy! Thanks for replying.

Quote:

Uhm, well for starters, you are putting the local mode invocation code into the template phpinclude_start yes?
Absolutely. When that didn't work I tried including the quote without the <?php> , but no go.

Quote:

And are you then placing the variable $phpAds_raw[html] in the appropriate spot?
Yes. This too I am sure of because I replaced the $phpAds_raw[html] with the java invocation code and the ads are displaying just right. But I seriously want the local method to work to ensure lower loads

cmiller1014 03-23-2005 04:15 AM

I ended up getting it to work flawlessly on my site. Even setup a template condition to not display it on the homepage of vbadvanced (the banners are in my header and footer)

I'll help you if you want. Drop me an email:

chris@distributortalk.com

it looks like you figured it out :) I see the ad on your homepage

This automerge doublepost "feature" is the most annoying, confusing thing to hit vbulletin. :(

pguy 03-23-2005 04:43 AM

AHoy Chris,

Those ads are based on the javascript invocation, which I don't prefer due to the slightly increased loads. I hope I can still email you to figure this out since we seem to use the same templates! :D

ssanders 03-23-2005 05:06 AM

I can't get it to work.

I followed the tutorial verbatim, but they wont show up on my forums. :(

ideas?

Michael Morris 03-23-2005 12:15 PM

Well, first off - the <?php and ?> tags need to be dropped before inserting the material into phpinclude_start. Their presence will trigger a parse error.

Second, make sure the zone # in the function call is correct - this is the part of the code most likely to change.

Don't copy the code from my tutorial. Go to your phpads setup and have it give you the local mode invocation code. Then paste THAT CODE into phpinclude_start and delete the <?php and ?> markups along with the echo statement. Finally place the variable $phpAds_raw[html] where you need it to appear on your page.

pguy 03-23-2005 12:48 PM

Michael, I had dropped the <?php and ?> tags and tried. But even with their presence I did not receive any error. All code I pasted were from within phpadsnew. If the javainvocation code goes in the same are as $phpAds_raw[html] then all goes well.


All times are GMT. The time now is 09:24 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.01396 seconds
  • Memory Usage 1,743KB
  • 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
  • (3)bbcode_quote_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