ADMINISTRATION DOCUMENTATION updated 8/16/04 UNPACK THE ARCHIVE Unpack the archive file with winzip(windows), stuffit(mac) or tar/gzip(unic/linux). You must edit three files before you upload so keep reading. Don't worry, it's not hard at all. EDIT THE CONFIGURATION FILES Once you have unpacked the archive file open the includes folder, This folder contains your configuration files. The configuration files are: base_config.inc common.inc config.inc config_errors.inc config_registration_email.inc BASE_CONGIF.INC The base_config.inc file must be edited and is one of three files that is required to be edited for the script to function properly. So therefore we will edit this file and get the contest management functioning before we proceed to editing the other file. The base_config.inc file contains these lines: $base_path = '/home/atomic'; $base_url = "http://192.168.1.10/atomic"; $AdminEmail = "linuxeclipse@chartermi.net"; $max_file_size = '60000'; $ShowCompany = 'yes'; // yes...no The base_path is the path to the contest folder on your website. All the required folders/files are contained in one main folder and this is the path to that folder. If you are confused about the path I have included a file to help you,upload the file info.php to the main website folder and go there with a browser. This file will display much information about your website, one of which is your path. The base_url is the same as the path except it's the URL to the contest folder. The AdminEmail is The contact email for the webmaster or contest administrator. The max_file_size is required to limit the upload size for contest prize pictures. The max_file_size is calculated in Bytes and is defaulted at 60,000 which is 58.5K, if you need to you may change this to 120,000 which is 117 bytes. The show_company controls the display, on the contest page, of the company blurb. This can be useful if you happen to be running sponsored contests as each contest can use different company display data. REGISTERED_USERS.TXT #2 The second file we must edit is required for access to the administration functions. The file /data/registered_users.txt contains a default line for the administrator.It's the only line in the file at present and other lines will be added as users register.The line looks like this: 1085731365%%admin%%email%%FIRST%%LAST%%ADDRESS%%CITY%%ST%%ZIP%%male/fe male%%age This line has 12 pieces of data seperated by %%. They are: UNIX TIME STAMP(reg date)* ADMIN/BASIC(authorization)** USER EMAIL ADDRESS FIRST NAME LAST NAME ADDRESS CITY STATE ZIP CODE MALE/FEMALE AGE When this line is added by user registration the default authorization is set to basic and the timestamp is the users registration date. For administrators the timestamp will become their password.The reason we use this here is so that only admin will be shown the administration menu link on the main page automatically upon login to the main page. *You may change the timestamp to whatever you wish for an admin password. ** You may NOT change the administrator user name from "admin" or you wont get into the administration area. ADMIN/AUTHRIZATION.PHP The third file we need to edit contains the admin user name and password. You will need this when you click the administration link on the main page. While we could have not used this it is an added level of security. If you open the file and look around line 10 or so, you will see this: if (($_SERVER['PHP_AUTH_USER'] == 'USER') and ($_SERVER['PHP_AUTH_PW'] == 'PASSWORD')) Edit the USER and PASSWORD to whatever you want. They are case sensative. INSTALLING THE SCRIPT Now that we have edited the three files necessary you can begin the upload to your server. Remember, upload to the folder named in the base_path the you have created. You may upload these folders and files to your base website if you want to run just a contest website. Your directory inside that folder should look like this, the permissions should also be set to match. FOLDERS drwxr-xr-x atomic www 4096 Aug 09 17:01 admin drwxr-xr-x atomic www 4096 Jul 07 16:46 banners drwxrwxrwx atomic www 4096 Jul 06 03:22 contests drwxr-xr-x atomic www 4096 Aug 10 10:23 data drwxr-xr-x atomic www 4096 Aug 10 14:06 docs drwxr-xr-x atomic www 4096 Aug 09 16:05 images drwxr-xr-x atomic www 4096 Aug 10 12:01 includes FILES -rw-r--r-- atomic www 1398 Jul 08 00:21 contest_display.php -rw-r--r-- atomic www 975 Jul 07 20:38 contests.php -rw-r--r-- atomic www 1252 Jul 19 21:42 enter_contest.php -rw-r--r-- atomic www 994 Jul 07 23:01 index.php -rw-r--r-- atomic www 31 Jun 01 16:27 info.php -rw-r--r-- atomic www 2135 Jul 07 22:53 login.php -rw-r--r-- atomic www 1140 Jun 24 11:47 logout.php -rw-r--r-- atomic www 3704 Jun 26 02:04 register.php Once the upload is complete go to http://your-domain.com/contest_folder/ and now the index file for the contest should show. You can use the first pass/check you made in the registered_users.txt file to login. Now that you have logged in as a user you should see at the top of the menu an administration link. Only users with an auth type of admin are shown this link. Click the administration link, use the second set of USER and PASSWORD you edited to enter the main administration area. TROUBLE SHOOTING If you are not able to get this far please review the steps and complete any you missed. If you did not miss any steps please delete all and reopen the archive file and start over. It should only take a few minutes to edit the config files. If you're still unable to get this install working please use the forum for support. Include the error messsage(s) you recieve and a link to the install. CONTEST AUTO-MANAGEMENT There is a file named /includes/admin/auto_sync.php. This file must be run periodicly by some utility such as cron. This file checks the start and stop dates and acts upon them. If a contest has not yet reached its start date it will be moved to the pending folder while a contest that has reached the stop date will be terminated. Contests in the pending folder will be checked and any that are past the start date will be moved to the active folder. None of the data is deleted or changed when contests are moved.This file should be run nightly, 12:05am is a good time. When a contest is terminated and moved to the closed folder its name is changed. The time stamp is prepended to keep track of exactly when the termination occured and to allow for contest names to be reused. That is why in our order of sync we first move any unsynced and not ready contests to pending and do the terminations and then lastly we move pending to active. LOGGING The sync files write to a log file, /logs/sync_log.txt. While both sync actions write to their output to the same file each entry is identified by the file that created it as auto or manual. CONTEST CREATION The admin area allow for the creation of contests. When you name and create a contest a folder is made with the name you gave for it and the contents of /includes/skel is then copied to the newly created contest folder. You may then use the manage panel to edit the contest data. The only contests you may edit are contests that are newly created and not yet synced. Once synced you may still edit but you must manually edit the file and re-upload it. The idea behind this is that once started a contest data should not be edited. MAIN CONTENT The index and contest page middle content is contained in the /includes/content folder ad are respectivly the index.txt and contest.txt files. The middle content on the admin page, should you want to paste some of the docs there for easy reference is located in the /includes/admin folder and is the admin.txt file. The /includes/content/thanks.txt file is the content shown when a user enters a contest. TO DO 1. Newsletter Module 2. Main Content Editor