Location: PHPKode > projects > ProNuke. Postnuke To Oracle > postnuke/html/modules/NS-Your_Account/user/modules/changehome.php
<?php // $Id: changehome.php,v 1.4 2001/12/04 13:07:48 jgm Exp $
global $dbconn;
modules_get_language();

function edithome() {
    global $user, $userinfo, $Default_Theme;
    include ("header.php");
    getusrinfo($user);
    OpenTable();
    echo "<center><font class=\"pn-title\">"._HOMECONFIG."</font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    // nav();
    CloseTable();
    echo "<br>";
    if($userinfo['theme']=="") {
        $userinfo['theme'] = "$Default_Theme";
    }
    OpenTable();
    echo "<form action=\"user.php\" method=\"post\">"
    ."<font class=\"pn-normal\">"._NEWSINHOME." "._MAX127."</font> "
    ."<input type=\"text\" name=\"storynum\" size=\"3\" maxlength=\"3\" value=\"$userinfo[storynum]\">"
    ."<br><br>";
    if ($userinfo['ublockon']==1) {
        $sel = "checked";
    }
    echo "<input type=\"checkbox\" name=\"ublockon\" $sel>"
    ." <font class=\"pn-normal\">"._ACTIVATEPERSONAL."</font>"
    ."<br><font class=\"pn-normal\">"._CHECKTHISOPTION."</font>"
    ."<br><font class=\"pn-normal\">"._YOUCANUSEHTML."</font><br>"
    ."<textarea cols=\"55\" rows=\"5\" name=\"ublock\">$userinfo[ublock]</textarea>"
    ."<br><br>"
    ."<input type=\"hidden\" name=\"theme\" value=\"$userinfo[theme]\">"
    ."<input type=\"hidden\" name=\"uname\" value=\"$userinfo[uname]\">"
    ."<input type=\"hidden\" name=\"uid\" value=\"$userinfo[uid]\">"
    ."<input type=\"hidden\" name=\"op\" value=\"savehome\">"
    ."<input type=\"hidden\" name=\"module\" value=\"NS-ChangeHome\">"
    ."<input type=\"submit\" value=\""._SAVECHANGES."\">"
    ."</form>";
    CloseTable();
    include ("footer.php");
}

function savehome($uid, $uname, $theme, $storynum, $ublockon, $ublock)
{
    global $user, $cookie, $userinfo, $pntable, $dbconn;

    csrfcheck();

    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'");
    list($vuid, $ccpass) = $result->fields;
    if (($uid == $vuid) AND ($check2 == $ccpass)) {
        if (isset($ublockon)) {
            $ublockon=1;
        } else {
            $ublockon=0;
        }
        $ublock = FixQuotes($ublock);
        $column = &$pntable['users_column'];
        $dbconn->Execute("UPDATE $pntable[users] SET $column[storynum]='$storynum', $column[ublockon]='$ublockon', $column[ublock]='$ublock' 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?theme='.$theme);
    }
}

switch($op) 
{
    case "edithome": edithome();
             break;
    case "savehome": savehome($uid, $uname, $theme, $storynum, $ublockon, $ublock);
             break;

}

?>
Return current item: ProNuke. Postnuke To Oracle