コード例 #1
0
ファイル: puzzle.php プロジェクト: paultag/puzzle-editing
    echo "<div class='errormsg'>You do not have permission to view this puzzle.</div>";
    foot();
    exit(0);
}
// Record this user's visit (in two ways)
$lastVisit = updateLastVisit($uid, $pid);
if (!isEditorChief($uid) && !isCohesion($uid)) {
    addSpoiledUserQuietly($uid, $pid);
    if ($_GET['discuss'] && isEditorAvailable($uid, $pid) && !isEditorChief($uid)) {
        changeEditors($uid, $pid, array($uid), array());
    } 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)
コード例 #2
0
    header("Location: " . URL . "/puzzle.php?pid={$pid}");
    exit(0);
}
if (isset($_POST['changeFactcheckers'])) {
    $pid = $_POST['pid'];
    if (isset($_POST['addFactchecker'])) {
        $add = $_POST['addFactchecker'];
    } else {
        $add = NULL;
    }
    if (isset($_POST['removeFactchecker'])) {
        $remove = $_POST['removeFactchecker'];
    } else {
        $remove = NULL;
    }
    changeFactcheckers($uid, $pid, $add, $remove);
    header("Location: " . URL . "/puzzle.php?pid={$pid}");
    exit(0);
}
if (isset($_POST['changeAuthors'])) {
    $pid = $_POST['pid'];
    if (isset($_POST['addAuth'])) {
        $add = $_POST['addAuth'];
        subscribe($uid, $pid);
    } else {
        $add = NULL;
    }
    if (isset($_POST['removeAuth'])) {
        $remove = $_POST['removeAuth'];
        unsubscribe($uid, $pid);
    } else {