TinyPortal

Development => Block Codes => Topic started by: Gossamer on July 29, 2011, 12:17:31 PM

Title: Rotating Images
Post by: Gossamer on July 29, 2011, 12:17:31 PM
Link to my site: http://www.markedrp.com
SMF version: SMF 2 Gold
TP version: TP 1.104
Default Forum Language: English
Theme name and version: Outline
Browser Name and Version: Firefox 4
Mods installed:
Enhanced Dropdown
Member Color Link
Board Sort Methods
Pretty URLs
Subaccounts Mod
Stop Spammer
Custom Form Mod
Custom BBCode
Member Awards
Aeva ~ Auto-Embed Video & Audio
Related Error messages: Nothing is being displayed.

I recently switched from SimplePortal to tinyportal and have been moving my blocks over.  I have one block with an image/text rotation code in it.  It worked fine on SimplePortal, but when I dropped it into an HTML/Javascript block on Tinyportal nothing actually displays.  I have not edited the code at all.  It's just a direct copy & paste.

Any ideas what might be wrong?

Here is the code:

<center><script>
var img = [],n=0;

//img[n++] = ["image","description","link"];

//ELEMENTS
//Event: The Winter Recital
img[n++] = ["http://i49.tinypic.com/qqo1ts.jpg","<center><b>The Winter Recital</b></center>The burning of Rochester's auditorium was Marked's first successful major event. It was a major turning point for the entire community; Marked, Half-Breeds, and Daemos alike.","http://markedrp.com/forum/index.php?topic=2177.0"];

//Character: Alexander Shayes
img[n++] = ["http://i32.tinypic.com/vew7b4.jpg","<center><b>Alexander Shayes</b></center>Alex has been through a lot since the very beginning. His unique personality makes for interesting plots and relationships. His posts are always a joy to read, and we are looking forward to his further development and exciting adventures.","http://markedrp.com/forum/index.php?topic=32.msg371314#msg371314"];

//Character: Shayla Meridian
img[n++] = ["http://i27.tinypic.com/rmqvbl.jpg","<center><b>Shayla Meridian</b></center>Shayla is a well-rounded, deep character that is true to a suffering and struggling teen. She is also quite a lightning bolt of energy!","http://markedrp.com/forum/index.php?topic=832.msg881155#msg881155"];

//Character: Aleksandr
img[n++] = ["http://i1185.photobucket.com/albums/z343/soulforasong/character-award-lyosha.png","<center><b>Aleksandr</b></center>Lyosha is one of those rare, cunning characters that is always true to himself no matter the situation. The concept of Tychean is genius, and Jax's boy-ish faced Daemos has the potential to be the thread that links most of our characters together, thanks to his chaotic quirks.","http://markedrp.com/forum/index.php?topic=1524.0"];

//Character: Lilith
//img[n++] = ["http://i693.photobucket.com/albums/vv299/Ariah_rp/character-award-lilith.png","<center><b>Lilith</b></center>From the moment she joined the game, Lilith has been a well-written and intriguing character with her dark and elegant persona.  Her threads are always a joy to read and we look forward to everything Lilith will someday spring upon the world.","http://markedrp.com/forum/half-breeds/lilith/"];

//Member: Jax
img[n++] = ["http://i50.tinypic.com/15s7qfl.jpg","<center><b>Jax</b></center>Jax has been with us since nearly the beginning. Between his growing cast of well-written characters, contributions to the wiki, self-motivation, and ingenious plots, we hope that Jax will remain with us for a long time to come.","http://markedrp.com/forum/index.php?action=profile;u=754"];

//Member: Kelly
img[n++] = ["http://i693.photobucket.com/albums/vv299/Ariah_rp/player-award-kelly.png","<center><b>Kelly</b></center>Since her arrival, Kelly has jumped in with both feet. From a large set of interesting, original characters to her extensive additions to the wiki, Kelly has contributed a lot to the Marked community--and she's super-fun, to boot!","http://markedrp.com/forum/profile/Kelly/"];

//Thread: Beyond the Mirror
img[n++] = ["http://i35.tinypic.com/2qi4wlu.jpg","<center><b>Beyond the Mirror</b></center>This thread is simply enthralling; what started out as a peaceful walk in the park had evolved into a terrifying life-or-death situation. A simply thrilling read that leaves you with baited breath to know more.","http://markedrp.com/forum/index.php?topic=3226.0"];


//Rotating Code
var numb = img.length;
var random = Math.floor(Math.random() * numb);

document.write("<a href='"+img[random][2]+"'><img src='"+img[random][0]+"' alt='' /></a><br />"+img[random][1]);
</script></center>
Title: Re: Rotating Images
Post by: ZarPrime on July 29, 2011, 03:53:09 PM
Gossamer,

We recently added a new editor for this version of TP and that particular block type may not be working quite right yet.

For now, to fix the problem on your site with the block, go the block edit screen for that block, switch the block type to a php type block and save.  After that, delete all the code you see in the textarea and paste the code back in.  Then save.  Finally, switch the block type back to the HTML and Javascript type and save again.  The content of the block should now show up.

It works to do that on a test site here --> http://www.buildandtell.com/demosite/index.php

Block is in the right panel there and I will remove it once you take  a look.  LMK if that fixes it.  We should have this fixed soon in the next version of TP.

ZarPrime
Title: Re: Rotating Images
Post by: Gossamer on July 30, 2011, 01:17:41 AM
Thanks, that fixed it!
Title: Re: Rotating Images
Post by: andyac on August 14, 2011, 11:44:04 PM
hey how did u get the chat room in that block? its very cool.
Title: Re: Rotating Images
Post by: WillyP on August 15, 2011, 05:57:23 PM
Looks like a custom shoutbox. Andyac, if you have further questions about the shoutbox please post a new topic.