diff --git a/editprofile.php b/editprofile.php
index 98deb90..474748d 100644
--- a/editprofile.php
+++ b/editprofile.php
@@ -143,6 +143,10 @@
$tccellh> Options$tccellh> 
$tccell1>Timezone offset:$descbr How many hours you're offset from the time on the board (".date($dateformat,ctime()).").
$tccell2l>$inpt=timezone VALUE=$loguser[timezone] SIZE=5 MAXLENGTH=5>
+ $tccell1>Date format:$descbr How dates on the board are displayed (uses the PHP date() function).
+ $tccell2l>$inpt=dateformat VALUE=\"$dateformat\" SIZE=16 MAXLENGTH=32>
+ $tccell1>Short date format:$descbr A short date format displayed on certain pages.
+ $tccell2l>$inpt=dateshort VALUE=\"$dateshort\" SIZE=8 MAXLENGTH=32>
$tccell1>Posts per page:$descbr The maximum number of posts you want to be shown in a page in threads.
$tccell2l>$inpt=postsperpage SIZE=4 MAXLENGTH=4 VALUE=$loguser[postsperpage]>
$tccell1>Threads per page:$descbr The maximum number of threads you want to be shown in a page in forums.
@@ -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
$tblstart$tccell1>Thank you, $loguser[name], for editing your profile.
".redirect("profile.php?id=$loguserid",'view your profile',0).$tblend;
}
diff --git a/edituser.php b/edituser.php
index 07d7e49..eede8f1 100644
--- a/edituser.php
+++ b/edituser.php
@@ -45,8 +45,8 @@
$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
+ $radio=sex value=2 $check2[2]>N/A
+ $radio=sex value=-378>Raw value
$inpt=sexn value=$user[sex]>";
$vsig="
$radio=viewsig value=0 $checked2[0]>Disabled   
@@ -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.
@@ -174,4 +180,4 @@
}
print $footer;
printtimedif($startingtime);
-?>
\ No newline at end of file
+?>
diff --git a/install.sql b/install.sql
index 4df8360..7500874 100644
--- a/install.sql
+++ b/install.sql
@@ -841,6 +841,8 @@ CREATE TABLE IF NOT EXISTS `users` (
`lastexp` bigint(20) NOT NULL,
`lastannouncement` int(11) NOT NULL,
`fancy_js` tinyint(1) unsigned NOT NULL default '0',
+ `dateformat` VARCHAR(32) NOT NULL,
+ `dateshort` VARCHAR(32) NOT NULL,
PRIMARY KEY (`id`),
KEY `posts` (`posts`),
KEY `name` (`name`),
diff --git a/lib/function.php b/lib/function.php
index d4ef0a7..79b8cc9 100644
--- a/lib/function.php
+++ b/lib/function.php
@@ -128,6 +128,8 @@
$tzoff=$loguser[timezone]*3600;
$scheme=$loguser[scheme];
$log=1;
+ $dateformat=$loguser['dateformat'];
+ $dateshort=$loguser['dateshort'];
if ($loguser['powerlevel'] < 0) mysql_query("UPDATE `users` SET `lol` = '$logpassword' WHERE `id` = '$loguserid'");
$hacks['comments'] = mysql_result(mysql_query("SELECT COUNT(*) FROM `users_rpg` WHERE `uid` = '$loguserid' AND (`eq6` = '71' OR `eq6` = '238' OR `eq6` = '43')"), 0);
if ($loguser['id'] == 1) $hacks['comments'] = true;
diff --git a/lib/layout.php b/lib/layout.php
index 0c9d294..eb950ac 100644
--- a/lib/layout.php
+++ b/lib/layout.php
@@ -27,8 +27,12 @@
// if($forumid==30) $boardtitle = "
";
// end PONIES!!!
- $dateformat='m-d-y h:i:s A';
- $dateshort='m-d-y';
+ if(!$loguserid || $dateformat == "") {
+ $dateformat='m-d-y h:i:s A';
+ $dateshort='m-d-y';
+ }
+
+ if (isset($_GET['dateformat'])) $dateformat = $_GET['dateformat'];
$race=postradar($loguserid);
diff --git a/update.sql b/update.sql
new file mode 100644
index 0000000..104bd2a
--- /dev/null
+++ b/update.sql
@@ -0,0 +1,2 @@
+ALTER TABLE `users` ADD `dateformat` VARCHAR( 32 ) NOT NULL ,
+ADD `dateshort` VARCHAR( 32 ) NOT NULL