random quotes block

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   random quotes block
zoom12345
CZ Newbie
zoom12345 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 10, 2004
0.00 posts per day
Posts: 8
Points: 1,188
   
ok, i found a random quotes script on the internet, but its in PHP, and i tried to get it to work as a block, but no luck, can anyone help me out with this? here is the script:
<?
/* start by creating an array of quotes. To add to the array, just type $quote[#]="text you want displayed";

Each time you add to the aray, increase the # by 1*/

$quote[0]="first random quote";
$quote[1]="another random quote";
$quote[2]="another quote goes here";
$quote[3]="and this can go on forever";

/* If you add to the array, change the last number (3) to the number of the last item in the array.

If you remove items from the array, lower the last number to the amount of items in the array...*/
$randnum=mt_rand(0,3);

// this last line displays the quotes randomly.
echo $quote[$randnum];
?>


thx


Back to top Reply with quote
#2   re: random quotes block
Taut
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif california.gif
Occupation: Entrepreneur
Gender: Female
Fav. Sports Team: SF Giants
Status: Offline
Joined: May 27, 2003
0.70 posts per day
Posts: 5530
Points: 481,695
   
have you tried using the block creator in the Web Tools area?



Back to top Reply with quote
#3   re: random quotes block
zoom12345
CZ Newbie
zoom12345 has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Aug 10, 2004
0.00 posts per day
Posts: 8
Points: 1,188
   
ya, i tried that, it didnt work just got errors



Back to top Reply with quote
#4   re: random quotes block
nomadesign
CZ Super Newbie
nomadesign has been a member for over 20 year's 20 Year Member
usa.gif
Status: Offline
Joined: Jun 24, 2004
0.01 posts per day
Posts: 71
Points: 2,907
   
Here is one in Javascript

place this in a script file

// Make sure these quotes don't wrap in your file

var quotes = new Array()
quotes[0] = "Every time history repeats itself the price goes up.<BR><small>- Anonymous</small>"
quotes[1] = "The moment you think you understand a great work of art, it's dead for you.<BR><small>- Robert Wilson</small>"
quotes[2] = "To love one person with a private love is poor and miserable; to love all is glorious.<BR><small>- Thomas Traherne</small>"
quotes[3] = "Every violation of truth is not only a sort of suicide in the liar, but is a stab at the health of human society.<BR><small>- Ralph Waldo Emerson</small>"
quotes[4] = "Man is to be found in reason, God in the passions.<BR><small>- G. C. Lichtenberg</small>"
quotes[5] = "Great innovations should not be forced on slender majorities.<BR><small>- Thomas Jefferson</small>"
quotes[6] = "In this world nothing can be said to be certain, except death and taxes.<BR><small>- Benjamin Franklin</small>"
quotes[7] = "Nine-tenths of wisdom consists in being wise in time.<BR><small>- Theodore Roosevelt</small>"
quotes[8] = "We have no more right to consume happiness without producing it than to consume wealth without producing it.<BR><small>- George Bernard Shaw</small>"
quotes[9] = "So little done, so much to do.<BR><small>- Cecil Rhodes</small>"

// This line displays one of these quotes, chosen at random, onscreen

document.write(quotes[Math.round(Math.random()*9)])




Hope this helps
-damon



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum