Add home and away record to equation builder

This commit is contained in:
Brian Miyaji
2015-04-11 14:39:45 +10:00
parent 93aef64809
commit ac83d14fa3
4 changed files with 76 additions and 5 deletions

View File

@@ -1059,6 +1059,18 @@ if ( !function_exists( 'sp_solve' ) ) {
return '-';
endif;
elseif ( strpos( $equation, '$homerecord' ) !== false ):
// Return imploded string
$homerecord = sp_array_value( $vars, 'homerecord', array( 0 ) );
return implode( '-', $homerecord );
elseif ( strpos( $equation, '$awayrecord' ) !== false ):
// Return imploded string
$awayrecord = sp_array_value( $vars, 'awayrecord', array( 0 ) );
return implode( '-', $awayrecord );
endif;
// Remove unnecessary variables from vars before calculating