cfg_ml)){}" in the text; then delete "/ask/control "search file in the directory."/> cfg_ml)){}" in the text; then delete "/ask/control "search file in the directory.">
Home >CMS Tutorial >DEDECMS >How does dedecms enable visitors to ask questions, answer and view
dedecmsHow to enable visitors to ask questions, answer and view?
In some cases in dedecms we need to give visitors certain permissions, such as asking questions, answering and viewing, etc. This article gives the following solutions:
Recommended learning: Dedecms
1. Visitor’s question:
Find the question.php file in the /ask/control directory of dedecms5.7, find this piece of code and delete it:
The code is as follows:
if(empty($this->cfg_ml->M_ID)) { ShowMsg('您尚未登录,请先登录',$GLOBALS['cfg_ask_member']); exit; } if($this->cfg_ml->M_Spacesta < 0) { ShowMsg('您还没有通过审核,暂时不能提问,请耐心等....','-1'); exit; }
2. Visitor Q&A, prompting "Do not reply to the same question repeatedly":
Similarly find and delete the /ask/control directory of dedecms5.7 Find the following code in the question.php file under:
The code is as follows:
if($rs) { ShowMsg('请勿重复回复同一问题!','-1'); exit; }
3. The question has expired and the questioner cannot answer his own question
Also find and delete the question.php file in the /ask/control directory of dedecms5.7, and find a piece of code in it
The code is as follows:
if($question) { if($question['uid'] == $this->cfg_ml->M_ID) { ShowMsg('提问者自己不能回答自己的问题', '-1'); exit; }else if($question['expiredtime'] < $GLOBALS['cfg_ask_timestamp']){ ShowMsg('问题已经过期','-1'); exit; } $data['tid'] = $question['tid']; $data['tid2'] = $question['tid2']; $data['userip'] = getip(); }else{ ShowMsg('回答的问题不存在','-1'); exit; }
4. "You have not logged in yet. Please log in first”
Find, find and delete the myask.php file in the /ask/control directory of dedecms5.7
The code is as follows:
if(empty($this->cfg_ml->M_ID)) { ShowMsg('您尚未登录,请先登录',$GLOBALS['cfg_ask_member']); exit; }
Find, find and delete dedecms5 The code for the search.php file
in the /ask/control directory of .7 is as follows:
if(empty($cfg_ml->M_ID)) { ShowMsg('您尚未登录,请先登录',$GLOBALS['cfg_ask_member']); exit; } if($cfg_ml->M_Spacesta = 0) { ShowMsg('您还没有通过审核,暂时不能提问,请耐心等....','-1'); exit; }
5. "Wrong verification code!" "Wrong answer to the verification question"
Find and delete the question.php file in the /ask/control directory of dedecms5.7
The code is as follows:
if(preg_match("#7#",$GLOBALS['safe_gdopen'])){ $svali = GetCkVdValue(); if(strtolower($data['vdcode']) != $svali || $svali=='') { ResetVdValue(); ShowMsg('验证码错误!', '-1'); exit(); } } //检查验证问题 $faqkey = isset($data['faqkey']) && is_numeric($data['faqkey']) ? $data['faqkey'] : 0; if($GLOBALS['gdfaq_ask'] == 'Y') { global $safefaqs; if($safefaqs[$faqkey]['answer'] != $data['safeanswer'] || $data['safeanswer'] =='') { ShowMsg('验证问题答案错误', '-1'); exit(); } }
The above is the detailed content of How does dedecms enable visitors to ask questions, answer and view. For more information, please follow other related articles on the PHP Chinese website!