# ASP Football Pool

### Version 3.0

Copyright 1999-2009 by Mike Hall.

## Contents

- License and Disclaimer
- Description
- Pool Formats
  - Weekly Pool
  - Survivor/Margin Pool
  - Playoffs Pools
- Requirements
- How to Set Up Your Pool
  1. Configure Your Pool Settings
  2. Code Your Email Function (Optional)
  3. Upload the Files and Test the Database Connection
  4. Test Your Email Function (Optional)
  5. Invite Some Friends to Play
- Running Your Pool
- Links
- Release Notes

## License and Disclaimer

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

This software includes a copy of TinyMCE, used under the GNU Library General Public License. See the LGPL license for more details.

This software is intended for recreational use only. It is not affiliated with the NFL or any NFL team.

## Description

This web application allows you to host a weekly pick'em football pool for your friends, family, co-workers or whomever you like. In addition to weekly pools you can run a survivor pool, a margin pool or a combination of both. For the postseason, there are two different pools covering the playoffs and a third just for the Super Bowl. It is designed to be easy to set up and run with minimal maintenance. Some notable features:

- The weekly pick'em pool has options to use point spreads and/or confidence points.
- Optional awards for the best overall weekly scoring.
- Survivor pool options include setting the number of incorrect picks for elimination and permitting buybacks.
- Run either or both of two different playoffs pools (pick'em and rank'em formats).
- An optional Super Bowl pool which can be customized.
- Password-protected access for users.
- Easy, online sign up for players.
- Entries may be made for weeks in advance.
- Picks are automatically locked based on the game schedule.
- For the survivor/margin pool, players are automatically prevented from using a team more than once.
- Players can be prevented from seeing other's picks until games are locked.
- Players may edit or delete their entries up until games are locked.
- The Administrator can modify player entries (even after games are locked).
- Results are automatically updated as soon as game results are entered by the Administrator.
- Players can update their profiles to provide contact information for the Administrator.
- Players may choose receive email notifications for different types of updates (game scores, scheduling changes, etc.).
- Entry fees and pool winnings are automatically tracked.
- The Administrator can enter payment information and view account balances.
- Players can view their own account history, balance and winnings.
- Includes weekly and team schedules, division and conference standings and several statistical displays.
- Help pages are automatically tailored to fit the pool options chosen.
- Users can chat and trash-talk on the optional message board.
- Includes optional features for accepting online payments (via PayPal) and displaying live scores.

A designated Administrator manages the pool: setting the point spreads (if used), entering game scores and updating the game schedule as necessary. The Administrator also manages user accounts and can update the home page with news, announcements, etc.

## Pool Formats

Here is a brief description of the available pools and options.

### Weekly Pool

Each week, players enter by guessing the winner in each of the week's games. Whoever scores the highest in that week wins. Players are also asked to guess the total number of points that will be scored in the Monday Night game (or whatever the last schedule game of the week is). In the event of a tie, the player or players who guess closest to that total win.

You can choose to use point spreads, in which case players must pick teams to win against the spread, rather than straight up.

You can also choose to use confidence points, where players must rank each pick from one to however many games there are that week. Players are scored by totaling the points assigned to each correct pick.

#### Overall Award(s)

You can choose to reserve a portion of each week's pot to go towards an overall award given at the end of the regular season. There are one or two awards, the first going to the player with most total correct picks. If you use confidence points, there is a second award for the player who scores the most total points.

You set the amount as a percentage of each weekly pot. The size of the award will depend on the total number of entries for each weekly pool. When using confidence points, you can specify how this total award will be split between the two categories (correct picks and total points). For example, you can split them 50-50 or give 60% to the player with the most points and the remaining 40% to the player with the most correct picks.

Should more than one player tie for one of these awards, it is split evenly among them.

### Survivor/Margin Pool

This pool is separate from the weekly pools and runs the length of the regular season. In either pool (or in the combined pool) players are asked to pick one team each week and cannot use any team more than once.

#### Survivor Pool

Each week, if a player's chosen team wins, the player continues on to the next week. If the player's chosen team loses, the player is eliminated (you can choose whether to count a tie game as a win or a loss). The last player left standing wins.

Should all active players be eliminated in a given week, they are automatically reinstated and continue on to the next week. If more than one player survives the entire season, the number of correct picks is used as a tiebreaker.

