[[WordPressの日本語対応版の配布を行っているサイト:http://wordpress.xwd.jp/]]がありました。すばらしい。今後お世話になります。(^^) - 2003.12.23

----

 [[WordPress:http://wordpress.org/]]とは、PHP、MySQLを利用したblogツールです。表示される文字列の全日本語化は考えていませんが、とりあえず日本語環境で使えるようにすることはできます。

** mbstringを有効に
** mbstringを有効に [#uc305efb]
 なので、PHPのバージョンは4.2以降が望ましいですね。

** wp-config-extra.phpで$admin_area_charsetを追加
** wp-config-extra.phpで$admin_area_charsetを追加 [#sceb123f]
>$admin_area_charset="Shift_JIS";~

の1行を追加すると、MySQLのDBにShift_JISのままinsertされます。

** http-equivの編集
** http-equivの編集 [#n5caeaa3]
 各*.phpファイルに点在しているmeta http-equivのcharsetを日本語コードにする。私はほとんどを「Shift_JIS」としました。
><meta http-equiv="ContentType" content="text/html; charset=iso-8859_1"~

を~
><meta http-equiv="ContentType" content="text/html; charset=Shift_JIS"~

に変更。

** RDF、RSSファイルのContent-type、encodingの編集・追加
** RDF、RSSファイルのContent-type、encodingの編集・追加 [#l96371e3]
 XMLをHTTP出力する部分が動作しなくなるので、
>header('Content-type: text/xml');~
><?php echo "<?xml version=\"1.0\"?".">"; ?>~

を~
>header('Content-type: text/xml; charset=Shift_JIS');~
><?php echo "<?xml version=\"1.0\" encoding=\"Shift_JIS\"?".">"; ?>~

のように変更します。

** メール送信時の文字化け対策
** メール送信時の文字化け対策 [#k27eb182]
 http://cgi.no-ip.org/wp/index.php?p=8&c=1 にあるように、
+php.iniのmbstring.func_overloadの値を変更するか
+mail()関数をmb_send_mail()関数に置き換えるか

です。

** trackbackの文字化け対策
** trackbackの文字化け対策 [#m71e6174]
 http://cgi.no-ip.org/wp/index.php?p=9&c=1 より。

b2trackback.phpで

>// trackback is done by a GET

のコメントの後に

>$charset=$HTTP_GET_VARS[’charset’];

を追加。

>// trackback is done by a POST

のコメントの後に

>$charset=$HTTP_POST_VARS[’charset’];

を追加。

>$query = “INSERT INTO $tablecomments VALUES (’0′,’$comment_post_ID’,’>$author’,’$email’,’$tb_url’,’$user_ip’,’$now’,’$comment’,’0′)";
>$result = $wpdb->query($query);

の前に

>if ($charset==""){$charset="auto";}
>else {$charset = strtoupper(trim($charset));}
>$comment = mb_convert_encoding($comment,"Shift_JIS", $charset);
>$author = mb_convert_encoding($author,"Shift_JIS", $charset);

を挿入。

b2functions.phpのtrackback関数について、
>$query_string = “title=$title&url=$url&blog_name=$blog_name&excerpt=$excerpt&charset=shift_jis“;

と変更。
- QM3AMA  <a href="http://doguvoiwtiyi.com/">doguvoiwtiyi</a>, [url=http://qtckwievvefs.com/]qtckwievvefs[/url], [link=http://twzbfccotcqz.com/]twzbfccotcqz[/link], http://dpqlaxnhwlyk.com/ -- [[xxitfascu]] &new{2013-12-07 (Sat) 13:07:59};




#comment


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS