Skip to main content

Game Ladder Script

Published on
Two years ago I decided to check out an old gaming group that I used to play with years before that. I created a plugin to seamlessly add a ladder system into their web site.  A ladder system is typically used to match one-on-one matches. This allowed the group to add friendly competition without major overhaul of their web site.  I only made one version, but I plan on developing it a little bit further. The script allows for multiple games,which are dynamically set, and requires only one additional SQL table. You can download the script for personal and non-commercial use.

Glamanate Game Ladder Script Documentation

gls_display($string, [$orderby])

This function will return an array of members with points, off of the table declared in the script's file. The $string value represents the game value, such as "wow" for World of Warcraft, or "sc2" for StarCraft 2. By default it orders based on points, but other values include: win, loss. Since it returns a raw array, you must use a foreach statement to extract the information. The .zip file contains sample scripts.

gls_username($array)

This function is used to return the username of a player record within the gls_display array.

gls_points($array)

This function is used to return the points of a player record within the gls_display array.

gls_wins($array)

This function is used to return the wins of a player record within the gls_display array.

gls_loss($array)

This function is used to return the losses of a player record within the gls_display array.

gls_report($win, $loss, $game)

This function is used to record a lost match. This function would be located on the loss report form's action page. The $win parameter is the winner's user database ID,  $loss is the loser's user database ID, and again the $game parameter is based on what you choose to differentiate between games, or for the main game used.