|
6#
樓主 |
發表于 2024-4-11 16:05:32
|
只看Ta
- 打開source\function\function_discuzcode.php 這個文件
- 下面這個是關鍵的地方在222行
- if(strpos($msglower, '[hide]') !== FALSE) {
- if($authorreplyexist === null) {
- if(!$_G['forum']['ismoderator']) {
- if($_G['uid']) {
- $_post = C::t('forum_post')->fetch('tid:'.$_G['tid'], $pid);
- $authorreplyexist = $_post['tid'] == $_G['tid'] ? C::t('forum_post')->fetch_pid_by_tid_authorid($_G['tid'], $_G['uid']) : FALSE;
- }
- } else {
- $authorreplyexist = TRUE;
- }
- }
- if($authorreplyexist) {
- $message = preg_replace("/\[hide\]\s*(.*?)\s*\[\/hide\]/is", tpl_hide_reply(), $message);
- } else {
- $message = preg_replace("/\[hide\](.*?)\[\/hide\]/is", tpl_hide_reply_hidden(), $message);
- $message = '<script type="text/javascript">replyreload += \',\' + '.$pid.';</script>'.$message;
- }
- }
- 226行是把玩家回復的內容加入變量$_post里面
- 然后227行是判斷的
- 玩家是否回復了這個帖子
- 回復了這個數值就是真
- 然后怎么檢測回復的內容里面帶圖片呢?
- 把227行那個三元操作改為if else的形式
- if($_post['tid'] == $_G['tid']){
- if(這里加一個判斷,判斷玩家的回復里面是否有圖片鏈接){
- $authorreplyexist = TRUE;
- }else{
- $authorreplyexist = FALSE;
- }
- }else{
- $authorreplyexist = FALSE;
- }
復制代碼 樓上的代碼不知道為什么少了很多
|
|