Viewing 3 replies - 1 through 3 (of 3 total)
  • Yes you can. In the documentation it lists a bunch of filters and hooks that you can use. You will want to use matchtable_header_soccer and matchtable_columns_soccer.

    You can see how to implement this in the soccer.php file under function __construct(). than farther down in that file under displayMatchesHeader() and displayMatchesColumns()

    You will want to place the add_action( 'matchtable_header_soccer', ' myNewFunction') line in your themes function file, where myNewFunction is the name of the unidque function you will call to place in your Referee column, and than below that add your myNewFunction function just like they did in the soccer.php file. Do the same with matchtable_columns_soccer.

    Thread Starter romedius33

    (@romedius33)

    Hi Paulio51
    thanks for your reply and your information. It would be perfect if it works. I’m working already on it …
    and keep you informed,
    thanks again

    Thread Starter romedius33

    (@romedius33)

    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.]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘extra column in matches table’ is closed to new replies.