Support » Plugins and Hacks » Single ad-rotator plugin for multiple blogs

  • I’m using the ad-rotator plugin from http://blog.taragana.com but have a problem getting it to use a single URL source for the ad txt files. Here’s the full original code…

    <?php
    function getad($ad = ”) {
    $ad = trim($ad);
    if(strlen($ad) > 0) {
    $ad = ABSPATH . “wp-content/” . $ad . ‘.txt’;
    if(file_exists($ad)) {
    $ads = file($ad);
    return $ads[rand(0, sizeof($ads)-1)];
    }
    }
    }
    ?>

    I want to be able to pull the same set of txt files from a single place on one of my websites, so I tried changing the line in bold to this…

    $ad = ABSPATH . “http://www.bigarenarecords.com/ads/” . $ad . ‘.txt’;

    …where “http://www.bigarenarecords.com/ads/” is the location of my txt ad files but it won’t work. The plugin works fine if I keep the path as “wp-content/” but this won’t work for me since I am trying to manage a large number of blogs. I want to be able to update my ad txt files in one place and then have all the blogs pull the ads from that one place. Otherwise, everytime I want to make a change to the ads I will have to upload a new set of files to every blog wp-content folder. Since I run a record label with a growing number of artists blogs, all of which I want to be able to pull and insert ads from one set, this could quickly become a headache.

    Any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Single ad-rotator plugin for multiple blogs’ is closed to new replies.