Hi Paulio51,
you’re great. Thanks for all.
This is how I did it: (I added 3 columns “Referee”, “Matchtype” and “Man of the Match” – further I deleted the columns of “Halftime, Overtime and Penalty”
soccer.php
function displayMatchesHeader()
{
echo '<th>'.__( 'Referee', 'leaguemanager' ).'</th>';
echo '<th>'.__( 'Matchtype', 'leaguemanager' ).'</th>';
echo '<th>'.__( 'Man/match', 'leaguemanager' ).'</th>';
}
/**
* display Table columns for Match Administration
*
* @param object $match
* @return void
*/
function displayMatchesColumns( $match )
{
echo '<td><input class="points" type="text" size="6" id="ref'.$match->id.'" name="custom['.$match->id.'][ref]" value="'.$match->ref.'" /></td><td><input class="points" type="text" size="2" id="matchtype'.$match->id.'" name="custom['.$match->id.'][matchtype]" value="'.$match->matchtype.'" /></td><td><input class="points" type="text" size="6" id="man'.$match->id.'" name="custom['.$match->id.'][man]" value="'.$match->man.'" /></td>';
}
</blockquote>
I also want to export these values:
<blockquote>
function exportMatchesHeader( $content )
{
$content .= "\t".__( 'Referee', 'leaguemanager' )."\t".__('matchtype', 'leaguemanager')."\t".__('Man/match', 'leaguemanager');
return $content;
}
/**
* export matches data
*
* @param string $content
* @param object $match
* @return the content
*/
function exportMatchesData( $content, $match )
{
if ( isset($match->man) )
$content .= "\t".sprintf($match->ref)."\t".sprintf($match->matchtype)."\t".sprintf($match->man);
else
$content .= "\t\t\t";
return $content;
}
</blockquote>
And this is the rewritten table in matches.php:
<blockquote>
<table class='leaguemanager matchtable' summary='' title='<?php echo __( 'Match Plan', 'leaguemanager' )." ".$league->title ?>'>
<tr>
<th width=100px class='date1'><?php _e( 'Date', 'leaguemanager' ) ?></th>
<th width=50px class='time'><?php _e( 'Time', 'leaguemanager' ) ?></th>
<th width=100px class='location'><?php _e( 'Field', 'leaguemanager' ) ?></th>
<th width=200px class='match'><?php _e( 'Match', 'leaguemanager' ) ?></th>
<th width=30px class='score'><?php _e( 'Score', 'leaguemanager' ) ?></th>
<th width=40px class='ref'><?php _e( 'Referee', 'leaguemanager' ) ?></th>
<th width=40px class='man'><?php _e( 'Man/match', 'leaguemanager' ) ?></th>
</tr>
<?php foreach ( $matches AS $match ) : ?>
<tr class='<?php echo $match->class ?>'>
<td width=100px class='date1'><?php echo $match->date ?></td>
<td width=50px class='time'><?php echo $match->start_time ?></td>
<td width=100px class='location'><?php echo $match->location ?></td>
<td width=200px class='match'><?php echo $match->title ?> <?php echo $match->report ?></td>
<td width=30px class='score'><?php echo $match->score ?></td>
<td width=40px class='ref'><?php echo $match->ref ?></td>
<td width=40px class='man'><?php echo $match->man ?></td>
</tr>
<?php endforeach; ?>
</table>
[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]