Version: , by Admin (Coder)
Developer Last Online: Nov 2024
Version: 2.2.x
Rating:
Released: 09-15-2001
Last Update: Never
Installs: 23
No support by the author.
This hack adds an option for the user to select the date format and time format he wants to use in the forum.
Good for people from different countries, that use different formats.
Requested by markrt.
Demo:
Run this query:
Code:
ALTER TABLE user ADD dateformat VARCHAR(4) DEFAULT '-1' not null AFTER timezoneoffset, ADD timeformat VARCHAR(4) DEFAULT '-1' not null AFTER dateformat;
(for more information on running queries visit the Troubleshooting and Problems forum)
In your modifyoptions template add this code:
Code:
<tr>
<td bgcolor="{secondaltcolor}"><normalfont><b>Date format</b></normalfont><br>
<smallfont>Select what format you would like to use for dates.</smallfont></td>
<td bgcolor="{secondaltcolor}"><smallfont>
<select name="newdateformat">
<option value="-1" $datedefselected>Use forum default</option>
<option value="0" $date0selected>04-25-1998</option>
<option value="1" $date1selected>04-25-98</option>
<option value="2" $date2selected>04.25.1998</option>
<option value="3" $date3selected>04.25.98</option>
<option value="4" $date4selected>25-04-1998</option>
<option value="5" $date5selected>25-04-98</option>
<option value="6" $date6selected>25.04.1998</option>
<option value="7" $date7selected>25.04.98</option>
<option value="8" $date8selected>April 25th, 1998</option>
<option value="9" $date9selected>Saturday, April 25th, 1998</option>
<option value="10" $date10selected>25th April 1998</option>
<option value="11" $date11selected>Saturday, 25th April 1998</option>
</select></smallfont></td>
</tr>
<tr>
<td bgcolor="{firstaltcolor}"><normalfont><b>Time format</b></normalfont><br>
<smallfont>Select what format you would like to use for times.</smallfont></td>
<td bgcolor="{firstaltcolor}"><smallfont>
<select name="newtimeformat">
<option value="-1" $timedefselected>Use forum default</option>
<option value="0" $time0selected>08:15 pm</option>
<option value="1" $time1selected>08:15:48 pm</option>
<option value="2" $time2selected>08:15 PM</option>
<option value="3" $time3selected>08:15:48 PM</option>
<option value="4" $time4selected>20:15</option>
<option value="5" $time5selected>20:15:48</option>
</select></smallfont></td>
</tr>
if ($bbuserinfo[timezoneoffset]<0) {
$timezonesel["n".(-$bbuserinfo[timezoneoffset]*10)]="selected";
} else {
$timezonesel[$bbuserinfo[timezoneoffset]*10]="selected";
}
Still in member.php, replace this code:
Code:
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
nosessionhash='$nosessionhash'
WHERE userid='$bbuserinfo[userid]'");
with this code:
Code:
$DB_site->query("UPDATE user
SET ".$updatestyles."adminemail='$adminemail',
showemail='$showemail',invisible='$invisible',cookieuser='$cookieuser',
maxposts='".addslashes($umaxposts)."',daysprune='".addslashes($prunedays)."',
dateformat='".addslashes($newdateformat)."',timeformat='".addslashes($newtimeformat)."',
timezoneoffset='".addslashes($timezoneoffset)."',emailnotification='$emailnotification',
startofweek='".addslashes($startofweek)."',options='$options',receivepm='$receivepm',
emailonpm='$emailonpm',pmpopup='$pmpopup',usergroupid='$bbuserinfo[usergroupid]',
nosessionhash='$nosessionhash'
WHERE userid='$bbuserinfo[userid]'");
(note: this code might be changed in your file due to another hack. If so, just add the code that is in red)
That's it.
I know it might look long, but it's really very very easy to install.
If you have any troubles with that block I told you about, ask for help here.
Feedback please!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Database error in vBulletin: Invalid SQL: UPDATE user
SET styleid='1',adminemail='1',
showemail='1',invisible='0',cookieuser='1',
maxposts='-1',daysprune='-1',
dateformat='9',timeformat='-1',
startofweek='2',options='15',receivepm='1',
emailonpm='0',pmpopup='1',usergroupid='6',
nosessionhash='0'
WHERE userid='1'
mysql error: Unknown column 'dateformat' in 'field list'
mysql error number: 1054
Date: Tuesday 18th of September 2001 01:00:28 AM
Script:
/vbb/member.php?invisible=no&cookieuser=yes&nosessionha sh=no&allowmail=yes&showemail=yes&emailnotificatio n=no&receivepm=yes&emailonpm=no&pmpopup=yes&showsi gnatures=yes&showavatars=yes&showimages=yes&pruned ays=-1&umaxposts=-1&startofweek=2&timezoneoffset=-5&newdateformat=9&newtimeformat=-1&vbcode=yes&newstyleset=1&action=updateoptions&Su bmit=Submit+Modifications
Referer: http://www.shenlong20xl.com/vbb/memb...on=editoptions
ALTER TABLE user ADD dateformat VARCHAR(4) DEFAULT '-1' not null AFTER timezoneoffset, ADD timeformat VARCHAR(4) DEFAULT '-1' not null AFTER dateformat;
ALTER TABLE user ADD dateformat VARCHAR(4) DEFAULT '-1' not null AFTER timezoneoffset, ADD timeformat VARCHAR(4) DEFAULT '-1' not null AFTER dateformat;
if you have run this query how can you undo it ????????