但不方便之處是除了副檔名是 jpg|jpeg|gif|png 外其他的也不能用 [img], 而且一些如 tinypic 的網根本沒副檔名的就完全不能用 [img], 現在我在不斷嘗試下改到令沒副檔名的也可以用到 [img], 就是開 includes/bbcode.php 內, 找這句\r
代碼: 選擇全部
$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);代碼: 選擇全部
$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);請各位給些意見... (我已預到放寬 img 的危險了, 但由於很多人因此不貼圖, 所以只好這樣 <- 又不想開 html 碼, 況且他們也不知論壇是可以用 html = =)
雖說已知問題, 但被人提醒後也想了一會, 最後我想到這方式... @@
不要用上面的句子, 在\r
代碼: 選擇全部
$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);
代碼: 選擇全部
$text = preg_replace("#\[img\]http://www.tinypic.com/*?\[/img\]#sie", "'[img:$uid]\\\1' . str_replace(' ', '%20', '\\\3') . '[/img:$uid]'", $text);
