Exemplo n.º 1
0
function changeNeededEditors($uid, $pid, $need)
{
    if (!canChangeEditorsNeeded($uid, $pid)) {
        utilsError("You do not have permission to change the number of needed editors.");
    }
    $sql = sprintf("UPDATE puzzle_idea SET needed_editors='%s' WHERE id='%s'", mysql_real_escape_string($need), mysql_real_escape_string($pid));
    query_db($sql);
}
Exemplo n.º 2
0
function displayEditors($uid, $pid)
{
    ?>
    <tr>
        <td class='peopleInfo'>
            <strong>Discussion Editors:</strong> <?php 
    $est = getEditorStatus($pid);
    echo $est[0];
    ?>
&nbsp;&nbsp;<a href="#" class="changeLink">[Change]</a>
            <!-- There was an if statement around this entire [change] block before, but non-authors should be able to add themselves as discussion editors, and authors should be able to change the number of discussion editors needed, so that's, like, everybody... -->
        </td>
    </tr>
    <tr>
        <td>
            <?php 
    if (canChangeEditorsNeeded($uid, $pid)) {
        ?>
            <div>
            <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;
        ?>
" />
                Change # of needed editors: <input type="text" name="needed_editors" value="<?php 
        echo getNeededEditors($pid);
        ?>
" class="shortin" /> <input type="submit" name="changeNeededEditors" value="Go" />
            </form>
            </div>
            <?php 
    }
    ?>
            <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 Discussion Editor(s):</strong></p>
                            <?php 
    echo displayRemoveEditor($pid, $uid);
    ?>
                        </td>
                        <td>
                            <p><strong>Add Discussion Editor(s):</strong></p>
                            <?php 
    echo displayAddEditor($pid, $uid);
    ?>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <input type="submit" name="changeEditors" value="Change Editors" />
                        </td>
                    </tr>
                </form>
            </table>
        </td>
    </tr>
<?php 
}