Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    I had the same issue (OTW and OTL only):

    Just edit the file hockey.php in the folder ‘leaguemanager\sports’.
    There you insert echo '<th>OTW</th><th>OTL</th>'; into the function displayStandingsHeader().
    Then, in the displayStandingsColumns function, insert

    echo '<td>'.$this->getNumWonMatchesOvertime($team->id).'</td>';
    echo '<td>'.$this->getNumLostMatchesOvertime($team->id).'</td>';

    after the line global $leaguemanager;

    Best regards

    Thread Starter eedo

    (@eedo)

    Thnx! It gave me OTW and OTL. But it gave me 0-0 under OTW, isn’t that wrong? Should have just given me a column of 0?

    Thread Starter eedo

    (@eedo)

    Oh, and by the way. Is there any way to get the columns centerd or right adjusted? cant get that working ??

    Thanx!

    Make sure to insert the columns in the same direction both in the displayStandingsHeader and displayStandingsColumns functions. I think that you have the goals displayed in the OTW column.
    To right-align your columns, just edit the file “leaguemanager/style.css” and change the following code

    table.leaguemanager .num {
    	text-align: center;
    	}

    to

    table.leaguemanager .num {
    	text-align: right;
    	}

    Regards!

    Thread Starter eedo

    (@eedo)

    I fixed the 0-0 problem on my own (woho :))

    If you look at this page, you see what i mean.

    https://www.vikhockey.se/a-lag/tabell/20132014-2/div-1-e-1314

    It shows some left align and some center? cant figure out how to fix it ??

    Regards! And thnx for all the great help!

    Can you please send me the content of your displayStandingsColumns function?

    $league = $leaguemanager->getCurrentLeague();
    
    		echo '<td class="num">';
    		if ( is_admin() && $rule == 'manual' )
    			echo '<input type="text" size="2" name="custom['.$team->id.'][points2][plus]" value="'.$team->points2_plus.'" /> : <input type="text" size="2" name="custom['.$team->id.'][points2][minus]" value="'.$team->points2_minus.'" />';
    		else
    			printf($league->point_format2, $team->points2_plus, $team->points2_minus);
    
    		echo '</td>';
    		echo '<td class="num">'.$team->diff.'</td>';

    In the original code, the goal and diff-columns have the class “num”, which right-aligns them. In your source-code, the two columns are missing the “num”-class. If you add the class, these two columns should also be right-aligned.

    regards

    Thread Starter eedo

    (@eedo)

    function displayStandingsColumns( $team, $rule )
    	{
    		global $leaguemanager;
    		echo '<td>'.$this->getNumWonMatchesOvertime($team->id).'</td>';
    		echo '<td>'.$this->getNumLostMatchesOvertime($team->id).'</td>';
    		$league = $leaguemanager->getCurrentLeague();
    
    		echo '<td class="num">';
    		if ( is_admin() && $rule == 'manual' )
    			echo '<input type="text" size="2" name="custom['.$team->id.'][points2][plus]" value="'.$team->points2_plus.'" /> : <input type="text" size="2" name="custom['.$team->id.'][points2][minus]" value="'.$team->points2_minus.'" />';
    		else
    			printf($league->point_format2, $team->points2_plus, $team->points2_minus);
    
    		echo '</td>';
    		echo '<td class="num">'.$team->diff.'</td>';
    	}

    This is the complete function. I’m not that good at PHP, just the ordinary fixes and stuff, trying to learn ??

    Only edited what you said

    Regards!

    Ok now I see whats wrong with your code, this also explains the “0-0” problem ??
    You have inserted the columns in the wrong order, as i mentioned above: In the header, you have “M?l Diff OTW OTL”, but in the table itself you have OTW and OTL first.
    I guess you have fixed the 0-0 problem in the league settings, point format? You can change it back to %d-%d, so that the goals are displayed correctly.
    Then change your displayStandingsColumns to the following code, and your columns should be in the right order and OTW and OTL should also be right-aligned:

    function displayStandingsColumns( $team, $rule )
    	{
    		global $leaguemanager;		
    
    		$league = $leaguemanager->getCurrentLeague();
    
    		echo '<td class="num">';
    		if ( is_admin() && $rule == 'manual' )
    			echo '<input type="text" size="2" name="custom['.$team->id.'][points2][plus]" value="'.$team->points2_plus.'" /> : <input type="text" size="2" name="custom['.$team->id.'][points2][minus]" value="'.$team->points2_minus.'" />';
    		else
    			printf($league->point_format2, $team->points2_plus, $team->points2_minus);
    
    		echo '</td>';
    		echo '<td class="num">'.$team->diff.'</td>';
    
    		echo '<td class="num">'.$this->getNumWonMatchesOvertime($team->id).'</td>';
    		echo '<td class="num">'.$this->getNumLostMatchesOvertime($team->id).'</td>';
    	}

    regards

    Thread Starter eedo

    (@eedo)

    Thank you! It looks perfect now ??

    I really appriciate the time you took to help me fix the problem I had.

    Have a good day and a great weekend!

    thnx again!

    Regards!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Overtime Lost, Overtime Won’ is closed to new replies.