From bb1cd0d3e6ef6dce19d021499492a9b63cf1982a Mon Sep 17 00:00:00 2001 From: Xkeeper Date: Sun, 13 Nov 2011 14:17:48 -0800 Subject: [PATCH] Fixing the dateformat issue + some other tweaks Date formats can be edited in profiles. The field defaults to the current dateformat set (either the default or the user's), but will only be saved in the database if it differs from $defaultdateformat. Edit Profile (editprofile.php) has been cleaned up and now does less absurd things. For one, it doesn't pass along your password in plaintext any more! The formatting of the file has also been cleaned up a bit and should hopefully be less absurd. --- editprofile.php | 516 +++++++++++++++++++++++------------------ edituser.php | 17 +- lib/config.default.php | 20 +- lib/function.php | 3 + 4 files changed, 319 insertions(+), 237 deletions(-) diff --git a/editprofile.php b/editprofile.php index 6d72199..d6b8181 100644 --- a/editprofile.php +++ b/editprofile.php @@ -1,230 +1,304 @@ =500 or ($loguser[posts]>=250 && (ctime()-$loguser[regdate])>=100*86400)) $postreq=1; - if($loguser[titleoption]==0 || $banned) $titleopt=0; - if($loguser[titleoption]==1 && ($postreq or $power>0 or $loguser[title])) $titleopt=1; - if($loguser[titleoption]==2) $titleopt=1; - if(!$action){ - $birthday=getdate($loguser[birthday]); - if($loguser[birthday]){ - $month=$birthday[mon]; - $day=$birthday[mday]; - $year=$birthday[year]; - } - $descbr="$smallfont
 "; - $checked1[$loguser[sex]]='checked=1'; - $checked2[$loguser[viewsig]]='checked=1'; - $checked3[$loguser[posttool]]='checked=1'; - $checked4[$loguser[useranks]]='checked=1'; - $checked5[$loguser[pagestyle]]='checked=1'; - $checked6[$loguser[pollstyle]]='checked=1'; - $sexlist=" - $radio=sex value=0 $checked1[0]> Male    - $radio=sex value=1 $checked1[1]> Female    - $radio=sex value=2 $checked1[2]> N/A"; - $vsig=" - $radio=viewsig value=0 $checked2[0]> Disabled    - $radio=viewsig value=1 $checked2[1]> Enabled    - $radio=viewsig value=2 $checked2[2]> Auto-updating"; - $vtool=" - $radio=posttool value=0 $checked3[0]> Disabled    - $radio=posttool value=1 $checked3[1]> Enabled"; - $pagestyle=" - $radio=pagestyle value=0 $checked5[0]> Inline    - $radio=pagestyle value=1 $checked5[1]> Seperate line"; - $pollstyle=" - $radio=pollstyle value=0 $checked6[0]> Normal    - $radio=pollstyle value=1 $checked6[1]> Influence"; - if($titleopt){ - // this went after this block, which makes it COMPLETELY USELESS - squot(0,$loguser[title]); - $titleoption=" - $tccell1>Custom title:$descbr This title will be shown below your rank. - $tccell2l>$inpt=title VALUE=\"$loguser[title]\" SIZE=60 MAXLENGTH=255> + if ($loguser['posts']>=500 or ($loguser['posts']>=250 && (ctime()-$loguser['regdate'])>=100*86400)) $postreq=1; + if ($loguser['titleoption']==0 || $banned) $titleopt=0; + if ($loguser['titleoption']==1 && ($postreq or $power>0 or $loguser['title'])) $titleopt=1; + if ($loguser['titleoption']==2) $titleopt=1; + + if(!$action){ + $birthday=getdate($loguser[birthday]); + if($loguser[birthday]){ + $month=$birthday[mon]; + $day=$birthday[mday]; + $year=$birthday[year]; + } + $descbr="$smallfont
 "; + $checked1[$loguser['sex']] = 'checked="1"'; + $checked2[$loguser['viewsig']] = 'checked="1"'; + $checked3[$loguser['posttool']] = 'checked="1"'; + $checked4[$loguser['useranks']] = 'checked="1"'; + $checked5[$loguser['pagestyle']] = 'checked="1"'; + $checked6[$loguser['pollstyle']] = 'checked="1"'; + $sexlist=" + $radio=sex value=0 $checked1[0]> Male    + $radio=sex value=1 $checked1[1]> Female    + $radio=sex value=2 $checked1[2]> N/A"; + $vsig=" + $radio=viewsig value=0 $checked2[0]> Disabled    + $radio=viewsig value=1 $checked2[1]> Enabled    + $radio=viewsig value=2 $checked2[2]> Auto-updating"; + $vtool=" + $radio=posttool value=0 $checked3[0]> Disabled    + $radio=posttool value=1 $checked3[1]> Enabled"; + $pagestyle=" + $radio=pagestyle value=0 $checked5[0]> Inline    + $radio=pagestyle value=1 $checked5[1]> Seperate line"; + $pollstyle=" + $radio=pollstyle value=0 $checked6[0]> Normal    + $radio=pollstyle value=1 $checked6[1]> Influence"; + + if($titleopt){ + // this went after this block, which makes it COMPLETELY USELESS + squot(0,$loguser[title]); + $titleoption=" + $tccell1>Custom title:$descbr This title will be shown below your rank. + $tccell2l>$inpt=title VALUE=\"$loguser[title]\" SIZE=60 MAXLENGTH=255> + "; + } + + /* + squot(1,$loguser[minipic]); + squot(1,$loguser[picture]); + squot(1,$loguser[aim]); + squot(1,$loguser[imood]); + squot(1,$loguser[email]); + squot(1,$loguser[homepageurl]); + */ + + // TODO: Go through and use proper htmlentities() to escape quotes and crap + // Probably will require fixing the forms too + squot(0,$loguser['realname']); + squot(0,$loguser['location']); + squot(0,$loguser['homepagename']); + sbr(1,$loguser['postheader']); + sbr(1,$loguser['signature']); + sbr(1,$loguser['bio']); + + $schemes=mysql_query('SELECT id,name FROM schemes WHERE ord > 0 ORDER BY ord'); + while($sch=mysql_fetch_array($schemes)){ + $sel=($sch[id]==$loguser[scheme]?' selected':''); + $used=mysql_result(mysql_query("SELECT count(*) FROM users WHERE scheme=$sch[id]"),0,0); + $schlist.="