WordPress.org

Ready to get started?Download WordPress

Forums

Ad Rotator Trouble - Fatal Error Call to Undefined Function (3 posts)

  1. lmh1111
    Member
    Posted 6 years ago #

    I was successful in installing and activating Word Press. I also installed the following Ad Rotator Plugin from Augsuman Chakraborty:
    <?php
    /*
    Plugin Name: Ad Rotator
    Plugin URI: http://blog.taragana.com/index.php/archive/wordpress-plugin-adrotator-rotate-your-ads-including-adsense-dynamically/
    Description: Rotates Ads randomly from a specified text file
    Version: 1.0
    Author: Angsuman Chakraborty
    Author URI: http://blog.taragana.com/
    Disclaimer: Use at your own risk. No warranty expressed or implied is provided.
    */
    /* Usage: echo getad('Ad File Name'); */
    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)];
    }
    }
    }
    ?>

    HOWEVER, I can't get my text file to run on my web page. I am getting Fatal Error: Please visit http://www.myspiritcandles.com

    Please note that this is a test site and doesn't really make sense. I'm trying to get the Ad Rotator to work so I can apply in different areas.

    Thanks for your help!

  2. whistler2020
    Member
    Posted 6 years ago #

    what does the code look like where your include is located? and where is the ad script in relation to your wp install?

  3. lmh1111
    Member
    Posted 6 years ago #

    Thanks for your reply.

    I placed the include code on my index.php page. It looks like this:

    <table width="700" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="237" height="250">
          <img src="KimRocsidearmcurl.jpg" alt="Kim and Roc Arm Curl" width="200" height="159" class="pictureborder" />
          <table width="250" border="0" cellspacing="0" cellpadding="3">
            <tr>
              <td><img src="frontview.jpg" alt="Roc Fitness" width="200" height="110" class="pictureborder" /></td>
            </tr>
          </table>
          </td>
        <td width="464" height="250"><h1>WELCOME</h1>
          <p>Roc Fitness, located in Clearwater, Florida provides personalized training services. He is dedicated to each of his clients and works with them to develop a customized training program. In addition, he shares his years of experience as a personal trainer by providing workout and fitness tips, healthy recipes and nutritional information, and other fitness resources to all of his clients.</p>
          <h3>
            <a href="mailto:info@rocfitness.com">E-mail</a>      </h3></td>
      </tr>
    </table>
    <table width="700" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="350" height="50"><div align="center">
         <?php echo getad('bannerads');?>
        </div></td>
    	<td width="350" height="50"><div align="center">
         <?php echo getad('bannerads');?>
        </div></td>
      </tr>
    </table>
    <table width="700" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="700" height="24"><div align="center">
          &copy; 2007 Roc Fitness - All Rights Reserved
        </div></td>
      </tr>
    </table>
    </div>
    </body>
    </html>

    The ad script is located in the wp-content folder, under wordpress. I was thinking it might be something with my text file. It looks like this:

    <html>
    <head></head>
    <title></title>
    The Ultimate Real Estate System. Buy Nothing Down, Realize Returns As High As 50% With Tax Lien Certificates And Discount Real Estate With Foreclosure Short Sales.<a href="http://lmh1111.uresystem.hop.clickbank.net/">Click Here!</a>
    </html>
    <html>
    The Creative Real Estate System W Complete Tools For MarketTrends Now! Dont Get Trapped In The One Size Fits All Mentality To Creative Real Estate Investing. We Teach *What Works* For Market Trends Now And Provide Our Students W More Tools Than Anyone. High Satisfaction!<a href="http://lmh1111.cresystems.hop.clickbank.net/">Click Here!</a>
    
    </html>

    Thanks again!!!!

Topic Closed

This topic has been closed to new replies.

About this Topic