Location: PHPKode > projects > ProNuke. Postnuke To Oracle > postnuke/html/modules/NS-Comments/user/modules/modifycomments.php
<?

global $dbconn;

modules_get_language();

function editcomm()
{
    global $user, $userinfo;
    include ("header.php");
    getusrinfo($user);
    OpenTable();
    echo "<center><font class=\"pn-title\">"._COMMENTSCONFIG."</font></center>";
    CloseTable();
    echo "<br>";
    echo "<br>";
    OpenTable();
    echo "<table cellpadding=\"8\" border=\"0\"><tr><td>"
        ."<form action=\"user.php\" method=\"post\">"
        ."<font class=\"pn-normal\">"._DISPLAYMODE."</font><br>"
        ."<select name=\"umode\">";
?>
    <option value="nocomments" <?php if ($userinfo['umode'] == 'nocomments') { echo "selected"; } ?>><?php echo _NOCOMMENTS ?>
    <option value="nested" <?php if ($userinfo['umode'] == 'nested') { echo "selected"; } ?>><?php echo _NESTED ?>
    <option value="flat" <?php if ($userinfo['umode'] == 'flat') { echo "selected"; } ?>><?php echo _FLAT ?>
    <option value="thread" <?php if (!isset($userinfo['umode']) || ($userinfo['umode']=="") || $userinfo['umode']=='thread') { echo "selected"; } ?>><?php echo _THREAD ?>
    </select>
    <br><br>
    <?php echo "<font class=\"pn-normal\">"._SORTORDER."</font><br>" ?>
    <select name="uorder">
    <option value="0" <?php if (!$userinfo['uorder']) { echo "selected"; } ?>><?php echo _OLDEST ?>
    <option value="1" <?php if ($userinfo['uorder']==1) { echo "selected"; } ?>><?php echo _NEWEST ?>
    <option value="2" <?php if ($userinfo['uorder']==2) { echo "selected"; } ?>><?php echo _HIGHEST ?>
    </select>
    <br><br>
    <?php echo "<font class=\"pn-normal\">"._THRESHOLD."</font>" ?>
    <?php echo "<font class=\"pn-normal\">"._COMMENTSWILLIGNORED."</font>" ?><br>
    <select name="thold">
    <option value="-1" <?php if ($userinfo['thold']==-1) { echo "selected"; } ?>>-1: <?php echo _UNCUT ?>
    <option value="0" <?php if ($userinfo['thold']==0) { echo "selected"; } ?>>0: <?php echo _EVERYTHING ?>
    <option value="1" <?php if ($userinfo['thold']==1) { echo "selected"; } ?>>1: <?php echo _FILTERMOSTANON ?>
    <option value="2" <?php if ($userinfo['thold']==2) { echo "selected"; } ?>>2: <?php echo _USCORE ?> +2
    <option value="3" <?php if ($userinfo['thold']==3) { echo "selected"; } ?>>3: <?php echo _USCORE ?> +3
    <option value="4" <?php if ($userinfo['thold']==4) { echo "selected"; } ?>>4: <?php echo _USCORE ?> +4
    <option value="5" <?php if ($userinfo['thold']==5) { echo "selected"; } ?>>5: <?php echo _USCORE ?> +5
    </select><br>
    <?php echo "<font class=\"pn-normal\">"._SCORENOTE."</font>" ?>
    <br><br>
    <INPUT type="checkbox" name="noscore" <?php if ($userinfo['noscore']==1) { echo "checked"; } ?>>
    <?php echo "<font class=\"pn-normal\">"._NOSCORES."</font>" ?> <?php echo "<font class=\"pn-normal\">"._HIDDESCORES."</font>" ?>
    <br><br>
    <?php echo "<font class=\"pn-normal\">"._MAXCOMMENT."</font>" ?> <?php echo "<font class=\"pn-normal\">"._TRUNCATES."</font>" ?><br>
    <input type="text" name="commentmax" value="<?php echo $userinfo['commentmax'] ?>" size=11 maxlength=11> <?php echo "<font class=\"pn-normal\">"._BYTESNOTE."</font>" ?>
    <br><br>
    <input type="hidden" name="uname" value="<?php echo"$userinfo[uname]"; ?>">
    <input type="hidden" name="uid" value="<?php echo"$userinfo[uid]"; ?>">
    <input type="hidden" name="op" value="savecomm">
    <input type="submit" value="<?php echo _SAVECHANGES ?>">
    </form></td></tr></table>
<?php
    CloseTable();
    echo "<br><br>";
    include ("footer.php");
}

function savecomm($uid, $uname, $umode, $uorder, $thold, $noscore, $commentmax)
{
    global $user, $cookie, $userinfo, $pntable, $dbconn;
    cookiedecode($user);
    $check = $cookie[1];
    $check2 = $cookie[2];
    $column = &$pntable['users_column'];
    $result = $dbconn->Execute("SELECT $column[uid], $column[pass] FROM $pntable[users] WHERE $column[uname]='$check'");
//ADODBtag list+row
    list($vuid, $ccpass) = $result->fields;
    if (($uid == $vuid) AND ($check2 == $ccpass)) {
        if(isset($noscore)) {
            $noscore = 1;
        } else {
            $noscore = 0;
        }
        $column = &$pntable['users_column'];
        $dbconn->Execute("UPDATE $pntable[users] SET $column[umode]='$umode', $column[uorder]='$uorder', $column[thold]='$thold', $column[noscore]='$noscore', $column[commentmax]='$commentmax' WHERE $column[uid]=$uid");
        getusrinfo($user);
        docookie($userinfo[uid],$userinfo[uname],$userinfo[pass],$userinfo[storynum],$userinfo[umode],$userinfo[uorder],$userinfo[thold],$userinfo[noscore],$userinfo[ublockon],$userinfo[theme],$userinfo[commentmax]);
        pnRedirect('user.php');
    }
}

switch ($op) {
        case "editcomm":
                editcomm();
                break;
        case "savecomm":
                 savecomm($uid, $uname, $umode, $uorder, $thold, $noscore, $commentmax);
                break;

}

?>
Return current item: ProNuke. Postnuke To Oracle