●架設主機作業系統:Linux
●您的 phpBB2 版本:phpBB 2.0.6
我是架設在www.acsite.net上,已經確定支援iconv,但是中文仍然會有亂碼,英文則顯示正常,我嚐試上傳5種不同的中文字型上去,但是都只有英文顯示正常,中文則為亂碼,請問有人遇到和我一樣的狀況而且已經解決的嗎?
[問題]狀態簽名檔中文亂碼
版主: 版主管理群
不是字體的問題.....
改字體只會讓字變奇怪不會變亂碼\r
你是抓哪個載點的??
說不定你抓到的是原始的版本...
改字體只會讓字變奇怪不會變亂碼\r
你是抓哪個載點的??
說不定你抓到的是原始的版本...
問題外掛:(例:快速回覆)
參考連結:(連結至外掛發表區的主題)
使用版本:(例:phpBB 2.0.2)
網站位置:(例:http://phpbb-tw.net)
狀況描述:
(這裡描述您遇到的狀況)
補充:
(若是需要,請列出您曾裝過的外掛名稱)
這是我用的版本,因為目前只能使用英文,所以我把中文顯示那一欄給DISABLE掉,字型也都換成英文字型,冒犯之處請見諒銀薰 寫:不是字體的問題.....
改字體只會讓字變奇怪不會變亂碼\r
你是抓哪個載點的??
說不定你抓到的是原始的版本...
代碼: 選擇全部
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
/* need iconv module */
function big52uni($text) {
$rtext="";
$max=strlen($text);
for($i=0;$i<$max;$i++){
$h=ord($text[$i]);
if($h>=160 && $i<$max-1){
$rtext.="&#".base_convert(bin2hex(iconv("big5","ucs-2",
substr($text,$i,2))),16,10).";";
$i++;
}else{
$rtext.=$text[$i];
}
}
return $rtext;
}
// Get basic (usernames + totals) online
// situation
//
$user_forum_sql = ( !empty($forum_id) ) ? "AND s.session_page = " . intval($forum_id) : '';
$sql = "SELECT u.username, u.user_id, s.session_logged_in, s.session_ip
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
AND s.session_time >= ".( time() - 300 ) . "
$user_forum_sql
ORDER BY u.username ASC, s.session_ip ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online information', '', __LINE__, __FILE__, $sql);
}
$logged_online = 0;
$prev_user_id = 0;
while( $row = $db->sql_fetchrow($result) )
{
// User is logged in and therefor not a guest
if ( $row['session_logged_in'] )
{
// Skip multiple sessions for one user
if ( $row['user_id'] != $prev_user_id )
{
$logged_online++;
}
$prev_user_id = $row['user_id'];
}
}
$sql = 'SELECT max(topic_id)
FROM ' . TOPICS_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve max of Topic_id data', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$max_topic_id = $row['max(topic_id)'];
}
$sql = 'SELECT topic_title
FROM ' . TOPICS_TABLE . '
WHERE topic_id = ' . $max_topic_id;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Couldn\'t retrieve Topic_id data', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result))
{
$latest_topic = $row['topic_title'];
}
$image = "myphpbb.png";
$im = imagecreate (480, 100);
$left = imagecreatefrompng($image);
$tc = ImageColorAllocate ($im, 0, 0, 0);
$red = ImageColorAllocate ($im, 255, 0, 0);
$blue = ImageColorAllocate ($im, 0, 0, 255);
$dblue = ImageColorAllocate ($im, 9, 110, 161);
$orange = ImageColorAllocate ($im, 252, 179, 22);
$orange1 = ImageColorAllocate ($im, 240, 139, 50);
$sitename = $board_config['sitename'];
$total_users = get_db_stat('usercount');
$total_posts = get_db_stat('postcount');
$total_topics = get_db_stat('topiccount');
$j = strlen($total_users);
$leerzeichen = $j*6+237;
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
ImageCopy ($im, $left, 0, 0, 0, 0, 480, 100);
//Mowd(TM) 計數器專用\r
$time=time()-10800;
$sql="SELECT time FROM stat WHERE time > $time";
$result=mysql_query($sql);
$stat=mysql_num_rows($result);
ImageTTFText($im, 9, 0, 130, 80, $red, "./comic.ttf", big52uni("Visiter in lates 3hrs: $stat"));
//ImageTTFText($im, 12, 0, 130, 15, $orange, "./augie.ttf", big52uni("$sitename"));
ImageTTFText($im, 15, 0, 130, 20, $orange1, "./AGENO.TTF", big52uni("$sitename"));
ImageTTFText($im, 9, 0, 130, 35, $tc, "./comic.ttf", big52uni("Total Users: $total_users"));
ImageTTFText($im, 9, 0, 130, 50, $red, "./comic.ttf", big52uni("Online Users: $logged_online"));
ImageTTFText($im, 9, 0, 130, 65, $tc, "./comic.ttf", big52uni("Newest Registered: $newest_user"));
//ImageTTFText($im, 9, 0, 150, 41, $tc, "./comic.ttf", big52uni("Latest Topic:↓"));
ImageTTFText($im, 9, 0, 130, 95, $tc, "./comic.ttf", big52uni("We have $total_posts posts of $total_topics topics"));
//ImageTTFText($im, 9, 0, 200, 54, $blue, "./GKAI00MP.TTF", big52uni("$latest_topic"));
//ImageTTFText($im, 9, 0, 366, 41, $dblue, "./comic.ttf", big52uni("中文顯示修正: Mowd "));
header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>你連結的字體是什麼字體....
comic.ttf?
不懂
comic.ttf?
不懂
問題外掛:(例:快速回覆)
參考連結:(連結至外掛發表區的主題)
使用版本:(例:phpBB 2.0.2)
網站位置:(例:http://phpbb-tw.net)
狀況描述:
(這裡描述您遇到的狀況)
補充:
(若是需要,請列出您曾裝過的外掛名稱)


