Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
phpAdsNew Banner Ads integration (advertisements, classified ads, Adsense, etc.) Details »»
phpAdsNew Banner Ads integration (advertisements, classified ads, Adsense, etc.)
Version: 1.0.4, by The M.I.P. The M.I.P. is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.x Rating:
Released: 11-05-2005 Last Update: 10-11-2006 Installs: 571
Uses Plugins
 
No support by the author.

OpenAds / phpAdsNew Integration 1.0.4 for vBulletin 3.[56].x
2006-06-08 by mip

Integrates the OpenAds / phpAdsNew ads system by introducing a new template tag <ad ... />.
You can even deliver your Adsense stuff via phpAdsNew using HTML banners.

The features of phpAdsNew combined with the power of vBulletin's templating system gives you the possibility to place ads for specific user groups, forums, and keywords.

PREREQUISITES:
This plugin requires a working installation (local or remote) of a recent version ofOpenAds / phpAdsNew (free software released under the GPL).
When using OpenAds, replace phpAdsNew in this documentation with OpenAds (phpAdsNew is just the predecessor of OpenAds).

INSTALLATION:
When having a previous version of this product installed, see section UPGRADE instead.

Install product "phpadsnew-1.0.4.xml".
Set phpAdsNew path in Server Settings and Optimization Options to point to either your local phpAdsNew installation or a remote server (using XML-RPC).
It is strongly recommended to set $phpAds_config['compatibility_mode'] = true; in phpAdsNew config file, to prevent problems when phpAdsNew uses a database different from the one used by your vBulletin board.

When using XML-RPC, make sure to have lib-xmlrpc-class.inc.php and lib-xmlrpc.inc.php copied from phpAdsNew misc/samples/xmlrpc/php/ to your forum's includes/ directory (not necessary when using a local phpAdsNew installation).

Read the NOTES section below.

Click INSTALL in this thread to mark product as "installed" and receive notifications when a new version comes out.

UPGRADE:
  • 1.0.3 --> 1.0.4
    1. Import product as usual, with "Allow Overwrite" set to Yes.
  • 1.0.2 --> 1.0.3
    Upgrading is recommended, as this is a bugfix release.
    1. Import product as usual, with "Allow Overwrite" set to Yes.
    2. Recompile any templates where you experienced problems with the <ad .../> tag (notably those where this tag is used repeatedly on a line).
  • 1.0.1 --> 1.0.2
    1. Import product as usual, with "Allow Overwrite" set to Yes.
    2. Set $phpAds_config['compatibility_mode'] = true; in phpAdsNew config file.
  • 1.0 --> 1.0.1
    There's basically no need to upgrade, as the changes don't affect a working installation, but I recommend to do so, to ease possible upgrades in the future.
    1. Import product as usual, with "Allow Overwrite" set to Yes.
    2. Alter the path to phpAdsNew in vBulletin Server Settings and Optimization Options to point to your phpAdsNew installation.
      As opposed to version 1.0 of this product, a local path is not relative to the DOCUMENT_ROOT.

USAGE:
Use the newly introduced <ad ... /> tag in your templates.
The syntax is similar to phpAdsNew's view_raw() function call - the tag understands what, clientid, target, source, and withtext as arguments.

Please make yourself familiar with phpAdsNew prior to using this product. You can't expect this product to work, if you didn't check if your phpAdsNew is delivering your banners cleanly.

Examples:
  • Get banner using keywords:
    <ad what="foo|bar" />
  • Get banner for guest usergroup (in this case, "ug1" must be set as a keyword in phpADsNew, see 2nd screenshot):
    <ad what="ug$bbuserinfo['usergroupid']" />
    (same technique can be applied to deliver forum-specific ads)
  • Similar invocation using template conditionals:
    <if condition="$bbuserinfo['usergroupid']==1"><ad what="" /></if>

NOTES:
  1. Always use the latest stable version of phpAdsNew.
    Old versions had bugs and some even had severe security issues - I'll give no support for installations with an outdated phpAdsNew.
    At the time of writing, latest version is 2.0.8.
  2. Templates which make use of the ad-tag might need to get recompiled after product change.
  3. Recommendations for heavy-duty servers: Move the plugin code to files; try to avoid using xml-rpc or cache xml-rpc requests (e.g. with memcache).
  4. Have an eye on current phpAdsNew security issues
  5. This product comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
  6. Support is provided at will.
    Don't expect help if you haven't read instructions or phpAdsNew manual, if you're using non-standard vBulletin software or if your problem descriptions are useless.

