Changeset 1081 in ExiteCMS


Ignore:
Timestamp:
11/07/07 16:57:20 (4 years ago)
Author:
root
Message:

removed empty locale index files
moved some locale settings (charset, country, dateinfo) from $locale to $settings
updated the modules and templates that used these variables

Location:
trunk
Files:
3 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/feeds.php

    r1071 r1081  
    8787 
    8888// start building the XML file 
    89 header("Content-type: text/xml; charset=".$locale['charset']); 
    90 echo "<?xml version=\"1.0\" encoding=\"".$locale['charset']."\"?>\n"; 
     89header("Content-type: text/xml; charset=".$settings['charset']); 
     90echo "<?xml version=\"1.0\" encoding=\"".$settings['charset']."\"?>\n"; 
    9191echo "<rss version=\"2.0\">\n"; 
    9292 
  • trunk/files/locales/English.main.global.php

    r1080 r1081  
    77*/ 
    88 
    9 // Locale Settings 
    10 setlocale(LC_TIME, "en_GB", "en","GB"); // Linux Server (Windows may differ) 
    11 $locale['country'] = "GB"; 
    12 $locale['charset'] = "iso-8859-1"; 
    13 $locale['tinymce'] = "en"; 
    14 $locale['phpmailer'] = "en"; 
    15  
    16 // Full & Short Months, Date info 
     9// Full & Short Months 
    1710$locale['months'] = "&nbsp|January|February|March|April|May|June|July|August|September|October|November|December"; 
    1811$locale['shortmonths'] = "&nbsp|Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sept|Oct|Nov|Dec"; 
    19 $locale['dateformat'] = "mm-dd-yyyy"; 
    20 $locale['datesequence'] = array("M", "D", "Y"); 
    2112 
    2213// Standard User Levels 
  • trunk/files/locales/English.main.setup.php

    r1080 r1081  
    11<?php 
    22$locale['title'] = "ExiteCMS Setup"; 
    3 $locale['charset'] = "iso-8859-1"; 
     3 
    44$locale['400'] = "Select your default locale"; 
    55$locale['401'] = "Unable to establish database connection.<br><br> 
  • trunk/forum/post.php

    r1071 r1081  
    465465            if ($settings['forum_flags']) { 
    466466                if ($userdata['user_id'] == 1) { 
    467                     $preview['cc_flag'] = GeoIP_Code2Flag($locale['country']); 
     467                    $preview['cc_flag'] = GeoIP_Code2Flag($settings['country']); 
    468468                } else { 
    469469                    $preview['cc_flag'] = GeoIP_IP2Flag($userdata['user_ip']); 
  • trunk/forum/viewthread.php

    r1071 r1081  
    252252        if ($settings['forum_flags']) { 
    253253            if ($data['post_author'] == 1) { 
    254                 $data['cc_flag'] = GeoIP_Code2Flag($locale['country']); 
     254                $data['cc_flag'] = GeoIP_Code2Flag($settings['country']); 
    255255            } else { 
    256256                $data['cc_flag'] = GeoIP_IP2Flag($data['post_ip']); 
  • trunk/includes/locale_functions.php

    r1076 r1081  
    5454} 
    5555 
    56 // locale defines 
     56// legacy locale defines 
    5757define("PATH_LOCALE", PATH_ROOT."locale/"); 
    5858if (!defined('LOCALESET')) define("LOCALESET", $settings['locale']."/"); 
     59 
     60// define the website server locale (if not defined) 
     61if (!isset($settings['unix_locale'])) $settings['unix_locale'] = "en_US"; 
     62 
     63// set system locales 
     64setlocale(LC_TIME, $settings['unix_locale']); // *nix Server (TODO: Windows may differ) 
     65 
     66// define the website characterset (if not defined) 
     67if (!isset($settings['charset'])) $settings['charset'] = "iso-8859-1"; 
     68 
     69// define the website location (country) (if not defined) 
     70if (!isset($settings['country'])) $settings['country'] = "??"; 
     71 
     72// get the locale code, we need this in several places 
     73if (dbtable_exists($db_prefix."locale")) { 
     74    $result = dbquery("SELECT locale_code FROM ".$db_prefix."locale WHERE locale_name = '".$settings['locale']."'"); 
     75    if ($dbrows($result)) { 
     76        $data = dbarray($result); 
     77        $settings['locale_code'] = $data['locale_code']; 
     78    } 
     79} 
     80if (!isset($settings['locale_code'])) $settings['locale_code'] = "en"; 
     81 
     82// Date info (TODO: need to find a better solution for this) 
     83if (!isset($settings['dateformat'])) $settings['dateformat'] = "mm-dd-yyyy"; 
     84if (!isset($settings['datesequence'])) $settings['datesequence'] = array("M", "D", "Y"); 
    5985 
    6086// Initialise the $locale array 
  • trunk/includes/sendmail_include.php

    r863 r1081  
    1919     
    2020    $mail = new PHPMailer(); 
    21     if (file_exists(PATH_INCLUDES."languages/phpmailer.lang-".$locale['phpmailer'].".php")) { 
    22         $mail->SetLanguage($locale['phpmailer'], PATH_INCLUDES."language/"); 
     21    if (file_exists(PATH_INCLUDES."languages/phpmailer.lang-".$settings['locale_code'].".php")) { 
     22        $mail->SetLanguage($settings['locale_code'], PATH_INCLUDES."language/"); 
    2323    } else { 
    2424        $mail->SetLanguage("en", PATH_INCLUDES."language/"); 
     
    3636    } 
    3737     
    38     $mail->CharSet = $locale['charset']; 
     38    $mail->CharSet = $settings['charset']; 
    3939    $mail->From = $fromemail; 
    4040    $mail->FromName = $fromname; 
  • trunk/includes/template-plugins/modifier.escape.php

    r917 r1081  
    2222function smarty_modifier_escape($string, $esc_type = 'entities', $char_set = '') 
    2323{ 
    24     global $locale; 
     24    global $locale, $settings; 
    2525     
    2626    // set a default char_set if none given 
    27     if ($char_set == '') $char_set = $locale['charset']; 
     27    if ($char_set == '') $char_set = $settings['charset']; 
    2828 
    2929    switch ($esc_type) { 
  • trunk/includes/templates/main.edit_profile.tpl

    r1060 r1081  
    114114        <tr> 
    115115        <td class='tbl'> 
    116             {$locale.u010} 
     116            {$locale.u010} ( {$settings.dateformat} ) 
    117117        </td> 
    118118            <td class='tbl'> 
    119                 {foreach from=$locale.datesequence item=field} 
     119                {foreach from=$settings.datesequence item=field} 
    120120                {if $field == "D"} 
    121121                <select name='user_day' class='textbox'> 
  • trunk/includes/templates/main.register.tpl

    r954 r1081  
    122122                <td class='tbl'> 
    123123                    {$locale.u010} 
    124                     <span class='small2'>( mm/dd/yyyy )</span> 
    125                 </td> 
    126                 <td class='tbl'> 
    127                     {foreach from=$locale.datesequence item=field} 
     124                    <span class='small2'>( {$settings.dateformat} )</span> 
     125                </td> 
     126                <td class='tbl'>} 
     127                    {foreach from=$settings.datesequence item=field} 
    128128                    {if $field == "D"} 
    129129                    <select name='user_day' class='textbox'> 
  • trunk/includes/templates/main.setup.tpl

    r960 r1081  
    1919<head> 
    2020<title>{$locale.title}</title> 
    21 <meta http-equiv='Content-Type' content='text/html; charset={$locale.charset}'> 
     21<meta http-equiv='Content-Type' content='text/html; charset={$settings.charset}'> 
    2222{literal}<style type="text/css"> 
    2323<!-- 
  • trunk/includes/user_functions.php

    r1060 r1081  
    185185// if logged in, update the users lastvisit time and country 
    186186if (iMEMBER) { 
    187     $cc_code = $userdata['user_id'] == 1 ? $locale['country'] : GeoIP_IP2Code(USER_IP, true); 
     187    $cc_code = $userdata['user_id'] == 1 ? $settings['country'] : GeoIP_IP2Code(USER_IP, true); 
    188188    $result = dbquery("UPDATE ".$db_prefix."users SET user_lastvisit='".time()."', user_ip='".USER_IP."', user_cc_code='".$cc_code."' WHERE user_id='".$userdata['user_id']."'"); 
    189189} 
  • trunk/pm.php

    r1071 r1081  
    5454            // fix the webmaster to the site's country code 
    5555            if ($msgrec['pmindex_from_id'] == 1) { 
    56                 $data2['cc_flag'] = GeoIP_Code2Flag($locale['country']); 
     56                $data2['cc_flag'] = GeoIP_Code2Flag($settings['country']); 
    5757            } else { 
    5858                $data2['cc_flag'] = GeoIP_IP2Flag($data2['user_ip']); 
     
    8383                // fix the webmaster to the site's country code 
    8484                if ($msgrec['pmindex_to_id'] == 1) { 
    85                     $data2['cc_flag'] = GeoIP_Code2Flag($locale['country']); 
     85                    $data2['cc_flag'] = GeoIP_Code2Flag($settings['country']); 
    8686                } else { 
    8787                    $data2['cc_flag'] = GeoIP_IP2Flag($data2['user_ip']); 
  • trunk/setup.php

    r1071 r1081  
    112112$settings = array("locale" => (isset($_GET['localeset']) ? $_GET['localeset'] : "English")); 
    113113$variables['localeset'] = $settings['locale']; 
     114$variables['charset'] = "iso-8859-1"; 
    114115 
    115116// check if the cache directories are writeable 
  • trunk/themes/ExiteCMS/templates/templates/_header.tpl

    r961 r1081  
    2222<head> 
    2323    <title>{$settings.sitename}</title> 
    24     <meta http-equiv='Content-Type' content='text/html; charset={$locale.charset}' /> 
     24    <meta http-equiv='Content-Type' content='text/html; charset={$settings.charset}' /> 
    2525    <meta name='description' content='{$settings.description}' /> 
    2626    <meta name='keywords' content='{$settings.keywords}' /> 
     
    3939            editor_deselector:'textbox', 
    4040            theme:'advanced', 
    41             language:'en', 
     41            language:'{/literal}{$settings.locale_code}{literal}', 
    4242            entities:'60,lt,62,gt', 
    4343            document_base_url:'{/literal}{$settings.siteurl}{literal}', 
     
    6767            mode:'textareas', 
    6868            theme:'simple', 
    69             language:'en', 
     69            language:'{/literal}{$settings.locale_code}{literal}', 
    7070            convert_newlines_to_brs:'true', 
    7171            force_br_newlines:'true', 
Note: See TracChangeset for help on using the changeset viewer.