Version 1.1 beta release and feature walk-through | Peter's Sports League Standings | Forum
Back to the sports standings script page
See the installation instructions in readme.txt or see the main script page as the steps have not changed from version 1.0.
If you are upgrading from a version 1.0 installation:
- Run the SQL command in upgrade_1.0_to_1.1.sql to upgrade the database tables from version 1.0 to 1.1.
- All files can be overwritten except for settings.php, unless you have customized the display in standings.php or update.php.
- settings.php has a new setting for winning percentage calculation, so you can copy and paste that section to your existing settings.php
Feature walk-through
Multiple scores can be added at once
In the conference view, click the "Add a new score of game" link as usual. You should see a new dropdown list to select how many scores / games to add at once:
You can select anywhere from 1 to 10 scores to add, and the page will show the specified number or entry forms.
Non-admin users can edit their own profile
Previously, only admin user(s) had access to a special "Manage users" section to edit each user account. However, now each logged in user can edit their own name, e-mail address and password (this is a subset of a user account -- the admin user(s) can edit more properties).
When a user first logs in, there is a new "Edit my profile" link:
Clicking this link brings up the "Edit profile" page:
Winning percentage can be calculated in multiple ways
In settings.php, there is a new setting:
// Setting on how to calculate winning percentage
// A setting of 1 means wins divided by total games played minus ties (ignoring ties)
// A setting of 2 means wins plus ties divided by two divided by total games played (ties are half-wins)
// A setting of 3 means points divided by total possible points
$winning_pct_calc = 1;
New standings sorting logic
If you look at the standings.php code, it explains the available fields that you can sort by:
Available sort fields:
Name: teamname
Wins: teamwins
Losses: teamlosses
Ties: teamties
Forfeits: teamforfeits
Runs for: teamrf
Runs against: teamra
Games behind: gamesbehind
Points: points
Winning percentage: winningpct
Custom tie break: teamorder
Separate the fields by commas and always specify a sort order as DESC for descending and ASC for ascending
Use this information in the code directly below that section in order to customize the order of sorting. For example, when you sort by wins (basically when a user clicks the "wins" column), if multiple teams have the same number of wins, you can specify the next few sorting criteria.
New "custom order" team field
Related to the sorting discussed above, there is a now an arbitrary sort field that is editable whenever you edit a team. This is useful if, say, you settle tie-breakers by head-to-head record. Simply calculate the head-to-head record yourself, then give the team with the better head-to-head record a higher "custom order" field value:
Link from team names to show a specific team's score and schedule
In the default standings display, each team name is now linked:
Click on any team name to bring up its full schedule of past scores and upcoming games:
For the technically inclined, the display of the schedule is now a function, meaning that it can be more easily included into your custom implementation. Look in standings_functions.php for the sls_team_schedule function and accompanying usage description.
10:03 am
I have problems pls help
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\\wamp\\www\\Website\\standings.php on line 238
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\\wamp\\www\\Website\\standings.php on line 240
Team Name GP Wins Losses Ties Forfeits RF RA GB PCT Points
Peter's division
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\\wamp\\www\\Website\\standings.php on line 238
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\\wamp\\www\\Website\\standings.php on line 240
Team Name GP Wins Losses Ties Forfeits RF RA GB PCT Points