[問題]狀態簽名檔中文亂碼

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

主題已鎖定
Oudie
星球普通子民
星球普通子民
文章: 28
註冊時間: 2002-07-02 23:58

[問題]狀態簽名檔中文亂碼

文章 Oudie »

●架設主機作業系統:Linux
●您的 phpBB2 版本:phpBB 2.0.6
我是架設在www.acsite.net上,已經確定支援iconv,但是中文仍然會有亂碼,英文則顯示正常,我嚐試上傳5種不同的中文字型上去,但是都只有英文顯示正常,中文則為亂碼,請問有人遇到和我一樣的狀況而且已經解決的嗎?
夢幻LUGIA
竹貓忠實會員
竹貓忠實會員
文章: 352
註冊時間: 2003-11-16 07:27
來自: 竹貓不忠實會員

文章 夢幻LUGIA »

字體大小呢?
之前用MOWD大的方法,把字體調到9以外的大小就會出問題

不知道不知道不知道XD〈逃
Oudie
星球普通子民
星球普通子民
文章: 28
註冊時間: 2002-07-02 23:58

文章 Oudie »

字體大小我從6調到14,只看到亂碼由小變大XDXDXD
銀薰
星球公民
星球公民
文章: 48
註冊時間: 2003-05-10 00:28

文章 銀薰 »

不是字體的問題.....
改字體只會讓字變奇怪不會變亂碼\r
你是抓哪個載點的??
說不定你抓到的是原始的版本...
圖檔
問題外掛:(例:快速回覆)
參考連結:(連結至外掛發表區的主題)
使用版本:(例:phpBB 2.0.2)
網站位置:(例:http://phpbb-tw.net)
狀況描述:

(這裡描述您遇到的狀況)


補充:
(若是需要,請列出您曾裝過的外掛名稱)
Oudie
星球普通子民
星球普通子民
文章: 28
註冊時間: 2002-07-02 23:58

文章 Oudie »

銀薰 寫:不是字體的問題.....
改字體只會讓字變奇怪不會變亂碼\r
你是抓哪個載點的??
說不定你抓到的是原始的版本...
這是我用的版本,因為目前只能使用英文,所以我把中文顯示那一欄給DISABLE掉,字型也都換成英文字型,冒犯之處請見諒 :-D

代碼: 選擇全部

<?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); 
?>
圖檔
銀薰
星球公民
星球公民
文章: 48
註冊時間: 2003-05-10 00:28

文章 銀薰 »

你連結的字體是什麼字體....
comic.ttf?
不懂
圖檔
問題外掛:(例:快速回覆)
參考連結:(連結至外掛發表區的主題)
使用版本:(例:phpBB 2.0.2)
網站位置:(例:http://phpbb-tw.net)
狀況描述:

(這裡描述您遇到的狀況)


補充:
(若是需要,請列出您曾裝過的外掛名稱)
主題已鎖定

回到「外掛問題討論」