21sta

WordPress使用和个人碎碎念

phpnuke显示中文解决方案

johnkou writes “I am a big fan of your phpnuke portal software. And I have successfully used your phpnuke systems for Chinese community. However, with a lot of modifications to the origional phpnuke versions in order to make the system display Chinese correctly.

Have anyone reported to you that phpnuke has problem with Chinese?

There is a solution for phpnuke 77.

If add utf-8 (unicode) Chinese Language files to the system, and use the new utf-8 Chinese language files instead origional Chinese language files, 90% of the functions will work under Chinese. However, there still few places needed to be modified in order to make phpnuke 100% contapable with Chinese display (unicode Chinese)

New phpnuke 79, however, created more problem for Chinese display. Most likely is because the functions used in the new version. For example:

/*
$xsitename = htmlentities($xsitename, ENT_QUOTES);
$xslogan = htmlentities($xslogan, ENT_QUOTES);
$xbackend_title = htmlentities($xbackend_title, ENT_QUOTES);
$xnotify_subject = htmlentities($xnotify_subject, ENT_QUOTES);
$xsingleaccountname = htmlentities($xsingleaccountname, ENT_QUOTES);
*/
$sitename = filter($row['sitename'], nohtml, 1);
$nukeurl = filter($row['nukeurl'], nohtml, 1);
$site_logo = filter($row['site_logo'], nohtml, 1);
$slogan = filter($row['slogan'], nohtml, 1);

More exaple:
admin/modules/settings.php 「slogan」 can not display Chinese

We need to modify mainfile.php, change $what to the following:

function filter($what, $strip="", $save="", $type="") {
if ($strip == "nohtml") {
$what = check_html($what, $strip);
//$what = htmlentities(trim($what), ENT_QUOTES);
$what = htmlspecialchars(trim($what), ENT_QUOTES);
// If the variable $what doesn't comes from a preview screen should be converted
if ($type != "preview" AND $save != 1) {
$what = html_entity_decode($what, ENT_QUOTES);
}
}

When you make new version next time, would you please consider this issue?

I think once you have Asian language, double bytes, issue taking care of, phpnuke will win over millions of Chinese, Japanese and Korean users.

Best Regards,
John Kou
john@geilusa.com

点赞

发表评论

电子邮件地址不会被公开。 必填项已用*标注