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) {
        $days = $days != 365;
        $prefix = $days ? PlayerType::Text($tournament->GetPlayerType()) : "New " . strtolower(PlayerType::Text($tournament->GetPlayerType()));
        $item_title = $prefix . " #stoolball tournament: " . $tournament->GetTitle() . ", " . $tournament->GetStartTimeFormatted(true, true, true);
    } else {
        $item_title = $tournament->GetTitle() . ", " . $tournament->GetStartTimeFormatted();
    }
<?php

ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] . '/../classes/' . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] . "/../");
require_once 'context/stoolball-settings.class.php';
require_once 'data/mysql-connection.class.php';
require_once 'http/short-url-manager.class.php';
$settings = new StoolballSettings();
$db = new MySqlConnection($settings->DatabaseHost(), $settings->DatabaseUser(), $settings->DatabasePassword(), $settings->DatabaseName());
$short_url_manager = new ShortUrlManager($settings, $db);
$real_url = $short_url_manager->ParseRequestUrl();
$db->Disconnect();
if (is_array($real_url)) {
    $hidden_get_vars = array_combine($real_url['param_names'], $real_url['param_values']);
    $_GET = array_merge($_GET, $hidden_get_vars);
    $_SERVER['PHP_SELF'] = '/' . $real_url['script'];
    require $real_url['script'];
} else {
    # Hard-coded URLs which redirect to WordPress and so can't be in .htaccess
    if (strtolower(trim($_SERVER['REQUEST_URI'], '/')) == "insurance") {
        header("Location: /manage/insurance/");
        exit;
    }
    # If page requested starting with /news, make WordPress think it was /category/news
    if (substr(strtolower(trim($_SERVER['REQUEST_URI'], '/')), 0, 4) == "news") {
        if ($_SERVER['REQUEST_URI'] == "/news") {
            $_SERVER['REQUEST_URI'] = "/news/";
        }
        # Keeps the /category bit invisible if just /news requested
        $_SERVER['REQUEST_URI'] = "/category" . $_SERVER['REQUEST_URI'];
    }
    # Does it look suspicious?