:::
XOOPS使用討論區

求救!安裝好XOOPS後按一般設定,原本的中文突然自動轉英文了!?

discuss pic 2012-08-07 17:05:13
我的作業系統是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


希望能一起討論找出解決的方法,感謝!!
如果資料還有不足請告知,我再拿出來參考~拜託各位了!!!
discuss pic 2012-08-08 00:45:21
tad
竟然可以裝到這麼複雜.....
重裝吧!
重開一個資料庫,只要確定資料庫是 utf8_genernal_ci
接著一路安裝就沒事了...
discuss pic 2012-08-08 02:45:30
謝謝Tad老師,我再重安裝試試看!
那這樣的話我的資料庫和xoops的版本組合其實是OK的,跟我出現的問題是沒關係的囉?

那請問一下安裝xoops的時候,要確定資料庫是utf8_genernal_ci的話要先在資料庫裡先新增好空的資料庫(ex:xoops),之後點xoops資料庫進去管理那裏改它的校正為utf8_genernal_ci嗎?因為如果是直接安裝xoops時按照步驟新增好的資料庫好像預設都是latin1_swedish_ci
discuss pic 2012-08-08 02:47:55
tad
那就是MySQL伺服器的設定檔預設編碼不正確阿~
或者說是預設值沒去調整的關係
discuss pic 2012-08-08 03:10:00
Tad老師說的這兩樣我都不曉得@@"
原來要調整阿!!
現在已經重新安裝好xampp了,好險還沒安裝xoops!!

我去找看看改的方法,如果Tad老師能提供好的解決方法也請指教,謝謝^^
discuss pic 2012-08-08 04:21:22
我改MySQL編碼的方法是在C:\xampp\mysql\bin\my.ini [mysqld] character-set-server=utf8 collation-server=utf8_general_ci init-connect='SET NAMES utf8' [client] default-character-set=utf8 檢查 MySQL Server 的編碼也都成功為utf8_general_ci 安裝完xoops後卻是一片空白~囧" 也檢查過資料庫是他的資料庫編碼utf8_general_ci 開啟除錯後: 錯誤 警告: include(C://xampp//xoops255_data/caches/smarty_compile/71fe51b7-system-default-default^%%22^222^222153D0%%db%3Asystem_block_user.html.php) [function.include]: failed to open stream: No such file or directory 在檔案中的第 /class/smarty/Smarty.class.php 列 1263 警告: include() [function.include]: Failed opening 'C://xampp//xoops255_data/caches/smarty_compile/71fe51b7-system-default-default^%%22^222^222153D0%%db%3Asystem_block_user.html.php' for inclusion (include_path='.;C:/xampp/php/PEAR') 在檔案中的第 /class/smarty/Smarty.class.php 列 1263 警告: include(C://xampp//xoops255_data/caches/smarty_compile/71fe51b7-system-default-default^%%42^428^428512AB%%db%3Asystem_block_mainmenu.html.php) [function.include]: failed to open stream: No such file or directory 在檔案中的第 /class/smarty/Smarty.class.php 列 1263 警告: include() [function.include]: Failed opening 'C://xampp//xoops255_data/caches/smarty_compile/71fe51b7-system-default-default^%%42^428^428512AB%%db%3Asystem_block_mainmenu.html.php' for inclusion (include_path='.;C:/xampp/php/PEAR') 在檔案中的第 /class/smarty/Smarty.class.php 列 1263 警告: unlink(xampp//xoops255_data/caches/xoops_cache/xoops_71fe51b7_page_cb2646cc-tchinese_utf8-98c6f2c2-eab00118.php) [function.unlink]: No such file or directory 在檔案中的第 /class/file/file.php 列 325 警告: include(C://xampp//xoops255_data/caches/smarty_compile/71fe51b7-system-default-default^%%65^65F^65F592F1%%db%3Asystem_homepage.html.php) [function.include]: failed to open stream: No such file or directory 在檔案中的第 /class/smarty/Smarty.class.php 列 1263 警告: include() [function.include]: Failed opening 'C://xampp//xoops255_data/caches/smarty_compile/71fe51b7-system-default-default^%%65^65F^65F592F1%%db%3Asystem_homepage.html.php' for inclusion (include_path='.;C:/xampp/php/PEAR') 在檔案中的第 /class/smarty/Smarty.class.php 列 1263 警告: include(C://xampp//xoops255_data/caches/smarty_compile/71fe51b7-system-default-default^%%48^480^480341A6%%theme.html.php) [function.include]: failed to open stream: No such file or directory 在檔案中的第 /class/smarty/Smarty.class.php 列 1256 警告: include() [function.include]: Failed opening 'C://xampp//xoops255_data/caches/smarty_compile/71fe51b7-system-default-default^%%48^480^480341A6%%theme.html.php' for inclusion (include_path='.;C:/xampp/php/PEAR') 在檔案中的第 /class/smarty/Smarty.class.php 列 1256 不建議使用 問題 0.000992 - SET NAMES 'utf8' 0.000478 - SET SQL_BIG_SELECTS = 1 0.002246 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '1') ORDER BY conf_order ASC 0.001049 - SELECT sess_data, sess_ip FROM session WHERE sess_id = 'fbdjfbiel1klj46okqln16t986' 0.000607 - SELECT * FROM users WHERE uid = '1' 0.001443 - SELECT COUNT(*) FROM banner 0.000912 - SELECT * FROM banner LIMIT 2, 1 0.001577 - SELECT * FROM config WHERE (conf_modid = '0' AND conf_catid = '3') ORDER BY conf_order ASC 0.002129 - SELECT DISTINCT gperm_itemid FROM group_permission WHERE gperm_name = 'block_read' AND gperm_modid = 1 AND gperm_groupid IN (1,2) 0.006549 - 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.001289 - SELECT COUNT(*) FROM priv_msgs WHERE (read_msg = '0' AND to_userid = '1') 0.002883 - 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.001956 - SELECT * FROM modules WHERE (hasmain = '1' AND isactive = '1' AND weight > '0') ORDER BY weight ASC, mid ASC 0.001295 - SELECT * FROM group_permission WHERE (gperm_name = 'module_read' AND gperm_modid = '1' AND (gperm_groupid = '1' OR gperm_groupid = '2')) 0.001720 - 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.001571 - 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 實在看不懂>< 希望能幫我看一下問題在哪,謝謝!
:::

搜尋

QR Code 區塊

https%3A%2F%2Ftad0616.net%2Fmodules%2Ftad_discuss%2Fdiscuss.php%3FBoardID%3D17%26DiscussID%3D2484%26g2p%3D1

線上使用者

70人線上 (47人在瀏覽討論留言)

會員: 0

訪客: 70

更多…