Drupal - Display Random Quotes
The following PHP snipet allows you to add a block to your Drupal site that will display a random quote from a list of user defined quotes.
Create a new block. Set the input format to PHP code. Then paste in the following (changing the quotes as desired, obviously):
$quotes[] = "Quote 1";
$quotes[] = "Quote 2";
$quotes[] = "Quote 3";
$quotes[] = "Quote 4";
srand ((double) microtime() * 1000000);
$randomquote = rand(0,count($quotes)-1);
echo "<div class=\"quote\"><p>\"";
echo $quotes[$randomquote];
echo "\"</p></div>";
?>
That's it. Now add the block to your site as normal.