If desired, you can configure this pool to allow two or more losses before elimination. It also supports buybacks, where eliminated players can get back into the pool for a fee.

#### Margin Pool

Unlike the survivor pool, players are not eliminated for losing picks. Instead, the goal is pick the team that will win by the most points each week.

When a player's team wins, the number of points the team won by is added to his or her total. When a team loses, the player's total is deducted by the number of points the team lost by. The player with the highest total score at the end of the regular season wins. Should two or more players tie for the highest score, the number of correct picks is used as a tiebreaker.

Optionally, you can choose not to deduct points for a losing pick. Instead, the player will receive zero points for that week.

#### Combined Survivor/Margin Pool

You can also combine the survivor and margin pools. Players pick one team each week and that team is used in both pools. Even if a player is eliminated from the survivor pool, he or she continues making picks for the margin pool.

You can specify how to divide the pot between each pool. For example, you might award 75% to the winner of the survivor pool and give the remaining 25% to the margin pool winner. If you allow players to buyback into the survivor pool, those fees are not included in the split. Instead they are added to the calculated survivor pot.

Note: By default, the survivor, margin or combined pool begins on the first week of the season. You can set it to start on a later week, if desired.

### Playoffs Pools

There are actually three separate playoffs pools. You can run any combination of these you like. Note that there is no tiebreaker in any of these pools, players tied for the highest score will split the pot evenly.

#### Playoffs Pick'em Pool

This pool is similar to a weekly pool except that it covers all the postseason games. If point spreads and/or confidence points were used in the weekly pool, they will be used in this pool as well.

#### Playoffs Rank'em Pool

For this pool, players rank each of the playoff teams using confidence points. These ranking must be submitted before the first playoff game starts. Everytime a team wins a playoff game, players have whatever points they've assigned to that team added to their total score. The player with the highest total score after the final game is played wins.

#### Super Bowl Pool

This one is based on propositions, specific statistics and events concerning the big game. Players answer a series of questions in the form of "which team will:"

- Score the first touchdown,
- Commit the first turnover,
- Score the most points in the 1st quarter,
- Gain the most rushing yards,
- Complete the longest pass play,
- ...and so on.

The player who gets the most correct wins.

Over two dozen different propositions are provided by default but as the Administrator you can add, remove or replace any of them with your own.

The application includes help pages that explains the pool rules in more depth. They automatically tailored to cover the specific pool options you have set. Be sure to read the special Administrator sections on those pages before attempting to run a pool.

## Requirements

This application is designed to run on Internet Information Server (IIS) web servers, using Active Server Pages (ASP) and a Microsoft Access database. To host it, your web server must support ASP and have the appropriate database drivers installed.

You may also need the ability to modify directory permissions on your site in order to allow updates to the database. Check with your hosting provider to ensure your site meets these requirements.

Some ASP programming knowledge is required in order to use the email notification feature. ASP has no built-in functionality for sending email. However, most hosting services provide some facility for sending emails via script. To make use of whatever your host provides, you will need to add the appropriate code as described below.

## How to Set Up Your Pool

Please carefully review all the following steps before attempting to install the Football Pool on your own web site.

### 1. Configure Your Pool Settings

The `includes/config.asp` file contains several constant definitions that you need to customize. The first section relates to your site.

#### Site Settings

    '--------------------------------------------------------------------------
    ' Site settings.
    '--------------------------------------------------------------------------

    'Session timeout (in minutes).
    const SESSION_TIMEOUT = 60

    'Site URL, used for the emails sent to users.
    const POOL_URL = "http://www.example.net/pool"

    'Page title.
    const PAGE_TITLE = "2009 Football Pool"

    'Administrator email address.
    const ADMIN_EMAIL = "admin@example.net"

    'Flag indicating whether the server can send email or not.
    const SERVER_EMAIL_ENABLED = false

    'Sign up invitation code.
    const SIGN_UP_INVITATION_CODE = ""

    'Time zone difference between host server and database schedule (Eastern).
    const TIME_ZONE_DIFF = 0

    'Location of the database.
    const DATABASE_FILE_PATH = "./data/NFL.mdb"

    'For best performance, leave false unless the server does not have the Jet
    'OLE DB provider installed.
    const USE_ACCESS_ODBC_DRIVER = false

    'Key used for encrypting private data.
    const DATA_ENCRYPTION_KEY = "4k0s*b92mqld:pdw7d4sklda8adz@d{a"

    'Username session variable.
    const SESSION_USERNAME_KEY = "FootballPoolUsername"

