AdRotator Random Ads Plugin
First you should upload the plugin to your wp-content/plugins directory and Activate the plugin from Plugin Manager.
Then you should create one or more files (depending on the number of Ad groups you envision) in wp-content folder with names ending with .txt. For example: banner.txt or skyscrapper.txt etc. Each files contains a specific type of Ads, normally with the same size. If you name the file indicating the type of Ad it displays, then it will be easier for you to remember later.
You can either create them on your desktop and upload them using ftp or create them directly on the server or use the Admin interface, your choice.
Each of these files contains one or more lines. Each line contains the Ad code for any particular advertisement.
What if your ad code is multi-line?
Normally Ad codes are provided in single line. However in certain cases like Google AdSense, for example, multi-line Ad codes are provided. In that case either convert the Ad code to single line manually or just take the most relevant portion of the code at the end and insert it in the file. The remaining code (which normally will be used to setup some parameters) will remain above the location (in your template file) where you would insert the function to select an ad from this ad group. So when this particular ad is chosen, then all the required code will be available and the ad will be visible. Read the AdSense discussion below for further clarification.
This can be used to display Google AdSense, LinkShare or your custom Advertisements.
For AdSense keep the top portion of the code where settings are provided, as-is in your template. Compress the last three lines (includes a javascript file) of the code, which actually inserts the Ad, in a single line and insert it in your text file.
In case you are wondering it doesn’t violate any terms of service regarding competing ads because the final HTML (at that location) displays Ads from only one source, randomly selected.
Finally you need to specify a location to display your ads. Add the code <?php echo getad(’Ad File Name’); ?> (after providing the actual ad file name without the .txt extension) anywhere in your template.
The AdRotator looks for a text file as specified in the Ad file name and with a .txt extension. So if you have a code like:
<?php echo getad(’bannerad’); ?>
Then AdRotator looks for wp-content/bannerad.txt file. If it finds it, it picks up a line randomly from the file and inserts it in your template/html.
You can alter the weight of an Ad (how often you want it displayed) by repeating the same ad line multiple times.
Note: If it cannot find the specified text file or cannot find any ad in the file then it does not insert anything.
