$player_type = null; $player_types = null; if (isset($_GET['player'])) { $player_type = PlayerType::Parse($_GET['player']); if (!is_null($player_type)) { $player_types = array($player_type); if ($player_type == PlayerType::JUNIOR_MIXED) { $player_types[] = PlayerType::GIRLS; $player_types[] = PlayerType::BOYS; } $player_type = PlayerType::Text($player_type) . " "; } } $manager->FilterByMatchType(array(MatchType::TOURNAMENT)); $manager->FilterByPlayerType($player_types); $manager->SortBy("date_changed DESC"); $manager->FilterByDateStart($i_start); $manager->FilterByDateEnd($i_end); $manager->ReadMatchSummaries(); $matches = $manager->GetItems(); unset($manager); $database->Disconnect(); $title = 'Stoolball tournaments'; if ($player_type) { $title = $player_type . strtolower($title); } $feedData = array('title' => $title, 'description' => "New or updated " . strtolower($player_type) . "stoolball tournaments on the Stoolball England website", 'link' => 'http://www.stoolball.org.uk/tournaments', 'charset' => 'utf-8', "language" => "en-GB", "author" => "Stoolball England", "image" => "https://www.stoolball.org.uk/images/feed-ident.gif", 'entries' => array()); # Option to tweet new entries to a user, for use with www.iftt.com $tweet = isset($_GET['format']) && $_GET['format'] === "tweet"; foreach ($matches as $tournament) { if ($tweet) {