• Your hard work restoring The Bell Tree has paid off! A commemorative Shiny Ditto Easter Egg has now appeared in the Shop for 99 Bells.
  • Easter season is here! Here's what we have going on at The Bell Tree:
    • The egg decorating contest is back! Join TBT’s Fifth Egg Decorating Contest, now with two distinct categories: decorating and painting. Entries must be submitted by April 9th.
    • Starting this Friday at 7PM EDT, follow clues to search for eggs around the forum in TBT's Thirteenth Annual Easter Egg Hunt. New eggs will appear throughout the weekend and the hunt ends on April 6th!
    • Customize your profile by spending bells on any of our three recurring backdrops.

[zb] Fast-reply ad rotator

Jman

Senior Member
Joined
Dec 16, 2006
Posts
604
Life Coins
478
Eggs
0
Code name: Fast-reply rotational ads
Date created: 8/19/10
Author(s): Meeeee.
Description: Done as a request. Puts a randomized image in the fast-reply box.
Preview: Click here!

<div class='spoiler_toggle'>Code. >:)</div><div class="spoiler" style="display:none;">
Code:
<[b][color=#5a70b3]script[/color][/b] [color=#5a70b3]type[/color]='[color=#090]text/javascript[/color]'>
    affiliates = [], i = 0;

    // add images below. (:

    affiliates[i++] = ["[url]http://outlineforum.com"[/url], "[url]http://209.85.62.24/179/85/0/p257849/outlinead2.png"];[/url]
    affiliates[i++] = ["[url]http://themeszetaboards.com/"[/url], "[url]http://209.85.62.24/179/85/0/p257849/outlinead2.png"];[/url]

    if (location.href.match('/topic/')) {
        if ($('#fast-reply').length) {
            x = Math.floor(Math.random() * (affiliates.length));
            $('#fast-reply dd').append('<[b][color=#5a70b3]br[/color][/b] /><[b][color=#5a70b3]br[/color][/b] /><[b][color=#5a70b3]span[/color][/b] [color=#5a70b3]id[/color]="[color=#090]affiliate[/color]"><[b][color=#5a70b3]center[/color][/b]><[b][color=#5a70b3]a[/color][/b] [color=#5a70b3]href[/color]="[color=#090]' + affiliates[x][0] + '[/color]"><[b][color=#5a70b3]img[/color][/b] [color=#5a70b3]src[/color]="[color=#090]' + affiliates[x][1] + '[/color]"></[b][color=#5a70b3]a[/color][/b]></[b][color=#5a70b3]center[/color][/b]></[b][color=#5a70b3]span[/color][/b]>');
        }
    }
</[b][color=#5a70b3]script[/color][/b]>
</div>
Board Template -> Below the Board

Made this a couple weeks back... not the most organized code in the world, but it works. You can use this to rotate images, affiliates, or whatever. Thoughts? (:

To add images/links: Keep adding to or edit the affiliates[i++] array like I have done above.
 
Back
Top