• Hi,
    I’m trying to integrate leaguemanager to my team’s website but i have a little question about the widget and the template.

    Instead of displaying the number of point in the widget (and in the page or article) i would like to show the percentage of win.
    In the best scenario i would like to display something like :

    G(game played) W(win) L(loss) PCT(percent)

    when i use the normal widget or the compact standing.

    Any idea how i can make this right ?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter grunk

    (@grunk)

    I reply to myself :

    To customize the display of the widget and the standing i just edit the standing-*.php in the template folder :

    1 – Create the following folder /wp-content/theme/your-theme/leaguemanager
    2 – Past the required standing file. (ie : i’m using only compact so i copied standing-compact.php from plugin/leaguemanager/template/
    3 – Edit the previous file.

    In my case i did this change :

    <tr>
    	<th class="num"><?php echo _c( 'Pos|Position', 'leaguemanager' ) ?></th>
    	<th class="num"> </th>
    	<?php if ( $league->show_logo ) : ?>
    	<th class="logo"> </th>
    	<?php endif; ?>
    
    	<th><?php _e( 'Team', 'leaguemanager' ) ?></th>
    	<?php if ( 1 == $league->standings['pld'] ) : ?>
    	<th class="num">G</th>
    	<?php endif; ?>
    	<th class="num">W</th>
    	<th class="num">L</th>
    	<th class="num">%</th>
    </tr>
    <?php if ( $teams ) : ?>
    <?php foreach( $teams AS $team ) : ?>
    
    <tr class='<?php echo $team->class ?>'>
    	<td class='rank'><?php echo $team->rank ?></td>
    	<td class="num"><?php echo $team->status ?></td>
    
    	<?php if ( $league->show_logo ) : ?>
    	<td class="logo">
    		<?php if ( $team->logo != '' ) : ?>
    		<img src='<?php echo $team->logoURL ?>' alt='<?php _e('Logo','leaguemanager') ?>' title='<?php _e('Logo','leaguemanager')." ".$team->title ?>' />
    		<?php endif; ?>
    	</td>
    	<?php endif; ?>
    
    	<td><?php echo $team->title ?></td>
    	<?php if ( 1 == $league->standings['pld'] ) : ?>
    	<td class='num'><?php echo $team->done_matches ?></td>
    	<td class='num'><?php echo $team->won_matches ?></td>
    	<td class='num'><?php echo $team->lost_matches ?></td>
    	<td class='num'><?php echo round($team->won_matches/$team->done_matches,3) ?></td>
    	<?php endif; ?>
    </tr>

    That’s it ! You can now enjoy your new standings and widget 🙂

    Hello grunk,
    i am the admin for a baseball club website and your topic has been very useful.
    quick question : our website displays results for several teams, including french little league teams, and the points format is not the same :
    •for adults it is a percentage, like the template you posted
    •for little league it is a simple number of points.
    Do you know how to mix the 2 ?? How to add your template to the template list in the widget by example ?
    I hope you still read the posts on this thread 😉
    Thank you in advance

    Suzanne

    I reply to myself too 😉
    In the folder /wp-content/theme/your-theme/leaguemanager I put the 2 standings templates :
    •standing-compact.php taken from the plugin, that i use for little league (results displayed as POINTS)
    •standing-extend.php that I edited with your code above, that i use for all other games (results displayed as %)

    Suzanne

    Thread Starter grunk

    (@grunk)

    Merci pour l’auto réponse 🙂
    Ca pourra peut être nous servir aussi , club français aussi (duc-baseball.org) on affiche pour le moment que les résultat baseball/softball senior donc en %

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: LeagueManager] Baseball widget and template’ is closed to new replies.