為什麼是空白的!QQ
我的有支援iconv。
設定檔
代碼: 選擇全部
$phpbb_root_path = './forum'; //請對映到PHPBB的資料夾\r
論壇在/home/forum/
這樣設定對嗎?
版主: 版主管理群

代碼: 選擇全部
$phpbb_root_path = './forum'; //請對映到PHPBB的資料夾\r

代碼: 選擇全部
<?
//中文化 BY 銀薰 http://mybell.myftp.org/phpbb2/
//參考網頁http://freebsd.sinica.edu.tw/~statue/zh-tut/php-imagettftext.html Mowd提供
/* need iconv module */
function big52uni($text) {
$rtext="";
$max=strlen($text);
for($i=0;$i<$max;$i++){
$h=ord($text[$i]);
if($h>=150 && $i<$max-1){
$rtext.="&#".base_convert(bin2hex(iconv("big5","ucs-2",
substr($text,$i,2))),16,10).";";
$i++;
}else{
$rtext.=$text[$i];
}
}
return $rtext;
}
//
// Configuration
//
$width = 365; //圖片寬度
$height = 30; //圖片高度\r
$left = 10; //文字距離\r
$top = 25; //文字高度\r
$spacing = 11; //Line spacing of stats text
$signImage = "sign.jpg"; //底圖名稱\r
$newImage = "burnz.jpg"; //生成的論壇狀態圖(就是加上論壇狀況的圖啦.. 這圖不會即時更新 搞不懂原作者為啥弄個這個出來)
$compression = 100; //壓縮簽名檔圖像 (100 = 不壓縮)
define('IN_PHPBB', true);
$phpbb_root_path = './forum/'; //請對映到PHPBB的資料夾\r
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$total_topics = get_db_stat('topiccount');
$text = "會員: $total_users 主題: $total_topics 文章: $total_posts
";
$writeImage = split("
", $text);
if(is_array($writeImage)){
$i = 0;
foreach($writeImage as $writtenImage){
$i++;
$output[$i] = $writtenImage;
}
}
$tmpImage = imagecreatefromjpeg($signImage);
$img = imagecreate($width,$height);
$bg_color = imagecolorallocate ($img, 255, 255, 255);//RGB values - 底色吧.....
$text_color = imagecolorallocate ($img, 0, 0, 0);//RGB values - 文字顏色\r
imagefilledrectangle ($img, 0, 0, $width, $height, $bg_color);
imagecopy ($img, $tmpImage, 0, 0, 0, 0, $width, $height); // Copy stats
imagecolortransparent($img, $bg_color); // 設定底色透明
//$i = 0;
//while($i < count($output)){
//imagestring($img, 2, $left, (($i * $spacing) - $spacing + $top), $output[$i], $text_color);
//$i++;
//}
ImageTTFText($img, 9, 0, $left, $top, $text_color, "C:/WINNT/Fonts/mingliu.ttc",big52uni("$text"));
header("Content-Type: image/png");
imagepng($img);
imagejpeg($img, $newImage, $compression);
imagedestroy($img); // get the image out of memory
?>
