SimpleLeague is a very (and I mean very) minimalistic tool to display tabular league data (results, rankings etc.) in existing websites.
I needed a simple way to insert database-driven HTML tables with results and rankings into an existing site, which was created with a CMS.
There weren't any plugins available for that CMS which provided anything like this, so I had to build it myself...but I wanted to do it with the least effort possible (because I knew that I would need to enter only a few results per year).
That's why I decided to build a "technology-agnostic" and very minimalistic solution:
SimpleLeague just consists of a few PHP files that spit out raw HTML tables. You need a server with PHP and MySQL to install it, but you can integrate it in websites built with any technology, as long as you are able to include content from external URLs.
There isn't even an admin screen, and it's unlikely that there will ever be one.
To enter players, results etc., you just edit the database directly in phpMyAdmin (or whatever tool your server provides).
Yes, it's that minimalistic.
And yes, this means that you probably need to be a developer to be able to use SimpleLeague.
You need a web server with PHP and a MySQL database.
To install SimpleLeague, just:
src
folder onto your servercache
subfolder to 777
db.sql
to create the tablesinc.config.php
(server, database, user and password)To integrate it with your site, use whatever is provided by the technology your site was built with, for example:
include
(with allow_url_include
enabled)For example URLs, see below.
The following text gives a short explanation of SimpleLeague's core concepts and how they link to the database.
Bold words refer to a table of the same name.
The "core data" of SimpleLeague are players and (optional) teams.
Think of something like StarCraft: there are two "players" (actual humans), but their "teams" are Terrans, Zerg or Protoss.
There are one or more seasons.
A season has a name (like "2013") and consists of one or more rounds.
Each round has a number and can optionally have a name (something like "Winter 2013").
A round consists of one or more games.
Each game has exactly two players facing each other.
(or just one player if he has no opponent - in this case, just set the opponent's player_id
to 0
)
The players score points and victory points.
Think of the way scores in sports leagues work: the actual game result is something like 13 : 8 victory points (goals, touchdowns...whatever), and the winner gets 2 points for winning, which directly affect his position in the league rankings. So the position in the rankings is mainly determined by the amount of "league points", the victory points only matter when there's a draw in league points.
You can use this SQL script to create a database with sample data.
Here is a list of the available URLs, with examples how the rendered tables look like.
The example tables use the sample data from the script above.
URL:
/season_players/?season_name=2013
Example:
URL:
/season_schedule/?season_name=2013
Optional: To display a single round, pass the round number as the second parameter:
/season_schedule/?season_name=2013&round_number=2
Example:
(without the "round number" parameter)
Note: only visible when the round is finished.
A round is considered finished when the finished
column in the rounds
table is set to 1
.
URL:
/round_results/?season_name=2013&round_number=2
Example:
Optional: Append the show_unfinished
parameter to display results even if the round is still unfinished (to check results before setting the round to finished):
/round_results/?season_name=2013&round_number=2&show_unfinished=1
Note: only incorporates the results of finished rounds where the round number is equal or smaller than the specified one.
A round is considered finished when the finished
column in the rounds
table is set to 1
.
URL:
/season_ranking/?season_name=2013&round_number=2
Example:
Optional: Append the show_unfinished
parameter to display results of unfinished rounds as well (to check results before setting the round to finished):
/season_ranking/?season_name=2013&round_number=2&show_unfinished=1
Notes:
finished
column in the rounds
table is set to 1
.URL:
/season_crosstab/?season_name=2013
Example:
SimpleLeague also includes some features which generate statistics across all seasons.
There's a setting to exclude certain seasons from these statistics: just set no_statistics
in the seasons
table to false
.
Notes:
finished
column in the rounds
table is set to 1
.URL:
/alltime_allresults/
Example:
You can provide your own templates if you don't like the default ones.
All URLs accept the name of a custom template as an optional parameter:
put the template file (with .mustache
file extension) into the /tpl
folder where the default templates are:
/tpl/my_template.mustache
Append the custom_template
parameter to the URL:
&custom_template=my_template
Export settings for phpMyAdmin to create db.sql
:
AUTO_INCREMENT
offHow to make a release:
Prerequisites:
7za.exe
from the 7-Zip Command Line Version in the parent folderSteps:
version-number.bat
release.bat
(this will create a zip file in the release
subfolder)SimpleLeague makes use of the following open source projects:
SimpleLeague is licensed under the MIT License. See License.txt for details.