Changeset 1082 in ExiteCMS for trunk/includes/locale_functions.php
- Timestamp:
- 11/07/07 18:09:49 (5 years ago)
- File:
-
- 1 edited
-
trunk/includes/locale_functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/locale_functions.php
r1081 r1082 58 58 if (!defined('LOCALESET')) define("LOCALESET", $settings['locale']."/"); 59 59 60 // define the website server locale (if not defined)61 if (!isset($settings['unix_locale'])) $settings['unix_locale'] = "en_US";62 63 // set system locales64 setlocale(LC_TIME, $settings['unix_locale']); // *nix Server (TODO: Windows may differ)65 66 // define the website characterset (if not defined)67 if (!isset($settings['charset'])) $settings['charset'] = "iso-8859-1";68 69 60 // define the website location (country) (if not defined) 70 61 if (!isset($settings['country'])) $settings['country'] = "??"; 71 62 72 // get the locale code, we need this in several places63 // get locales information, we need this in several places 73 64 if (dbtable_exists($db_prefix."locale")) { 74 $result = dbquery("SELECT locale_codeFROM ".$db_prefix."locale WHERE locale_name = '".$settings['locale']."'");75 if ( $dbrows($result)) {65 $result = dbquery("SELECT * FROM ".$db_prefix."locale WHERE locale_name = '".$settings['locale']."'"); 66 if (dbrows($result)) { 76 67 $data = dbarray($result); 77 68 $settings['locale_code'] = $data['locale_code']; 69 $settings['charset'] = $data['locale_charset']; 70 $settings['locales'] = $data['locale_locale']; 78 71 } 79 72 } 73 // if we couldn't find it, use some default values 80 74 if (!isset($settings['locale_code'])) $settings['locale_code'] = "en"; 75 if (!isset($settings['charset'])) $settings['charset'] = "iso-8859-1"; 76 if (!isset($settings['locales'])) $settings['locales'] = "en_US|en_GB|english|eng"; 81 77 82 // Date info (TODO: need to find a better solution for this) 83 if (!isset($settings['dateformat'])) $settings['dateformat'] = "mm-dd-yyyy"; 84 if (!isset($settings['datesequence'])) $settings['datesequence'] = array("M", "D", "Y"); 78 // set the locale for strfime() 79 setlocale(LC_TIME, explode("|", $settings['locales'])); 85 80 86 81 // Initialise the $locale array
Note: See TracChangeset
for help on using the changeset viewer.
