Simpsons Quote Module
projectbravo - March 9, 2005 - 19:15
I just found this cool plugin for wordpress and was hoping someone here could turn it into a drupal module... or point me in the right direction to figure it out for myself.
I just found this cool plugin for wordpress and was hoping someone here could turn it into a drupal module... or point me in the right direction to figure it out for myself.
Might try the Quote module
You might try the quote module at http://drupal.org/project/quote.
It allows you to catagorize quotes if you want and add new quote blocks as needed.
The challange would be getting the quotes into Drupal, but it should be possible without too much work.
You mean the 'Quotes' module...
The 'quote' module you link to adds markup and css for quoting text in a reply.
"The 'quotes' module allows you to maintain a list of quotations that you find notable, humorous, famous, infamous, or otherwise worthy of sharing with website visitors. These quotes are selected randomly and displayed in a block on your Drupal site."
Yes, it would make much more
Yes, it would make much more sense to do this with the quotes module. However, having an image as part of the quote might be a good feature. I like the way it looks as though the character is saying the quote.
I can be easily amused sometimes :)
How whimsical
Here's code for a custom block you could add:
(I couldn't resist)
<?php
global $base_url;
/*
Plugin Name: Simpsons Quote
Plugin URI: <a href="http://phunky.co.uk
Description:" title="http://phunky.co.uk
Description:" rel="nofollow">http://phunky.co.uk
Description:</a> Random test for writing plugins for wordpress
Author: Phunky
Version: 0.01
Author URI: http://phunky.co.uk
(Drupalized by Mark Howell mark[@]nullcraft.org)
*/
$simpsons_dir = $base_url."/misc/simpsons";
// A Couple of Random Quotes
$quotes = array("The strong must protect the Sweet.",
"What have I done? I smashed open my little boy's piggy bank, and for what? A few measly cents, not even enough to buy one beer. Wait a minute, lemme count and make sure... not even close.",
"Television! Teacher, mother, secret lover.",
"Homer no function beer well without.",
"When will I learn? The answer to life's problems aren't at the bottom of a bottle, they're on TV!",
"it's how drunk you get.",
"I didn't do it, no one saw me do it, there's no way you can prove anything!",
"Christmas is a time when people of all religions come together to worship Jesus Christ.",
"I've said it before, and I'll say it again...aye carumba!",
"Who's the black private dick that's a sex machine with all the chicks?",
"There's no such thing as a soul. It's just something they made up to scare kids, like the boogeyman or Michael Jackson.",
"I'll use your head as a bucket and paint my house with your brains",
"Every time I learn something new, it pushes some old stuff out of my brain. Remember when I took that home winemaking course, and I forgot how to drive?",
"To alcohol! The cause of- and solution to- all of life's problems",
"Don't let Krusty's death get you down, boy. People die all the time, just like that. Why, you could wake up dead tomorrow! Well, good night.",
"Kids, kids. As far as Daddy's concerned, you're both potential murderers.",
"Oh, people can come up with statistics to prove anything. 14% of people know that.",
"What's Santa's Little Helper doing to that dog? Looks like he's trying to jump over, but he can't quite make it.",
"When the doctor said I didn't have worms any more, that was the happiest day of my life."
);
$characters = array("homer.gif",
"homer.gif",
"homer.gif",
"homer.gif",
"homer.gif",
"homer.gif",
"bart.gif",
"bart.gif",
"bart.gif",
"bart.gif",
"bart.gif",
"moe.gif",
"homer.gif",
"homer.gif",
"homer.gif",
"homer.gif",
"homer.gif",
"bart.gif",
"ralph.gif"
);
$which_one = mt_rand(0, count($quotes) - 1 );
// Print it out
echo "<div id=\"sQuote\">";
echo "<p><img src='$simpsons_dir/$characters[$which_one]' align='left' hspace='5' />“$quotes[$which_one]”</p>";
echo "</div>";
?>
You'll need to place the images from phunky.co.uk in your misc/simpsons dir or update the variable to point elsewhere.
Hey, glad to see you like
Hey, glad to see you like the plugin, its no where near what i want it to be it was just a cludge to see how the WordPress Plugin API worked and such.
Im going to attempt to put sometime into it this weekend to make the code a lot cleaner and also remove the quotes to a text file so it can be simpler to update.
Im also looking into mergin a Flash MP3 Player into it to let you be able to play the actual audio of the quote
Fortune
You may want to look at the old common Unix program fortune. The quotes are stored in simple text files, usually found in /usr/share/games/fortune. In fact, if you're running your site on linux/unix you may just want to call the fortune app from php and display its output. At the very least you may want to borrow its data files and format.
---
DocForge - Because we need documentation too
This is great! You guys
This is great! You guys rock!
www.projectbravo.com - where you go to be a man
modified version
Thanks javanaut. This script was great. I modified your random quote script slightly to have an author name instead of image and to make it a easier to maintain (putting the quote and author entries together). You can find it here.
januario
Quotes somwhere else not on right or left sidebar
On our page I'd like to have quote under navigation randomized, (see www.em3r10.com), I installed quote module, but it only displays in left or right block. How could i display it up there?!?!
Thx for your answers ...
Davorin
www.em3r10.com