mirror of
https://github.com/e107inc/e107.git
synced 2025-08-07 07:06:30 +02:00
Add 'predefined list' type to extended user fields; uses a list of values and display text in e107_admin/sql directory.
Create 'timezone' type of extended user field as predefined list. Move user timezone to extended user fields. Update routine only transfers existing data if its enabled in prefs. Delete the existing user_timezone, user_new fields from user table. Add timezone data file
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/sql/core_sql.php,v $
|
||||
| $Revision: 1.7 $
|
||||
| $Date: 2008-01-11 22:13:43 $
|
||||
| $Revision: 1.8 $
|
||||
| $Date: 2008-01-15 21:57:10 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -67,7 +67,7 @@ CREATE TABLE audit_log (
|
||||
dblog_remarks text NOT NULL,
|
||||
PRIMARY KEY (dblog_id),
|
||||
KEY dblog_datestamp (dblog_datestamp)
|
||||
) TYPE=MyISAM;
|
||||
) TYPE=MyISAM AUTO_INCREMENT=1;
|
||||
# --------------------------------------------------------
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ CREATE TABLE dblog (
|
||||
dblog_remarks text NOT NULL,
|
||||
PRIMARY KEY (dblog_id),
|
||||
KEY dblog_datestamp (dblog_datestamp)
|
||||
) TYPE=MyISAM;
|
||||
) TYPE=MyISAM AUTO_INCREMENT=1;
|
||||
|
||||
# --------------------------------------------------------
|
||||
|
||||
@@ -499,7 +499,6 @@ CREATE TABLE user (
|
||||
user_email varchar(100) NOT NULL default '',
|
||||
user_signature text NOT NULL,
|
||||
user_image varchar(100) NOT NULL default '',
|
||||
user_timezone varchar(3) NOT NULL default '',
|
||||
user_hideemail tinyint(3) unsigned NOT NULL default '0',
|
||||
user_join int(10) unsigned NOT NULL default '0',
|
||||
user_lastvisit int(10) unsigned NOT NULL default '0',
|
||||
@@ -511,7 +510,6 @@ CREATE TABLE user (
|
||||
user_ip varchar(45) NOT NULL default '',
|
||||
user_ban tinyint(3) unsigned NOT NULL default '0',
|
||||
user_prefs text NOT NULL,
|
||||
user_new text NOT NULL,
|
||||
user_viewed text NOT NULL,
|
||||
user_visits int(10) unsigned NOT NULL default '0',
|
||||
user_admin tinyint(3) unsigned NOT NULL default '0',
|
||||
|
78
e107_admin/sql/extended_timezones.php
Normal file
78
e107_admin/sql/extended_timezones.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/sql/extended_timezones.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2008-01-15 21:57:15 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
/*
|
||||
This file is used with the extended user field 'predefined list' type. Its invoked when the value field is 'timezones'.
|
||||
The variable name must be 'timezones_list', and is an array of possible values, each of which is a value => text pair
|
||||
The text is displayed in a drop-down; the value is returned.
|
||||
If function timezones_value() exists, it is called to create the displayed text
|
||||
*/
|
||||
global $timezones_list;
|
||||
if (!is_array($timezones_list))
|
||||
{
|
||||
$timezones_list = array(
|
||||
array('-12', "International DateLine West"),
|
||||
array('-11', "Samoa"),
|
||||
array('-10', "Hawaii"),
|
||||
array( '-9', "Alaska"),
|
||||
array( '-8', "Pacific Time (US and Canada)"),
|
||||
array( '-7', "Mountain Time (US and Canada)"),
|
||||
array( '-6', "Central Time (US and Canada), Central America"),
|
||||
array( '-5', "Eastern Time (US and Canada)"),
|
||||
array( '-4', "Atlantic Time (Canada)"),
|
||||
array( '-3.30', 'Newfoundland'),
|
||||
array( '-3', "Greenland, Brasilia, Buenos Aires, Georgetown"),
|
||||
array( '-2', "Mid-Atlantic"),
|
||||
array( '-1', "Azores, Cape Verde Islands"),
|
||||
array( '+0', "UK, Ireland, Lisbon"),
|
||||
array( '+1', "West Central Africa, Western Europe"),
|
||||
array( '+2', "Greece, Egypt, parts of Africa"),
|
||||
array( '+3', "Russia, Baghdad, Kuwait, Nairobi"),
|
||||
array( '+3.30', 'Tehran, Iran'),
|
||||
array( '+4', "Abu Dhabi, Kabul"),
|
||||
array( '+4.30', 'Afghanistan'),
|
||||
array( '+5', "Islamabad, Karachi"),
|
||||
array( '+5.30', "Mumbai, Delhi, Calcutta"),
|
||||
array( '+5.45', 'Kathmandu'),
|
||||
array( '+6', "Astana, Dhaka"),
|
||||
array( '+7', "Bangkok, Rangoon"),
|
||||
array( '+8', "Hong Kong, Singapore, Perth, Beijing"),
|
||||
array( '+9', "Tokyo, Seoul"),
|
||||
array( '+9.30', 'Darwin, Adelaide'),
|
||||
array('+10', "Brisbane, Canberra, Sydney, Melbourne"),
|
||||
array('+10.30', 'Lord Howe Island'),
|
||||
array('+11', "Soloman Islands"),
|
||||
array('+11.30', 'Norfolk Island'),
|
||||
array('+12', "New Zealand, Fiji, Marshall Islands"),
|
||||
array('+13', "Tonga, Nuku'alofa, Rawaki Islands"),
|
||||
array('+13.45', 'Chatham Island'),
|
||||
array('+14', 'Kiribati: Line Islands')
|
||||
);
|
||||
}
|
||||
|
||||
if (!function_exists('timezones_value'))
|
||||
{
|
||||
function timezones_value($key, $value)
|
||||
{
|
||||
return 'GMT'.$key.' - '.$value;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user