Download SportsPHool


Administration Guide

Table of Contents

bullet Introduction
bullet PHools
bullet Teams
bullet Weeks
bullet Games
bullet Copying PHools
bullet Players


To administer your SportsPHool installation, sign on to SportsPHool using the Administrator username and password you chose during setup. Click on the "Administration" link in the main menu. The first time you run the admin scripts, you will be presented with a message telling you there are no PHools available and the form for creating a PHool. Thereafter, running this script will present you with a list of your available PHools.


A PHool is a set of sports games from which your players can choose a winner. For each correct choice, a player is awarded one point. Deciding what to do with the player(s) with the most points is up to you. Note Betting pools are illegal in many areas; but, this application should be perfectly legal as long as you do not charge a fee to the players. Don't take may word for it, consult local legal authorities if you are in doubt.

Each PHool is composed of teams, weeks and games. These components are fairly self-explanatory, but are covered in a bit more depth below. Each PHool can also be marked as "against the spread", if you want to have your players make choices taking the spread into account. (See the Games section for more information about spreads.)

You may set up as many different PHools as you want, and players who register with your system may choose from among all the PHools you set up. All PHools use a common header, navigation bar and footer. See the Installation Manual for information on configuring the format of your PHools.

To create a PHool, select the Create PHool link from the main menu of the SP Administration script. At this point, all you need is a PHool name and you will need to choose whether this will be an against the spread PHool (the default is No). You may also specify a default time zone offset from GMT (for example, -4 for Eastern Daylight Time). This offset will be used when you enter Week times. Enter a name, a time zone offset, check Yes or No and click the Create PHool button. Your PHool will be created and show in the PHool list. To edit the PHool name or its spread status, click Edit next to the PHool name in the PHool list. (If you are on another page, click Display PHools in the main menu to get back to the PHool list.)

If you decide to delete a PHool, click Delete next to the PHool name in the PHool list. You will be asked to confirm the deletion, so don't panic if you click it accidentally. If the PHool you delete is assigned as any player's default PHool, their default will be set to 0 (zero), causing a prompt for choosing a new default next time they log in. To add or edit the teams, weeks or games for a PHool, click Edit in the PHool list.


Once you have created a PHool, click Edit in the list of PHools and then choose Add/Edit Teams. You will get a list of all currently entered teams (the list will be blank if you have not entered any teams).

You will always receive at least 30 slots for entering teams, or five more slots than teams (whichever is greater). To add a team, enter the team's name (typically a geographic location), the team's nickname, a team abbreviation and a team logo filename (if available) into an empty slot. To delete a team, delete the team name from that slot. To edit a team's information, simply change fields. You may enter the teams in any order you wish, they will always be displayed alphabetically by the team name when listed.

Team abbreviations are used in the "View all player picks" grid, and should be short (2-5 letter) abbreviations of the team name that are easily understood by the players. Team logos are graphics files that should be roughly icon-sized (e.g. 32x32) and are displayed in the view/change picks grid and in the "View all player picks" grid. You do not have to use team logos, and can leave these blank.

If you do use team logos, be sure you are not violating copyright/trademark laws. Enter the filename of the logo. The team logo graphics should be uploaded to the /assets/logos subdirectory, as that is where SportsPHool looks for them. To make your pages display faster, use a standard size for all team logos and enter this information during SportsPHool setup.


Sports PHool is built primarily on the concept of "weeks". These do not have to be actual weeks, that is merely a term that helps distinguish one time period from another. By breaking down the games for your PHool into distinct time periods, players can more easily make choices due to a shorter list of games. Click Edit next to the PHool name in the PHool list, and then click Add/Edit Weeks.

Each week has three components: a name, a start date/time and a stop date/time.

  1. The name for the week is what will be displayed to the players. You may use numbers or words, but using numbers that correspond to the week of play makes it easier for players to understand the system. You'll want to use short names, so that the list of weeks displayed to the players is not too large.

  2. The start date/time is a date/time when this week becomes the default view week--i.e. after this date/time, players will automatically see this week when they first log in to Sports PHool. The start date for the first week of the season should be before you open your Sports PHool to the public. If users sign up and no weeks have started yet, they'll get a PHP error message.

  3. The stop date/time is the time after which no more changes can be made by the players to their picks for this week