`SESSION_TIMEOUT`
Determines how long a user can remain idle before being automatically logged out.

`POOL_URL`
Set this to the web address of your pool.

`PAGE_TITLE`
This is used on the top banner and title of all pages. Each individual page also has a subtitle.

`ADMIN_EMAIL`
Set this to the email address you'd like players to use to contact you.

`SERVER_EMAIL_ENABLED`
Indicates whether email send capability is available or not. If your host does not permit you to send email via ASP set this to `false`. Note that email notifications will not be available in this case and there will be no email confirmation for user sign ups.

`SIGN_UP_INVITATION_CODE`
You can use this to restrict user sign ups. If left as an empty string, anyone may use the sign up page to create a user account.

To prevent just anyone from signing up, you can set this to a simple character string (e.g., a four-digit number, a password, etc.) which you would then give out to those you wish to invite to the pool. Users trying to sign up will be required to enter that string on the sign up form. Note that if used, the invitation code is case-sensitive.

`TIME_ZONE_DIFF`
Set this to compensate for the time zone difference between your web server and the Eastern time zone. For example, if your web server is located in the Central time zone, set the value to `-1`. If your web server is located in the Pacific time zone, you should set the value to `-3`

`DATABASE_FILE_PATH`
This is used to set up the database connection. Initially, the database file `(NFL.mdb)`is located in a subdirectory named `data`. If you move or rename that database file, you will need to update this constant accordingly.

You may specify either a full path (e.g., `C:\sites\username\databases\NFL.mdb`) or a relative path (e.g., `..\..\databases\NFL.mdb`)

Note that some hosts provide a specific location on their server for you to place databases. If that is the case, you should move the `NFL.mdb` file there and set this value accordingly for improved security. Be sure to check with your hosting provider to determine the proper location.

`USE_ACCESS_ODBC_DRIVER`
This should generally be set to `false` unless you encounter an error like that described below.

`DATA_ENCRYPTION_KEY`
This character string is used to encrypt and decrypt private user data (email address, contact information, etc.) It is recommended that you change this key so that it is unique to your installation. Any string of 20 to 40 random characters will do.

`SESSION_USERNAME_KEY`
This is the name used for the ASP Session variable that tracks users when they log in. Normally, you can leave it alone. But, if you have multiple instances of the pool installed on your site, you should make this value unique in each. Any name can be used.

#### General Pool Settings

    '--------------------------------------------------------------------------
    ' General pool settings.
    '--------------------------------------------------------------------------

    'Hide other players picks until the games are locked flag.
    const HIDE_OTHERS_PICKS = true

    'Use confidence points flag (weekly and playoffs pick'em pools).
    const USE_CONFIDENCE_POINTS = false

    'Use point spreads flag (weekly and playoffs pick'em pools).
    const USE_POINT_SPREADS = false

    'Text string used when displaying the Super Bowl in the playoffs schedule.
    const SUPER_BOWL_INFO = "XLIV - Dolphin Stadium - Miami Gardens, FL"

`HIDE_OTHERS_PICKS`
If `true,` players cannot see picks made by other players until they have been locked. The Administrator can still see all picks, however. If `false,` players can see other player's picks as soon as they are made.

`USE_CONFIDENCE_POINTS`
This applies to the weekly and playoffs pick'em pools. If `true,` players must assign confidence points to each pick. The point values range from one to the number of games that week (or the total number of playoffs games) and each point value can be used only once. The player's score will be the total of the points assigned to each correct pick. If `false,` a player's score is simply the number of correct picks he or she made.

`USE_POINT_SPREADS`
Again, this applies to the weekly and playoffs pick'em pools. If `true,` the outcome of each game is based on a point spread, set by the Administrator. If `false,` picks are straight-up.

`SUPER_BOWL_INFO`
This text string is used when displaying the Super Bowl on the playoffs schedule (which is available only when at least one playoffs pool has been enabled). It's merely informative but obviously changes from year to year so it's included here for easy modification.

