Viewing 6 replies - 1 through 6 (of 6 total)
  • Im interested as we are looking at adding the team icons functionality for our south american football site.

    Thread Starter werresal

    (@werresal)

    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

    Thread Starter werresal

    (@werresal)

    This is the Solution to get images into fixtures view only !
    We only use fixtures, so i did not changed the rest of the code, but its pretty similar to fixtures.
    You just need to check the code of the other views to get where you have to add the filter and change the output. Its all written in the same .phh file. Check commentary lines for the beginning of the views outputs.

    good luck

    thanks for the tip, I’m a designer so any coding assistance would be greatly appreciated. My client is trying to recreate the following example
    http://www.goal.com/es-ar/tables/primera-divisi%C3%B3n/87

    he want to have a dropdown to shift between leagues and would like to include the logos and a short description.

    Happy to pay for your time and input.

    Here is a link to the site we are developing http://truefutbol.com

    cheers
    Mo

    @werresal is the plugin working for you? I cant get new results etc anymore.

    Plugin Author Mihaly Soft

    (@szi19830728)

    The icons “werresal” mentioned were added to the official version.
    I will try to add as many icons as possible in the upcoming weeks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Some Updates to this script:’ is closed to new replies.