-- Start Of Configurable Part --\r
*/\r
\r
-include('./install_lang_japanese-utf8.php');\r
+include('./install_lang_japanese.php');\r
\r
// array with names of plugins to install. Plugin files must be present in the nucleus/plugin/\r
// directory.\r
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
<html xmlns="http://www.w3.org/1999/xhtml">\r
<head>\r
- <meta http-equiv="content-type" content="application/xhtml+xml; charset=<?php echo _CHARSET; ?>" />\r
+ <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />\r
<title><?php echo _TITLE; ?></title>\r
<style type="text/css"><!--\r
@import url('nucleus/documentation/styles/manual.css');\r
\r
<?php echo _TEXT1; ?>\r
\r
+ <h1><?php echo _HEADER1_2 ?></h1>\r
+\r
+ <?php echo _TEXT1_2; ?>\r
+\r
+ <fieldset>\r
+ <legend><?php echo _TEXT1_2_TAB_HEAD; ?></legend>\r
+ <table>\r
+ <tr>\r
+ <td><?php echo _TEXT1_2_TAB_FIELD1; ?></td>\r
+ <td>\r
+ <select name="charset" tabindex="10000">\r
+ <option value="utf8" selected="selected">UTF-8</option>\r
+ <option value="ujis" >EUC-JP</option>\r
+ </select>\r
+ </td>\r
+ </tr>\r
+ </table>\r
+ </fieldset>\r
+\r
<h1><?php echo _HEADER2; ?></h1>\r
\r
<?php echo _TEXT2; ?>\r
<table>\r
<tr>\r
<td><?php echo _TEXT4_TAB_FIELD1; ?></td>\r
- <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host') )?>" /></td>\r
+ <td><input name="mySQL_host" value="<?php echo htmlspecialchars(@ini_get('mysql.default_host') )?>" tabindex="10010" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT4_TAB_FIELD2; ?></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT4_TAB_FIELD3; ?></td>\r
- <td><input name="mySQL_password" type="password" /></td>\r
+ <td><input name="mySQL_password" type="password" tabindex="10030" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT4_TAB_FIELD4; ?></td>\r
- <td><input name="mySQL_database" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create" /><label for="mySQL_create"><?php echo _TEXT4_TAB_FIELD4_ADD; ?></label>)</td>\r
+ <td><input name="mySQL_database" tabindex="10040" /> (<input name="mySQL_create" value="1" type="checkbox" id="mySQL_create" tabindex="10050" /><label for="mySQL_create"><?php echo _TEXT4_TAB_FIELD4_ADD; ?></label>)</td>\r
</tr>\r
</table>\r
</fieldset>\r
<legend><?php echo _TEXT4_TAB2_HEAD; ?></legend>\r
<table>\r
<tr>\r
- <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix" /><label for="mySQL_usePrefix"><?php echo _TEXT4_TAB2_FIELD; ?></label></td>\r
- <td><input name="mySQL_tablePrefix" value="" /></td>\r
+ <td><input name="mySQL_usePrefix" value="1" type="checkbox" id="mySQL_usePrefix" tabindex="10060" /><label for="mySQL_usePrefix"><?php echo _TEXT4_TAB2_FIELD; ?></label></td>\r
+ <td><input name="mySQL_tablePrefix" value="" tabindex="10070" /></td>\r
</tr>\r
</table>\r
\r
$url .= '/';\r
}\r
\r
- echo $url; ?>" /></td>\r
+ echo $url; ?>" tabindex="10080" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT5_TAB_FIELD2; ?></td>\r
<td><input name="AdminURL" size="60" value="<?php\r
if ($url) {\r
echo $url . 'nucleus/';\r
- } ?>" /></td>\r
+ } ?>" tabindex="10090" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT5_TAB_FIELD3; ?></td>\r
<td><input name="AdminPath" size="60" value="<?php\r
if($basePath) {\r
echo $basePath . 'nucleus/';\r
- } ?>" /></td>\r
+ } ?>" tabindex="10100" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT5_TAB_FIELD4; ?></td>\r
<td><input name="MediaURL" size="60" value="<?php\r
if ($url) {\r
echo $url . 'media/';\r
- } ?>" /></td>\r
+ } ?>" tabindex="10110" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT5_TAB_FIELD5; ?></td>\r
<td><input name="MediaPath" size="60" value="<?php\r
if ($basePath) {\r
echo $basePath . 'media/';\r
- } ?>" /></td>\r
+ } ?>" tabindex="10120" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT5_TAB_FIELD6; ?></td>\r
<td><input name="SkinsURL" size="60" value="<?php\r
if ($url) {\r
echo $url . 'skins/';\r
- } ?>" />\r
+ } ?>" tabindex="10130" />\r
<br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
</td>\r
</tr>\r
<td><input name="SkinsPath" size="60" value="<?php\r
if ($basePath) {\r
echo $basePath . 'skins/';\r
- } ?>" />\r
+ } ?>" tabindex="10140" />\r
<br />(<?php echo _TEXT5_TAB_FIELD7_2; ?>)\r
</td>\r
</tr>\r
<td><input name="PluginURL" size="60" value="<?php\r
if ($url) {\r
echo $url . 'nucleus/plugins/';\r
- } ?>" /></td>\r
+ } ?>" tabindex="10150" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT5_TAB_FIELD9; ?></td>\r
<td><input name="ActionURL" size="60" value="<?php\r
if ($url) {\r
echo $url . 'action.php';\r
- } ?>" />\r
+ } ?>" tabindex="10160" />\r
<br />(<?php echo _TEXT5_TAB_FIELD9_2;?>)\r
</td>\r
</tr>\r
<table>\r
<tr>\r
<td><?php echo _TEXT6_TAB_FIELD1; ?></td>\r
- <td><input name="User_name" value="" /> <small>(<?php echo _TEXT6_TAB_FIELD1_2; ?>)</small></td>\r
+ <td><input name="User_name" value="" tabindex="10170" /> <small>(<?php echo _TEXT6_TAB_FIELD1_2; ?>)</small></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT6_TAB_FIELD2; ?></td>\r
- <td><input name="User_realname" value="" /></td>\r
+ <td><input name="User_realname" value="" tabindex="10180" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT6_TAB_FIELD3; ?></td>\r
- <td><input name="User_password" type="password" value="" /></td>\r
+ <td><input name="User_password" type="password" value="" tabindex="10190" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT6_TAB_FIELD4; ?></td>\r
- <td><input name="User_password2" type="password" value="" /></td>\r
+ <td><input name="User_password2" type="password" value="" tabindex="10200" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT6_TAB_FIELD5; ?></td>\r
- <td><input name="User_email" value="" /> <small>(<?php echo _TEXT6_TAB_FIELD5_2; ?>)</small></td>\r
+ <td><input name="User_email" value="" tabindex="10210" /> <small>(<?php echo _TEXT6_TAB_FIELD5_2; ?>)</small></td>\r
</tr>\r
</table>\r
</fieldset>\r
<table>\r
<tr>\r
<td><?php echo _TEXT7_TAB_FIELD1; ?></td>\r
- <td><input name="Blog_name" size="60" value="My Nucleus CMS" /></td>\r
+ <td><input name="Blog_name" size="60" value="My Nucleus CMS" tabindex="10220" /></td>\r
</tr>\r
<tr>\r
<td><?php echo _TEXT7_TAB_FIELD2; ?></td>\r
- <td><input name="Blog_shortname" value="mynucleuscms" /> <small>(<?php echo _TEXT7_TAB_FIELD2_2; ?>)</small></td>\r
+ <td><input name="Blog_shortname" value="mynucleuscms" tabindex="10230" /> <small>(<?php echo _TEXT7_TAB_FIELD2_2; ?>)</small></td>\r
</tr>\r
</table>\r
</fieldset>\r
<legend><?php echo _TEXT8_TAB_HEADER; ?></legend>\r
<table>\r
<tr>\r
- <td><input name="Weblog_ping" value="1" type="checkbox" id="Weblog_ping" /><?php echo _TEXT8_TAB_FIELD1; ?></td>\r
+ <td><input name="Weblog_ping" value="1" type="checkbox" id="Weblog_ping" tabindex="10240" /><?php echo _TEXT8_TAB_FIELD1; ?></td>\r
</tr>\r
</table>\r
</fieldset>\r
\r
<?php echo _TEXT9; ?>\r
\r
- <p><input name="action" value="go" type="hidden" /> <input type="submit" value="<?php echo _BUTTON1; ?>" onclick="return checkSubmit();" /></p>\r
+ <p><input name="action" value="go" type="hidden" /> <input type="submit" value="<?php echo _BUTTON1; ?>" onclick="return checkSubmit();" tabindex="10250" /></p>\r
\r
</form>\r
</body>\r
$user_email = postVar('User_email');\r
$blog_name = postVar('Blog_name');\r
$blog_shortname = postVar('Blog_shortname');\r
+ $charset = postVar('charset');\r
$config_adminemail = $user_email;\r
$config_sitename = $blog_name;\r
$weblog_ping = postVar('Weblog_ping');\r
\r
+ $_POST = array();\r
+ if ($charset == 'ujis') {\r
+ define('_CHARSET', 'EUC-JP');\r
+ $config_sitename = mb_convert_encoding($config_sitename, _CHARSET, 'UTF-8');\r
+ $user_realname = mb_convert_encoding($user_realname, _CHARSET, 'UTF-8');\r
+ $blog_name = mb_convert_encoding($blog_name, _CHARSET, 'UTF-8');\r
+ } else {\r
+ define('_CHARSET', 'UTF-8');\r
+ }\r
+\r
$config_indexurl = replaceDoubleBackslash($config_indexurl);\r
$config_adminurl = replaceDoubleBackslash($config_adminurl);\r
$config_mediaurl = replaceDoubleBackslash($config_mediaurl);\r
showErrorMessages($errors);\r
}\r
\r
- // 2. try to log in to mySQL\r
+ // 2-1. try to log in to mySQL\r
global $MYSQL_CONN;\r
$MYSQL_CONN = @mysql_connect($mysql_host, $mysql_user, $mysql_password);\r
\r
_doError(_ERROR15 . ': ' . mysql_error() );\r
}\r
\r
+/*/ <add for garble measure>\r
+ // 2-2. set DEFAULT CHARSET and COLLATE\r
+ $mySqlVer = implode('.', array_map('intval', explode('.', mysql_get_server_info($MYSQL_CONN))));\r
+ if ($mySqlVer >= '5.0.7' && phpversion() >= '5.2.3') {\r
+ mysql_set_charset($charset);\r
+ } else {\r
+ mysql_query("SET NAMES " . $charset);\r
+ }\r
+ $collation = ($charset == 'utf8') ? 'utf8_unicode_ci' : 'ujis_japanese_ci';\r
+// </add for garble measure>*/\r
+\r
// 3. try to create database (if needed)\r
if ($mysql_create == 1) {\r
- mysql_query('CREATE DATABASE ' . $mysql_database) or _doError(_ERROR16 . ': ' . mysql_error() );\r
+ $sql = 'CREATE DATABASE '\r
+ . $mysql_database\r
+/*/ <add for garble measure>\r
+ . ' DEFAULT CHARACTER SET '\r
+ . $charset\r
+ . ' COLLATE '\r
+ . $collation\r
+// </add for garble measure>*/\r
+ . '';\r
+ mysql_query($sql) or _doError(_ERROR16 . ': ' . mysql_error());\r
}\r
\r
// 4. try to select database\r
if ($mysql_usePrefix == 1) {\r
$query = str_replace($aTableNames, $aTableNamesPrefixed, $query);\r
}\r
+ if ($mysql_create != 1 && strpos($query, 'CREATE TABLE') === 0) {\r
+ $query .= ' DEFAULT CHARACTER SET ' . $charset . ' COLLATE ' . $collation;\r
+ }\r
\r
mysql_query($query) or _doError(_ERROR30 . ' (<small>' . htmlspecialchars($query) . '</small>): ' . mysql_error() );\r
}\r
}\r
\r
// 5a make first post\r
- $newpost = "INSERT INTO " . tableName('nucleus_item') . " VALUES (1, '" . _1ST_POST_TITLE . "', '" . _1ST_POST . "', '" . _1ST_POST2 . "', 1, 1, '2005-08-15 11:04:26', 0, 0, 0, 1, 0, 1);";\r
+ if ($charset == 'ujis') {\r
+ $itm_title = mb_convert_encoding(_1ST_POST_TITLE, _CHARSET, 'UTF-8');\r
+ $itm_body = mb_convert_encoding(_1ST_POST, _CHARSET, 'UTF-8');\r
+ $itm_more = mb_convert_encoding(_1ST_POST2, _CHARSET, 'UTF-8');\r
+ } else {\r
+ $itm_title = _1ST_POST_TITLE;\r
+ $itm_body = _1ST_POST;\r
+ $itm_more = _1ST_POST2;\r
+ }\r
+ $newpost = "INSERT INTO "\r
+ . tableName('nucleus_item')\r
+ . " VALUES ("\r
+ . "1, "\r
+ . "'" . $itm_title . "',"\r
+ . " '" . $itm_body . "',"\r
+ . " '" . $itm_more . "',"\r
+ . " 1, 1, '2005-08-15 11:04:26', 0, 0, 0, 1, 0, 1);";\r
mysql_query($newpost) or _doError(_ERROR18 . ' (<small>' . htmlspecialchars($newpost) . '</small>): ' . mysql_error() );\r
\r
// 6. update global settings\r
updateConfig('ActionURL', $config_actionurl);\r
updateConfig('AdminEmail', $config_adminemail);\r
updateConfig('SiteName', $config_sitename);\r
+ if ($charset == 'ujis') {\r
+ updateConfig('Language', 'japanese-euc');\r
+ }\r
\r
// 7. update GOD member\r
$query = 'UPDATE ' . tableName('nucleus_member')\r
mysql_query($query) or _doError(_ERROR20 . ': ' . mysql_error() );\r
\r
// 8-2. update category settings\r
+ if ($charset == 'ujis') {\r
+ $cat_name = mb_convert_encoding(_GENERALCAT_NAME, _CHARSET, 'UTF-8');\r
+ $cat_desc = mb_convert_encoding(_GENERALCAT_DESC, _CHARSET, 'UTF-8');\r
+ } else {\r
+ $cat_name = _GENERALCAT_NAME;\r
+ $cat_desc = _GENERALCAT_DESC;\r
+ }\r
$query = 'UPDATE ' . tableName('nucleus_category')\r
- . " SET cname = '" . addslashes(_GENERALCAT_NAME) . "',"\r
- . " cdesc = '" . addslashes(_GENERALCAT_DESC) . "'"\r
+ . " SET cname = '" . $cat_name . "',"\r
+ . " cdesc = '" . $cat_desc . "'"\r
. " WHERE"\r
. " catid = 1";\r
\r
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
<html xmlns="http://www.w3.org/1999/xhtml">\r
<head>\r
- <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET; ?>" />\r
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
<title><?php echo _TITLE; ?></title>\r
<style>@import url('nucleus/styles/manual.css');</style>\r
</head>\r