Football League Predictor Documentation

The WordPress Fantasy Football Plugin allows blog users to predict the score for football league matches.

Users predict the score for each defined match in the league and are awarded points based on the accuracy of their prediction.

Match results and league tables may also be displayed using this plugin.

Features

  • easy adding of seasons, matches, results
  • entry form for users to make predictions on each game
  • 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
  • configurable scoring system to award points to users’ predictions

Installation

Check that you are running WordPress V3.0 or later, PHP V5.0 or later, MySQL V5.0 or later.

To install the plugin complete the following steps:-

  1. Unzip the zip-file and upload the content to your WordPress Plugin directory. Usually `/wp-content/plugins`
  2. Activate the plugin via the Admin plugin page.
  3. Define league seasons, schedules and matches via the Admin page.
  4. Create or edit a post/page and add the shortcode `[fantasy-football predict=n]` where n is the season ID.

Usage

After installation use the Football menu to configure the teams and match schedules.

Match times and Prediction deadlines are entered in Server Local Time. See the Overview screen for the current Server Time.
If matches are played in a different timezone to the Server Time ensure you make to appropriate adjustments.

In order to manage the teams, matches etc. the logged in user must have the WordPress capability `football_manager`. By default the plugin adds this capability to the Administrator and Editor roles. If the Football menu option is not available verify that the currrent user has the `football_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 `[fantasy-football predict=n]` to display an entry form where `n` is the season ID.
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 Match Predictor admin menu option to enter the goals scored. The match results displayed by the shortcodes will be updated.

Options

None as yet.

Points Calculations

To update the users’ prediction scores, select the matches in the Match Predictor menu and click ‘Calculate Points for 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.

Administration

The administration functions are available via the WordPress administration screens using the Football menu option.

Overview

Provides a brief overview of the number of seasons, teams, predictions etc. that have been defined.

Configuration

The configuration screen has a number of tabs to define Seasons, Teams, Schedules and Matches.

  1. Seasons – Create each of the football league seasons (2009, 2010, 2011 etc) with the name of the league or championship in the description. For example, 2010, Premier League.
  2. Teams – Each of the teams in all the leagues for all seasons. Each team requires an 18 pixel square image for the team badge displayed on the prediction form
  3. Schedules – For each ‘week’ in a season a number of teams play each other – enter the week and the latest time that a user may enter a prediction. Predictions entered are this time are not counted. Also weeks prior to the predict by time will not be shown on the prediction or beat the manager forms.
  4. Matches – Within each season, define which matches take place in each week (or schedule) For example within a week some teams may play on a Saturday, or Sunday or Monday
  5. League Points – For the league table – setup the points for a match win, draw or loss

Match Predictor

This shows all the users who have made predictions for each match and match results.

It is possible to create predictions on behalf of a user if, for example, their prediction is sent in via email.

  1. Match Predictions – Select the season and view the users’ predictions. When creating a user prediction use the week filter to limit the match selection.
  2. Match Results – Once the matches are finished, select the week via the filter and enter the result of each match. In the table below, select each match and click ‘Calculate Points for Selected’ to award points to users.
    A green tick is displayed for all the matches that have been scored.
  3. Rankings – Dislays the current ranking for users scores.
  4. Match Scores – Displays the scores for finished matches and the predictions for each match
  5. League Table – The league table for all matches
  6. Scoring Configuration – For the selected season, assign the points to be applied in the event of win, draw etc.

Match Statistics

Display users prediction statistics for matches

  1. Frequency – For the selected match show the frequency of predictions
  2. Aggregate – Display the number of predictions for win, draw and loss

Each option has a filter to limit the statistics to the best scoring top ‘n’ predictors.

Shortcodes

To dislay the prediction form, rankings and results in a page or post use the shortcode [fantasy-football] with any required options

Prediction form

The shortcode [fantasy-football predict=n] displays the next weeks matches for the season ID ‘n‘.

To display additional matches use the attribute weeks=m where ‘m‘ is the number of weeks to show. For example

[fantasy-football predict=1 weeks=3]

will display up to 3 weeks’ matches for season ID 1.

Ranking table – Total scores

The shortcode [fantasy-football match_ranking=n] displays the points ranking table for all users for season ID ‘n‘.

Available options: avatar, limit, highlight, sort, show_user

Summary table – Prediction points per week

The shortcode [fantasy-football match_summary=n] displays
a summary of points per week for the currently logged in users predictions for season ID ‘n‘.

Available options: avatar, limit, sort

Results table – Predictions by match

The shortcode [fantasy-football match_predictions=n] displays all the match results and each players predictions for season ID ‘n‘.

Available options: match, avatar, limit, sort, highlight

Match Results

The shortcode [fantasy-football match_results=n] displays all the match results
for the season ID ‘n‘.

Available options: limit, sort

Shortcode options

Both the Ranking and Results shortcodes have the optional attributes:-

  • avatar=1 – Display users’ avatar in ranking/results
  • limit=n – Limit form/leaderboard/results to n rows or weeks
  • highlight=1 – Highlight the currently logged-in user with the CSS class logged-in-user in ranking/results
  • show_user=1 – Append current user to ranking if outside ‘limit’ rows.
  • match_id=-1 – Show results for all (-1) or specific (n) match ID
  • sort='ASC|DESC' – Sort the table ASC (ascending) or DESC (descending)
League Table

The shortcode [fantasy-football match_table=n] displays the current league table for season ID ‘n‘.

Available options : show_mp, show_win, show_draw, show_loss, show_gf, show_ga, show_gd – Set to 1/0 to show/hide each column

Widgets

The Fantasy Football widget can be dragged multiple times onto any sidebar and configured to display Ranking or Results tables.

Using the same options as the shortcodes above, select the Season, Match (if applicable) and other options.

In addition, you may add a URL which is displayed as a link to the full results or rankings page below the widget.

Styling

By default this plugin supplies a default CSS stylesheet, wp-content/plugins/fantasy-football/css/style.css, to
style the prediction form, widgets and result tables.

If you wish modify the style, then do not edit the supplied CSS file as it will get over-written on plugin upgrades. Instead, copy
the supplied stylesheet to the root directory of your theme and name it fantasy-football.css For example, copy style.css
to wp-content/themes/your-theme/fantasy-football.css

3 Responses to Football League Predictor Documentation

  1. Nelly says:

    Hello Ian,

    First of all, thanks for developing great plugins. I’m currently setting up Euro 2012 predictor for a website of mine and am thinking about purchasing the Football League Predictor as well. There’s just one thing I need to find out before rushing into things – is it possible to partly integrate Football Predictor with BuddyPress? That is to say, is there a way to show specific user’s latest predictions and success rate on his BuddyPress profile page? I understand that it may require some development from my side, so I just need to now whether you think if it’s possible in theory and whether or not it’s a complicated task or not.

    Thanks in advance,
    Nelly

    • Hello Nelly,

      I’m not that familiar with BuddyPress but I would guess it should be fairly easy to implement.

      At the moment the Football League predictor has a couple of shortcodes that may be of use, for example,

      Summary table – Prediction points per week

      The shortcode [fantasy-football match_summary=n] displays a summary of points per week for the currently logged in users predictions for season ID ‘n’.

      User Predictions

      The shortcode [fantasy-football user_predictions=n] displays all the predictions for the currently logged-in user for the season ID ‘n’.

      So it may be possible in the BP users’ profile to either call those shortcodes (or make the appropriate PHP calls to the shortcode functions).

      Contact me directly on ian.haycox at gmail dot com if you would like to discuss in more detail.

      Ian.

      • Nelly says:

        Thanks a lot for the reply, Ian. I’ll make sure to make the purchase today, would be glad if you could send over the zip today, also.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>