Plugin Author
K
(@koelle)
Hi jinko, nice job, I only fixed the code a little bit.
<table class='leaguemanager matchtable' summary='' title='<?php echo __( 'Match Plan', 'leaguemanager' )." ".$league->title ?>'>
<tr>
<th class='match'><?php _e( 'Home Team', 'leaguemanager' ) ?></th>
<th class='score'><?php _e( 'Score', 'leaguemanager' ) ?></th>
<th class='match'><?php _e( 'Away Team', 'leaguemanager' ) ?></th>
</tr>
<?php foreach ( $matches AS $match ) : ?>
<?php $The_Home_team = "<span class='logos'><img class='home_logo' src='".$teams[$match->home_team]['logo']."' alt='' /></span>".$teams[$match->home_team]['title']; ?>
<?php $The_Away_team = "<span class='logos'><img class='away_logo' src='".$teams[$match->away_team]['logo']."' alt='' /></span>".$teams[$match->away_team]['title']; ?>
<?php if ( $leaguemanager->isHomeTeamMatch( $match->home_team, $match->away_team, $teams ) ) : ?>
$The_Home_team = sprintf("<strong>%s</strong>", $The_Home_team);
$The_Away_team = sprintf("<strong>%s</strong>", $The_Away_team);
<?php endif; ?>
<tr class='<?php echo $match->class ?>'>
<td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Home_team ?> </td>
<td class='match' style='text-align:center; margin: 20px; font-size: 20px;'><?php echo $match->homeScore."-".$match->awayScore ?><br /><?php echo '<p style="font-size: 12px; font-style: italic;">'.$match->date." ".$match->start_time.'</p>' ?> </td>
<td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Away_team ?></td>
</tr>
<?php endforeach; ?>
</table>
Thread Starter
jnko
(@kopr)
Thank you, your modified code throws me an error, but I figured it was probably from you test for me:-)
<?php $The_Home_team = sprintf("<strong>%s</strong>", $The_Home_team);?>
In my template tag nicer ‘br’ instead of ‘span’
thank you very much
sorry for bad English
Final code:
<table class='leaguemanager matchtable' summary='' title='<?php echo __( 'Match Plan', 'leaguemanager' )." ".$league->title ?>'>
<tr>
<th class='match'><?php _e( 'Home Team', 'leaguemanager' ) ?></th>
<th class='score'><?php _e( 'Score', 'leaguemanager' ) ?></th>
<th class='match'><?php _e( 'Away Team', 'leaguemanager' ) ?></th>
</tr>
<?php foreach ( $matches AS $match ) : ?>
<?php $The_Home_team = "<br class='logos'><img class='home_logo' src='".$teams[$match->home_team]['logo']."' alt='' /></br>".$teams[$match->home_team]['title']; ?>
<?php $The_Away_team = "<br class='logos'><img class='away_logo' src='".$teams[$match->away_team]['logo']."' alt='' /></br>".$teams[$match->away_team]['title']; ?>
<?php if ( $leaguemanager->isHomeTeamMatch( $match->home_team, $match->away_team, $teams ) ) : ?>
<?php $The_Home_team = sprintf("<strong>%s</strong>", $The_Home_team);?>
<?php $The_Away_team = sprintf("<strong>%s</strong>", $The_Away_team); ?>
<?php endif; ?>
<tr class='<?php echo $match->class ?>'>
<td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Home_team ?> </td>
<td class='match' style='text-align:center; padding-top: 35px; font-size: 20px; font-weight: bold;'><?php echo $match->homeScore."-".$match->awayScore ?><br /><?php echo '<p style="font-size: 12px; font-weight: normal; font-style: italic;">'.$match->date." ".$match->start_time.'</p>' ?> </td>
<td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Away_team ?></td>
</tr>
<?php endforeach; ?>
</table>
Thread Starter
jnko
(@kopr)
One more question Kolja,
I do not know whether it’s just me, but playing on the filter does not work.
http://jnko.eu/wp-content/uploads/filter.png
hi, this is great, i hope kolja will include this in next plugin update.
Question – is it possible (and how) to have both “templates” for matches? For example, on one page i want to have this, let’s call it, fancy template, but on the other page, ia want to have just results of all matches in league?
Thank you,
KR,
Matija
this piece of code sounds familiar 🙂
Plugin Author
K
(@koelle)
Hi Jinko, your usage of <br> is simply wrong! It only forces a line break. This could do what you want.
<table class='leaguemanager matchtable' summary='' title='<?php echo __( 'Match Plan', 'leaguemanager' )." ".$league->title ?>'>
<tr>
<th class='match'><?php _e( 'Home Team', 'leaguemanager' ) ?></th>
<th class='score'><?php _e( 'Score', 'leaguemanager' ) ?></th>
<th class='match'><?php _e( 'Away Team', 'leaguemanager' ) ?></th>
</tr>
<?php foreach ( $matches AS $match ) : ?>
<?php $The_Home_team = $teams[$match->home_team]['title']; ?>
<?php $The_Away_team = $teams[$match->away_team]['title'] ?>
<?php if ( $leaguemanager->isHomeTeamMatch( $match->home_team, $match->away_team, $teams ) ) : ?>
<?php $The_Home_team = sprintf("<strong>%s</strong>", $The_Home_team);?>
<?php $The_Away_team = sprintf("<strong>%s</strong>", $The_Away_team); ?>
<?php endif; ?>
<?php $The_Home_team = "<p class='logos'><img class='home_logo' src='".$teams[$match->home_team]['logo']."' alt='' /></p><p>".$The_Home_team."</p>"; ?>
<?php $The_Away_team = "<p class='logos'><img class='away_logo' src='".$teams[$match->away_team]['logo']."' alt='' /></p><p>".$The_Away_team."</p>"; ?>
<tr class='<?php echo $match->class ?>'>
<td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Home_team ?> </td>
<td class='match' style='text-align:center; padding-top: 35px; font-size: 20px; font-weight: bold;'><?php echo $match->homeScore."-".$match->awayScore ?><br /><?php echo '<p style="font-size: 12px; font-weight: normal; font-style: italic;">'.$match->date." ".$match->start_time.'</p>' ?> </td>
<td class='match' style='text-align:center; font-size: 15px;'><?php echo $The_Away_team ?></td>
</tr>
<?php endforeach; ?>
</table>
better that you remove summary=”” from all tables – it is not allowed any more.
Thread Starter
jnko
(@kopr)
Hello to all.
For-Kolja
Thank you for the explanation.
For-ben52
I’m not a programmer, I tried your suggestion to delete summary = “”, but somehow I did not. I will be happy if you help us clean up the code.
For-armando.alberti
I waited if you continue and put in the code and logos, as I interviewed a proposal from Kolji’re applying for a change “homeScore”. When nothing happened for a long time, so I finished it, perhaps you do not mind:-)
For all
It works well you filter playing days? On my template does not respond.
http://jnko.eu/wp-content/uploads/filter.png”
Hi jnko,
example:
<table class=’leaguemanager matchtable’ summary=” title='<?php echo __( ‘Match Plan’, ‘leaguemanager’ ).” “.$league->title ?>’>
you have to remove “summary=”” will be like this:
<table class=’leaguemanager matchtable’ title='<?php echo __( ‘Match Plan’, ‘leaguemanager’ ).” “.$league->title ?>’>
Thread Starter
jnko
(@kopr)
Hi ben52,
Thank you very much for the correction. I got it wrong.
Kolja,
I am sure many of us are producing interesting custom templates for showing standings matches etc etc.
Why don’t we create a kinda “LeagueManager Best Practice Forum” somewhere in Internet to let anyone sharing pieces of codes?
I am sure plug-in will take-off further….
Thanks
Thread Starter
jnko
(@kopr)
Hi, I also was a separate forum. I would like to join and even helped create some simple forum.