mirror of
https://github.com/e107inc/e107.git
synced 2025-08-12 09:34:54 +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_files/shortcode/batch/signup_shortcodes.php,v $
|
||||
| $Revision: 1.9 $
|
||||
| $Date: 2008-01-09 22:44:13 $
|
||||
| $Revision: 1.10 $
|
||||
| $Date: 2008-01-15 21:57:31 $
|
||||
| $Author: e107steved $
|
||||
|
|
||||
| Mods to show extended field categories
|
||||
@@ -275,34 +275,6 @@ if($pref['signup_option_image'])
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_TIMEZONE
|
||||
global $pref;
|
||||
if ($pref['signup_option_timezone'])
|
||||
{
|
||||
$timezone = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "GMT", "+1", "+2", "+3", "+4", "+5", "+5.30", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13");
|
||||
$timearea = array("International DateLine West", "Samoa", "Hawaii", "Alaska", "Pacific Time (US and Canada)", "Mountain Time (US and Canada)", "Central Time (US and Canada), Central America", "Eastern Time (US and Canada)", "Atlantic Time (Canada)", "Greenland, Brasilia, Buenos Aires, Georgetown", "Mid-Atlantic", "Azores", "GMT - UK, Ireland, Lisbon", "West Central Africa, Western Europe", "Greece, Egypt, parts of Africa", "Russia, Baghdad, Kuwait, Nairobi", "Abu Dhabi, Kabul", "Islamabad, Karachi", "Mumbai, Delhi, Calcutta", "Astana, Dhaka", "Bangkok, Rangoon", "Hong Kong, Singapore, Perth, Beijing", "Tokyo, Seoul", "Brisbane, Canberra, Sydney, Melbourne", "Soloman Islands", "New Zealand", "Nuku'alofa");
|
||||
$text .= "
|
||||
<select style='width:99%' name='timezone' class='tbox'>\n";
|
||||
|
||||
$count = 0;
|
||||
while ($timezone[$count])
|
||||
{
|
||||
if ($timezone[$count] == $user_timezone)
|
||||
{
|
||||
$text .= "<option value='".$timezone[$count]."' selected>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= "<option value='".$timezone[$count]."'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
$text .= "</select>";
|
||||
return $text;
|
||||
}
|
||||
return "";
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN SIGNUP_IMAGECODE
|
||||
global $signup_imagecode, $rs, $sec_img;
|
||||
|
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/usersettings_shortcodes.php,v $
|
||||
| $Revision: 1.8 $
|
||||
| $Date: 2008-01-08 22:24:14 $
|
||||
| $Revision: 1.9 $
|
||||
| $Date: 2008-01-15 21:57:31 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -145,28 +145,6 @@ return display_help("", 2);
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN TIMEZONE
|
||||
global $curVal;
|
||||
$ret = "<select name='timezone' class='tbox'>\n";
|
||||
$timezone = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "GMT", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13");
|
||||
$timearea = array("International DateLine West", "Samoa", "Hawaii", "Alaska", "Pacific Time (US and Canada)", "Mountain Time (US and Canada)", "Central Time (US and Canada), Central America", "Eastern Time (US and Canada)", "Atlantic Time (Canada)", "Greenland, Brasilia, Buenos Aires, Georgetown", "Mid-Atlantic", "Azores", "GMT - UK, Ireland, Lisbon", "West Central Africa, Western Europe", "Greece, Egypt, parts of Africa", "Russia, Baghdad, Kuwait, Nairobi", "Abu Dhabi, Kabul", "Islamabad, Karachi", "Astana, Dhaka", "Bangkok, Rangoon", "Hong Kong, Singapore, Perth, Beijing", "Tokyo, Seoul", "Brisbane, Canberra, Sydney, Melbourne", "Soloman Islands", "New Zealand", "Nuku'alofa");
|
||||
$count = 0;
|
||||
while ($timezone[$count])
|
||||
{
|
||||
if ($timezone[$count] == $curVal['user_timezone'])
|
||||
{
|
||||
$ret .= "<option value='".$timezone[$count]."' selected='selected'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret .= "<option value='".$timezone[$count]."'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
|
||||
$ret .= "</select>";
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN AVATAR_UPLOAD
|
||||
global $pref;
|
||||
|
@@ -91,28 +91,28 @@ if ($parms[1] == 'icon')
|
||||
if ($parms[1] == 'value')
|
||||
{
|
||||
$uVal = str_replace(chr(1), "", $udata['user_'.$parms[0]]);
|
||||
// check for db_lookup type
|
||||
if($ueStruct["user_".$parms[0]]['user_extended_struct_type'] == '4')
|
||||
switch ($ueStruct["user_".$parms[0]]['user_extended_struct_type'])
|
||||
{
|
||||
// check for db_lookup type
|
||||
case EUF_DB_FIELD :
|
||||
$tmp = explode(",",$ueStruct["user_".$parms[0]]['user_extended_struct_values']);
|
||||
if($sql->db_Select($tmp[0],"{$tmp[1]}, {$tmp[2]}","{$tmp[1]} = '{$uVal}'"))
|
||||
{
|
||||
$row = $sql->db_Fetch();
|
||||
$ret_data = $row[$tmp[2]];
|
||||
$row = $sql->db_Fetch();
|
||||
$ret_data = $row[$tmp[2]];
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret_data = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//check for 0000-00-00 in date field
|
||||
if($ueStruct["user_".$parms[0]]['user_extended_struct_type'] == '7')
|
||||
{
|
||||
if($uVal == "0000-00-00") { $uVal = ""; }
|
||||
$ret_data = FALSE;
|
||||
}
|
||||
break;
|
||||
case EUF_DATE ; //check for 0000-00-00 in date field
|
||||
if($uVal == "0000-00-00") { $uVal = ""; }
|
||||
$ret_data = $uVal;
|
||||
break;
|
||||
case EUF_PREDEFINED : // Predefined field - have to look up display string in relevant file
|
||||
$ret_data = e107_user_extended::user_extended_display_text($ueStruct["user_".$parms[0]]['user_extended_struct_values'],$uVal);
|
||||
break;
|
||||
}
|
||||
if($ret_data != "")
|
||||
{
|
||||
|
Reference in New Issue
Block a user