PLUS 1.53
爬文搜尋笑臉創造器無解決方法....記得以前有的說!
不知道哪位大大知道解決方法的?
[問題] 發文時的笑臉創造器中文亂碼
版主: 版主管理群
使用全新 PLUS 1.53 UTF-8 測試,多國語言的文字都成為亂碼。
無解中 -.-
[預覽] 若有相關文字成為亂碼,請將 AJAX 功能關閉即可。
無解中 -.-
[預覽] 若有相關文字成為亂碼,請將 AJAX 功能關閉即可。
我們都想寫下自己的故事,才初執筆就驚覺,悲歡離合竟也是年輕事!
平凡心動 http://www.hope99.idv.tw/
提出問題時,請提供較完整的資料,才能給你正確的答案,節省你的時間。
發問格式可參閱: http://phpbb-tw.net/phpbb/viewtopic.php?t=15329
PLUS 下載位址: http://www.phpbb2.de/dload.php?action=c ... &cat_id=20
平凡心動 http://www.hope99.idv.tw/
提出問題時,請提供較完整的資料,才能給你正確的答案,節省你的時間。
發問格式可參閱: http://phpbb-tw.net/phpbb/viewtopic.php?t=15329
PLUS 下載位址: http://www.phpbb2.de/dload.php?action=c ... &cat_id=20
那個問題跟狀態簽名檔的中文問題是相同的, 主要是字型的問題
請先找一個有支援utf8的字型檔, 例如Widnows的mingliu.ttc
將字型上傳到plus的根目錄下, 然後這樣子修改
#
#----------[ OPEN ]--------------------
#
text2schild.php
#
#----------[ FIND ]--------------------
#
#
#----------[ REPLACE WITH ]--------------------
#
# 請視實際上傳的檔案名稱做修改
#
#----------[ SAVE/CLOSE FILE ]--------------------
#
# EoM
如果你論壇採用的編碼是big5的話, 請先確認主機有支援iconv
確認支援iconv之後, 請再多做底下的修改
#
#----------[ OPEN ]--------------------
#
text2schild.php
#
#----------[ FIND ]--------------------
#
#
#----------[ AFTER, ADD ]--------------------
#
代碼:
#
#----------[ SAVE/CLOSE FILE ]--------------------
#
# EoM
另外提供一個檔案大小比mingliu.ttc還小的utf8字型
請按此下載
請先找一個有支援utf8的字型檔, 例如Widnows的mingliu.ttc
將字型上傳到plus的根目錄下, 然後這樣子修改
#
#----------[ OPEN ]--------------------
#
text2schild.php
#
#----------[ FIND ]--------------------
#
代碼: 選擇全部
$schriftdatei = 'arial';#----------[ REPLACE WITH ]--------------------
#
# 請視實際上傳的檔案名稱做修改
代碼: 選擇全部
$schriftdatei = 'mingliu.ttc';#----------[ SAVE/CLOSE FILE ]--------------------
#
# EoM
如果你論壇採用的編碼是big5的話, 請先確認主機有支援iconv
確認支援iconv之後, 請再多做底下的修改
#
#----------[ OPEN ]--------------------
#
text2schild.php
#
#----------[ FIND ]--------------------
#
代碼: 選擇全部
if(!$text) $text = 'error';//$lang['SC_error'];#----------[ AFTER, ADD ]--------------------
#
代碼:
代碼: 選擇全部
$text = iconv('Big5', 'UTF-8', $text);#----------[ SAVE/CLOSE FILE ]--------------------
#
# EoM
另外提供一個檔案大小比mingliu.ttc還小的utf8字型
請按此下載
謝絕所有私人訊息詢問外掛相關問題
有問題請直接於版上發表, 集思廣議絕對比專挑特定人士詢問來的好
竹貓禁止發表含破解相關的軟體, 違者砍文
不要跟我講別的地方都可以發, 為什麼竹貓就不行
免費不等於破解, 傻傻的搞不清楚
有問題請直接於版上發表, 集思廣議絕對比專挑特定人士詢問來的好
竹貓禁止發表含破解相關的軟體, 違者砍文
不要跟我講別的地方都可以發, 為什麼竹貓就不行
免費不等於破解, 傻傻的搞不清楚
我也是有同樣的問題, 我用手動修改把字往上移2pixel
但還是遇見句子太長的話會被吃字(無解中...) XD
以下是我修改的內碼, 希望對你有幫助
如果你使用mingliu.ttc
#
#----------[ OPEN ]--------------------
#
text2schild.php
#
#----------[ FIND ]--------------------
#
#
#----------[ REPLACE WITH ]--------------------
#
#
#----------[ SAVE/CLOSE FILE ]--------------------
#
# EoM
但還是遇見句子太長的話會被吃字(無解中...) XD
以下是我修改的內碼, 希望對你有幫助
如果你使用mingliu.ttc
#
#----------[ OPEN ]--------------------
#
text2schild.php
#
#----------[ FIND ]--------------------
#
代碼: 選擇全部
$i = 0;
while($i < count($output)){
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
if($schattenfarbe) imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + 6), trim($output[$i]), $txt2color);
imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + 5), trim($output[$i]), $txtcolor);
}else{
if($schattenfarbe) imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + $schriftheight + 4), $txt2color, $schriftdatei, trim($output[$i]));
imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + $schriftheight + 3), $txtcolor, $schriftdatei, trim($output[$i]));
}
$i++;
}
#----------[ REPLACE WITH ]--------------------
#
代碼: 選擇全部
$i = 0;
while($i < count($output)){
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
if($schattenfarbe) imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + 6) + 2, trim($output[$i]), $txt2color);
imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + 5) + 2, trim($output[$i]), $txtcolor);
}else{
if($schattenfarbe) imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + $schriftheight + 4) + 2, $txt2color, $schriftdatei, trim($output[$i]));
imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + $schriftheight + 3) + 2, $txtcolor, $schriftdatei, trim($output[$i]));
}
$i++;
}
#----------[ SAVE/CLOSE FILE ]--------------------
#
# EoM
關於笑臉創造器吃字的問題, 排位問題和多行處理問題我都決解了
不過, 一定要有php 4.3以上和gd 要support free type font
#
#----------[ OPEN ]--------------------
#
text2schild.php
#
#----------[ FIND ]--------------------
#
#
#----------[ REPLACE WITH ]--------------------
#
# mingliu.ttc是目前我試到最好的字型, 如果用其它字型可能要做一點調試
#
#----------[ FIND ]--------------------
#
#
#----------[ REPLACE WITH ]--------------------
#
# 處理句字多長要断行的問題
#
#----------[ FIND ]--------------------
#
#
#----------[ REPLACE WITH ]--------------------
#
# 利用imagettfbbox來計算句字的寛和高
#
#----------[ FIND ]--------------------
#
#
#----------[ REPLACE WITH ]--------------------
#
# 把句字貼上去!!
#
#----------[ SAVE/CLOSE FILE ]--------------------
#
# EoM
如果有什麼錯請指教^^
不過, 一定要有php 4.3以上和gd 要support free type font
#
#----------[ OPEN ]--------------------
#
text2schild.php
#
#----------[ FIND ]--------------------
#
代碼: 選擇全部
$schriftdatei = 'arial';#----------[ REPLACE WITH ]--------------------
#
# mingliu.ttc是目前我試到最好的字型, 如果用其它字型可能要做一點調試
代碼: 選擇全部
$schriftdatei = 'mingliu.ttc';#
#----------[ FIND ]--------------------
#
代碼: 選擇全部
$worte = split(" ", $text);
if(is_array($worte)){
$i = 0;
foreach($worte as $wort){
if((strlen($output[$i].' '.$wort) < 33) && (!substr_count($wort, '[SM'))){
$output[$i] .= ' '.$wort;
}else{
if($i <= 11){
if($zeichenzahl < strlen($output[$i])) $zeichenzahl = strlen($output[$i]);
$i++;
$output[$i] = $wort;
}
}
}
}else{
$zeichenzahl = 33;
$output[0] = substr($text, 0, 30)."...";
}
#----------[ REPLACE WITH ]--------------------
#
# 處理句字多長要断行的問題
代碼: 選擇全部
// BEGIN -- kenspc modified
$worte = split(" ", $text);
$output[0] = '';
if(is_array($worte)){
$i = 0;
foreach($worte as $wort){
if((strlen($output[$i].' '.$wort) < 33) && (!substr_count($wort, '[SM'))){
$output[$i] .= ' '.$wort;
}else{
if($i <= 11){
if($zeichenzahl < strlen($output[$i])) $zeichenzahl = strlen($output[$i]);
if($output[$i] == ''){
$output[$i] = $wort;
}else{
$i++;
$output[$i] = $wort;
}
}
}
}
}else{
$zeichenzahl = 33;
$output[0] = substr($text, 0, 30)."...";
}
// END -- kenspc modified
#----------[ FIND ]--------------------
#
代碼: 選擇全部
$width = ($zeichenzahl * $schriftwidth) + 6;
$height = (count($output) * $schriftheight) + 34;
#----------[ REPLACE WITH ]--------------------
#
# 利用imagettfbbox來計算句字的寛和高
代碼: 選擇全部
// BEGIN -- kenspc modified
//$width = ($zeichenzahl * $schriftwidth) + 6;
//$height = (count($output) * $schriftheight) + 34;
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
$width = ($zeichenzahl * $schriftwidth) + 6;
$height = (count($output) * $schriftheight) + 34;
}else{
$ttfbboxwidth = 0;
$i = 0;
while($i < count($output)){
$ttfbbox = imagettfbbox($schriftheight, 0, $schriftdatei, trim($output[$i]));
$tempwidth = $ttfbbox[4] - $ttfbbox[6];
if($ttfbboxwidth <= $tempwidth){
$ttfbboxwidth = $tempwidth;
}
$i++;
}
$width = $ttfbboxwidth + 6;
$ttfbboxheight = abs($ttfbbox[5] - $ttfbbox[3]);
$height = (count($output) * $ttfbboxheight) + 34;
}
// END -- kenspc modified
#----------[ FIND ]--------------------
#
代碼: 選擇全部
$i = 0;
while($i < count($output)){
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
if($schattenfarbe) imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + 6), trim($output[$i]), $txt2color);
imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + 5), trim($output[$i]), $txtcolor);
}else{
if($schattenfarbe) imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + $schriftheight + 4), $txt2color, $schriftdatei, trim($output[$i]));
imagettftext($img, $schriftheight, 0, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + $schriftheight + 3), $txtcolor, $schriftdatei, trim($output[$i]));
}
$i++;
}
#----------[ REPLACE WITH ]--------------------
#
# 把句字貼上去!!
代碼: 選擇全部
// BEGIN -- kenspc modified
$i = 0;
while($i < count($output)){
if(((!$gd_info['FreeType Support']) || (!file_exists($schriftdatei)))){
if($schattenfarbe) imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2 + 1), ($i * $schriftheight + 6) + 2, trim($output[$i]), $txt2color);
imagestring($img, 2, (($width - (strlen(trim($output[$i])) * $schriftwidth) - 2) / 2), ($i * $schriftheight + 5) + 2, trim($output[$i]), $txtcolor);
}else{
if($schattenfarbe) imagettftext($img, $schriftheight, 0, (($width - $ttfbboxwidth - 2) / 2 + 1), ($i * $ttfbboxheight + $schriftheight + 4) + 4, $txt2color, $schriftdatei, trim($output[$i]));
imagettftext($img, $schriftheight, 0, (($width - $ttfbboxwidth - 2) / 2), ($i * $ttfbboxheight + $schriftheight + 3) + 4, $txtcolor, $schriftdatei, trim($output[$i]));
}
$i++;
}
// END -- kenspc modified
#----------[ SAVE/CLOSE FILE ]--------------------
#
# EoM
如果有什麼錯請指教^^

