我的作業系統是Windows
資料庫是使用xampp 1.7.3版
xoops是2.5.5 正體中文版
雖然一開始安裝後完全是亂碼
但有找到方法改成中文了:(如下)
在/phpMyAdmin/libraries/select_lang.lib.php 改以下程式碼:
「'big5'=>'big5',」→「'big5'=>'latin1',」
「'utf-8'=>'utf8',」→「'utf-8'=>'latin1',」
安裝後只改了這部份而已...
原本很開心終於有中文可使用了,結果每次一點到"偏好設定>系統設定>一般設定"後,不管有沒有按執行修改,整個前台和後台都變成英文+一些中文的樣子,而且一般設定裡的語言選項一直是選擇英文的,不管我怎麼選擇改成tchinese_utf8再執行都沒辦法變中文,我還去查了我的資料庫裡的選項明明是選擇中文的值,而後台卻一直保持選擇英文的選項@@"
除了按到這個就會變成英文之外,其他的功能都是正常的,完全不會有變成英文的情況,現在都不敢去按他了,但是有些設定一定要在那裡修改,真的很困擾...
PS.安裝後改語系時也使用過修改Xoops的程式碼,在class/database/mysqldatabase.php中
$result = mysql_query($sql, $this->conn);之前加入
@mysql_query("SET NAMES 'utf8'", $this->conn);
也是一樣成功出現中文,但點了"一般設定"也是出現同樣的問題,於是後來改語系還是使用前面講的方法(改/phpMyAdmin/libraries/select_lang.lib.php)
我把以下除錯模式出現的問題貼上,分別是還沒到一般模式,還是中文的前台和後台;和已經按到一般模式後的前台和後台:
*安裝後正常中文開除錯後的顯示
(前台)
0.001697 - SET NAMES 'utf8'
0.000328 - SET SQL_BIG_SELECTS = 1
0.005659 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC
0.001269 - SELECT sess_data, sess_ip FROM session WHERE sess_id = 'mafvvegsf1vi7vkivrft7je835'
0.001223 - SELECT * FROM users WHERE uid = '1'
0.000774 - SELECT COUNT(*) FROM banner
0.000444 - SELECT * FROM banner LIMIT 0, 1
0.001070 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '3') ORDER BY conf_order ASC
0.002739 - SELECT DISTINCT gperm_itemid FROM group_permission WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (1,2)
0.005932 - SELECT b.* FROM newblocks b, block_module_link m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id IN (0,-1) AND b.bid IN (1,2,3,4,5,6,7,8,9,10,11,12) ORDER BY b.weight, m.block_id
0.001679 - SELECT COUNT(*) FROM priv_msgs WHERE (read_msg = '0' AND to_userid = '1')
0.001664 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset = 'default' AND tpl_file = 'system_block_user.html') ORDER BY tpl_refid
0.001673 - SELECT * FROM modules WHERE (hasmain = '1' AND isactive = '1' AND weight > '0') ORDER BY weight ASC, mid ASC
0.000748 - SELECT * FROM group_permission WHERE (gperm_name = 'module_read' AND gperm_modid = '1' AND (gperm_groupid = '1' OR gperm_groupid = '2'))
0.001177 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset = 'default' AND tpl_file = 'system_block_mainmenu.html') ORDER BY tpl_refid
0.001035 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset = 'default' AND tpl_file = 'system_homepage.html') ORDER BY tpl_refid
總計: 16
(後台)
0.000430 - SET NAMES 'utf8'
0.000223 - SET SQL_BIG_SELECTS = 1
0.001739 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC
0.000824 - SELECT sess_data, sess_ip FROM session WHERE sess_id = 'mafvvegsf1vi7vkivrft7je835'
0.000460 - SELECT * FROM users WHERE uid = '1'
0.001099 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '3') ORDER BY conf_order ASC
0.000870 - SELECT * FROM modules WHERE dirname = 'system'
0.001395 - SELECT * FROM config WHERE (conf_modid = '1') ORDER BY conf_order ASC
0.000978 - SELECT * FROM modules WHERE (hasadmin = '1' AND isactive = '1') ORDER BY weight ASC, mid ASC
0.000879 - SELECT * FROM modules WHERE dirname = 'pm'
0.000426 - SELECT * FROM modules WHERE mid = 2
0.001019 - SELECT * FROM modules WHERE dirname = 'profile'
0.000789 - SELECT * FROM modules WHERE mid = 3
0.000865 - SELECT * FROM modules WHERE dirname = 'protector'
0.000403 - SELECT * FROM modules WHERE mid = 4
0.000892 - SELECT * FROM newblocks WHERE bid = 4
0.001416 - SELECT b.bid FROM newblocks b LEFT JOIN group_permission l ON l.gperm_itemid=b.bid WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND (l.gperm_groupid=1 OR l.gperm_groupid=2) AND b.isactive=1 ORDER BY b.weight,b.bid
0.000528 - SELECT * FROM newblocks WHERE bid = 9
0.000478 - SELECT * FROM newblocks WHERE bid = 8
0.000476 - SELECT * FROM newblocks WHERE bid = 10
0.002801 - SELECT COUNT(*) FROM xoopscomments WHERE com_status=1
0.001206 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset = 'default' AND tpl_file = 'system_block_waiting.html') ORDER BY tpl_refid
0.001005 - SELECT * FROM `users` WHERE (level > '0') ORDER BY user_regdate DESC LIMIT 0, 10
0.001228 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset = 'default' AND tpl_file = 'system_block_newusers.html') ORDER BY tpl_refid
0.001036 - SELECT * FROM `users` WHERE (level > '0') ORDER BY posts DESC LIMIT 0, 10
0.001273 - SELECT f.*, s.tpl_source FROM tplfile f LEFT JOIN tplsource s ON s.tpl_id=f.tpl_id WHERE (tpl_tplset = 'default' AND tpl_file = 'system_block_topusers.html') ORDER BY tpl_refid
0.001496 - SELECT * FROM group_permission WHERE (gperm_name = 'module_read' AND gperm_groupid IN (1,2))
0.000680 - SELECT * FROM xoopscomments WHERE (com_status = '2' AND com_modid IN (1,2,3,4)) ORDER BY com_created DESC LIMIT 0, 10
0.000463 - SELECT * FROM modules WHERE hascomments = '1' ORDER BY weight ASC, mid ASC
總計: 29
*按了"一般設定"後開除錯的顯示
(前台)
0.000404 - SET NAMES 'utf8'
0.000210 - SET SQL_BIG_SELECTS = 1
0.001727 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC
0.000792 - SELECT sess_data, sess_ip FROM session WHERE sess_id = 'n00rgfneah2qkrch88mu92shb3'
0.000443 - SELECT * FROM users WHERE uid = '1'
0.000912 - SELECT COUNT(*) FROM banner
0.000425 - SELECT * FROM banner LIMIT 1, 1
0.000753 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '3') ORDER BY conf_order ASC
0.001362 - SELECT DISTINCT gperm_itemid FROM group_permission WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (1,2)
0.005120 - SELECT b.* FROM newblocks b, block_module_link m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id IN (0,-1) AND b.bid IN (1,2,3,4,5,6,7,8,9,10,11,12) ORDER BY b.weight, m.block_id
0.000776 - SELECT COUNT(*) FROM priv_msgs WHERE (read_msg = '0' AND to_userid = '1')
0.000915 - SELECT * FROM modules WHERE (hasmain = '1' AND isactive = '1' AND weight > '0') ORDER BY weight ASC, mid ASC
0.000677 - SELECT * FROM group_permission WHERE (gperm_name = 'module_read' AND gperm_modid = '1' AND (gperm_groupid = '1' OR gperm_groupid = '2'))
Total: 13
(後台)
0.000462 - SET NAMES 'utf8'
0.000229 - SET SQL_BIG_SELECTS = 1
0.001753 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC
0.000949 - SELECT sess_data, sess_ip FROM session WHERE sess_id = 'n00rgfneah2qkrch88mu92shb3'
0.000469 - SELECT * FROM users WHERE uid = '1'
0.001352 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '3') ORDER BY conf_order ASC
0.000878 - SELECT * FROM modules WHERE dirname = 'system'
0.001631 - SELECT * FROM config WHERE (conf_modid = '1') ORDER BY conf_order ASC
0.001036 - SELECT * FROM modules WHERE (hasadmin = '1' AND isactive = '1') ORDER BY weight ASC, mid ASC
0.001057 - SELECT * FROM modules WHERE dirname = 'pm'
0.000426 - SELECT * FROM modules WHERE mid = 2
0.000845 - SELECT * FROM modules WHERE dirname = 'profile'
0.000429 - SELECT * FROM modules WHERE mid = 3
0.001103 - SELECT * FROM modules WHERE dirname = 'protector'
0.000785 - SELECT * FROM modules WHERE mid = 4
0.000872 - SELECT * FROM newblocks WHERE bid = 4
0.001448 - SELECT b.bid FROM newblocks b LEFT JOIN group_permission l ON l.gperm_itemid=b.bid WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND (l.gperm_groupid=1 OR l.gperm_groupid=2) AND b.isactive=1 ORDER BY b.weight,b.bid
0.000572 - SELECT * FROM newblocks WHERE bid = 9
0.000544 - SELECT * FROM newblocks WHERE bid = 8
0.000552 - SELECT * FROM newblocks WHERE bid = 10
0.000682 - SELECT COUNT(*) FROM xoopscomments WHERE com_status=1
0.000882 - SELECT * FROM `users` WHERE (level > '0') ORDER BY user_regdate DESC LIMIT 0, 10
0.000870 - SELECT * FROM `users` WHERE (level > '0') ORDER BY posts DESC LIMIT 0, 10
0.000985 - SELECT * FROM group_permission WHERE (gperm_name = 'module_read' AND gperm_groupid IN (1,2))
0.000526 - SELECT * FROM xoopscomments WHERE (com_status = '2' AND com_modid IN (1,2,3,4)) ORDER BY com_created DESC LIMIT 0, 10
0.000428 - SELECT * FROM modules WHERE hascomments = '1' ORDER BY weight ASC, mid ASC
Total: 26
希望能一起討論找出解決的方法,感謝!!
如果資料還有不足請告知,我再拿出來參考~拜託各位了!!!