I am using this and I am happy with it (WP2.7.1) it’s not a plugin.
Found a description here:
https://www.tutorialized.com/view/tutorial/Creating-a-file-based-AD-rotator-script/24458
Save your ad’s (images, jpg’s) in a folder on your server. Use Wordpad to make a file called adlist.txt
.
Example:
<a target="_blank" href="https://2x2noppennieuws.nl"><img src="https://www.enduro.nl/sponsorpagina/logos/2x2nop.jpg" alt="2x2 NOPPENNIEUWS" border="0" /></a>
<a target="_blank" href="https://www.andremotors.nl"><img border="0" src="https://www.enduro.nl/sponsorpagina/logos/ANDRE_MOTORS.jpg" alt="" /></a>
Every ad gets one line; no line-breaks!!
Save the follwing code as microADRotator.php
in your theme folder:
<?php
// Function to display random ads from a list
function showRandomAD($ADnumber = 1){
// Loading the ad list into an array
$adList = file('/var/www/vhosts/enduro.nl/httpdocs/sponsorpagina/logos/adlist.txt');
// Check the total number of ads
$numberOfADs = sizeof($adList);
// Initialize the random generator
list($usec, $sec) = explode(' ', microtime());
srand((float) $sec + ((float) $usec * 100000));
// Initialize the ads counter
$adCount = 0;
// Loop to display the requeste number of ads
while ($adCount++ < $ADnumber) {
// Generate random ad id
$actAD = rand(0, $numberOfADs-1);
// Display the above generated ad from the array
echo $adList[$actAD].'';
}
}
?>
Change line 5 to your situation, calling the adlist.txt
Ad this to the very top of for example your rightsidebar:
<?php require_once('microADRotator.php');?>
Next put this in for example your rightsidebar, there where you want the ad (s) to appear. Change the number after showRandomAD to show 1 or 2 ad’s etc:
<div id="adrotator">
<?php showRandomAD(6); ?>
</div>