__('Displays last or next match from a specified team', 'wp-soccr')); $this->WP_Widget('soccr', __('Soccr Match Widget'), $widget_ops); } // Display Widget function widget($args, $instance) { $cacheKey = "soccr_match_" . $instance['widgettype']; $match = wp_cache_get($cacheKey); if($match == null) { $SoccrCore = new SoccrCore(); if($instance['widgettype'] == "next") { $match = $SoccrCore->GetNextMatchByTeam($instance['team'], $instance["leagueShortcut"]); } else { $match = $SoccrCore->GetLastMatchByTeam($instance['team'], $instance["leagueShortcut"]); } wp_cache_add($cacheKey, $match); } ?>
| date; ?> - time; ?> Uhr | ||||
| LocationCity; ?> - LocationStadium; ?> | ||||
| teamName1; ?> | : | teamName2; ?> | ||
| GoalsTeam1; ?> | GoalsTeam2; ?> | |||
|
||||
;">No Teams for this League and Season avaibile. Widget can't be saved
GetAvailibleTeams($_GET["leagueShortcut"], $_GET["season"]); $i = 0; foreach($teams as $team): $arr[$i]["optionValue"] = $team->teamID; $arr[$i]["optionDisplay"] = $team->teamName; $i = $i + 1; endforeach; echo json_encode($arr); die(); } function soccr_get_availible_teams_ajax() { ?>