mirror of
https://github.com/Xkeeper0/jul.git
synced 2025-05-19 00:30:21 -07:00
Fixed dateformat crap (#2) and cleaned up edituser
edituser.php - Fixed '-removing bug in dateformat code - Fixed long-standing issue involving auto-updating layout selection - Made the page's code less compressed. This actually doubled the file size, unsurprisingly. The power of whitespace. - Fixed dateformat field being filled with the default if the user's setting was blank - Made the form creation code only run when the form is actually being used - Oh god, never again editprofile.php clea-- haha, no. Not even going to touch that mess
This commit is contained in:
parent
919f707732
commit
60402a0c0d
2
.gitignore
vendored
2
.gitignore
vendored
@ -11,7 +11,7 @@ ext/
|
||||
irc/
|
||||
|
||||
# Themeing
|
||||
images/*.*
|
||||
images/*
|
||||
numgfx/*
|
||||
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
require 'lib/function.php';
|
||||
require 'lib/layout.php';
|
||||
if(!$log) errorpage('You must be logged in to edit your profile.');
|
||||
if($_GET['lol'] || ($loguserid == 1420)) errorpage('<div style="position: fixed; top: 0; left: 0; width: 100%; height: 100%;"><object width="100%" height="100%"><param name="movie" value="http://www.youtube.com/v/lSNeL0QYfqo&hl=en_US&fs=1&color1=0x2b405b&color2=0x6b8ab6&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/lSNeL0QYfqo&hl=en_US&fs=1&color1=0x2b405b&color2=0x6b8ab6&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="100%" height="100%"></embed></object></div>');
|
||||
if($banned) errorpage('Sorry, but banned users arent allowed to edit their profile.');
|
||||
if($loguser['profile_locked'] == 1) {
|
||||
errorpage("You are not allowed to edit your profile.");
|
||||
@ -144,9 +143,9 @@
|
||||
$tccell1><b>Timezone offset:$descbr How many hours you're offset from the time on the board (".date($dateformat,ctime()).").</td>
|
||||
$tccell2l>$inpt=timezone VALUE=$loguser[timezone] SIZE=5 MAXLENGTH=5><tr>
|
||||
$tccell1><b>Date format:$descbr How dates on the board are displayed (uses the <a href='http://php.net/manual/en/function.date.php'>PHP date()</a> function).</td>
|
||||
$tccell2l>$inpt=dateformat VALUE=\"$dateformat\" SIZE=16 MAXLENGTH=32><tr>
|
||||
$tccell2l>$inpt=dateformat VALUE=\"". $user['dateformat'] ."\" SIZE=16 MAXLENGTH=32><tr>
|
||||
$tccell1><b>Short date format:$descbr A short date format displayed on certain pages.</td>
|
||||
$tccell2l>$inpt=dateshort VALUE=\"$dateshort\" SIZE=8 MAXLENGTH=32><tr>
|
||||
$tccell2l>$inpt=dateshort VALUE=\"". $user['dateshort'] ."\" SIZE=8 MAXLENGTH=32><tr>
|
||||
$tccell1><b>Posts per page:$descbr The maximum number of posts you want to be shown in a page in threads.</td>
|
||||
$tccell2l>$inpt=postsperpage SIZE=4 MAXLENGTH=4 VALUE=$loguser[postsperpage]><tr>
|
||||
$tccell1><b>Threads per page:$descbr The maximum number of threads you want to be shown in a page in forums.</td>
|
||||
@ -218,8 +217,8 @@
|
||||
}
|
||||
if(!isset($useranks)) $useranks=$loguser[useranks];
|
||||
|
||||
$dateformat = str_replace("'", "", $_POST['dateformat']);
|
||||
$dateshort = str_replace("'", "", $_POST['dateshort']);
|
||||
$dateformat = $_POST['dateformat'];
|
||||
$dateshort = $_POST['dateshort'];
|
||||
|
||||
mysql_query("UPDATE users SET `password` = '$passwordenc', `picture` = '$picture', `minipic` = '$minipic', `signature` = '$signature', `bio` = '$bio', `email` = '$email', `icq` = '$icq', `title` = '$title', `useranks` = '$useranks', `aim` = '$aim', `sex` = '$sex', `homepageurl` = '$homepage', `homepagename` = '$pagename', `timezone` = '$timezone', `dateformat` = '$dateformat', `dateshort` = '$dateshort', `postsperpage` = '$postsperpage', `realname` = '$realname', `location` = '$location', `postbg` = '$postbg', `postheader` = '$postheader', `birthday` = '$birthday', `scheme` = '$sscheme', `threadsperpage` = '$threadsperpage', `viewsig` = '$viewsig', `layout` = '$tlayout', `moodurl` = '". $_POST['moodurl'] ."', `posttool` = '$posttool', `imood` = '$imood', `signsep` = '$signsep', `pagestyle` = '$pagestyle', `pollstyle` = '$pollstyle' WHERE `id` = '$loguserid' AND `password` = '$userpass'") OR print mysql_error();
|
||||
|
||||
|
443
edituser.php
443
edituser.php
@ -1,183 +1,278 @@
|
||||
<?php
|
||||
|
||||
require 'lib/function.php';
|
||||
require 'lib/layout.php';
|
||||
require 'lib/function.php';
|
||||
require 'lib/layout.php';
|
||||
|
||||
|
||||
if ($_GET['id'] == 650 && false) {
|
||||
print "$header
|
||||
<br>
|
||||
$tblstart
|
||||
<tr>$tccellh><b>Error</b>
|
||||
<tr>$tccell1> <br>
|
||||
Sorry, this user is too much of a pompous dickhead to have his profile edited! :(<br><br><a href=/>Back to index!</a>
|
||||
<br> $tblend$footer";
|
||||
die();
|
||||
}
|
||||
print $header;
|
||||
|
||||
if(!$isadmin) die();
|
||||
if (!$isadmin) {
|
||||
// TODO: Better error message formatting. Or not.
|
||||
print "No.";
|
||||
print $footer;
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
$user=@mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id=$id"));
|
||||
print $header;
|
||||
$check1[$user[powerlevel]+1]='selected';
|
||||
$check2[$user[sex]]='checked=1';
|
||||
$check3[$user[useranks]]='checked=1';
|
||||
$check4[$user[profile_locked]]='checked=1';
|
||||
$check5[$user[editing_locked]]='checked=1';
|
||||
$checked2[$user[viewsig]]='checked=1';
|
||||
$checked3[$user[posttool]]='checked=1';
|
||||
$plocking="
|
||||
$radio=profile_locked value=1 $check4[1]>Locked
|
||||
$radio=profile_locked value=0 $check4[0]>Unlocked";
|
||||
$elocking="
|
||||
$radio=editing_locked value=1 $check5[1]>Locked
|
||||
$radio=editing_locked value=0 $check5[0]>Unlocked";
|
||||
$levellist="
|
||||
<select name=powerlevel>
|
||||
<option value=-1 $check1[0]>Banned</option>
|
||||
<option value=0 $check1[1]>Normal</option>
|
||||
<option value=1 $check1[2]>Normal +</option>
|
||||
<option value=2 $check1[3]>Moderator</option>
|
||||
<option value=3 $check1[4]>Administrator</option>
|
||||
<option value=4 $check1[5]>Administrator (invisible)</option>
|
||||
</select>";
|
||||
$sexlist="
|
||||
$radio=sex value=0 $check2[0]>Male   
|
||||
$radio=sex value=1 $check2[1]>Female   
|
||||
$radio=sex value=2 $check2[2]>N/A
|
||||
$radio=sex value=-378>Raw value<br>
|
||||
$inpt=sexn value=$user[sex]>";
|
||||
$vsig="
|
||||
$radio=viewsig value=0 $checked2[0]>Disabled   
|
||||
$radio=viewsig value=1 $checked2[1]>Enabled   
|
||||
$radio=viewsig value=1 $checked2[2]>Auto-updating";
|
||||
$vtool="
|
||||
$radio=posttool value=0 $checked3[0]>Disabled   
|
||||
$radio=posttool value=1 $checked3[1]>Enabled";
|
||||
$birthday=getdate($user[birthday]);
|
||||
if($user[birthday]){
|
||||
$month=$birthday[mon];
|
||||
$day=$birthday[mday];
|
||||
$year=$birthday[year];
|
||||
}
|
||||
$schemes=mysql_query('SELECT id,name FROM schemes ORDER BY ord');
|
||||
while($sch=mysql_fetch_array($schemes)){
|
||||
$sel='';
|
||||
if($sch[id]==$user[scheme]) $sel=' selected';
|
||||
$used=mysql_result(mysql_query("SELECT count(id) as cnt FROM users WHERE scheme=$sch[id]"),0,'cnt');
|
||||
$schlist.="<option value=$sch[id]$sel>$sch[name] ($used)";
|
||||
}
|
||||
$schlist="<select name=sscheme>$schlist</select>";
|
||||
$tlayouts=mysql_query('SELECT id,name FROM tlayouts ORDER BY ord');
|
||||
while($lay=mysql_fetch_array($tlayouts)){
|
||||
$sel="";
|
||||
if($lay[id]==$user[layout]) $sel=' selected';
|
||||
$used=mysql_result(mysql_query("SELECT count(id) as cnt FROM users WHERE layout=$lay[id]"),0,'cnt');
|
||||
$laylist.="<option value=$lay[id]$sel>$lay[name] ($used)";
|
||||
}
|
||||
$laylist="<select name=tlayout>$laylist</select>";
|
||||
$rsets=mysql_query('SELECT id,name FROM ranksets ORDER BY id');
|
||||
while($set=mysql_fetch_array($rsets)){
|
||||
$sel=($set[id]==$user[useranks]?' selected':'');
|
||||
$used=mysql_result(mysql_query("SELECT count(*) FROM users WHERE useranks=$set[id]"),0,0);
|
||||
$rsetlist.="<option value=$set[id]$sel>$set[name] ($used)";
|
||||
}
|
||||
$rsetlist="<select name=useranks>$rsetlist</select>";
|
||||
if(!$_POST[action] and $log){
|
||||
$lft="<tr>$tccell1><b>";
|
||||
$rgt=":</td>$tccell2l>";
|
||||
$hlft="<tr>$tccellh>";
|
||||
$hrgt="</td>$tccellh> </td>";
|
||||
squot(0,$user[name]);
|
||||
squot(0,$user[title]);
|
||||
// squot(1,$user[minipic]);
|
||||
// squot(1,$user[picture]);
|
||||
squot(0,$user[realname]);
|
||||
squot(0,$user[location]);
|
||||
// squot(1,$user[aim]);
|
||||
// squot(1,$user[imood]);
|
||||
// squot(1,$user[email]);
|
||||
// squot(1,$user[homepageurl]);
|
||||
squot(0,$user[homepagename]);
|
||||
sbr(1, $user[bio]);
|
||||
sbr(1, $user[signature]);
|
||||
sbr(1, $user[postheader]);
|
||||
print "
|
||||
<br>
|
||||
$tblstart
|
||||
<FORM ACTION=edituser.php NAME=REPLIER METHOD=POST>
|
||||
$hlft Login information $hrgt
|
||||
$lft User name $rgt$inpt=username VALUE=\"$user[name]\" SIZE=25 MAXLENGTH=25>
|
||||
$lft Password $rgt$inpp=password VALUE=\"\" SIZE=13 MAXLENGTH=32>
|
||||
$hlft Administrative bells and whistles $hrgt
|
||||
$lft Power level $rgt$levellist
|
||||
$lft Custom title $rgt$inpt=usertitle VALUE=\"$user[title]\" SIZE=60 MAXLENGTH=255>
|
||||
$lft Rank set $rgt$rsetlist
|
||||
$lft Number of posts $rgt$inpt=numposts SIZE=5 MAXLENGTH=10 VALUE=$user[posts]>
|
||||
$lft Registration time:</b>$smallfont<br>(seconds since ".date($dateformat,$tzoff).")</td>$tccell2l>$inpt=regtime SIZE=10 MAXLENGTH=15 VALUE=$user[regdate]><tr>
|
||||
$lft Lock Profile $rgt$plocking
|
||||
$lft Restrict Editing $rgt$elocking
|
||||
$hlft Appearance $hrgt
|
||||
$lft Mini picture $rgt$inpt=minipic VALUE=\"$user[minipic]\" SIZE=60 MAXLENGTH=100>
|
||||
$lft User picture $rgt$inpt=picture VALUE=\"$user[picture]\" SIZE=60 MAXLENGTH=100>
|
||||
$lft Mood avatar $rgt$inpt=moodurl VALUE=\"$user[moodurl]\" SIZE=60 MAXLENGTH=100>
|
||||
$lft Post background $rgt$inpt=postbg VALUE=\"$user[postbg]\" SIZE=60 MAXLENGTH=100>
|
||||
$lft Post header $rgt$txta=postheader ROWS=5 COLS=60>". htmlspecialchars($user[postheader]) ."</TEXTAREA>
|
||||
$lft Signature $rgt$txta=signature ROWS=5 COLS=60>". htmlspecialchars($user[signature]) ."</TEXTAREA>
|
||||
$hlft Personal information $hrgt
|
||||
$lft Sex $rgt$sexlist
|
||||
$lft Real name $rgt$inpt=realname VALUE=\"$user[realname]\" SIZE=40 MAXLENGTH=60>
|
||||
$lft Location $rgt$inpt=location VALUE=\"$user[location]\" SIZE=40 MAXLENGTH=60>
|
||||
$lft Birthday $rgt Month: $inpt=bmonth SIZE=2 MAXLENGTH=2 VALUE=$month> Day: $inpt=bday SIZE=2 MAXLENGTH=2 VALUE=$day> Year: $inpt=byear SIZE=4 MAXLENGTH=4 VALUE=$year>
|
||||
$lft Bio $rgt$txta=bio ROWS=5 COLS=60>". htmlspecialchars($user[bio]) ."</TEXTAREA>
|
||||
$hlft Online services $hrgt
|
||||
$lft Email address $rgt$inpt=email VALUE=\"$user[email]\" SIZE=60 MAXLENGTH=60>
|
||||
$lft AIM screen name $rgt$inpt=aim VALUE=\"$user[aim]\" SIZE=30 MAXLENGTH=30>
|
||||
$lft ICQ number $rgt$inpt=icq SIZE=10 MAXLENGTH=10 VALUE=$user[icq]>
|
||||
$lft Homepage title $rgt$inpt=pagename VALUE=\"$user[homepagename]\" SIZE=60 MAXLENGTH=80>
|
||||
$lft Homepage URL $rgt$inpt=homepage VALUE=\"$user[homepageurl]\" SIZE=60 MAXLENGTH=80>
|
||||
$hlft Options $hrgt
|
||||
$lft Timezone offset $rgt$inpt=timezone SIZE=5 MAXLENGTH=5 VALUE=$user[timezone]>
|
||||
$lft Date format $rgt$inpt=dateformat VALUE=\"$dateformat\" SIZE=16 MAXLENGTH=32>
|
||||
$lft Short date format $rgt$inpt=dateshort VALUE=\"$dateshort\" SIZE=8 MAXLENGTH=32>
|
||||
$lft Posts per page $rgt$inpt=postsperpage SIZE=5 MAXLENGTH=5 VALUE=$user[postsperpage]>
|
||||
$lft Threads per page $rgt$inpt=threadsperpage SIZE=4 MAXLENGTH=4 VALUE=$user[threadsperpage]>
|
||||
$lft Use text toolbar when posting $rgt$vtool
|
||||
$lft View signatures and post headers $rgt$vsig
|
||||
$lft Thread layout $rgt$laylist
|
||||
$lft Color scheme / layout $rgt$schlist
|
||||
$lft  </td>$tccell2l>
|
||||
$inph=action VALUE=saveprofile>
|
||||
$inph=userid VALUE=$id>
|
||||
$inps=submit VALUE=\"Edit profile\"></td></FORM>
|
||||
$tblend
|
||||
";
|
||||
}
|
||||
if($_POST[action]=='saveprofile'){
|
||||
sbr(0,$signature);
|
||||
sbr(0,$bio);
|
||||
sbr(0,$postheader);
|
||||
$minipic = htmlspecialchars($minipic);
|
||||
$avatar = htmlspecialchars($avatar);
|
||||
$birthday=@mktime(0,0,0,$bmonth,$bday,$byear);
|
||||
if(!$bmonth && !$bday && !$byear) $birthday=0;
|
||||
if($password) $passedit=", `password` = '".md5($password)."'";
|
||||
//mysql_query("INSERT logs SET useraction ='Edit User ".$user[nick]."(".$user[id]."'");
|
||||
if ($sex == -378) {
|
||||
$sex = $sexn;
|
||||
$user = $sql -> fetchq("SELECT * FROM `users` WHERE `id`='$id'");
|
||||
|
||||
|
||||
|
||||
if (!$_POST['action']) {
|
||||
|
||||
// Generate layout + options
|
||||
$check1[$user['powerlevel']] = "selected='selected'";
|
||||
$check2[$user['sex']] = "checked='1'";
|
||||
$check3[$user['useranks']] = "checked='1'";
|
||||
$check4[$user['profile_locked']] = "checked='1'";
|
||||
$check5[$user['editing_locked']] = "checked='1'";
|
||||
$checked2[$user['viewsig']] = "checked='1'";
|
||||
$checked3[$user['posttool']] = "checked='1'";
|
||||
|
||||
// Why are these in reverse order, anyway
|
||||
$plocking = "
|
||||
<label for='plock1' style='margin-right: 2em;'>$radio=profile_locked id='plock1' value='1' $check4[1]>Locked</label>
|
||||
<label for='plock0' style='margin-right: 2em;'>$radio=profile_locked id='plock0' value='0' $check4[0]>Unlocked</label>
|
||||
";
|
||||
|
||||
$elocking = "
|
||||
<label for='elock1' style='margin-right: 2em;'>$radio=editing_locked id='elock1' value='1' $check5[1]>Locked</label>
|
||||
<label for='elock0' style='margin-right: 2em;'>$radio=editing_locked id='elock0' value='0' $check5[0]>Unlocked</label>
|
||||
";
|
||||
|
||||
$levellist = "
|
||||
<select name=powerlevel>
|
||||
<option value='-1' {$check1['-1']}>Banned</option>
|
||||
<option value='0' $check1[0]>Normal</option>
|
||||
<option value='1' $check1[1]>Normal +</option>
|
||||
<option value='2' $check1[2]>Moderator</option>
|
||||
<option value='3' $check1[3]>Administrator</option>
|
||||
<option value='4' $check1[4]>Administrator (invisible)</option>
|
||||
</select>
|
||||
";
|
||||
|
||||
$sexlist = "
|
||||
<label for='sex0' style='margin-right: 2em;'>$radio='sex' id='sex0' value='0' $check2[0]>Male</label>
|
||||
<label for='sex1' style='margin-right: 2em;'>$radio='sex' id='sex1' value='1' $check2[1]>Female</label>
|
||||
<label for='sex2' style='margin-right: 2em;'>$radio='sex' id='sex2' value='2' $check2[2]>N/A</label>
|
||||
<label for='sexr'>$radio='sex' id='sexr' value='-378'>Raw value</label>: $inpt='sexn' value=$user[sex]>
|
||||
";
|
||||
|
||||
$vsig = "
|
||||
<label for='viewsig0' style='margin-right: 2em;'>$radio='viewsig' id='viewsig0' value=0 $checked2[0]>Disabled</label>
|
||||
<label for='viewsig1' style='margin-right: 2em;'>$radio='viewsig' id='viewsig1' value=1 $checked2[1]>Enabled</label>
|
||||
<label for='viewsig2' style='margin-right: 2em;'>$radio='viewsig' id='viewsig2' value=2 $checked2[2]>Auto-updating</label>
|
||||
";
|
||||
|
||||
$vtool = "
|
||||
<label for='posttool0' style='margin-right: 2em;'>$radio='posttool' id='posttool1' value='0' $checked3[0]>Disabled   
|
||||
<label for='posttool1' style='margin-right: 2em;'>$radio='posttool' id='posttool1' value='1' $checked3[1]>Enabled
|
||||
";
|
||||
|
||||
if ($user['birthday']) {
|
||||
$birthday = getdate($user['birthday']);
|
||||
$month = $birthday['mon'];
|
||||
$day = $birthday['mday'];
|
||||
$year = $birthday['year'];
|
||||
} else {
|
||||
$month = "";
|
||||
$day = "";
|
||||
$year = "";
|
||||
}
|
||||
|
||||
|
||||
# TODO: Combine this whole thing into one query with the magic of GROUP BY
|
||||
$schemes = $sql -> query("SELECT `id`, `name` FROM `schemes` ORDER BY `ord`");
|
||||
while ($sch = $sql -> fetch($schemes)) {
|
||||
$sel = ($sch['id'] == $user['scheme']) ? "selected='selected'" : "";
|
||||
$used = $sql -> resultq("SELECT COUNT(`id`) cnt FROM `users` WHERE `scheme` = '$sch[id]'");
|
||||
$schlist .= "
|
||||
<option value='$sch[id]' $sel>$sch[name] ($used)</option>
|
||||
";
|
||||
}
|
||||
$schlist = "
|
||||
<select name=sscheme>
|
||||
$schlist
|
||||
</select>
|
||||
";
|
||||
|
||||
|
||||
|
||||
$tlayouts = $sql -> query("SELECT `id`, `name` FROM `tlayouts` ORDER BY `ord`");
|
||||
while ($lay = $sql -> fetch($tlayouts)) {
|
||||
$sel = ($lay['id'] == $user['layout']) ? "selected='selected'" : "";
|
||||
$used = $sql -> resultq("SELECT COUNT(`id`) FROM `users` WHERE `layout` = '$lay[id]'");
|
||||
$laylist .= "
|
||||
<option value='$lay[id]' $sel>$lay[name] ($used)</option>
|
||||
";
|
||||
}
|
||||
$laylist = "
|
||||
<select name='tlayout'>
|
||||
$laylist
|
||||
</select>
|
||||
";
|
||||
|
||||
|
||||
$rsets = $sql -> query("SELECT `id`, `name` FROM `ranksets` ORDER BY `id`");
|
||||
while ($set = $sql -> fetch($rsets)) {
|
||||
$sel = ($set['id'] == $user['useranks']) ? "selected='selected'" : "";
|
||||
$used = $sql -> resultq("SELECT COUNT(*) FROM `users` WHERE `useranks` = '$set[id]'");
|
||||
$rsetlist .= "
|
||||
<option value='$set[id]' $sel>$set[name] ($used)</option>
|
||||
";
|
||||
}
|
||||
$rsetlist = "
|
||||
<select name='useranks'>
|
||||
$rsetlist
|
||||
</select>
|
||||
";
|
||||
|
||||
|
||||
$lft = "<tr>$tccell1><b>";
|
||||
$rgt = ":</td>$tccell2l>";
|
||||
$hlft = "<tr>$tccellh>";
|
||||
$hrgt = "</td>$tccellh> </td>";
|
||||
squot(0,$user['name']);
|
||||
squot(0,$user['title']);
|
||||
squot(0,$user['realname']);
|
||||
squot(0,$user['location']);
|
||||
squot(0,$user['homepagename']);
|
||||
sbr(1, $user['bio']);
|
||||
sbr(1, $user['signature']);
|
||||
sbr(1, $user['postheader']);
|
||||
print "
|
||||
<br>
|
||||
<form action='edituser.php' method='post'>
|
||||
$tblstart
|
||||
$hlft Login information $hrgt
|
||||
$lft User name $rgt $inpt=username value=\"$user[name]\" size=25 maxlength=25>
|
||||
$lft Password $rgt $inpp=password value=\"\" size=13 maxlength=32>
|
||||
|
||||
$hlft Administrative bells and whistles $hrgt
|
||||
$lft Power level $rgt $levellist
|
||||
$lft Custom title $rgt $inpt=usertitle value=\"$user[title]\" size=60 maxlength=255>
|
||||
$lft Rank set $rgt $rsetlist
|
||||
$lft Number of posts $rgt $inpt=numposts size=5 maxlength=10 value=$user[posts]>
|
||||
$lft Registration time:</b>$smallfont<br>(seconds since ".date($dateformat,$tzoff).")</td>$tccell2l>$inpt=regtime size=10 maxlength=15 value=$user[regdate]><tr>
|
||||
$lft Lock Profile $rgt $plocking
|
||||
$lft Restrict Editing $rgt $elocking
|
||||
|
||||
$hlft Appearance $hrgt
|
||||
$lft Mini picture $rgt $inpt=minipic value=\"$user[minipic]\" size=60 maxlength=100>
|
||||
$lft User picture $rgt $inpt=picture value=\"$user[picture]\" size=60 maxlength=100>
|
||||
$lft Mood avatar $rgt $inpt=moodurl value=\"$user[moodurl]\" size=60 maxlength=100>
|
||||
$lft Post background $rgt $inpt=postbg value=\"$user[postbg]\" size=60 maxlength=100>
|
||||
$lft Post header $rgt $txta=postheader rows=5 cols=60>". htmlspecialchars($user[postheader]) ."</textarea>
|
||||
$lft Signature $rgt $txta=signature rows=5 cols=60>". htmlspecialchars($user[signature]) ."</textarea>
|
||||
|
||||
$hlft Personal information $hrgt
|
||||
$lft Sex $rgt $sexlist
|
||||
$lft Real name $rgt $inpt=realname value=\"$user[realname]\" size=40 maxlength=60>
|
||||
$lft Location $rgt $inpt=location value=\"$user[location]\" size=40 maxlength=60>
|
||||
$lft Birthday $rgt Month: $inpt=bmonth size=2 maxlength=2 value=$month>
|
||||
Day: $inpt=bday size=2 maxlength=2 value=$day>
|
||||
Year: $inpt=byear size=4 maxlength=4 value=$year>
|
||||
$lft Bio $rgt $txta=bio rows=5 cols=60>". htmlspecialchars($user[bio]) ."</textarea>
|
||||
|
||||
$hlft Online services $hrgt
|
||||
$lft Email address $rgt $inpt=email value=\"$user[email]\" size=60 maxlength=60>
|
||||
$lft AIM screen name $rgt $inpt=aim value=\"$user[aim]\" size=30 maxlength=30>
|
||||
$lft ICQ number $rgt $inpt=icq size=10 maxlength=10 value=$user[icq]>
|
||||
$lft Homepage title $rgt $inpt=pagename value=\"$user[homepagename]\" size=60 maxlength=80>
|
||||
$lft Homepage URL $rgt $inpt=homepage value=\"$user[homepageurl]\" size=60 maxlength=80>
|
||||
|
||||
$hlft Options $hrgt
|
||||
$lft Timezone offset $rgt $inpt=timezone size=5 maxlength=5 value=$user[timezone]>
|
||||
$lft Date format $rgt $inpt=dateformat value=\"". $user['dateformat'] ."\" size=16 maxlength=32>
|
||||
$lft Short date format $rgt $inpt=dateshort value=\"". $user['dateshort'] ."\" size=8 maxlength=32>
|
||||
$lft Posts per page $rgt $inpt=postsperpage size=5 maxlength=5 value=$user[postsperpage]>
|
||||
$lft Threads per page $rgt $inpt=threadsperpage size=4 maxlength=4 value=$user[threadsperpage]>
|
||||
$lft Use post toolbar $rgt $vtool
|
||||
$lft View post layouts $rgt $vsig
|
||||
$lft Thread layout $rgt $laylist
|
||||
$lft Color scheme $rgt $schlist
|
||||
|
||||
$lft </td> $tccell2l>
|
||||
$inph=action value='saveprofile'>
|
||||
$inph=userid value='$id'>
|
||||
$inps=submit value='Edit profile'></td>
|
||||
|
||||
$tblend
|
||||
</form>
|
||||
";
|
||||
|
||||
|
||||
|
||||
} elseif ($_POST['action'] == "saveprofile") {
|
||||
|
||||
sbr(0, $signature);
|
||||
sbr(0, $bio);
|
||||
sbr(0, $postheader);
|
||||
$minipic = htmlspecialchars($minipic);
|
||||
$avatar = htmlspecialchars($avatar);
|
||||
|
||||
if (!$bmonth || !$bday || !$byear) {
|
||||
$birthday = 0;
|
||||
} else {
|
||||
$birthday = mktime(0, 0, 0, $bmonth, $bday, $byear);
|
||||
}
|
||||
|
||||
if ($password) {
|
||||
$passedit="`password` = '".md5($password)."', ";
|
||||
}
|
||||
|
||||
if ($sex == -378) {
|
||||
$sex = $sexn;
|
||||
}
|
||||
|
||||
$sql -> query("
|
||||
UPDATE `users`
|
||||
SET `posts` = '$numposts',
|
||||
`regdate` = '$regtime',
|
||||
`name` = '$username',
|
||||
$passedit
|
||||
`picture` = '$picture',
|
||||
`signature` = '$signature',
|
||||
`bio` = '$bio',
|
||||
`powerlevel` = '$powerlevel',
|
||||
`title` = '$usertitle',
|
||||
`email` = '$email',
|
||||
`icq` = '$icq',
|
||||
`aim` = '$aim',
|
||||
`sex` = '$sex',
|
||||
`homepageurl` = '$homepage',
|
||||
`timezone` = '$timezone',
|
||||
`dateformat` = '$dateformat',
|
||||
`dateshort` = '$dateshort',
|
||||
`postsperpage` = '$postsperpage',
|
||||
`realname` = '$realname',
|
||||
`location` = '$location',
|
||||
`postbg` = '$postbg',
|
||||
`postheader` = '$postheader',
|
||||
`useranks` = '$useranks',
|
||||
`birthday` = '$birthday',
|
||||
`minipic` = '$minipic',
|
||||
`homepagename` = '$pagename',
|
||||
`scheme` = '$sscheme',
|
||||
`threadsperpage` = '$threadsperpage',
|
||||
`viewsig` = '$viewsig',
|
||||
`layout` = '$tlayout',
|
||||
`posttool` = '$posttool',
|
||||
`moodurl` = '$moodurl',
|
||||
`profile_locked` = '$profile_locked',
|
||||
`editing_locked` = '$editing_locked'
|
||||
|
||||
WHERE `id` = '$userid'
|
||||
") or print mysql_error();
|
||||
|
||||
print "
|
||||
$tblstart
|
||||
$tccell1>Thank you, $loguser[name], for editing this user.<br>
|
||||
". redirect("index.php","return to the board", 0) ."
|
||||
$tblend";
|
||||
}
|
||||
|
||||
$dateformat = str_replace("'", "", $_POST['dateformat']);
|
||||
$dateshort = str_replace("'", "", $_POST['dateshort']);
|
||||
|
||||
mysql_query("UPDATE `users` SET `posts` = '$numposts', `regdate` = '$regtime', `name` = '$username'$passedit, `picture` = '$picture', `signature` = '$signature', `bio` = '$bio', `powerlevel` = '$powerlevel', `title` = '$usertitle', `email` = '$email', `icq` = '$icq', `aim` = '$aim', `sex` = '$sex', `homepageurl` = '$homepage', `timezone` = '$timezone', `dateformat` = '$dateformat', `dateshort` = '$dateshort', `postsperpage` = '$postsperpage', `realname` = '$realname', `location` = '$location', `postbg` = '$postbg', `postheader` = '$postheader', `useranks` = '$useranks', `birthday` = '$birthday', `minipic` = '$minipic', `homepagename` = '$pagename', `scheme` = '$sscheme', `threadsperpage` = '$threadsperpage', `viewsig` = '$viewsig', `layout` = '$tlayout', `posttool` = '$posttool', `moodurl` = '$moodurl', `profile_locked` = '$profile_locked', `editing_locked` = '$editing_locked' WHERE `id` = '$userid'") or print mysql_error();
|
||||
print "
|
||||
$tblstart
|
||||
$tccell1>Thank you, $loguser[name], for editing this user.<br>
|
||||
".redirect("index.php","return to the board",0)."
|
||||
$tblend";
|
||||
}
|
||||
print $footer;
|
||||
printtimedif($startingtime);
|
||||
?>
|
||||
print $footer;
|
||||
printtimedif($startingtime);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user