function head($selnav = "", $title = -1) { if ($title == -1) { $title = fullTitle(); } $hunt = mktime(12, 17, 00, 1, HUNT_DOM, HUNT_YEAR); $now = time(); $timediff = abs($hunt - $now); $days = (int) ($timediff / (60 * 60 * 24)); $hrs = (int) ($timediff / (60 * 60)) - 24 * $days; $mins = (int) ($timediff / 60) - 24 * 60 * $days - 60 * $hrs; $cdmsg = ""; if ($now > $hunt) { $cdmsg = "after hunt started!!!"; $cdclass = "cunum"; } else { $cdmsg = "left until hunt."; $cdclass = "cdnum"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico" /> <!-- CSS --> <link rel="stylesheet" type="text/css" href="css/reset-min.css" /> <link rel="stylesheet" type="text/css" href="css/base-min.css" /> <link rel="stylesheet" type="text/css" href="css/fonts-min.css" /> <link rel="stylesheet" type="text/css" href="css/style.css" /> <?php if ($selnav == "people" || $selnav == "account") { ?> <link rel="stylesheet" type="text/css" href="css/profiles.css" /> <?php } ?> <title><?php echo $title; ?> </title> <script type='text/javascript' src='jquery-1.4.2.js'></script> <script type='text/javascript' src='jquery.tablesorter.min.js'></script> <script type="text/javascript" src='js.js'></script> </head> <body> <div id="container"> <div id="header"> <div id="top"> <div id="countdowndiv"> <span id="countdown"> <?php if ($days !== 0) { $daypl = $days === 1 ? "" : "s"; echo "<span class=\"{$cdclass}\">{$days}</span> day{$daypl}, "; } $hrpl = $hrs === 1 ? "" : "s"; echo "<span class=\"{$cdclass}\">{$hrs}</span> hour{$hrpl} and "; $minpl = $mins === 1 ? "" : "s"; echo "<span class=\"{$cdclass}\">{$mins}</span> minute{$minpl} {$cdmsg}"; ?> </span> </div> <div id="titlediv"> <h1><?php echo fullTitle(); ?> </h1> </div> <div id="logindiv"> <?php if (isset($_SESSION['uid'])) { echo 'Logged in as <strong>' . getUserUsername($_SESSION['uid']) . '</strong>'; echo '<a href="account.php"' . ($selnav == "account" ? ' class="accsel"' : "") . '>Your Account</a>'; if (MAILING_LISTS) { echo '<a href="mailinglists.php"' . ($selnav == "mailinglists" ? ' class="accsel"' : "") . '>Mailing Lists</a>'; } if (!TRUST_REMOTE_USER) { echo '<a href="logout.php">Logout</a>'; } } else { ?> <span class="notloggedin">Not logged in</span> <a href="login.php">Login</a> <?php } ?> </div> </div> <div id="navbar"> <ul class="nav"> <li class="nav"><a class="nav wikinav" target="_blank" href="<?php echo WIKI_URL; ?> ">Wiki</a></li> <?php echoNav($selnav == "home", "index.php", "Home", true); if (isset($_SESSION['uid'])) { $suid = $_SESSION['uid']; echoNav1($selnav, "people", "People", true); echoNav1($selnav, "admin", "Admin", isServerAdmin($suid)); echoNav1($selnav, "author", "Author", true); echoNav1($selnav, "roundcaptain", "Round Captain", USING_ROUND_CAPTAINS && isRoundCaptain($suid)); echoNav1($selnav, "spoiled", "Spoiled", true); echoNav1($selnav, "editor", "Discussion Editor", isEditor($suid)); echoNav1($selnav, "approver", "Approval Editor", USING_APPROVERS && (isApprover($suid) || isEditorChief($suid))); echoNav1($selnav, "testsolving", "Testsolving", true); // echoNav1($selnav, "factcheck", "Fact Check", true); echoNav1($selnav, "ffc", "Final Fact Check", true); echoNav1($selnav, "editorlist", "Editor List", isEditorChief($suid) || isServerAdmin($suid)); echoNav1($selnav, "testadmin", "Testing Admin", isTestingAdmin($suid)); echoNav1($selnav, "testsolveteams", "TS Team Assignments", USING_TESTSOLVE_TEAMS && isTestingAdmin($suid)); echoNav1($selnav, "answers", "Answers", canChangeAnswers($suid)); echoNav1($selnav, "allpuzzles", "All Puzzles", canSeeAllPuzzles($suid)); echoNav1($selnav, "editor-pick-special", "Puzzles Needing Help", true); } ?> </ul> </div> <div class="clear"></div> </div> <div id="body"> <?php }
<?php // vim:set ts=4 sw=4 sts=4 et: require_once "config.php"; require_once "html.php"; require_once "db-func.php"; require_once "utils.php"; // Redirect to the login page, if not logged in $uid = isLoggedIn(); // Start HTML head("testsolveteams"); // Check for permissions if (!isTestingAdmin($uid)) { echo "<div class='errormsg'>Sorry, you're not a testing admin.</div>"; foot(); exit(1); } echo "<h2>Testsolve Team Puzzle Assignments</h2>"; echo "<table>"; echo "<tr><th>Puzzle ID</th><th>TestSolve Team</th></tr>\n"; $puzzles = getPuzzleTeamsList(); foreach ($puzzles as $pid => $testteam) { echo "<tr><td>{$pid}</td>\n"; echo "<td><form method='post' action='form-submit.php'>\n"; echo "<input type='hidden' name='pid' value='{$pid}'>\n"; echo "<input type='hidden' name='notfrompuzzle' value='YES'>"; echo "<SELECT NAME='tid'>\n"; if ($testteam == NULL) { echo "<option value=''>"; } $testteams = getTestTeams();
} else { if ($_GET['approve'] && isApproverAvailable($uid, $pid) && !isEditorChief($uid)) { changeApprovers($uid, $pid, array($uid), array()); } else { if ($_GET['factcheck'] && isFactcheckerAvailable($uid, $pid) && !isEditorChief($uid)) { changeFactcheckers($uid, $pid, array($uid), array()); } } } } // If author is a blind tester, turn page background red if (isAnyAuthorBlind($pid)) { echo '<style type="text/css">html {background-color: #B00000;}</style>'; } // Hide puzzle info from testing admins, to prevent spoilage $hidePuzzleInfo = (isServerAdmin($uid) || isTestingAdmin($uid)) && !isAuthorOnPuzzle($uid, $pid) && !isEditorOnPuzzle($uid, $pid); // If Testing Admin, hide answer, summary, and description if ($hidePuzzleInfo) { echo '<style type="text/css">.hideFromTest {display: none;}</style>'; } // Get all information about the puzzle (from puzzle_idea table) $puzzleInfo = getPuzzleInfo($pid); // Edit the summary and description? if (isset($_GET['edit'])) { editTitleSummaryDescription($uid, $pid, $puzzleInfo['title'], $puzzleInfo['summary'], $puzzleInfo['description']); foot(); exit(0); } echo "<div class='puzzleInfo'>"; // Display puzzle number, title, answer, summary, description. displayPuzzleInfo($uid, $pid, $puzzleInfo);