Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31

Thread: Rotating Banners and other Advertisments

  1. #1
    Thread Starter
    dmyers's Avatar
    Join Date
    Oct 2010
    Location
    United States, Texas
    Posts
    103
    Thanks
    5
    Thanked 83 Times in 11 Posts

    Thumbs up Rotating Banners and other Advertisments

    For those of you who have been looking for a way to rotate your 468x60 or 336x280 advertisments here is a solution for you. You can even use animated GIF files to add some flare to your ads.

    Notice: I did not write this code. I found it a long time ago somewhere and thought it might be useful here.

    This code will rotate banners and their associated links everytime the screen is refreshed or you click another post, category, page or whatever. As long as ClassiPress loads a new page, your banner will change.

    All you have to do is go to the Admin Dashboard --> ClassiPress --> Settings.
    Once you are there, just cut and paste the following code into the "Ad Code:" box under either the "Header Ad (486x60)" or the "Single Ad (336x280)". After you have pasted the code all you have to do is enable the ad and save the changes.

    Code:
    <script language="Javascript">
    <!--
     
    var currentdate = 0;
    var core = 0;
     
    function initArray() {
     
    this.length = initArray.arguments.length;
      for (var i = 0; i < this.length; i++) {
      this[i] = initArray.arguments[i];
      }
    }
     
    link = new initArray(
    "http://www.yourdomain.com/your_link_1",
    "http://www.yourdomain.com/your_link_2",
    "http://www.yourdomain.com/your_link_3",
    "http://www.yourdomain.com/your_link_4",
    "http://www.yourdomain.com/your_link_4"
    );
     
    image = new initArray(
    "http://www.yourdomain.com/your_image_name_1.gif",
    "http://www.yourdomain.com/your_image_name_2.jpg",
    "http://www.yourdomain.com/your_image_name_3.gif",
    "http://www.yourdomain.com/your_image_name_4.jpg",
    "http://www.yourdomain.com/your_image_name_5.jpg"
    );
     
    text = new initArray(
    "Alt Text Goes Here for Banner 1",
    "Alt Text Goes Here for Banner 2",
    "Alt Text Goes Here for Banner 3",
    "Alt Text Goes Here for Banner 4",
    "Alt Text Goes Here for Banner 5"
    );
     
    var currentdate = new Date();
    var core = currentdate.getSeconds() % image.length;
    var ranlink  = link[core];
    var ranimage = image[core];
    var rantext  = text[core];
     
    document.write('<a href="' +ranlink+ '"><img src="'+ranimage+'" border="1" alt="'+rantext+'"></a>');
     
    //-->
    </SCRIPT>

    Configuring the code above for your ads is very simple. Just replace the links, image urls and Alt Text entries for each ad you want to display. If you want more than five ads just add additional links, image urls and alt text entries. Make sure you ad them in equal numbers. If you have five ads, you have to have five links, five image urls and five alt text entries.

    If you do not ant Alt Text, make it look like the sample below.

    Code:
    text = new initArray(
    "",
    "",
    "",
    "",
    ""
    );

    Note that when you are editing the number of ads to be displayed the last entry in each array does not have a "," at the end.

    If you have any questions, please feel free to ask and I will try to help as best I can.



    Thanks,

    David
    Last edited by pepsi; November 10th, 2010 at 04:24 PM.

  2. The Following 6 Users Say Thank You to dmyers For This Useful Post:

    destacamos (April 12th, 2011), eaport (March 23rd, 2012), fiorese (November 10th, 2010), marvhart (March 17th, 2016), maurixius (October 28th, 2010), pinocchio (October 27th, 2010)

  3. #2
    maurixius's Avatar
    Join Date
    Oct 2010
    Posts
    70
    Thanks
    13
    Thanked 2 Times in 2 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #3
    jomarkosabel's Avatar
    Join Date
    Mar 2009
    Location
    Philippines
    Posts
    40,958
    Thanks
    169
    Thanked 3,405 Times in 3,276 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Please help our moderating team work more efficiently by not sending us support questions via PM. You can read more about how AppThemes support works here. However, you can send a PM to follow up and remind me if I missed your support request/thread.

    Thank you and have a nice day.

  5. #4
    katjaaclass's Avatar
    Join Date
    Oct 2010
    Location
    Los Angeles, CA
    Posts
    106
    Thanks
    9
    Thanked 5 Times in 3 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  6. #5
    Thread Starter
    dmyers's Avatar
    Join Date
    Oct 2010
    Location
    United States, Texas
    Posts
    103
    Thanks
    5
    Thanked 83 Times in 11 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #6
    Member fiorese's Avatar
    Join Date
    Sep 2010
    Location
    Brazil
    Posts
    51
    Thanks
    23
    Thanked 3 Times in 3 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. The Following User Says Thank You to fiorese For This Useful Post:

    ehawkins1 (June 22nd, 2012)

  9. #7
    Veteran doctorcilantro's Avatar
    Join Date
    Oct 2010
    Location
    Saudi Arabia
    Posts
    759
    Thanks
    2
    Thanked 26 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  10. #8
    Thread Starter
    dmyers's Avatar
    Join Date
    Oct 2010
    Location
    United States, Texas
    Posts
    103
    Thanks
    5
    Thanked 83 Times in 11 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  11. #9
    Veteran doctorcilantro's Avatar
    Join Date
    Oct 2010
    Location
    Saudi Arabia
    Posts
    759
    Thanks
    2
    Thanked 26 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  12. #10
    Veteran doctorcilantro's Avatar
    Join Date
    Oct 2010
    Location
    Saudi Arabia
    Posts
    759
    Thanks
    2
    Thanked 26 Times in 16 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Page 1 of 4 123 ... LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Banners
    By spymare in forum ClassiPress General Discussion
    Replies: 0
    Last Post: August 22nd, 2010, 05:12 PM
  2. Where to put links and banners?
    By TheSyndicate in forum Help Using ClassiPress
    Replies: 1
    Last Post: May 3rd, 2010, 12:03 PM