#### Weekly Pool Settings

    '--------------------------------------------------------------------------
    ' Weekly pool settings.
    '--------------------------------------------------------------------------

    'Cost of a weekly pool entry.
    const WEEKLY_ENTRY_FEE = 10

    'Allow tie picks flag.
    const ALLOW_TIE_PICKS = false

    'Enable overall award(s).
    const ENABLE_OVERALL_WEEKLY = false

    'Amount to take from each weekly pool towards the overall pot. This is a
    'percentage of the total weekly pot.
    const OVERALL_WEEKLY_SHARE = .10

    'Amount of pot that goes to the player with the most overall confidence
    'points. (Applies only when confidence points are used, the player with the
    'most overall correct picks gets the remainder.)
    const CONFIDENCE_OVERALL_WEEKLY_SHARE = .50

`WEEKLY_ENTRY_FEE`
The cost for each weekly entry, in dollars.

`ALLOW_TIE_PICKS`
If `true,` any games that end in a tie will only count towards a player's score if the player actually picked a tie for that game. If `false,` players may not pick games to end in a tie. Instead, all players will receive half the normal points awarded for a correct pick on any game that ends in a tie.

`ENABLE_OVERALL_WEEKLY`
Set to `true` to enable overall award(s). There are either one or two overall awards which are given after the final weekly pool is complete. One goes to the player(s) with the most correct picks over the entire regular season. If confidence points are used, a second award goes to the player(s) with the most total confidence points scored over the entire regular season.

`OVERALL_WEEKLY_SHARE`
This value determines what percent of each weekly pool's pot is reserved for the overall award(s). For example, if set to `.05`, 5% of a given weekly pot is reserved for the overall award(s) while the remaining 95% is paid to the winner(s) for that week. It should be a number between zero and one.

`CONFIDENCE_OVERALL_WEEKLY_SHARE`
Applies only if confidence points are used. This value determines how much of the overall award goes to the total points winner(s). For example, if set to `.60`, 60% of the overall pot goes to the total points winner(s) while the remaining 40% goes to the total correct picks winner(s). This should be a number between zero and one.

#### Survivor/Margin Pool Settings

    '--------------------------------------------------------------------------
    ' Side pool settings.
    '
    ' Note: You can choose to play this as a survivor pool, a margin pool or
    ' a combination of both. In a combined pool, users pick a single team each
    ' week and that pick applies to both pools.
    '--------------------------------------------------------------------------

    'Enable survivor pool flag.
    const ENABLE_SURVIVOR_POOL = false

    'Enable margin pool flag.
    const ENABLE_MARGIN_POOL = false

    'Cost of a survivor/margin pool entry.
    const SIDE_ENTRY_FEE = 50

    'Starting week of the side pool.
    const SIDE_START_WEEK = 1

    'Amount of pot that goes to the survivor pool winner(s).
    '(Applies only when a combined survivor/margin pool is used, the winner(s)
    'of the margin pool get the remainder.)
    const SURVIVOR_POT_SHARE = .50

    'Number of losing picks that will eliminate a player.
    const SURVIVOR_STRIKE_OUT = 1

    'Count a tie game as a losing survivor pick flag.
    const SURVIVOR_STRIKE_ON_TIE = true

    'Maximun number of time a player may buy back into the survivor pool.
    '(Set to zero to disable buybacks.)
    const SURVIVOR_BUYBACK_LIMIT = 0

    'Cost of a buyback.
    const SURVIVOR_BUYBACK_FEE = 25

    'Last week players will be permitted to buy back into the suvivor pool.
    const SURVIVOR_MAX_BUYBACK_WEEK = 10

    'Deduct points on a losing margin pick flag.
    'Note that when true, if a player does not make a pick then the largest
    'margin among all the week's games will be deducted.
    const MARGIN_DEDUCT_LOSS = true

`ENABLE_SURVIVOR_POOL`
Set to `true` to enable the survivor pool.

`ENABLE_MARGIN_POOL`
Set to `true` to enable the margin pool.

Note that if both pools are enabled, it is considered a combined survivor/margin pool. Players pay one entry fee for this combined pool and make one pick each week which will be applied toward both pools. You will want to set `SURVIVOR_POT_SHARE` (see below) to determine how to split the pot between the two pools.

