This document is intended to help users setup the PHP and MySQL "Community Calendar" that was designed by Rosenet, Inc. You are reading the documentation for version: 1999.04.01 Use of these scripts require PHP3 and MySQL. They can be found at: http://www.php.net/ http://www.mysql.com/ The scripts can be modified to use other PHP-supported SQL servers. Although these scripts were designed to be used with MySQL, they will probably work with little modification on other databases. The following files were added to your system when you unpacked this archive: -addCalendar.phtml - The script that allows an administrator to add data into their calendar -addCalendarResponse.phtml - The script that adds the data from the addCalendar.phtml page into the database -admin.phtml - The page that gives links to the administrative functions -approveRequest.phtml - The page to view and approve or deny a "public" request for data additions to the calendar -approveRequestResponse.phtml - The script that adds the approved data to the calendar and deletes it from the "pending" table -calendar-functions.php3 - The PHP 'include' file that contains the common header, footer, database and contact information for all other pages -CHANGE - The calendar revision history -declineRequest.phtml - The script that removes requested data from the "pending" table without adding it to the calendar -delete.phtml - The script where an administrator selects an event to remove from the calendar -deleteCalendar.phtml - The script that asks the admin if they are sure they want to delete the entry -deleteCalendarResponse.phtml - The script that deletes the entry -eventView.phtml - The page that the end user sees when they click a link on a calendar for more information -expire.phtml - The script that allows the administrator to select a month to expire (remove from the database) -expireResponse.phtml - The script that asks you if you are sure you want expire a month -expireResponseDoIt.phtml - The script that actually expires the chosen month's data -index.phtml - The script where end users select the month and year to view. You may want to consider having your users start at indexResponse.phtml instead -indexResponse.phtml - The script that shows the calendar (complete with database info) that the end user selected. If you do not wish to prompt users for the month, start at indexResponse.phtml. This script is designed to start at the current month of no month was spesified from a previous script. -newData.phtml - The script for "public" users to submit data to be reviewed for addition to the calendar -newDataResponse.phtml - The script that mails the data needing to be approved to the approver -README - This file -simple.phtml - The script where the end user selects a month and year to view on the database-less (simple) calendar -simpleCalendar.phtml - The actual database-less (simple) calendar -update.phtml - The script where the administrator chooses an event to update -updateCalendar.phtml - The form that contains the existing data of the item that needs to be updated or changed -updateCalendarResponse.phtml - The script that updates or changes the data I am sorry, but I don't have a Windows platform to test this software. The installation instructions are for Unix servers (and specifically those that run Apache). Installation on other platforms should be similar. 1) Unpack the file that you downloaded. On Unix platforms, you should unpack these documents in your web server's document root. This will create URLs in the directories: http://your.domain.com/calendar and http://your.domain.com/calendar/admin If you are on a platform where these files are all unpacked into a single directory, the following files should be in the /calendar directory: calendar-functions.php3 CHANGE eventView.phtml index.phtml indexResponse.phtml newData.phtml newDataResponse.phtml README simple.phtml simpleCalendar.phtml The rest of the files should be placed in the /calendar/admin directory and this directory should be password protected (consult your web server documentation). There are two files called eventView.phtml. One belongs in the admin directory. The other in the main source directory. The way to differentiate between the files is in the footer. The page that goes in the main source directory contains a tag: eventFooter(); The page that goes in the admin source directory contains a tag: eventAdminFooter(); 2) If your web server has a php3_include_path (most Apache versions have this in their srm.conf or httpd.conf file - consult your web server documentation), make sure that one of the listed directories is ./ (the current working directory). Otherwise, copy the calendar-functions.php3 file into one of the listed directories. If you have to do this, you will need to change the line that begins "require" in each file in the admin directory to read: require("calendar-functions.php3"); 3) Create the database. Feel free to use whatever database, table and field names you wish, but if you follow my example, you won't have to change as much of the coding on the other scripts. I created the database and table with the following commands: mysqladmin create Calendar mysql connect Calendar CREATE TABLE Contents ( Month CHAR(2) NOT NULL, Day CHAR(2) NOT NULL, Year CHAR(4) NOT NULL, Start_Time VARCHAR(10) NOT NULL, Start_Period CHAR(2) NOT NULL, End_Time VARCHAR(10) NOT NULL, End_Period CHAR(2) NOT NULL, Event VARCHAR(50) NOT NULL, Information MEDIUMTEXT NOT NULL, Submitter VARCHAR(50) NOT NULL, Event_ID BIGINT NOT NULL AUTO_INCREMENT, Contact VARCHAR(50) NOT NULL, Email VARCHAR(50) NOT NULL, Phone VARCHAR(20) NOT NULL, KEY (Event_ID) ); CREATE TABLE NewData ( Month CHAR(2) NOT NULL, Day CHAR(2) NOT NULL, Year CHAR(4) NOT NULL, Start_Time VARCHAR(10) NOT NULL, Start_Period CHAR(2) NOT NULL, End_Time VARCHAR(10) NOT NULL, End_Period CHAR(2) NOT NULL, Event VARCHAR(50) NOT NULL, Information MEDIUMTEXT NOT NULL, Submitter VARCHAR(50) NOT NULL, New_ID INT(3) ZEROFILL NOT NULL AUTO_INCREMENT, Contact VARCHAR(50) NOT NULL, Email VARCHAR(50) NOT NULL, Phone VARCHAR(20) NOT NULL, KEY (New_ID) ); If you have problems with these entries, consult your database documentation (this has been pretty well tested with MySQL). 4) Modify the "calendar-functions.php3" file: There are some variables in this file that you need to alter to fit your server and environment: $DBHost= - Set this to the host name of your database server $DBUser= - Set this to the database username $DBPass= - Set this to the database password $Approval_Email= - Set this to the email address that will be approving (or denying) public addition requests $Web_Host= - Set this the name of your web server (do not include a trailing forward slash ( / )) 5) Enter data into your database by going to: http://your.domain.com/calendar/admin/admin.phtml and clicking "Add an item..." 6) View the results! That's it! SPECIAL NOTES: - BROWSER ISSUES: In an attempt to keep things less browser dependant, I have added checks for browser versions. People using any browser other than Netscape or Internet Explorer versions 4 or later will get the eventView screen in a full (normal) browser window (these other browsers do not do the Java Script too well). Netscape and IE versions 4 or later will display the eventView windows in smaller pop-up screens. I did not build these compatibility checks into the admin functions, so I recommend Internet Explorer or Netscape version 4 or later for anyone administering the calendar. - AESTHETICS: The index.phtml file prompts the end-user to enter the month they wish to view. If you do not want this, start your users at indexResponse.phtml. This script was designed to start at the current month if no month was specified from a previous script. You can also add an Apache .htaccess file with the following line: Redirect /index.phtml http://your.domain.com/calendar/indexResponse.phtml This will cause all traffic to your.domain.com/calendar/ to automatically be forwarded to the current month of the calendar. - COMPATIBILITY: These scripts were designed with .phtml extensions because typing that extension is a force of habit. 8^) If your web server insists on treating files with this extension as PHP2/FI files (or any other file type), make a .htaccess file in the calendar directory with the following line: AddType application/x-httpd-php3 phtml This will cause the web server to treat files ending in .phtml as PHP3. - PHP VERSION INFO: Starting with PHP version version 3.0.6, database entries with apostrophes and quotation marks are handled much differently. If you have version 3.0.5 or earlier, I recommend upgrading. If you cannot upgrade, you will need to modify all of the included scripts which make database entries and add: $variable=addslashes($variable); for each variable before it gets inserted into the database. These scripts were created by Christopher Ostmo of Rosenet, Inc. 1998. Significant contributions were offered by Joe McNulty of Condor Consulting, Inc and Brad Marsh. If you have bugs to report, questions, feature requests, or jobs that we can assist you in completing, e-mail me at: costmo@rosenet.net Feel free to use and modify these scripts, but please keep this notice attached. http://www.rosenet.net/ http://modems.rosenet.net/ The latest version of these scripts and other PHP/MySQL utilities can be found at: http://modems.rosenet.net/mysql/ Copyright 1998-1999, Rosenet Inc.