The start and stop date/times should be entered in the format YYYY-MM-DD HH:MM:SS--e.g. 2000-12-01 18:00:00 for 6:00pm December 1, 2000. You may enter weeks in any order, they will always be listed in order by their start date/time. The times you enter will be modified by the timezone offset you entered for this PHool. For example, you entered -4 for EDT. The system will assume the date/times you are entering are 4 hours behind GMT, and will add 4 hours to the time before storing them in the database. This should be transparent to you.

Additionally, if you set use_dst in the config file (see the Installation Manual) to TRUE and any date/time you enter falls between the DST start and stop dates, it will be adjusted by the additional amount of time specified in dst_offset.

If you leave a gap between one week's stopdate and the next week's startdate, players will see the finished week by default for a while after the games are ended. This will allow the players to quickly check their score, before moving on to making their picks for the next week.

To add a week, enter a name, stopdate and stardate into an empty slot. To delete a week, delete its name. To edit a week, make changes to its information.


Games are defined by the week. Before you can enter games, you must first enter teams and weeks. Click Edit next to the PHool name in the PHool list, and then click Add/Edit Games.

For each game, select the visiting and home teams from the drop-down lists. You can also enter the spread and scores for each game on this screen; however, you may also use the Update Scores link from the Edit PHool screen. Update Scores is identical to Add/Edit Games, except you cannot add or delete games, only change the spreads and scores.

To add a game, select a visiting and home team. To delete a game, clear the visitor's box. To change a game, select different teams or change the spread or score information. To switch to a different week, select it from the list of weeks at the top of the screen. Do not be surprised that all teams scores are set to -1 (minus one). This is used by the system to distinguish between games that have not yet been completed and games that end with one (or both) teams scoring 0 (zero) points.

Each time you edit any games, the winners of all games are recalculated. If the PHool is defined as against-the-spread, the spread will be added (if positive) or subtracted (if negative) from the visitor's score. The team with the higher score (after spread adjustment if applicable) is declared the winner. If the teams tie (after spread adjustment if applicable), a value is entered that allows either no winner or all winners based on what you selected during SportsPHool setup.

Winners are not displayed on any Admin screens, you can check to see if the winners have been properly calculated by entering your PHool as a player and viewing picks.

Copying PHools

The Copy PHool utility is designed to help synchronize straight up and against the spread PHools based on the same sports season. E.g. NFL 2001 straight up and NFL 2001 against the spread. You may copy the teams, weeks and games from any PHool to any other PHool. When you do so, all existing information in the destination PHool is wiped clean and replaced with the originating PHool's information. The exception is game winners, which are recalculated for the destination PHool after the copy has taken place.

The best way to use the Copy PHool utility is to completely set up a straight-up PHool, then copy it to a newly created against the spread PHool. All team, week and game ID's will be identical, so you can safely copy the tables again. For example, during the season, you can update scores in the straight-up PHool and then copy the games table to the against the spread PHool (or vice-versa). Using Copy PHool saves you from entering identical information twice, but it must be used with care. If you make any changes to teams, weeks or games in the destination PHool after copying, you can't copy again--your changes will be wiped out. This could cause inaccurate information to appear for your players!

To copy a PHool, click the Copy PHool link in the main menu. Choose a PHool to copy from and a PHool to copy to. Highlight the tables you want to copy--you can copy one, two or all three of teams, weeks and games. (You cannot copy the picks table, as there is no way the picks can be identical from one PHool to another.) Click Copy Phool! and you should receive a success message.


Sports PHool allows you to view, delete and email your players. Select Display Players from the main menu to see all your players names, usernames and default profiles. You can email individual players by clicking the Email link next to their name (this is output as a mailto: link). Click Delete next to any player to delete that player and all their associated information. You will be asked to confirm the delete.

You can also email all players at once, or all players who are in a selected PHool. Select the Email Players link in the main menu to open an email form.

Select a PHool or All PHools for emailing players. (Even though All PHools is an option, you must have at least one PHool or you will receive an error message. It is assumed that you have at least one PHool built before allowing players to sign up.) Selecting All PHools selects all players. Selecting a specific PHool selects only players who have at least one profile set up with that PHool. (A player with multiple profiles in a single PHool will only receive one email.)

Enter your name, your reply-to address, a subject line and the text of your message. Click Send email and the email messages will be sent. Sports PHool sends out individual messages to each player in batches of 50. For each successful email sent, Sports PHool will output the player's name. You'll see the complete list of successfully mailed players once execution of the script completes.


SourceForge Logo     PHP Hypertext Preprocessor    MySQL Database