`SIDE_ENTRY_FEE`
The entry cost for the side pool, in dollars.

`SIDE_START_WEEK`
The week that the side pool begins. This is useful if you initially disabled the side pool but later on, after the season has begun, decide you'd like to include it.

`SURVIVOR_POT_SHARE`
Applies only if you combine the survivor and margin pools. This value determines how much of the total pot is awarded to the winner(s) of the survivor pool. The remainder will be awarded to the winner(s) of the margin pool. For example, if set to `.50`, the pot will be split evenly between the two pools. This should be a number between zero and one.

`SURVIVOR_STRIKE_OUT`
For the survivor pool, this number determines how many incorrect picks it takes to eliminate a player. Setting it to one means a player is eliminated with a single losing pick, setting it to two means a player is eliminated on their second losing pick, etc.

`SURVIVOR_STRIKE_ON_TIE`
Set to `true` to count a tie game as a loss in the survivor pool. If set to `false`, tie games will be counted as a win.

`SURVIVOR_BUYBACK_LIMIT`
You can allow eliminated players to get back into the survivor pool for a fee using this setting. Set to `1` to allow one buyback per player, `2` to allow up to two buybacks, etc. Setting this to zero effectively turns off the buyback option.

`SURVIVOR_BUYBACK_FEE`
The cost of a buyback. All buyback fees go into to the survivor pool pot. If your are running a combination survivor/margin pool, these fees are applied after the split (defined by `SURVIVOR_POT_SHARE`). In other words, they do not affect the margin pool pot.

`SURVIVOR_MAX_BUYBACK_WEEK`
This determines the last week a player may use the buyback option. Note that regardless of what is set here, buybacks may not be used in the final week of the regular season, or after the pool has been won.

`MARGIN_DEDUCT_LOSS`
If set to `true`, players will lose points in the margin pool when their pick loses. Note that if a player does not submit a pick for a given week, their score will be deducted using whichever game had the greatest scoring difference that week. Setting this to `false` means that players will receive zero points for a losing or missing pick.

#### Playoffs Pools Settings

    '--------------------------------------------------------------------------
    ' Playoffs pick'em pool settings.
    '--------------------------------------------------------------------------

    'Enable playoffs pick'em pool flag.
    const ENABLE_PLAYOFFS_PICK_POOL = false

    'Cost of a playoffs pick'em pool entry.
    const PLAYOFFS_PICK_ENTRY_FEE = 25

    '--------------------------------------------------------------------------
    ' Playoffs rank'em pool settings.
    '--------------------------------------------------------------------------

    'Enable playoffs rank'em pool flag.
    const ENABLE_PLAYOFFS_RANK_POOL = false

    'Cost of a playoffs rank'em pool entry.
    const PLAYOFFS_RANK_ENTRY_FEE = 25

    '--------------------------------------------------------------------------
    ' Super Bowl pool settings.
    '--------------------------------------------------------------------------

    'Enable Super Bowl pool flag.
    const ENABLE_SUPER_BOWL_POOL = false

    'Cost of a Super Bowl pool entry.
    const SUPER_BOWL_ENTRY_FEE = 25

`ENABLE_PLAYOFFS_PICK_POOL`
Set this to `true` to make the playoffs pick'em pool available. Note that the playoffs pick'em pool is played much like a regular weekly pool. If the weekly pool is set to use point spreads and/or confidence points, this playoffs pool will use them too.

`PLAYOFFS_PICK_ENTRY_FEE`
The entry cost for the playoffs pick'em pool, in dollars.

`ENABLE_PLAYOFFS_RANK_POOL`
Set this to `true` to make the playoffs rank'em pool available.

`PLAYOFFS_RANK_ENTRY_FEE`
The entry cost for the playoffs rank'em pool, in dollars.

`ENABLE_SUPER_BOWL_POOL`
Set this to `true` to make the Super Bowl pool available.

`SUPER_BOWL_ENTRY_FEE`
The entry cost for the Super Bowl pool, in dollars.

