FortuneLiddy 0.1 - Initial Development Release March 20, 2003 INTRODUCTION: Welcome to FortuneLiddy, the MySQL PHP fortune program of the stars! Here you'll find laughter, wonder, and maybe...just maybe...a lesson to be learned. So the idea with FortuneLiddy (besides mega$) is to allow easy management of fortunes: short (well, maybe), pithy (ha!) sayings that you'd like to repeat on the big bad InterWeb for all to see. Unlike a simple wrapper for fortune(1), the emphasis is on adding fortunes of your own that you'd like to add to your website. I'd like to take a moment here to acknowledge a big fat debt to Federico David Sacerdoti, the author of the amazing Ansel photo gallery program. Without being able to peak over his shoulder at his code, it's doubtful I would have been able to get this off the ground. If you notice a big similarity between his code and mine, you're exactly right. Ansel is listed on Freshmeat at: http://freshmeat.net/projects/ansel/?topic_id=92%2C111 Check it out; it's truly great. As a result of my shameless lifting^H^H^H^H^H^H^H^Hadmiration of his code, FortuneLiddy is released under the Original BSD License. See the end of this file for a copy. Anyway...excelsior! WARNING: This *is* a development release. I don't guarantee it'll do anything, let alone do it right. You'll probably want to make a sacrifice to Liddy Himself before doing anything: http://saintaardvarkthecarpeted.com/liddy/sacrifice.html INSTALLING: Preparation's pretty simple: 1. Install Apache. 2. Install MySQL. 3. Install PHP. You're on your own for all that. Next, go to your web directory, or wherever you want to install FortuneLiddy (tm. My wife says I should add a tm here. I think I'm going to skip it) and unpack the tarball: tar -zxvf fortuneliddy-0.1.tgz Then go into the "fortune" directory. Become root and run these two commands: mysqladmin create fortuneliddy mysql fortuneliddy < fortuneliddy.sql Note: you'll probably want to run both mysqladmin and mysql with the "-p" option, which will ask you for a password. Again, you are on your own here. And you'll want to make sure that whatever user you specify for LiddyFortune has appropriate permissions: mysql -u root -p mysql> grant select,update,insert,delete on fortuneliddy.* to theuseryouhavespecified@localhost; Finally, you'll want to grant access to edit/index.php (or whatever you write to replace it) to a select few. You do that by creating an .htaccess file in the edit directory that looks like this: AuthType Basic AuthName "And who the hell are you?" AuthUserFile /path/to/htpasswd Require user liddy And of course, you'll need an htpasswd file: $ htpasswd -c /path/to/htpasswd liddy Password: ****** Re-type new password: ****** Adding password for user liddy Keep /path/to/htpasswd out of your web directory (ie, don't put it in public_html!). I've probably left out some steps here. Email me and let me know. USING: FortuneLiddy provides the PHP object "fortune" (in fortune.php, natch) that has a few methods, but doesn't do too much in itself. Actual functionality is in the sample pages that I've enclosed: index.php and edit.php. They work (caveats about development release aside), but you can write your own pretty easily. The files are: README: This helpful guide. dbconnect.php: Database connection stuff. You'll want to edit this. edit/index.php: A sample page with editing functions. footer.php: The footer for each page. Edit to taste. fortune.php: The family jewels, as it were. Contains the code for the fortune object. fortune.sql: Initial SQL setup file. After you're done, you should probably get rid of it, or at least hide it. header.php: The opposite of footer.php. Edit to taste. index.php: A sample page that displays a random fortune. COMPLAINTS, COMPLIMENTS, QUESTIONS: I'd love to hear if this was at all useful for you, or if you've got any suggestions, questions, bugfixes or what have you. Email me: aardvark@saintaardvarkthecarpeted.com And the homepage: http://saintaardvarkthecarpeted.com/fortuneliddy I am now blessing your keyboard... COPYING: FortuneLiddy contains code releasedd by the following license: ===== Copyright (c) 2001, 2002 Federico David Sacerdoti All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Federico David Sacerdoti nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ===== FortuneLiddy itself is released under the following license: ===== Copyright (c) 2003, Hugh Brown All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Hugh Brown nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =====