Archive

Posts Tagged ‘bridge’

LeagueManager 2.9

May 25th, 2009

After a longer time of development Version 2.9 LeagueManager is finally available. It  introduces several changes and new features, the most important being a modular setup with several Wordpress actions and filters for easy implementation of different sport types. Here’s a brief list:

* Modular setup and several new sport types
* unlimited number of widgets
* different dropdown menues for match report
* easy adding of custom fields for matches and teams via WP hooks
* match statistics
* shortcodes to show teamlist and single team page
* TeamRoster via bridge to ProjectManager (for match stats)
* track team rank of previous save

Due to the growing complexity and number of sport types I cannot provide templates to cover everything. I can only impement the basic features to gather all needed data. I encourage anybody who to design new templates for any specific sport type or just for the fun of it. You can then send them to me by email for inclusion into the main plugin.

Kolja Schleich Plugins , ,

ProjectManager 2.1 with Bridge support

February 27th, 2009

The new version of ProjectManager has only a small change, but with great effect. The formfield types make use of the wordpress filter system, which enables other plugins to add special fields. This makes it possible to enable LeagueManager to hook into the plugin and more datafields, e.g. goal statistics. The formfields are added with the following code:

add_filter( ‘projectmanager_formfields’, ‘filter_formfields’);

‘filter_formfields’ is just an example function adds another field, such as:

function filter_formfields( $formfields ) {

$formfields['goals'] = array( ‘name’ => __(‘Goals’, ‘leaguemanager’), ‘callback’ => array($this, ‘getNumGoals’), ‘args’ => array() );

return $formfields;

}

This is the example I used to add a special field type in LeagueManager which automatically calculates shot goals of a player. The ‘name’ is simply the label of the field, ‘callback’ is a function that retrieves and returns the data, while ‘args’ are additional arguments that are passed to the function. ProjectManager automatically passes as first argument the dataset name and id as associative array. The function in the used example looks like this.

function getNumGoals( $player ) {

$player_name = $player['name'];

$player_id = $player['id'];

// get number of goals for this player

}

I hope I could describe a little bit how the bridging between the plugins functions. As far as I can tell now ProjectManager won’t need any further changes since most of the bridging is done from LeagueManager. Anybody can use the above filter to add formfields with special data. Up to now the new LeagueManager version is still in development and the next release will have the field for goal statistics.

Kolja Schleich Plugins , , , , ,