Пример #1
0
function getCommentTypeName($uid, $pid)
{
    if (isAuthorOnPuzzle($uid, $pid)) {
        return "Author";
    } else {
        if (isApproverOnPuzzle($uid, $pid)) {
            return "Approver";
        } else {
            if (isEditorOnPuzzle($uid, $pid)) {
                return "Discuss Editor";
            } else {
                if (isCohesion($uid)) {
                    return "Cohesion";
                } else {
                    if (isEditorChief($uid)) {
                        return "EIC";
                    } else {
                        if (isTesterOnPuzzle($uid, $pid)) {
                            return "Testsolver";
                        } else {
                            if (isDirector($uid)) {
                                return "Director";
                            } else {
                                if (isTestingAdminOnPuzzle($uid, $pid)) {
                                    return "TestingAdmin";
                                } else {
                                    if (isFactcheckerOnPuzzle($uid, $pid)) {
                                        return "Factchecker";
                                    } else {
                                        return NULL;
                                        // lurker or unknown, cannot comment
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Пример #2
0
function displayTags($uid, $pid)
{
    ?>
    <tr>
        <td class='peopleInfo'>
            <strong>Tags:</strong> <?php 
    echo getTagsAsList($pid);
    ?>
&nbsp;&nbsp;
    <?php 
    if (isCohesion($uid) || isEditorChief($uid) || isServerAdmin($uid)) {
        ?>
<a href="#" class="changeLink">[Change]</a>
        </td>
    </tr>
    <tr>
        <td>
            <table>
            <form method="post" action="form-submit.php">
                <input type="hidden" name="uid" value="<?php 
        echo $uid;
        ?>
" />
                <input type="hidden" name="pid" value="<?php 
        echo $pid;
        ?>
" />
                <tr>
                    <td>
                        <p><strong>Remove Tags:</strong></p>
                        <?php 
        echo displayRemoveTags($pid);
        ?>
                    </td>
                    <td>
                        <p><strong>Add Tags:</strong></p>
                        <?php 
        echo displayAddTags($pid);
        ?>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input type="submit" name="changeTags" value="Change Tags" />
                    </td>
                </tr>
            </form>
            </table>
    <?php 
    }
    ?>
        </td>
    </tr>
<?php 
}