參考連結:phpBB狀態簽名檔中文版+iconv安裝教學+修改
狀況描述:
這個是我見過的同類型外掛中容量佔最少的一個,
可是他是要連到php檔案不是輸出圖片,所以使用上碰上了麻煩。
使用來貼圖時除了副檔名為:jpg, jpeg, gif和png外,其他都會失效。
因此要使用這個外就得修改 includes/bbcode.php 中的這一段:
代碼: 選擇全部
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"
\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\\1' . str_replace(' ', '%20', '\\\3') . '[/img:$uid]'", $text);
但這樣論壇的安全性就會大大降低,
所以想在這裡請教各位要怎樣才能令階級是ADMIN能夠在中使用 .php ?
我的想法是這樣,把上面那段語法修改成這樣:
代碼: 選擇全部
// [img]image_url_here[/img] code..
if ( 階級 == ADMIN )
{
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"
\t<]*?(\.(jpg|jpeg|gif|png|php)))\[/img\]#sie", "'[img:$uid]\\\1' . str_replace(' ', '%20', '\\\3') . '[/img:$uid]'", $text);
}
else
{
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"
\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\\1' . str_replace(' ', '%20', '\\\3') . '[/img:$uid]'", $text);
}