World Cup Predictor
Plugin to manage and present a fantasy football (soccer) competition for the FIFA World Cup 2010
Contributors:Ian Haycox
Donate link: http://www.ianhaycox.com/donate
Tags: prediction, fantasy football, competition, soccer, football, fantasy, sidebar, widget, post
Requires at least: 2.8
Tested up to: 2.9.2
Stable tag: 0.4.2
Description
This plugin is designed to collect users predictions for each of the matches in the 2010 FIFA World Cup.
Users predict the score for each match in the group and knockout stages and are awarded points based on the accuracy of their prediction.
Match results can also be displayed via additional shortcodes.
Features
- easy adding of matches, venues, results
- entry form for users to make predictions on each World Cup games
- sidebar widget to display prediction standings
- sidebar widget to display currently logged in users’ predictions
- countdown timer to next prediction deadline
- display of match results and group tables
- configurable scoring system to award predictions
Installation
To install the plugin complete the following steps
- Unzip the zip-file and upload the content to your WordPress Plugin directory. Usually
/wp-content/plugins - Activate the plugin via the Admin plugin page.
- Configure Matches etc via the Admin page.
Upgrade Notice
- The database structure has changed between V0.2 and V0.3. After upgrading to 0.3, ensure you deactivate and reactivate the plugin then re-import the matches.
For more details on configuration see the Usage section below.
Frequently Asked Questions
- Why are there 64 teams ? – There are extra dummy ‘placeholder’ teams to fill-in the knockout results tables. Once a team has progressed through the group
stage to the knockout stage edit the match schedule to change the placeholder team to the actual team.
Screenshots
- Prediction entry form
- Group table results display
- Admin Screens
- Overview Screen
- Predictions
- Knockout tables
Changelog
Usage
After installation use Import button on the Admin ‘World Cup’ overview option to load the teams and match schedules.
Verify the timezone offset on this screen. Any difference should reflect the difference in time between your servers’
local time and South African time. If this setting is incorrect then users may be able to make predictions after kickoff.
The date and times of matches are in South African local time (UTC + 2)
In order to manage the teams, matches etc. the logged in user must have the Worldpress capability wcp2010_manager. By default
the plugin adds this capability to the Administrator and Editor roles. If the World Cup menu option is not available verify that
the currrent user has the wcp2010_manager role. You may need to install a capability manager plugin to manage roles and capabilities.
Users of the blog do not need any special role or capability to make predictions.
Predictions
Create a post or page with the shortcode [world-cup-predictor] to display an entry form. Other shortcodes are available to display prediction results
and match results. See below for more details.
Users can only predict on matches that have not yet started. Once a match has started it is removed from the entry form preventing further
predictions.
Match Results
As each match is complete, use the Matches admin menu option to enter the goals scored and check the ‘Match Finished’ checkbox.
The group tables and match results displayed by the shortcodes will be updated.
Once a team is confirmed as coming first or second in the group stage, edit the Matches to change the placeholder team to the
team that has qualified to the next stage. For example, if South Africa win Group A, edit Match Number 49 and change the
team from ‘Winner Group A’ to ‘South Africa’.
This change is then reflected in the knockout results table.
Options
None as yet.
Points Calculations
Once a match has finished enter the final score in the Matches tab and check the ‘Match Finished’ box. The displayed group tables
will then update with the latest team standings.
To update the users’ prediction scores, select the match in the ‘Predictions’ menu and click ‘Score Selected’. This updates the
users’ scores in the widget and results tables.
Points are assigned according to the settings in the ‘Configure Scoring’ tab.
NOTE – The bonus points are cummulative (added to the scores for exact, win and draw).
Therefore be aware that both the bonus goal and bonus goal difference points amounts will always be added
to the points for a win because the goals and goal difference are the same.
The bonus goal difference points are always added to a draw because the goal difference will match.
Adjust the win and draw points appropriately if either of the bonus points are non-zero.
Shortcodes
Prediction form
You can display an entry form for predictions and the results of matches and predictions with the following shortcodes in a post or page.
[world-cup-predictor]
Display an entry form for all the configured matches where the kickoff time is before the current date and time.
The form will display a countdown to the next match deadline. Once the match kickoff time has passed the match will
no longer be displayed and users cannot make predictions.
You may optionally supply the attribute stage=n where n is the stage id to limit the matches to a particular group.
To display just the matches in the group stages, not the knockout stages, use the attribute group=true, e.g. [world-cup-predictor group=true].
To display matches sorted by kickoff time, rather than by each stage, use the attribute kickoff=true and optionally a limit, e.g. [world-cup-predictor kickoff=true limit=5] to display the next 5 matches.
Group tables
[world-cup-predictor tables=1 stage=n show_results=n]
Display the group tables with the match results once the match has finished and the results have been entered.
You may optionally supply the attribute stage=n where n is the stage id to limit the matches to a particular group.
You may optionally supply the attribute show_results=n where n = 0 or 1 to hide or show the match results below the group table.
Knockout tables
[world-cup-predictor knockout=1]
Display the results of the knockout stages of the tournament.
Match Results
[world-cup-predictor results=1 stage=n]
Display a table of match results. You may optionally supply the attribute stage=n where n is the stage id to limit the matches to a particular group.
User scores
[world-cup-predictor scores=n]
For each match ID, specified by n, display a table of each users’ predictions and the points awarded.
Optionally add the attribute highlight=”css-styles” to add a CSS style to the table row of the currently logged in user. For example [world-cup-predictor scores=1 highlight="background:red;font-weight:bold"].
User Predictions
[world-cup-predictor user=1 show_total=n]
For the currently logged in user display the list of predictions for that user. If n is non-zero then show the total points for this user at he foot of the table.
You may also display just the users total via [world-cup-predictor show_total=1] without the table.
User Rankings
[world-cup-predictor ranking=1 limit=999]
Display a summary of all the users’ points as a ranking table. Optionally add the attribute highlight=”css-styles” to add a CSS style to the table row of the currently logged in user. For example [world-cup-predictor ranking=1 highlight="background:red;font-weight:bold"].
User Rankings Widget
The widget displays similar output to the shortcode [world-cup-predictor ranking=1 limit=999]
Drag and drop the widget to a sidebar and configure. Multiple instances of the widget, each configured separately, may be
placed on a sidebar.
If not blank, the URL option adds a link to the full results page using the title below as the link text.
User Predictions Widget
The widget displays the list of the currently logged in users’ predictions similar in output to the shortcode [world-cup-predictor user=1]
Drag and drop the widget to a sidebar and configure.
Documentation
Deutsch-Dokumentation