Quote:
Originally Posted by Marvin Hlavac
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?