Пример #1
0
function DisplayStatsHeader($startbody = 1)
{
    global $theaterfile, $theaterfile_compare, $version, $version_compare, $theaterpath, $theaterpath_compare, $theaters, $range, $range_unit, $range_units, $versions;
    startbody();
    echo "\n\t\t<form action='{$_SERVER['PHP_SELF']}' method='get'>\n\t\t<div style='margin: 5px;'>\n\t\t\t<h1>Insurgency Theater Parser</h1>\n\t\t\t<h2>Parsing {$theaterfile} from Version {$version}</h2>\n";
    echo "Theater: <select name='theater'>\n";
    foreach ($theaters as $theatername) {
        $sel = $theatername == $theaterfile || $theatername == $_REQUEST['theater'] ? ' SELECTED' : '';
        echo "\t\t\t\t\t<option{$sel}>{$theatername}</option>\n";
    }
    echo "</select> ";
    echo "Version: <select name='version'>\n";
    foreach ($versions as $vid) {
        $sel = $vid == $version ? ' SELECTED' : '';
        echo "\t\t\t\t\t<option{$sel}>{$vid}</option>\n";
    }
    echo "</select> ";
    $curname = '-Current-';
    echo "<span class='beta'>Compare [BETA] ";
    echo "Theater: <select name='theater_compare'>\n";
    $cursel = isset($_REQUEST['theater_compare']) ? $_REQUEST['theater_compare'] : ($theaterfile == $theaterfile_compare ? $curname : $theaterfile_compare);
    array_unshift($theaters, $curname);
    foreach ($theaters as $tid) {
        $sel = $tid == $cursel ? ' SELECTED' : '';
        echo "<option{$sel}>{$tid}</option>\n";
    }
    array_shift($theaters);
    echo "</select> ";
    echo "Version: <select name='version_compare'>\n";
    $cursel = isset($_REQUEST['version_compare']) ? $_REQUEST['version_compare'] : ($version == $version_compare ? $curname : $version_compare);
    array_unshift($versions, $curname);
    foreach ($versions as $vid) {
        $sel = $vid == $cursel ? ' SELECTED' : '';
        echo "<option{$sel}>{$vid}</option>\n";
    }
    array_shift($versions);
    echo "</select>";
    echo "</span><br>\n";
    echo "\t\t\t\tRange: <input type='text' value='" . dist($range, 'IN', null, 0) . "' name='range'> <select name='range_unit'>\n";
    foreach ($range_units as $ru => $runame) {
        $sel = $range_unit == $ru ? ' SELECTED' : '';
        echo "\t\t\t\t\t<option{$sel} value='{$ru}'>{$runame}</option>\n";
    }
    echo "\t\t\t\t</select><br>\n";
    echo "\t\t\t\t<input type='submit' value='Parse'>\n\t\t\t</div>\n";
}
Пример #2
0
//Root Path Discovery
if (!isset($rootpath)) {
    do {
        $rd = isset($rd) ? dirname($rd) : realpath(dirname(__FILE__));
        $tp = "{$rd}/rootpath.php";
        if (file_exists($tp)) {
            require_once $tp;
            break;
        }
    } while ($rd != '/');
}
$title = "Jared Ballou's Insurgency Tools";
require_once "{$includepath}/header.php";
//User to pull the data for
$githubuser = '******';
startbody();
$content_file = "{$includepath}/content.yaml";
$content = Spyc::YAMLLoad($content_file);
echo "<div class='content-wrapper' style='margin: 10px;'>\n";
echo "<div class='content-heading'><h1>{$title}</h1>\n{$content['heading']}</div>\n";
foreach ($content['github']['repos'] as $name => $repo) {
    echo "<div class='content-section'>\n";
    echo "<div class='content-section-heading'><a name='{$name}' href='https://github.com/{$content['github']['user']}/{$name}' target='_blank'><h2>{$repo['title']}</h2></a></div>\n";
    echo "<div class='content-section-content'>{$repo['content']}</div>\n";
    echo "</div>\n";
}
echo "</div>\n";
require_once "{$includepath}/footer.php";
exit;
/*
exit;
Пример #3
0
function DisplayStatsHeader($startbody = 1)
{
    global $mod, $mod_compare, $mods, $theaterfile, $theaterfile_compare, $theaters, $version, $version_compare, $versions, $theaterpath, $theaterpath_compare, $range, $range_unit, $range_units;
    // Are we comparing two different items?
    $compare = $version != $version_compare || $mod != $mod_compare || $theaterfile != $theaterfile_compare;
    startbody();
    echo "\n\t\t<form action='{$_SERVER['PHP_SELF']}' method='get'>\n\t\t<div style='margin: 5px;'>\n\t\t\t<h1>Insurgency Theater Parser</h1>\n\t\t\t<h2>Viewing {$theaterfile} from {$mod} {$version}</h2>\n";
    if ($compare) {
        echo "<h2>Comparing to {$theaterfile_compare} from {$mod_compare} {$version_compare}</h2>\n";
    }
    // Mod/version/theater
    echo "<div>\n";
    DisplayModSelection();
    // Comparison Mod/version/theater
    echo "<div class='beta' style='float: right;'><b>Compare to another theater:</b> \n";
    DisplayModSelection(1);
    echo "</div>\n";
    echo "</div>\n";
    // Select range and units of measure
    echo "<div>\n";
    DisplayRangeSelection();
    echo "</div>\n";
    // Submit button
    echo "\t\t\t\t<input type='submit' value='Parse'>\n\t\t\t</div>\n";
}