random image script question
Jörg Kantel
Manila-Newbies@userland.com
Mon, 16 Dec 2002 22:00:03 +0100
Am Montag den, 16. Dezember 2002, um 20:37, schrieb Scott:
> I removed the second (glossRef), added my image names, and then
> pasted the script into my homepage template.
>
> {if (random(1, 6) == 1)
> {pictureRef("Ellsworth in Idaho")}
> else {if (random(2, 6) == 2)
> {pictureRef("Ellsworth in Nova Scotia")}
> else {if (random(3, 6) == 3)
> {pictureRef("Ellsworth in Beaverton")}
> else {if (random(4, 6) == 4)
> {pictureRef("Ellsworth in Safford")}
> else {if (random(5, 6) == 5)
> {pictureRef("Ellsworth in Douglas")}
> else
> {pictureRef("Ellsworth in Military")}
> }}}}}
>
> Instead of displaying a single, random image, all of the images
> were displayed at the same time. Before and after each image
> was a line of script, like this:
>
> {if (random(1, 6) ==1)
> {pictureRef(
> the first image was displayed here
> )}
>
> else {if (random(2, 6) ==
> {pictureRef(
> the second image was displayed here.
> )}
>
> What am I doing wrong?
>
That looks all OK for me. And I've testet it on my Manila-Site
by removing the second (glossRef),too - it works. But "Ellsworth
in Idaho" and the others have to be valid shortcut in Manila.
That means in your list of shortcuts the name must exist and
linking to something like
<http://static.userland.com/sh4/images/schockwellenreiter/newsearch.gif>.
And pictureRef() as well as random() has to be an allowed macro.
If your Manila-site is hosting by UserLand this macro is valid
by default. In another case ask your system adminstrator.
And there mustn't any blank lines within your macro because
Manila is rendering by default every blank line to a <P>-tag
(and than the macro is broken). There are sometimes problems
with the different linefeeds in the different operating systems.
Try to write the whole macro in on line (it looks awful, but it
should work ;o).
Again HTH
J"org
--
J"org Kantel joerg@kantel.de
Der Schockwellenreiter <http://www.schockwellenreiter.de/>
Der Rollberg <http://rollberg.antville.org/>