The LeagueManager plugin is not geared towards WPMU.
But I was able to get it working by making the following changes.
I am using
- Wordpress MU 2.8.4
- LeagueManager 3.4 RC2
The main problems with this plugin have to do with locating the upload directory for a given league, and then locating the images that are uploaded to that directory.
So... do the following,
In admin.php, modify the addLeague function to automatically set the path to the blogs personal directory.
function addLeague( $title )
{
global $wpdb;
global $blog_id;
$settings = array( 'upload_dir' => 'wp-content/blogs.dir/'.$blog_id.'/files/leaguemanager',
...
...
}
Then remove the ability to modify the path to the upload directory in the admin settings page, settings.php. This isn't something you want your blog users to do anyway.
//Approximately Line 115 of settings.php
<!-- This should not be configurable in a multiuser site.
<tr valign"top">
<th scope="row"><label for="upload_dir"><?php _e( 'Upload Directory', 'leaguemanager' ) ?></label>
</th>
<td><input type="text" size="40" name="settings[upload_dir]" id="upload_dir" value="<?php echo $league->upload_dir ?>" /></td>
</tr>
-->
The next problem to tackle is the referencing of the image and thumbnail paths. I found the code for this to be quite odd, so it's significantly different.
You need to modify core.php, specifically the getImagePath and getThumbnailPath functions like so,
function getThumbnailPath( $file )
{
$league = $this->getCurrentLeague();
if ($file != false)
{
return ABSPATH . $league->upload_dir . '/' . 'thumb_'.basename($file);
}
return false;
}
function getImagePath( $file = false )
{
$league = $this->getCurrentLeague();
if ( $file ) {
return ABSPATH . $league->upload_dir . '/' . basename($file);
}
else
{
return ABSPATH . $league->upload_dir;
}
}
I also changed line 377 in upgrade.php for good measure.
$settings['upload_dir'] = 'wp-content/blogs.dir/'.$blog_id.'/files/leaguemanager';
It's working so far for me, but if anyone has any more info on necessary modifications to this plugin for WPMU compatibility , I would love to know.
-Shawn Tucker