Saturday, October 27, 2007

Plcaing Ad Banners through phpAdsNew/Openads in vBulletin

This tutorial instructs you to help display your Custom Ad Banners in vBulletin Discussion Board (one of the most popular bulletin boards Software) using Openads, formerly called phpadsnew (The most popular adserver solution)

There are two things needed to be done to achieve this..

First you need to execute the invocation code for the banner trough vBulletin to initialize the variables for the banners.
This can be done using the Hook system in vBulltin, by creating a Plugin
    Follow the steps mentioned below to do this.
  • In the admin panel goto Plugins & Products -> Plugin Manager

  • Click on the link Add New Plugin(You will find this at the bottom of the page)
    In the resulting page do the followings..
  • Select vBulletin from the Select Box labeled Product

  • Select global_start from the Select Box labeled Hook Location

  • Enter a title for this plugin let's name it phpAdsNew

  • Enter the invocation code of your ad banner in the text area labeled Plugin PHP Code except the echo part(because you dont want to display the Ads here)
It should look something like the following
if (@include(getenv('DOCUMENT_ROOT').'/manager/phpadsnew.inc.php'))
{
if (!isset($phpAds_context))
{
$phpAds_context = array();
}
$phpAds_raw01 = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
$phpAds_raw02 = view_raw ('zone:2', 0, '', '', '0', $phpAds_context);
$phpAds_raw03 = view_raw ('zone:3', 0, '', '', '0', $phpAds_context);
$phpAds_raw04 = view_raw ('zone:4', 0, '', '', '0', $phpAds_context);
//** initialize as many AdBanners as you want here ***
}

Now the second Step:

After deciding where you want to place the Ads, you need to identify the template for the section in which you want it displayed for example if you want to display the Ad in your left Column then you need to select the left column template from the Admin panel

  • Admin CP -> Styles & Templates -> Style Manager
  • select Edit Templates from the drop down box
  • double click on the item left_column
In the resulting page you will see the template code as following:
<br />
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="90%">
<tr>
<td class="tcat"><span class="smallfont"><b>» Block Name</b></span></td>
</tr>
<tr<
<td color="#FFFFFF" width="100%" bgcolor="#FFFFFF">

<!-- Begin custom code -->

$phpAds_raw01[html]
$phpAds_raw02[html]
<!-- all the AdBanners you want to display here -->

<!-- End custom code -->

</td>
</tr>
</table>
<br />


Click on the Save Button and you should be done..

1 comment:

rize wordpress said...

LAMP development relies on a viable web server which can conduct operations in a seamless manner. LAMP Development is pretty versatile for web development and preferred by many of the sites too.