Can now edit date formats in profile. Should be stable.

This commit is contained in:
Sanky
2011-11-12 13:53:23 +01:00
parent c53faa9a85
commit c0d05d0809
2 changed files with 21 additions and 8 deletions

View File

@@ -143,6 +143,10 @@
$tccellh> Options</td>$tccellh>&nbsp<tr>
$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>
$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>
$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>
@@ -214,7 +218,10 @@
}
if(!isset($useranks)) $useranks=$loguser[useranks];
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', `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();
$dateformat = str_replace("'", "", $_POST['dateformat']);
$dateshort = str_replace("'", "", $_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();
print "$header<br>$tblstart$tccell1>Thank you, $loguser[name], for editing your profile.<br>".redirect("profile.php?id=$loguserid",'view your profile',0).$tblend;
}

View File

@@ -45,8 +45,8 @@
$sexlist="
$radio=sex value=0 $check2[0]>Male&nbsp &nbsp
$radio=sex value=1 $check2[1]>Female&nbsp &nbsp
$radio=sex value=2 $check2[2]>N/A
$radio=sex value=-378>Raw value<br>
$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&nbsp &nbsp
@@ -139,6 +139,8 @@
$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
@@ -161,11 +163,15 @@
$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;
//mysql_query("INSERT logs SET useraction ='Edit User ".$user[nick]."(".$user[id]."'");
if ($sex == -378) {
$sex = $sexn;
}
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', `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();
$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>
@@ -174,4 +180,4 @@
}
print $footer;
printtimedif($startingtime);
?>
?>