ill try to give you an tutorial here, just sitting in train.
1. check all teamnames if their names are correct.
You can change the output in soccer-info.php beginning near at line 1092, function correct_team_name( $team_name )
It means often the real teamname isnt set. Example “hamburg” goes corrected to “Hamburger SV”. If youre done with this fixing, youre ready for point 2.
2. next step is to add an script wich filters the corrected team names to icon-filenames. As you maybe know servers dont get spaces in filenames or umlauts or something in this matter. (uppercase letters is also a problem)So you need to add a script wich renames for example “?sterreicher Wurstverein” to oesterreicher_wurstverein to get the image from server based on your filter.
Add the following code after line 697:
$foo = $team_a;
//changed spaces to "_"
$foo = str_replace (" ", "_",$foo);
$foo = str_replace ("'", "_",$foo);
$foo = str_replace (".", "_",$foo);
// change umlaut to latin letters
$ers = array(
' ' => '_',
'?' => 'Ae',
'?' => 'Oe',
'ü' => 'Ue',
'?' => 'ae',
'?' => 'oe',
'ü' => 'ue',
'?' => 'ss',
);
//
$foo = strtr($foo,$ers);
// uppercase to lowercase letters
$foo = strtolower($foo);
$foobar = $team_b;
//Leerzeichen ersetzen durch "_"
$foobar = str_replace (" ", "_",$foobar);
$foobar = str_replace ("'", "_",$foobar);
$foobar = str_replace (".", "_",$foobar);
// Umlaute durch Laute ersetzen
$erst = array(
' ' => '_',
'?' => 'Ae',
'?' => 'Oe',
'ü' => 'Ue',
'?' => 'ae',
'?' => 'oe',
'ü' => 'ue',
'?' => 'ss',
);
//
$foobar = strtr($foobar,$erst);
// Gro? zu Kleinbuchstaben
$foobar = strtolower($foobar);
This changes and filters the (internal) used teamnames to get the icon filenames.
Right under the inserted code you`ll see the output of the scripts – fixtures listing.
Overwrite it with this code:
$filtered_html_td .= '<td class="'.$all_columns['class'][2 + $van_comp].'">' .$team_a. '</td>'."\n";
$filtered_html_td .= '<td class="'.$all_columns['class'][3 + $van_comp].'"><span class="links"><img src="/wp-content/themes/sbar/images/soccer-icons/' .$foo. '.png"></span>vs.<span class="rechts"><img src="/wp-content/themes/sbar/images/soccer-icons/' .$foobar. '.png"></span></td>'."\n";
$filtered_html_td .= '<td class="'.$all_columns['class'][4 + $van_comp].'">' .$team_b. '</td>'."\n";
Change the paths in this block to your local server paths. Do an folder inside your themes image folder named “soccer-icons”. You have to create this icons by youselfe. i did 12 x 12 pixel transparent bg *pngs. Youll need to take the name is given by our filter script above. If a picture isnt shown, check the output of the script, maybe there is an unfixed filter problem.
I hope this helps, if you got further questions, let me know.
Werresal