Changeset 1875 in ExiteCMS


Ignore:
Timestamp:
10/19/08 16:20:21 (3 years ago)
Author:
hverton
Message:

updated the setup procedure to set the language choosen at setup time to be the default site language

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/administration/tools/language_pack_English.php

    r1871 r1875  
    37463746if (!defined('LP_COUNTRIES')) define('LP_COUNTRIES', "us|gb|ca|au|nz|in|za|ir|mt|hk|pr"); 
    37473747if (!defined('LP_VERSION')) define('LP_VERSION', "7.20"); 
    3748 if (!defined('LP_DATE')) define('LP_DATE', "1224409120"); 
     3748if (!defined('LP_DATE')) define('LP_DATE', "1224413129"); 
    37493749$lp_date = LP_DATE; 
    37503750 
     
    38453845 
    38463846        // check the last update of the locale 
    3847         $variables['last_update'] = isset($settings['LanguagePack.'.LP_LANGUAGE]) ? $settings['LanguagePack.'.LP_LANGUAGE] : dbfunction("MAX(locales_datestamp)", "locales", "locales_code = '".LP_LOCALE."' AND locales_name NOT LIKE 'modules%'"); 
     3847        $variables['last_update'] = isset($settings['LanguagePack.'.LP_LANGUAGE]) ? $settings['LanguagePack.'.LP_LANGUAGE] : min(LP_DATE - 1, dbfunction("MAX(locales_datestamp)", "locales", "locales_code = '".LP_LOCALE."' AND locales_name NOT LIKE 'modules%'")); 
    38483848         
    38493849        // check if this language pack has been installed 
  • trunk/administration/tools/language_pack_Nederlands.php

    r1871 r1875  
    37463746if (!defined('LP_COUNTRIES')) define('LP_COUNTRIES', "nl|be|sr|aw|an"); 
    37473747if (!defined('LP_VERSION')) define('LP_VERSION', "7.20"); 
    3748 if (!defined('LP_DATE')) define('LP_DATE', "1224409123"); 
     3748if (!defined('LP_DATE')) define('LP_DATE', "1224413132"); 
    37493749$lp_date = LP_DATE; 
    37503750 
     
    38453845 
    38463846        // check the last update of the locale 
    3847         $variables['last_update'] = isset($settings['LanguagePack.'.LP_LANGUAGE]) ? $settings['LanguagePack.'.LP_LANGUAGE] : dbfunction("MAX(locales_datestamp)", "locales", "locales_code = '".LP_LOCALE."' AND locales_name NOT LIKE 'modules%'"); 
     3847        $variables['last_update'] = isset($settings['LanguagePack.'.LP_LANGUAGE]) ? $settings['LanguagePack.'.LP_LANGUAGE] : min(LP_DATE - 1, dbfunction("MAX(locales_datestamp)", "locales", "locales_code = '".LP_LOCALE."' AND locales_name NOT LIKE 'modules%'")); 
    38483848         
    38493849        // check if this language pack has been installed 
  • trunk/includes/core_functions.php

    r1866 r1875  
    749749// replacement for die() 
    750750function terminate($text) { 
    751     die("<div style='font-family:Verdana,Sans-serif;font-size:11px;text-align:center;'>$text</div>"); 
     751    die("<div style='font-family:Verdana,Sans-serif;font-size:14px;font-weight:bold;text-align:center;'>$text</div>"); 
    752752} 
    753753 
  • trunk/includes/dbsetup_include.php

    r1868 r1875  
    22//---------------------------------------------------------- 
    33// ExiteCMS file : dbsetup_include.php 
    4 // Date generated  : `19/10/2008 10:24` 
     4// Date generated  : `19/10/2008 16:12` 
    55//---------------------------------------------------------- 
    66 
    77define('CMS_VERSION', '7.20'); 
    8 define('CMS_REVISION', '1858'); 
     8define('CMS_REVISION', '1872'); 
    99 
    1010define('MYSQL_CHARSET', 'utf8'); 
     
    310310    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('debug_querylog', '')"); 
    311311    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('debug_sql_explain', '0')"); 
     312    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('default_locale', 'en')"); 
    312313    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('description', 'ExiteCMS, a light-weight CMS system, wriiten in PHP, and using MySQL and the Smarty template engine')"); 
    313314    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('display_validation', '1')"); 
     
    365366    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('pm_sentbox_group', '0')"); 
    366367    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('remote_stats', '0')"); 
    367     $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('revision', '1858')"); 
     368    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('revision', '1872')"); 
    368369    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('session_gc_divisor', '100')"); 
    369370    $result = dbquery("INSERT INTO ".$db_prefix."configuration (cfg_name, cfg_value) VALUES('session_gc_maxlifetime', '2678400')"); 
  • trunk/includes/locale_functions.php

    r1776 r1875  
    257257            require $locales_file; 
    258258        } else { 
    259             // otherwise, if the locale is not English, try to load the system locale version 
    260             if ($locale_code != "en") { 
    261                 // retrieve the info for the system locale (which is the first one installed!) 
    262                 $result = dbquery("SELECT * FROM ".$db_prefix."locale ORDER BY locale_id LIMIT 1"); 
     259            // otherwise, if the locale is not the default system locale, try to load the system locale version 
     260            if ($locale_code != $settings['default_locale']) { 
     261                // retrieve the info for the system locale 
     262                $result = dbquery("SELECT * FROM ".$db_prefix."locale WHERE locale_code = '".$settings['default_locale']."'"); 
    263263                if (dbrows($result)) { 
    264264                    $data = dbarray($result); 
  • trunk/includes/templates/main.setup.tpl

    r1661 r1875  
    164164                            </td> 
    165165                            <td class='tbl1'> 
    166                                 <input type='text' value='{$db_prefix|default:"exitecms_"}' name='db_prefix' class='textbox' /> <span class='small'>{$locale.436}</span> 
     166                                <input type='text' value='{$db_prefix|default:"cms_"}' name='db_prefix' class='textbox' /> <span class='small'>{$locale.436}</span> 
    167167                            </td> 
    168168                        </tr> 
  • trunk/setup.php

    r1802 r1875  
    33| ExiteCMS Content Management System                 | 
    44+----------------------------------------------------+ 
    5 | Copyright 2007 Harro "WanWizard" Verton, Exite BV  | 
     5| Copyright 2008 Harro "WanWizard" Verton, Exite BV  | 
    66| for support, please visit http://exitecms.exite.eu | 
    77+----------------------------------------------------+ 
     
    126126    global $locale; 
    127127 
    128     $msg = "<div style='font-family:Verdana;font-size:14px;text-align:center;'><b>".(empty($locale['403'])?"Unable to run the ExiteCMS setup":$locale['403']).":<br /><br /><font style='color:red;'>"; 
     128    $msg = "<div style='font-family:Verdana;font-size:14px;text-align:center;font-weight:bold;'><b>".(empty($locale['403'])?"Unable to run the ExiteCMS setup":$locale['403']).":<br /><br /><font style='color:red;'>"; 
    129129    $msg .= $error."</font></b><br /><br />"; 
    130130    if ($wiki) { 
     
    257257    $db_prefix = isset($_POST['db_prefix']) ? stripinput($_POST['db_prefix']) : ""; 
    258258    $variables['db_prefix'] = $db_prefix; 
    259     if (!preg_match("/^[-0-9A-Z_@]*$/i", $db_prefix)) { 
     259    if (!empty($db_prefix) && !preg_match("/^[A-Z0-9][-0-9A-Z_@]*$/i", $db_prefix)) { 
    260260        $error .= $locale['428']."<br /><br />\n"; 
    261261    } 
     
    276276    // verify if the given user has create table on the database 
    277277    if (empty($error)) { 
    278         $result = dbquery("CREATE TABLE ".$db_prefix."_test (test TINYINT(1) NOT NULL) ENGINE = MYISAM"); 
     278        $result = dbquery("CREATE TABLE ".$db_prefix."___test (test TINYINT(1) NOT NULL) ENGINE = MYISAM"); 
    279279        if (!$result) { 
    280280            $error .= sprintf($locale['435'],$db_name)."<br /><br />\n"; 
    281281        } else { 
    282             $result = dbquery("DROP TABLE ".$db_prefix."_test"); 
     282            $result = dbquery("DROP TABLE ".$db_prefix."___test"); 
    283283        } 
    284284    } 
     
    392392            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$username."' WHERE cfg_name = ''siteusername"); 
    393393            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".$localeset."' WHERE cfg_name = 'locale'"); 
     394            $result = dbquery("UPDATE ".$db_prefix."configuration SET cfg_value = '".LP_CHARSET."' WHERE cfg_name = 'default_locale'"); 
    394395  
    395396            // create the admin rights field for the webmaster, based on all admin modules available 
     
    402403            // add the webmaster to the users table 
    403404            $commands = array(); 
    404             $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##users (user_name, user_password, user_webmaster, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_forum_fullscreen, user_theme, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status) VALUES ('$username', '$password', '1', '$email', '1', '', '0000-00-00', '', '', '', '', '', '0', 'Default', '0', '', '', '0', '".time()."', '0', '0.0.0.0', '".$adminrights."', '', '103', '0')"); 
     405            $commands[] = array('type' => 'db', 'value' => "INSERT INTO ##PREFIX##users (user_name, user_password, user_webmaster, user_email, user_hide_email, user_location, user_birthdate, user_aim, user_icq, user_msn, user_yahoo, user_web, user_forum_fullscreen, user_theme, user_locale, user_offset, user_avatar, user_sig, user_posts, user_joined, user_lastvisit, user_ip, user_rights, user_groups, user_level, user_status) VALUES ('$username', '$password', '1', '$email', '1', '', '0000-00-00', '', '', '', '', '', '0', 'Default', '".LP_CHARSET."', '0', '', '', '0', '".time()."', '0', '0.0.0.0', '".$adminrights."', '', '103', '0')"); 
    405406            $result = dbcommands($commands, $db_prefix); 
    406407     
Note: See TracChangeset for help on using the changeset viewer.