#### Message Board Settings

    '--------------------------------------------------------------------------
    ' Message board settings.
    '--------------------------------------------------------------------------

    'Enable message board flag.
    const ENABLE_MESSAGE_BOARD = true

    'Define maximum message length allowed.
    const MAX_MESSAGE_LENGTH = 2000

    'Define the number of days to keep posts. Set to zero to keep posts
    'indefinitely.
    const MAX_POST_AGE = 30

    'Define the maximum number of posts to keep (when this limit is exceeded,
    'the oldest posts will be removed first). Set to zero to keep an unlimited
    'number of posts.
    const MAX_POST_COUNT = 250

    'Number of posts displayed per page.
    const POST_PAGE_SIZE = 10

`ENABLE_MESSAGE_BOARD`
Set to `true` to enable the message board. If set to `false`, users will not be able to post or view messages.

By default, messages posted on the message board are removed after a certain number of days, or if the total number of messages exceeds a certain limit. There is also a limit on the size of any one message. All this is intended to keep the database from growing too large and possibly impacting performance. You can adjust these limits to suit your particular installation.

`MAX_MESSAGE_LENGTH`
Defines the maximum number of characters that can be used in a single post. Note that this includes HTML markup characters.

`MAX_POST_AGE`
Defines the maximum number of days that a post will be kept. Posts older than this will be deleted.

`MAX_POST_COUNT`
Defines the maximum number of posts that will be kept in the database. When this limit is reached, posting a new message will cause the oldest post in the database to be removed (regardless of its age).

`POST_PAGE_SIZE`
This simply defines how many posts will be shown per page when viewing the message board. It does not affect the size of messages or how long they are kept.

#### Add-ons

    '--------------------------------------------------------------------------
    ' Add-ons.
    '
    ' Note that these components rely on external web sources and are subject
    ' to changes with those sources. If problems occur, you can disable them
    ' here.
    '--------------------------------------------------------------------------

    'Enable online payments (via PayPal) flag.
    const ENABLE_PAYPAL_ADDON = false

    'Online payment settings.
    const PAYPAL_BUSINESS       = "admin@example.net"
    const PAYPAL_ITEM_NAME      = "2009 Football Pool"
    const PAYPAL_INVOICE_PREFIX = "FP09-"

    'Enable live scoreboard and scores loader flag.
    const ENABLE_SCORES_ADDON = false

`ENABLE_PAYPAL_ADDON`
This add-on allows players to submit payments via PayPal. Note that you must have a PayPal account to use this feature. It's a good idea to get a developer account so you can test your set up before attempting to accept real payments.

PayPal charges a processing fee for handling payments (currently, that fee is 2.9% of the payment plus $0.30). The code is set up to take that fee into account. For example, to receive $50.00 in credit towards the pool, a player will be asked to pay $51.80. The extra $1.80 will appear as a shipping charge on the payment.

To use this feature, you'll need to configure the following as well:

- `PAYPAL_BUSINESS`
  Set this to the email address you use for your PayPal account.

- `PAYPAL_ITEM_NAME`
  This text will appear as the item description on payments.

- `PAYPAL_INVOICE_PREFIX`
  This text will be used as part of the generated invoice number on payments.

`ENABLE_SCORES_ADDON`
This add-on generates a live scoreboard display on the site pages (which users can hide the display if desired). It also adds functionallity to Administrator's scores update page to look up scores online and prefill the form fields.

### 2. Code Your Email Function (Optional)

The `includes/email.asp` file contains a function stub named `SendMail().` This is intended to programmatically send emails to players, such as when a new user signs up or when the Administrator sends email notifications regarding point spreads updates, scheduling changes, etc.

Because each web host is different, you'll need to edit this function to provide working code for your particular installation. Check with your host provider regarding how to send email via ASP. Most provide sample code which you can tailor to your needs. If your host does not provide this functionality, set the `SERVER_EMAIL_ENABLED` option to `false` in your configuration settings.

Your implementation should use the function arguments defined in the code stub. It should return an empty string if the email was successfully sent or an error message if it fails.

