AdRotator is a WordPress plugin which displays an advertisement (which is randomly selected from a group of advertisements specified in a text file) at your chosen location. It has been tested and works in all version of WordPress (future and past proofed). It can also be used with other CMS systems or anywhere where PHP is supported. It does one job and does it well. Enough said. If you find this useful, let me know. Links are appreciated too.
Please read the User Manual thoroughly after you download the 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) in wp-content folder with names ending with .txt. For example: banner.txt or skyscrapper.txt etc. Each file contains a specific type of Ads, normally with the same size (though not required to be so). 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 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 that includes a file, which actually inserts the Ad, in a single line and insert it in your text file.
To use multiple AdSense ads you need to concatenate the settings portion of the code in a single line along with the last section which includes the file which displays the ad, all in a single line. While this requires that you remove newlines from AdSense code, it has been verified to be in compliance with AdSense policies.
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 which was selected
Finally you need to specify a location to display your ads. Add the code 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.
This disables the Plugin. You can also delete the adrotator.php file from wp-content/plugins directory and referer.txt (if created) from the wp-content directory for permanent removal.
Your comments and suggestions are welcome.