Changeset 1070 in ExiteCMS
- Timestamp:
- 11/06/07 15:39:37 (4 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 2 edited
-
administration/db_backup.php (modified) (1 diff)
-
administration/upgrade/rev01070.php (added)
-
files/locales (added)
-
files/locales/index.php (added)
-
includes/locale_functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/db_backup.php
r954 r1070 52 52 } else { 53 53 gzwrite($fp, "#----------------------------------------------------------".$crlf); 54 gzwrite($fp, "# PHP-FusionSQL Data Dump".$crlf);54 gzwrite($fp, "# ExiteCMS SQL Data Dump".$crlf); 55 55 gzwrite($fp, "# Database Name: `".$db_name."`".$crlf); 56 56 gzwrite($fp, "# Table Prefix: `".$db_prefix."`".$crlf); -
trunk/includes/locale_functions.php
r1069 r1070 11 11 +----------------------------------------------------*/ 12 12 if (eregi("locale_functions.php", $_SERVER['PHP_SELF']) || !defined('INIT_CMS_OK')) die(); 13 14 // locale defines (no longer needed once we moved to the new locale system15 16 define("PATH_LOCALE", PATH_ROOT."locale/");17 13 18 14 // locale detection - step 1 - check if there's a locale cookie set … … 58 54 } 59 55 56 // locale defines (no longer needed once we moved to the new locale system!) 57 58 define("PATH_LOCALE", PATH_ROOT."locale/"); 59 60 60 // locale detection - step 3 - use the website's default 61 61 if (!defined('LOCALESET')) { … … 67 67 68 68 // Load the global language file 69 include PATH_LOCALE.LOCALESET."global.php";69 locale_load("main.global"); 70 70 71 /*----------------------------------------------------+ 72 | locale_functions include - general functions below | 73 +----------------------------------------------------*/ 74 function locale_load($locale_name) { 75 76 global $settings, $locale; 77 78 // assemble the locale filename 79 $locales_file = PATH_ROOT."files/".$locale['locale'].".".$locale_name.".php"; 80 81 // check if we need to recompile from the database 82 if (dbtable_exists($prefix."locales")) { 83 84 // get the last update date from the locale strings table 85 $result = dbquery("SELECT MAX(locales_datestamp) as last_update FROM ".$db_prefix." WHERE locales_locale = '".$settings['locale']."' AND locales_name = '".$locale_name."'"); 86 87 // if found... 88 if ($data = dbarray($result)) { 89 90 // if the locales cache does not exist or is out of date... 91 if (!file_exists($locales_file) || filemtime($locales_file) < $data['last_update']) { 92 93 // compile the locales cache file from the locales table 94 if ($handle = fopen($locales_file, 'w')) { 95 96 // get the locale records for the selected locale and this locale_name 97 $result = dbquery("SELECT * FROM ".$db_prefix." WHERE locales_locale = '".$settings['locale']."' AND locales_name = '".$locale_name."' ORDER BY locales_key"); 98 if (dbrows($result)) { 99 fwrite($handle, "<?php"."\n"); 100 fwrite($handle, "// ----------------------------------------------------------"."\n"); 101 fwrite($handle, "// locale : ".$locale['locale']."\n"); 102 fwrite($handle, "// name : ".$locale_name."\n"); 103 fwrite($handle, "// date : ".date("D M j Y, G:i:s T")."\n"); 104 fwrite($handle, "// ----------------------------------------------------------"."\n"); 105 } 106 while ($data = dbarray($result)) { 107 fwrite($handle, "\$locale['".$data['locales_key']."'] = \"".$data['locales_value']."\"".";\n"); 108 } 109 fwrite($handle, "?>"."\n"); 110 fclose($handle); 111 } 112 } 113 } 114 } 115 116 // if the locale file could not be found or generated, check if a static file exists in the 'old' location 117 if (!file_exists($locales_file)) { 118 119 // split the locale_name to determine the location of the file on disk 120 // name is in the form: moduletype.modulename, p.e. main.setup, or admin.articles, or modules.some_panel 121 $nameparts = explode(".", strtolower($locale_name)); 122 123 switch ($nameparts[0]) { 124 125 case "admin": // admin modules 126 $locales_file = PATH_LOCALE.$settings['locale']."/admin/".$nameparts[1].".php"; 127 break; 128 129 case "main": // main modules 130 $locales_file = PATH_LOCALE.$settings['locale']."/".$nameparts[1].".php"; 131 break; 132 133 case "modules": // installable modules & plugins 134 $locales_file = PATH_MODULES.$nameparts[1]."/locale/".$settings['locale'].".php"; 135 break; 136 137 case "tools": // webmaster tools 138 $locales_file = PATH_ADMIN."tools/locale/".$nameparts[1].".php"; 139 break; 140 141 default: 142 // unknown module type 143 } 144 } 145 146 // if a locales file could be assembled, and it exists, load it 147 if (!empty($locales_file) && file_exists($locales_file)) { 148 include $locales_file; 149 } 150 151 } 71 152 ?>
Note: See TracChangeset
for help on using the changeset viewer.
