[問題]Forum.Statistic.Signature

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

版主: 版主管理群

主題已鎖定
hollowaysxp
竹貓忠實會員
竹貓忠實會員
文章: 535
註冊時間: 2004-06-01 22:39
來自: 仙境傳說回憶最美~台灣桃園
聯繫:

[問題]Forum.Statistic.Signature

文章 hollowaysxp »

http://home.twspc.net/signature.php

為什麼是空白的!QQ
我的有支援iconv。

設定檔

代碼: 選擇全部

$phpbb_root_path = './forum'; //請對映到PHPBB的資料夾\r
我的簽名檔signature.php在/home
論壇在/home/forum/
這樣設定對嗎?
●架設主機作業系統:FreeBSD 6.2-RELEASE (自行架設)
●我的上網方式:FTTB+VDSL HINET 10M/2M
●我安裝的程式:Apache 2.0.59+ PHP Version 4.4.4 + MySql 4.1.21+phpMyadmin 2.9.1.1
●我的 phpBB3 版本:phpBB3.0.1
●我的 phpBB3 連結網址 http://nitcs.itrello.com/forum/
NITCS歡迎你
NITCS論壇
aiken
竹貓忠實會員
竹貓忠實會員
文章: 1514
註冊時間: 2003-11-09 11:02
來自: 大頭真論壇
聯繫:

文章 aiken »

原始的mod連結呢?
誰知道你裝的是哪支MOD

順便把 signature.php 的內容貼出來
hollowaysxp
竹貓忠實會員
竹貓忠實會員
文章: 535
註冊時間: 2004-06-01 22:39
來自: 仙境傳說回憶最美~台灣桃園
聯繫:

文章 hollowaysxp »

連結不知道
名稱是\r
Forum.Statistic.Signature.Beta.0.3 可顯示中文版
原碼:

代碼: 選擇全部

<?
//中文化 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
?>

●架設主機作業系統:FreeBSD 6.2-RELEASE (自行架設)
●我的上網方式:FTTB+VDSL HINET 10M/2M
●我安裝的程式:Apache 2.0.59+ PHP Version 4.4.4 + MySql 4.1.21+phpMyadmin 2.9.1.1
●我的 phpBB3 版本:phpBB3.0.1
●我的 phpBB3 連結網址 http://nitcs.itrello.com/forum/
NITCS歡迎你
NITCS論壇
aiken
竹貓忠實會員
竹貓忠實會員
文章: 1514
註冊時間: 2003-11-09 11:02
來自: 大頭真論壇
聯繫:

文章 aiken »

你的不是 linux 嗎?
那這行是...
"$text_color, "C:/WINNT/Fonts/mingliu.ttc",big52uni("$text")); "
必須把這個檔案上傳到你的目錄中...
hollowaysxp
竹貓忠實會員
竹貓忠實會員
文章: 535
註冊時間: 2004-06-01 22:39
來自: 仙境傳說回憶最美~台灣桃園
聯繫:

文章 hollowaysxp »

沒用?剛剛試過了!
把那段改成
ImageTTFText($img, 9, 0, $left, $top, $text_color, "/home/TwsPC/mingliu.ttc",big52uni("$text"));

檔案也上傳了!一樣看不到簽名檔狀態!
●架設主機作業系統:FreeBSD 6.2-RELEASE (自行架設)
●我的上網方式:FTTB+VDSL HINET 10M/2M
●我安裝的程式:Apache 2.0.59+ PHP Version 4.4.4 + MySql 4.1.21+phpMyadmin 2.9.1.1
●我的 phpBB3 版本:phpBB3.0.1
●我的 phpBB3 連結網址 http://nitcs.itrello.com/forum/
NITCS歡迎你
NITCS論壇
Mowd
竹貓忠實會員
竹貓忠實會員
文章: 326
註冊時間: 2002-06-26 01:17
來自: 台北
聯繫:

文章 Mowd »

快速回覆這篇主題事實上...Windows字型到底能不能在UNIX中用還不知道,不過看了那麼多案例,應該是不能用吧...
主題已鎖定

回到「外掛問題討論」