Changeset 1085 in ExiteCMS
- Timestamp:
- 11/08/07 00:06:27 (4 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 10 edited
-
administration/settings_languages.php (modified) (2 diffs)
-
administration/tools/update_geoip_database.php (modified) (1 diff)
-
administration/upgrade/rev01079.php (modified) (2 diffs)
-
files/locales/English.admin.settings.php (modified) (1 diff)
-
images/pli_banner.png (deleted)
-
images/validate_bg.jpg (deleted)
-
includes/core_functions.php (modified) (1 diff)
-
includes/dbsetup_include.php (modified) (8 diffs)
-
includes/geoip_include.php (modified) (2 diffs)
-
includes/locale_functions.php (modified) (1 diff)
-
includes/templates/admin.settings_languages.tpl (modified) (1 diff)
-
profile.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/settings_languages.php
r1071 r1085 65 65 $result = dbquery("UPDATE ".$db_prefix."admin SET admin_title='".$locale['236']."' WHERE admin_link='settings_languages.php'"); 66 66 } 67 if (empty($_POST['old_country'])) { 68 $result = dbquery("INSERT INTO ".$db_prefix."CMSconfig (cfg_name, cfg_value) VALUES ('country', '".$_POST['country']."')"); 69 } else { 70 $result = dbquery("UPDATE ".$db_prefix."CMSconfig SET cfg_value = '".$_POST['country']."' WHERE cfg_name = 'country'"); 71 } 67 72 redirect(FUSION_SELF.$aidlink); 68 73 } … … 81 86 } 82 87 88 $variables['countries'] = array(); 89 $result = dbquery("SELECT locales_key, locales_value FROM ".$db_prefix."locales WHERE locales_locale = '".$settings['locale']."' AND locales_name = 'countrycode' ORDER BY locales_value"); 90 if (!dbrows($result)) { 91 // no translated country names found, load the english set instead 92 $result = dbquery("SELECT locales_key, locales_value FROM ".$db_prefix."locales WHERE locales_locale = 'English' AND locales_name = 'countrycode' ORDER BY locales_value"); 93 } 94 while ($data = dbarray($result)) { 95 $variables['countries'][$data['locales_key']] = $data['locales_value']; 96 } 97 83 98 // define the admin body panel 84 99 $template_panels[] = array('type' => 'body', 'name' => 'admin.settings_languages', 'template' => 'admin.settings_languages.tpl', 'locale' => "admin.settings"); -
trunk/administration/tools/update_geoip_database.php
r1068 r1085 89 89 display("* Imported ".$row." records into the GeoIP_import table."); 90 90 fclose($handle); 91 // delete the ip_name field, to make the table more compact 92 display("* Remove the country name from the GeoIP table."); 93 $result = dbquery("ALTER TABLE ".$db_prefix."GeoIP_import DROP ip_name"); 91 94 // delete the GeoIP table, rename the temp table 92 95 display("* Rename the old GeoIP table to GeoIP_backup, and the new GeoIP_import table to GeoIP."); -
trunk/administration/upgrade/rev01079.php
r1078 r1085 268 268 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'zm', 'Zambia', '1194378860')"); 269 269 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'zw', 'Zimbabwe', '1194378860')"); 270 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'tz', 'United Republic of Tanzania', '1194378860')"); 271 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'eu', 'Europe', '1194378860')"); 272 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'ap', 'Asia/Pacific Region', '1194378860')"); 273 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'rs', 'Serbia', '1194378860')"); 274 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'mo', 'Macau', '1194378860')"); 275 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 're', 'Reunion', '1194378860')"); 276 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'la', 'Lao People\'s Democratic Republic', '1194378860')"); 277 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'me', 'Montenegro', '1194378860')"); 278 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'ps', 'Occupied Palestinian Territory', '1194378860')"); 279 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'aq', 'Antarctica', '1194378860')"); 280 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countrycode', 'st', 'Sao Tome and Principe', '1194378860')"); 270 281 271 282 // add country codes to the locales table … … 525 536 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'vietnam', 'vn', '1194378981')"); 526 537 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'undefined', '--', '1194378981')"); 538 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'United Republic of Tanzania', 'tz', '1194378981')"); 539 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Europe', 'eu', '1194378981')"); 540 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Asia/Pacific Region', 'ap', '1194378981')"); 541 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Serbia', 'rs', '1194378981')"); 542 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Macau', 'mo', '1194378981')"); 543 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Reunion', 're', '1194378981')"); 544 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Lao People\'s Democratic Republic', 'la', '1194378981')"); 545 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Montenegro', 'me', '1194378981')"); 546 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Occupied Palestinian Territory', '1194378981')"); 547 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Antarctica', 'aq', '1194378981')"); 548 $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##locales (locales_locale, locales_name, locales_key, locales_value, locales_datestamp) VALUES ('English', 'countryname', 'Sao Tome and Principe', 'st', '1194378981')"); 527 549 528 550 // add currencycode codes to the locales table -
trunk/files/locales/English.admin.settings.php
r1080 r1085 5 5 $locale['402'] = "Site name:"; 6 6 $locale['403'] = "Site root directory:"; 7 $locale['404'] = " ";7 $locale['404'] = "Site located in:"; 8 8 $locale['405'] = "Site e-mail address:"; 9 9 $locale['406'] = "Your name or nickname:"; -
trunk/includes/core_functions.php
r1079 r1085 178 178 // check for upgrades in progress. 179 179 if (!eregi("upgrade.php", $_SERVER['PHP_SELF'])) { 180 180 181 include PATH_ADMIN."upgrade.php"; 181 182 // If so, force a switch to maintenance mode 182 183 if (UPGRADES) $settings['maintenance'] = 2; 183 } 184 185 // if not called from the maintenance mode module! (to prevent a loop, endless ;-) 186 // check if we need to redirect to maintenance mode (for users) or upgrade (for webmasters) 187 if ($settings['maintenance'] && !eregi("maintenance.php", $_SERVER['PHP_SELF'])) { 188 if (!iSUPERADMIN) { 189 redirect('maintenance.php?reason='.$settings['maintenance']); 190 } else { 191 redirect(ADMIN.'upgrade.php'.$aidlink); 184 185 // if not called from the maintenance mode module! (to prevent a loop, endless ;-) 186 // check if we need to redirect to maintenance mode (for users) or upgrade (for webmasters) 187 if ($settings['maintenance'] && !eregi("maintenance.php", $_SERVER['PHP_SELF'])) { 188 if (!iSUPERADMIN) { 189 // deny all non-webmasters access to the site 190 redirect('maintenance.php?reason='.$settings['maintenance']); 191 } else { 192 // force webmasters to the upgrade module 193 redirect(ADMIN.'upgrade.php'.$aidlink); 194 } 192 195 } 193 196 } -
trunk/includes/dbsetup_include.php
r954 r1085 2 2 //---------------------------------------------------------- 3 3 // ExiteCMS file : dbsetup_include.php 4 // Date generated : ` 18/10/2007 21:27`4 // Date generated : `07/11/2007 23:50` 5 5 //---------------------------------------------------------- 6 6 7 7 define('CMS_VERSION', '7.00'); 8 define('CMS_REVISION', ' 954');8 define('CMS_REVISION', '1082'); 9 9 10 10 if ($step == 1) { … … 37 37 `ip_start_num` int(10) unsigned NOT NULL default '0', 38 38 `ip_end_num` int(10) unsigned NOT NULL default '0', 39 `ip_code` char(2) NOT NULL default '', 40 `ip_name` varchar(50) NOT NULL default '' 39 `ip_code` char(2) NOT NULL default '' 41 40 ) ENGINE=MYISAM;"); 42 41 if (!$result) { … … 65 64 $result = dbquery("CREATE TABLE IF NOT EXISTS ".$db_prefix."admin ( 66 65 `admin_id` tinyint(2) unsigned NOT NULL auto_increment, 67 `admin_rights` varchar(2) NOT NULL default '',66 `admin_rights` char(2) NOT NULL default '', 68 67 `admin_image` varchar(50) NOT NULL default '', 69 68 `admin_title` varchar(50) NOT NULL default '', … … 78 77 79 78 // 80 // Code to create table `advert s`81 // 82 $result = dbquery("DROP TABLE IF EXISTS ".$db_prefix."advert s");83 $result = dbquery("CREATE TABLE IF NOT EXISTS ".$db_prefix."advert s(79 // Code to create table `advertising` 80 // 81 $result = dbquery("DROP TABLE IF EXISTS ".$db_prefix."advertising"); 82 $result = dbquery("CREATE TABLE IF NOT EXISTS ".$db_prefix."advertising ( 84 83 `adverts_id` smallint(5) NOT NULL auto_increment, 85 84 `adverts_userid` smallint(5) NOT NULL default '0', … … 101 100 if (!$result) { 102 101 $fail = "1"; 103 $failed[] = "advert s: ".mysql_error();102 $failed[] = "advertising : ".mysql_error(); 104 103 } 105 104 … … 455 454 `locale_code` varchar(8) NOT NULL default '', 456 455 `locale_name` varchar(50) NOT NULL default '', 456 `locale_locale` varchar(25) NOT NULL default '', 457 `locale_charset` varchar(25) NOT NULL default '', 457 458 `locale_active` tinyint(1) NOT NULL default '0', 458 459 PRIMARY KEY (`locale_id`) … … 461 462 $fail = "1"; 462 463 $failed[] = "locale : ".mysql_error(); 464 } 465 466 // 467 // Code to create table `locales` 468 // 469 $result = dbquery("DROP TABLE IF EXISTS ".$db_prefix."locales"); 470 $result = dbquery("CREATE TABLE IF NOT EXISTS ".$db_prefix."locales ( 471 `locales_id` int(10) unsigned NOT NULL auto_increment, 472 `locales_locale` varchar(50) NOT NULL default '', 473 `locales_name` varchar(50) NOT NULL default '', 474 `locales_key` varchar(25) NOT NULL default '', 475 `locales_value` text NOT NULL, 476 `locales_datestamp` int(10) unsigned NOT NULL default '0', 477 PRIMARY KEY (`locales_id`) 478 ) ENGINE=MYISAM;"); 479 if (!$result) { 480 $fail = "1"; 481 $failed[] = "locales : ".mysql_error(); 463 482 } 464 483 … … 849 868 `user_webmaster` tinyint(1) unsigned NOT NULL default '0', 850 869 `user_email` varchar(100) NOT NULL default '', 870 `user_bad_email` int(10) unsigned NOT NULL default '0', 851 871 `user_hide_email` tinyint(1) unsigned NOT NULL default '1', 852 872 `user_location` varchar(50) NOT NULL default '', -
trunk/includes/geoip_include.php
r863 r1085 71 71 } 72 72 $_GeoIP_result['ip_addr'] = $ip_addr; 73 return $_GeoIP_result['ip_name'];73 return GeoIP_Code2Name($_GeoIP_result['ip_code']); 74 74 } 75 75 } 76 76 77 77 function GeoIP_Code2Name($ip_code) { 78 global $db_prefix ;78 global $db_prefix, $settings; 79 79 80 $result = dbquery("SELECT * FROM ".$db_prefix."GeoIP WHERE ip_code ='".$ip_code."' LIMIT 1"); 80 $result = dbquery("SELECT locales_value FROM ".$db_prefix."locales WHERE locales_locale = '".$settings['locale']."' AND locales_name = 'countrycode' AND locales_key = '".$ip_code."' LIMIT 1"); 81 if (!dbrows($result)) { 82 // no translated country names found, load the english set instead 83 $result = dbquery("SELECT locales_value FROM ".$db_prefix."locales WHERE locales_locale = 'English' AND locales_name = 'countrycode' AND locales_key = '".$ip_code."' LIMIT 1"); 84 } 81 85 if (dbrows($result) == 0) { 82 86 return ""; 83 87 } 84 88 $data = dbarray($result); 85 return $data[' ip_name'];89 return $data['locales_value']; 86 90 } 87 91 … … 113 117 $data = dbarray($result); 114 118 $geoip_flag = strtolower($data['ip_code']); 115 $geoip_name = $data['ip_name'];119 $geoip_name = GeoIP_Code2Name($data['ip_code']); 116 120 if (!is_file(PATH_IMAGES."flags/".$geoip_flag.".gif")) { 117 121 if ($tag) { -
trunk/includes/locale_functions.php
r1082 r1085 67 67 $data = dbarray($result); 68 68 $settings['locale_code'] = $data['locale_code']; 69 $settings['charset'] = $data['locale_charset'];70 $settings['locales'] = $data['locale_locale'];69 if (isset($data['locale_charset'])) $settings['charset'] = $data['locale_charset']; 70 if (isset($data['locale_locale'])) $settings['locales'] = $data['locale_locale']; 71 71 } 72 72 } -
trunk/includes/templates/admin.settings_languages.tpl
r864 r1085 32 32 </tr> 33 33 <tr> 34 <td width='50%' class='tbl'> 35 {$locale.404} 36 </td> 37 <td width='50%' class='tbl'> 38 {html_options name="country" options=$countries selected=$settings2.country|default:"--" class="textbox"} 39 </td> 40 </tr> 41 <tr> 34 42 <td align='center' colspan='2' class='tbl'> 35 43 <br /> 36 44 <input type='hidden' name='old_localeset' value='{$settings2.locale}' /> 45 <input type='hidden' name='old_country' value='{$settings2.country|default:""}' /> 37 46 <input type='submit' name='savesettings' value='{$locale.750}' class='button' /> 38 47 </td> -
trunk/profile.php
r1082 r1085 70 70 if ($data['user_birthdate'] != "0000-00-00") { 71 71 $birthdate = explode("-", $data['user_birthdate']); 72 $data['user_birthdate'] = strftime(nl_langinfo(D_FMT), mktime(1,0,0,$birthdate[1],$birthdate[2],$birthdate[0])) 73 } 72 $data['user_birthdate'] = strftime(str_replace("%m", "%B", preg_replace("/[^a-z%]/i", " ", nl_langinfo(D_FMT))), mktime(1,0,0,$birthdate[1],$birthdate[2],$birthdate[0])); 74 73 } else { 75 74 $data['user_birthdate'] = $locale['u048'];
Note: See TracChangeset
for help on using the changeset viewer.
