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

这个小城,步入冬天就立马变了颜色,还没来得及等我换件衣服就开演了。如何扮演好自己的角色,我还没想好,我不适合做主角,只能在配角方面下功夫,极力配合主角旦,生的表演。红红火火的演完这场戏,让北方的冬天刮目相看。

 

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($question['uid'] == $uid)

              {

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

              }else*/

3,然后

if($answer['uid'] != $uid)

              {

                     showmsgs(‘unallowed_action’, $backurl);

              }else

替换成

if($question['uid'] == $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($answer['uid'] != $uid)

              {

                     showmsgs(‘unallowed_action’, $backurl);

              }elseif($answer['status'] != 0)

              {

                     showmsgs(‘question_solved’, $backurl);

              }elseif($answer['expiredtime'] < $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($question['uid'] == $uid)

       {

              $publisher = 1;

       }

 

本文dede 问答模块匿名提问的简单处理方法到此结束。要装进一杯新泉,你就必须倒掉已有的陈水;要获取一枝玫瑰,你就必须放弃到手的蔷薇;要多一份独特的体验,你就必须多一份心灵的创伤。谢谢大家支持!

标签: dede