dede 问答模块匿名提问的简单处理方法

2019-10-25 11:08:15 织梦安装使用
  • 文章介绍

 

post.php文件


if(empty($uid) && $action != ‘rate’)
{
showmsgs(‘no_login’,’../member/login.php?gourl=../ask/’);
exit;
}

1,修改成 或注释掉
if(empty($uid) && $action != ‘rate’)
{
if($action!=’ask’ & $action!=”)
{
showmsgs(‘no_login’,’../member/login.php?gourl=../ask/’);
exit;
}
}

 

2,注释掉

/*if($questionuid == $uid)

              {

                     showmsgs(‘asker_cannot_answer’, ‘-1′);

              }else*/

3,然后

if($answeruid != $uid)

              {

                     showmsgs(‘unallowed_action’, $backurl);

              }else

替换成

if($questionuid == $uid)

              {

                     showmsgs(‘asker_cannot_answer’, ‘-1′);

              }else

这样就不能修改答案了,不过这个提示是不会回答自己的问题。

 

或者直接注释掉:修改答案部分

else if($action == ‘modifyanswer’)

{

       $answer = $dsql->getone("SELECT answer.id, answer.uid, ask.dateline, ask.solvetime, ask.status, ask.expiredtime FROM `2d30_askanswer` answer left join 2d30_ask ask on ask.id=answer.askid WHERE answer.id=’$id’");

       if($answer)

       {

              if($answeruid != $uid)

              {

                     showmsgs(‘unallowed_action’, $backurl);

              }elseif($answerstatus != 0)

              {

                     showmsgs(‘question_solved’, $backurl);

              }elseif($answerexpiredtime < $timestamp)

              {

                     showmsgs(‘question_expired’, $backurl);

              }

       } else

       {

              showmsgs(‘question_nonexistence’);

       }

 

       if(trim($content) == ”)

       {

              showmsgs(‘post_answer_isnull’);

       }

       if(strlen($content) > 10000)

       {

              showmsgs(‘post_answer_toolong’);

       }

       if(strlen($brief) > 200)

       {

              showmsgs(‘post_brief_toolong’, ‘-1′);

       }

       if($dsql->ExecuteNoneQuery("update 2d30_askanswer set content=’$content’, brief=’$brief’ where id=’$id’"))

       {

              showmsgs(‘modifyanswer_success’,$backurl);

       }else

       {

              showmsgs(‘modifyanswer_failed’,$backurl);

       }

}

 

question.php

注释

       if($questionuid == $uid)

       {

              $publisher = 1;

       }

 

上一篇:dedecms模板调用论坛DZ的带附件为图..

下一篇:dedecms模板中arclist标签的基本应用..

专业的织梦模板定制下载站,在线购买后即可下载!

商业源码

跟版网模板,累计帮助5000+客户企业成功建站,为草根创业提供助力!

立刻开启你的建站之旅

QQ在线客服

服务热线

织梦建站咨询