__('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); } ?>
  • GetAvailibleTeams($instance['leagueShortcut'], $instance['season']); if($teams == null) { $displayNoTeamsInfo = true; } else { $displayNoTeamsInfo = false; } $instance = wp_parse_args((array) $instance, array('title' => 'Match', 'widgettype' => 'next')); $title = esc_attr($instance['title']); $instance['teams'] = $teams; $instance["team"] = 79; ?>

    ;">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() { ?>