Below is an example using CDOSYS (commonly found on Windows servers) showing how to use the function arguments and set the return a value:

    function SendMail(toAddr, subjectText, bodyText)

      dim mailer
      dim cdoMessage, cdoConfig

      'Assume all will go well.
      SendMail = ""

      'Configure the message.
      set cdoMessage = Server.CreateObject("CDO.Message")
      set cdoConfig = Server.CreateObject("CDO.Configuration")
      cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")  = 2
      cdoConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.example.net"
      cdoConfig.Fields.Update
      set cdoMessage.Configuration = cdoConfig

      'Create the email.
      cdoMessage.From     = ADMIN_USERNAME & " <" & ADMIN_EMAIL & ">"
      cdoMessage.To       = toAddr
      cdoMessage.Subject  = subjectText
      cdoMessage.TextBody = bodyText

      'Send it.
      on error resume next
      cdoMessage.Send

      'If an error occurred, return the error description.
      if Err.Number <> 0 then
        SendMail = Err.Description
      end if

      'Clean up.
      set cdoMessage = Nothing
      set cdoConfig  = Nothing

    end function

### 3. Upload the Files and Test the Database Connection

Upload all files to your web site. You should then be able to browse to the site and login as the Admin using the default password `admin.`

If not, the problem is probably with the database connection. Check that you set the database file path correctly in step 1 and that the database file has been uploaded to that location.

If you see an error like the following:

    Error Type:
    Provider (0x80004005)
    Unspecified error

Try setting `USE_ACCESS_ODBC_DRIVER` to `true` in your configuration settings.

If you still encounter problems, check with your host provider. They may have specific requirements for setting up a database connection, such as storing the database in a special location, defining a datasource name, etc. If that is the case, make the necessary configuration changes and/or move the database. In some cases, you may need to modify the `OpenDB()` subroutine in the `includes/common.asp` file to comply with your host requirements.

Once you have the database connection working, login as the Admin and try updating the database, say by adding a new user or changing your password. If you see an error similar to this:

    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Microsoft Access Driver] Operation must
    use an updateable query.

It means you'll need to set up access permissions for the database file. Again, this is host-specific so check with your provider regarding how to set permissions to allow your database to be updated by a web application.

### 4. Test Your Email Function (Optional)

If you've set your pool up to use email, you can test it by first editing the Administrator profile to add a working email address and check the "New announcements" notification option. Then go to the "Edit News" page, check the "Send update notification to users." option and click on `Save`.

If all is well, you should receive an email at the address you specified within a few minutes.

### 5. Invite Some Friends to Play

Once installed and tested, you can start inviting your friends to play.

You can either manually add users (don't forget to give them whatever password you have assigned to them) or direct them to the sign up form (remember to give them the invitation code, if you specified one in the pool configuration).

## Running Your Pool

The pool administrator has several duties that must be performed during the course of the season:

- Maintain user accounts.
  This may include setting up accounts, resetting passwords, updating entries for users when necessary, logging payments and delivering payouts.

- Maintain the game schedules and enter results.
  The regular season schedule is preloaded in the pool database, however, game dates and times are subject to change. Forms are provided for the Administrator to make any necessary updates. If point spreads are used, these must be set in a timely fashion so players have time to make their entries. Finally, game scores must be entered in order for the pool results to be determined.

  The above also applies to the playoffs schedule when running any of the playoffs pools. In this case, the Admin must also set the appropriate teams since these cannot be know until after the regular season has been completed.

- Keep players informed and moderate the message board.
  Be sure to communicate with your players. Let them know of any significant schedule changes, remind them to get picks in on time (especially for early games) and encourage them to join in any optional pools you plan run. Also be sure to answer any questions they may have, either directly or in response to message board posts.

  If you enable the message board, consider setting ground rules for postings and monitor the board to enforce them.

Be sure the check all the help pages that come with the pool. When logged in as the Admin, you'll find additional notes in them regarding administration.

The pool was designed to be a fun, friendly diversion for all participants to enjoy. Keep it fair, be open and responsive to your players and it should be just that.

## Links

ASP Football Pool Home Page
Forums

## Release Notes

- 3.0 - Additional playoffs pools added, survivor buyback support, new statistics pages, code refactoring.
- 2.3 - Code clean-up, improved handling of survivor/margin pool status, updated display for entry form and result pages.
- 2.2 - Updated email notifications to include relevant data.
- 2.1 - Added the option to start the survivor/margin pool after the first week.
- 2.0 - Survivor/margin pool added, more performance enhancements, restructured site pages.
- 1.2 - Moved all configuration settings to the `includes/common.asp` file.
- 1.1 - Modified to store calculated values for weekly results in the database for improved performance.
- 1.0 - Initial release.