|
楼主 |
发表于 2024-4-11 16:05:32
|
查看全部
- 打开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;
- }
复制代码 楼上的代码不知道为什么少了很多
|
|