[問題]論壇狀態簽名檔0.3可顯示中文

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

版主: 版主管理群

銀薰
星球公民
星球公民
文章: 48
註冊時間: 2003-05-10 00:28

文章 銀薰 »

伺服器的問題...
圖檔
問題外掛:(例:快速回覆)
參考連結:(連結至外掛發表區的主題)
使用版本:(例:phpBB 2.0.2)
網站位置:(例:http://phpbb-tw.net)
狀況描述:

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


補充:
(若是需要,請列出您曾裝過的外掛名稱)
aiken
竹貓忠實會員
竹貓忠實會員
文章: 1514
註冊時間: 2003-11-09 11:02
來自: 大頭真論壇
聯繫:

文章 aiken »

不是只要有支援PHP, MySQL與ICONV的伺服器就可以跑即時狀態簽名檔了嗎?
銀薰
星球公民
星球公民
文章: 48
註冊時間: 2003-05-10 00:28

文章 銀薰 »

伺服器不支援中文字型吧...
圖檔
問題外掛:(例:快速回覆)
參考連結:(連結至外掛發表區的主題)
使用版本:(例:phpBB 2.0.2)
網站位置:(例:http://phpbb-tw.net)
狀況描述:

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


補充:
(若是需要,請列出您曾裝過的外掛名稱)
conway
星球普通子民
星球普通子民
文章: 20
註冊時間: 2002-08-16 20:50
來自: 台中

[Linux]順便看看我的

文章 conway »

不好意思可以順便看一下我的嗎?

代碼: 選擇全部

<?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++;
		}
\n
		$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, 62);
$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);
$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, 62);

//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, 335, 28, $red, "C:/WINNT/Fonts/mingliu.ttc", big52uni(",最近3小時來訪: $stat")); 

ImageTTFText($im, 8, 0, 12, 13, $dblue, "/usr/share/fonts/mingliu.ttf", big52uni("$sitename"));
ImageTTFText($im, 9, 0, 150, 15, $tc, "/usr/share/fonts/mingliu.ttf", big52uni("所有會員: $total_users -")); 
ImageTTFText($im, 9, 0, $leerzeichen-10, 15, $red, "/usr/share/fonts/mingliu.ttf", big52uni("線上: $logged_online")); 
ImageTTFText($im, 9, 0, 292, 15, $tc, "/usr/share/fonts/mingliu.ttf", big52uni(",最新註冊的會員: $newest_user")); 
ImageTTFText($im, 9, 0, 150, 41, $tc, "/usr/share/fonts/mingliu.ttf", big52uni("最後發表的主題:↓")); 
ImageTTFText($im, 9, 0, 150, 28, $tc, "/usr/share/fonts/mingliu.ttf", big52uni("有 $total_posts 篇文章在 $total_topics 個主題中")); 
ImageTTFText($im, 9, 0, 150, 54, $blue, "/usr/share/fonts/mingliu.ttf", big52uni("$latest_topic")); 
ImageTTFText($im, 9, 0, 366, 41, $dblue, "/usr/share/fonts/mingliu.ttf", big52uni("中文顯示修正: Mowd "));
header("Content-Type: image/png"); 
Imagepng($im,'',100); 
ImageDestroy ($im); 
?>
我是架在linux 7.3 上面,那個細明體的檔案是我從xp copy 過去的....

結果會出現變成:
圖檔

搞了好久還是不知道問題在哪邊.
謝謝囉!
圖檔
主題已鎖定

回到「外掛問題討論」