主頁 > 網(wǎng)站建設(shè) > 建站知識(shí) > dede 問答模塊匿名提問的簡單處理方法

dede 問答模塊匿名提問的簡單處理方法

POST TIME:2018-10-30 21:57

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

這樣就不能修改答案了,不過這個(gè)提示是不會(huì)回答自己的問題。

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

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;

}

 



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266