there is a comfortable plugin for Serendipity called "Random Quotes". It allows you to enter a few quotes that appear in the sidebar and change on each refresh of the site.
You can modify this plugin in a way that it also interpretes HTML code. You just need to strip off the "htmlspecialchars()" in line 96 of the .php file and it should work fine.
I've actually used the random quote plugin to include html and images without editing any of the php files. Admittedly this was back when I was using Serendipity 0.82 and then 0.91, but I don't think the plugin has changed much since then so try it without altering any of the code. It might work for you as is.
Hmm the problem with this one is, is that it only displays one quote (or in my case link) at a time. I'm looking to have a list of links that are randomized.
Is there a way to make this so it can display a list and have that list be completely random?
Beyond that, you could do the same thing they do on 'random' amusement park rides, like the Tower of Terror: come up with a bunch of blocks and choose one of them randomly.
Sorry. But look what you'll be contributing back to the community!
I'm imagining an option in the plugin configuration: "Number of Quotes to Display". Then just wrap a for-loop around the bit that does the random choosing.
I'll be happy to contribute it as soon as I figure out how to make an actual plug-in and not have it just be hacked for my own purposes. I think I'll start reading now.
I found that there's a beautiful array_rand function for this in PHP. Download the new serendipity_plugin_randomquote.php from my site at http://www.judebert.com/wasted_youth/me ... quotes.php and tell me if it works. If so, I'll update CVS later tonight, after I pull out the language constants.
(You'll need to use "Save link as", or you'll wind up on my site.)
Last edited by judebert on Thu Nov 09, 2006 6:46 pm, edited 1 time in total.
I'm not that clever. I assume you used "Save link as", so it's probably a problem with the server recognizing .php files as executable. I zipped it up and we can try again: http://www.judebert.com/wasted_youth/me ... quotes.zip
Warning: array_rand() [function.array-rand]: Second argument has to be between 1 and the number of elements in the array in /home/nintendo/public_html/plugins/serendipity_plugin_randomquotes/serendipity_plugin_randomquotes.php on line 116
Warning: Invalid argument supplied for foreach() in /home/nintendo/public_html/plugins/serendipity_plugin_randomquotes/serendipity_plugin_randomquotes.php on line 117