文字化け回避策
サーバによって異なる可能性もある上に、XOOPSの移転に伴っておかしくなった可能性もある。
が、WADAXの場合の文字化け回避策。
/manager/index.php,line136-
// connect to the database if(@!$modxDBConn = mysql_connect($database_server, $database_user, $database_password)) { die("<h2>Failed to create the database connection!</h2>. Please run the MODx <a href='../install'>install utility</a>"); } else { mysql_select_db($dbase); @mysql_query("SET CHARACTER SET {$database_connection_charset}"); }
を
// connect to the database if(@!$modxDBConn = mysql_connect($database_server, $database_user, $database_password)) { die("<h2>Failed to create the database connection!</h2>. Please run the MODx <a href='../install'>install utility</a>"); } else { mysql_select_db($dbase); mysql_query("SET NAMES utf8;"); @mysql_query("SET CHARACTER SET {$database_connection_charset}"); }
と記述。
それから /manager/includes/extenders/dbapi.mysql.class.inc.php,line90のelse文直後
} else { $dbase = str_replace('`', '', $dbase); // remove the `` chars if (!@ mysql_select_db($dbase)) { $modx->messageQuit("Failed to select the database '" . $dbase . "'!"); exit; }
を
} else { mysql_query("SET NAMES utf8;"); $dbase = str_replace('`', '', $dbase); // remove the `` chars if (!@ mysql_select_db($dbase)) { $modx->messageQuit("Failed to select the database '" . $dbase . "'!"); exit; }
に変更。これでデータベースにはUTF8でデータが格納されるようになる。多分。