森林之原
五月 23, 2012, 10:02:08 pm *
歡迎光臨, 訪客. 請先 登入註冊一個帳號.

請輸入帳號, 密碼以及預計登入時間
新聞: CPG 1.4.3 繁體中文完成,請到 CPG 的版面下載。
 
   首頁   說明 搜尋 日曆 登入 註冊  
頁: [1]   向下
  寄送主題  |  列印  
作者 主題: 限制文章內的表情圖案  (閱讀 2934 次)
0 會員 以及 1 訪客 正在閱讀本篇主題.
Andrew::
魔,羯
*
離線 離線

文章: 217



個人網站
« 於: 一月 02, 2005, 11:13:14 am »

這個可以讓你限制文章內的表情圖案數量. 請依照下面的說明修改檔案:
程式碼:
<edit file>
Sources/Post.php
</edit file>

<search for>
$post_errors[] = 'long_message';
</search for>

<add after>
if (isset($_POST['message']))
{
$smileyLimit = 3;

$prev = substr_count($_POST['message'], '[img') + substr_count($_POST['message'], '[IMG');
$tempmsg = doUBBC($_POST['message'], true);
if (substr_count($tempmsg, '<img') > ($prev + $smileyLimit))
$post_errors[] = 'smiley_limit';
}
</add after>

<edit file>
Themes/default/languages/Post.english.php
</edit file>

<search for>
?>
</search for>

<add before>
$txt['error_smiley_limit'] = 'You can ad x smilies per post. Remove some smilyes and try again.';
</add before>

$smileyLimit = 3; 表示只允許3個表情圖案, 請改成你要允許的數量.

<edit file> - 修改檔案
<search for> - 找裡面的程式碼
<add after> - 在找到的程式碼後面加上
<add before> - 在找到的程式碼前面加上

來源: http://www.simplemachines.org/community/index.php?topic=17213.0
向版主檢舉   已記錄

頁: [1]   向上
  寄送主題  |  列印  
 
前往:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC Valid XHTML 1.0! Valid CSS!