- Moderated by:
- Support
-
- rank:
-
Freshman
- registered:
- September 2002
- Status:
- offline
- last visit:
- 06.01.04
- Posts:
- 40
I toyed around with the stock random quotes block, but I couldn't really justify typing all those buggars in by hand. So I thought, "Hmm, why not hook into fortune and use all those gems?"
Here's how...
Create a new Core/PHP block, call it what you want and position it wherever you want. The contents of that block should be as follows:
Code
echo "<br><i>\n";
$fortune = shell_exec ("/usr/games/fortune -ae");
echo(nl2br($fortune));
echo "</i>\n";
This should output a randomly selected quote from the popular fortune program. It should work as-is on most RedHat systems, but may need to be modified based on your particular system build.
It's not much, but I liked it.
--
Joshua D. Hensley
Network Engineer, Unisys
USCG Operations Systems Center
http://www.webflux.net -
- rank:
-
Freshman
- registered:
- September 2002
- Status:
- offline
- last visit:
- 06.01.04
- Posts:
- 40
Dubya, you say?
If you have a list of favorite qutoes, edit a plain text file with vi (or your favorite alternative) and add all the Dubya quotes you can handle. Separate quotes with a % sign on a blank line between each quote, and then run
Code
strfile <plain text quote file name> <samename.dat>
to output a file formatted for reading by fortune. Copy that file to /usr/share/games/fortune with the rest of your fortune files, and you should then be able to run "fortune <yourfile>" and get a random quote from it.
--
Joshua D. Hensley
Network Engineer, Unisys
USCG Operations Systems Center
http://www.webflux.net</yourfile>
