Thank you for downloading QuoteBook. QuoteBook aims to help you add funny and/or inspirational quotations to your website.
To get started, use "quotesdump.sql" to initialize the MySQL tables. Now edit the top four variables in quotes.inc: $dbhost should be set to your database host ('localhost' if PHP and MySQL are on the same computer), $dbusername and $dbuserpass are your login information, and $default_dbname can remain as 'quotes'. After these steps, the scripts should work fine!
How do I use the "Thought of the Day" feature?
Any script on your website can implement the "Thought of the Day" by including "quotes.inc" and calling "displayRandomQuote()".
How do determine who is a "favorite author"?
In quotes.php, about two thirds of the way down, is a query that determines the number of quotations accredited to an author in order for them to be considered a favorite.
//This query selects all authors having 3 or more quotes in the database. You may find you want to increase this number. $strSqlQuery = "SELECT Quotes.Name AS Author, COUNT(*) AS numQuotes FROM Quotes WHERE Quotes.Name <>'Anonymous' And Quotes.Name<>'Unknown' And Quotes.Name <> 'Fortune Cookie' GROUP BY Quotes.Name HAVING COUNT(*) > 2 ORDER BY Quotes.Name";
By changing the number in the query, you can alter the number of quotes needed to be a favorite author.
Here's a brief overview of what each file does.
This file contains all the database functions you'll need to call from the other quote scripts, as well as other PHP scripts that you'd like to include quotes on. Any PHP file that includes quotes.inc can call "displayRandomQuote()" and have a random quote presented on that page. Other than performing the initializations mentioned earlier, you should have no need to edit quotes.inc.
This file contains the quote searching and displaying functionality. You don't need to edit this file, unless you'd like to spruce it up a bit, either by applying a Cascading Style Sheet (CSS) or by making manual changes.
This file allows you to add quotes to the database. This file links back to quotes.php, but quotes.php does not link to this page. You probably don't want to make the URL of this page public, unless you want other users to be able to add quotes to your database. When you add a quote, be sure not to include the outer quote symbols. There is a limit of 255 characters on both the name and the quote field.
This file contains all the SQL queries you need to create the quotes database and populate it with your 100 free quotes. Either "source" this file from the MySQL command prompt, or use PHPMyAdmin to read the queries from this file.