PS:
This plugin is donationware - it helps you to make some money, so please be fair and honor my work with an adequate pecuniary donation.
Donate via Paypal

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #552  
Old 10-13-2008, 12:53 AM
dyna dyna is offline
 
Join Date: Sep 2008
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

guys, it seems like by using the javascript (which is what I am trying to get off of) we are making this thing less efficient. in fact i don't know what the point of having this mod is if we are putting in the javascript. the <ad variable call is gone right? i was interested in using the mod (<ad variable) so as to eliminate the additional http calls from the java script. using openx 2.6.4 and vb 3.7.3. am i missing some point somewhere? thanks.
Reply With Quote
  #553  
Old 10-14-2008, 05:53 PM
shadowdancer36 shadowdancer36 is offline
 
Join Date: Nov 2005
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No updates for this hack huh?
Reply With Quote
  #554  
Old 11-13-2008, 02:18 AM
LWillmann LWillmann is offline
 
Join Date: Jan 2006
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a new way to make this work. Granted it's not as pretty as this, but it does work, and I have been using it on one website for over a year without any problems.

I created a new plugin, I called it 'OpenAds Integration'
It's hooked in the vBulletin product at the init_startup (I've tested it 3.6.8 PL2 and 3.7.4)

Here is the code for it:
PHP Code:
if (@include(getenv('DOCUMENT_ROOT').'/location for your OpenAds install/phpadsnew.inc.php'))
{
  if (!isset(
$phpAds_context))
  {
    
$phpAds_context = array();
  }
  
$phpAds_head41 view_raw ('zone:2'0'''''0'$phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_head41['bannerid']);

  
$phpAds_side01 view_raw ('zone:1'0'''''0'$phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side01['bannerid']);
  
$phpAds_side02 view_raw ('zone:1'0'''''0'$phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side02['bannerid']);
  
$phpAds_side03 view_raw ('zone:1'0'''''0'$phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side03['bannerid']);
.
.
.
.
 
  
//** initialize as many AdBanners as you want here ***

Then in my templates, where ever I want a random banner to appear, I enter this code:
PHP Code:
$phpAds_side01[html
And I get the banner and associated code on the page.

There are a few drawbacks to this option... If you have a side column on your site and you display 50 ads, you have to build an array in this plugin for 50 ads, and then you have to enter the 50 entries into your template.

But this could be just a launching point for some other coder to pick up and run with it. I've tried to build a 'bits' system before and failed. I would imagine that you could extend what I've done and make it better pretty easily.

I know it's not what exactly what people have been hoping for, but hopefully it's a step in the right direction.
Reply With Quote
  #555  
Old 11-17-2008, 02:01 PM
Marvin Hlavac Marvin Hlavac is offline
 
Join Date: Sep 2007
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LWillmann View Post
PHP Code:
if (@include(getenv('DOCUMENT_ROOT').'/location for your OpenAds install/phpadsnew.inc.php'))
{
  if (!isset(
$phpAds_context))
  {
    
$phpAds_context = array();
  }
  
$phpAds_head41 view_raw ('zone:2'0'''''0'$phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_head41['bannerid']);

  
$phpAds_side01 view_raw ('zone:1'0'''''0'$phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side01['bannerid']);
  
$phpAds_side02 view_raw ('zone:1'0'''''0'$phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side02['bannerid']);
  
$phpAds_side03 view_raw ('zone:1'0'''''0'$phpAds_context);
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side03['bannerid']);
.
.
.
.
 
  
//** initialize as many AdBanners as you want here ***

Would you be so kind and tell me step-by-step where exactly to place the above code, and how to do it? I'd appreciate it very much.

I have spent three days attempting to show ads on my vB forum using OpenX. I have no luck at all, but I admit I don't have much technical knowledge in this area.
Reply With Quote
  #556  
Old 11-17-2008, 03:22 PM
LWillmann LWillmann is offline
 
Join Date: Jan 2006
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marvin Hlavac View Post
Would you be so kind and tell me step-by-step where exactly to place the above code, and how to do it? I'd appreciate it very much.

I have spent three days attempting to show ads on my vB forum using OpenX. I have no luck at all, but I admit I don't have much technical knowledge in this area.
In your ACP, you have to go to the Plugin Manager, and Add a New Plugin.

For that new product, you choose the Vbulletin Product

For the Hook Location, you choose "init_startup" (3.7.4 is alphabetized so it should be easy to find)

Give the new plugin a name "OpenAds Integration" for example.

Execution Order 5 is ok by default (I've never changed the order number).

Copy the code from my large php code box into the Plugin PHP Code box.

A few notes about the plugin part:

PHP Code:
  $phpAds_side01 view_raw ('zone:1'0'''''0'$phpAds_context); 
$phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_side01['bannerid']); 
These lines go in pairs. You have to have the two to work together.

If you want to run just two ads, then you can run have just phpAds_side01, and phpAds_side02. But you have to make the change in BOTH lines.

If you want to add more banners, just copy and pase more pairs, and increase the numbers. You don't want duplicate numbers, or you might run into issues.

NOTE the zone:1 part. You will have different zones in your OpenAds/OpenX install. This Zone number will correspond to the Zone you want to pull the ads from.

So, if your side ads are in zone 1, and your header ads are in zone 2, then you need to note that in these lines.

In my sample lines, my header zone is 3, my paying sponsors are in zone 2 and my site banner exchange is zone 1.

Once you make the code changes you need to, click Save to save the new plugin.

Then go to the template editor.

Edit the appropriate template, and place the code I showed in the smaller box:

PHP Code:
$phpAds_side01[html
do display the proper ad number.

In my case, on my right column of ads, I have a table with say 10 boxes, so I start at the top with that 01, and then the next row is 02, then 03, 04 etc on to 10. Even if I don't have 10 advertisers it's ok. The boxes stay hidden for me, unless I use a border on the table, until I ad an advertiser. When I ad the next advertiser in that zone, the ad automatically pops up and I didn't have to make a change to the templates or coding at all.

If I want more, just ad more to my array (the plugin pairs of lines for that zone) and then I can ad more to that table, and it will work.

Does this make it any easier?
Reply With Quote
  #557  
Old 11-18-2008, 09:06 AM
Marvin Hlavac Marvin Hlavac is offline
 
Join Date: Sep 2007
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, it is working for me now! I thank you very much, LWillmann. After 4 days of frustration, your solution finally made it work for me. I suggest you copy & paste your above step-by-step guide to a new thread.

Again, thank you very kindly for taking the time to share this with everyone!
Reply With Quote
  #558  
Old 11-18-2008, 11:10 AM
LWillmann LWillmann is offline
 
Join Date: Jan 2006
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I will.

I will do a better write up and will post a new mod thread with this in it.
Reply With Quote
  #559  
Old 11-18-2008, 04:09 PM
Marvin Hlavac Marvin Hlavac is offline
 
Join Date: Sep 2007
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That would be excellent!

Now that I am able to display a banner exactly where I need it, my next step is going to be to make the link to work. For some reason, when I click the banner, I'm directed to a non-existent URL.

Here's an example:

http://www.example.com/openx/www/delivery/ck.php?oaparams=2__bannerid=3__zoneid=0__log=no__c b=fc0c60228e__oadest=http://www.example.com/

Is this how the URL is supposed to look (real domain substituted by example.com)?
Reply With Quote
  #560  
Old 11-18-2008, 04:51 PM
LWillmann LWillmann is offline
 
Join Date: Jan 2006
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Those settings are done in OpenAds/OpenX, in the Advertiser Settings, Campaign/Banner Settings You'll have to go there to verify that everything is configured correctly.
Reply With Quote
  #561  
Old 11-25-2008, 02:15 PM
meadwench's Avatar
meadwench meadwench is offline
 
Join Date: Sep 2007
Location: North Carolina
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can also put ads in threads and between categories:

To put in threads:
http://www.vbulletin.com/forum/showthread.php?t=157022

To put between categories:
http://www.vbulletin.com/forum/showthread.php?t=225587

I've done this, and the space to show the ad is showing up, but the ad is not. My header and footer ads show up great, but the ads inside the forum itself don't.

I've tried putting in the link for my header ads, since I know they work, but it doesn't work inside the threads and categories.

Anyone got any ideas?

My site: http://www.gotmead.com/forum/index.php

Vicky Rowe
Gotmead.com
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 08:41 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.06701 seconds
  • Memory Usage 2,353KB
  • Queries Executed 25 (?)
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
  • (5)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete