Home > CMS Tutorial > DEDECMS > body text

How does dedecms enable visitors to ask questions, answer and view

藏色散人
Release: 2019-12-19 09:45:03
Original
1999 people have browsed it

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(&#39;您还没有通过审核,暂时不能提问,请耐心等....&#39;,&#39;-1&#39;);
exit;
}
Copy after login

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(&#39;请勿重复回复同一问题!&#39;,&#39;-1&#39;);
exit;
}
Copy after login

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[&#39;uid&#39;] == $this->cfg_ml->M_ID)
{
ShowMsg(&#39;提问者自己不能回答自己的问题&#39;, &#39;-1&#39;);
exit;
}else if($question[&#39;expiredtime&#39;] < $GLOBALS[&#39;cfg_ask_timestamp&#39;]){
ShowMsg(&#39;问题已经过期&#39;,&#39;-1&#39;);
exit;
}
$data[&#39;tid&#39;] = $question[&#39;tid&#39;];
$data[&#39;tid2&#39;] = $question[&#39;tid2&#39;];
$data[&#39;userip&#39;] = getip();
}else{
ShowMsg(&#39;回答的问题不存在&#39;,&#39;-1&#39;);
exit;
}
Copy after login

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(&#39;您尚未登录,请先登录&#39;,$GLOBALS[&#39;cfg_ask_member&#39;]);
exit;
}
Copy after login

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(&#39;您尚未登录,请先登录&#39;,$GLOBALS[&#39;cfg_ask_member&#39;]);
exit;
}
if($cfg_ml->M_Spacesta = 0)
{
ShowMsg(&#39;您还没有通过审核,暂时不能提问,请耐心等....&#39;,&#39;-1&#39;);
exit;
}
Copy after login

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[&#39;safe_gdopen&#39;])){
$svali = GetCkVdValue();
if(strtolower($data[&#39;vdcode&#39;]) != $svali || $svali==&#39;&#39;)
{
ResetVdValue();
ShowMsg(&#39;验证码错误!&#39;, &#39;-1&#39;);
exit();
}
}
//检查验证问题
$faqkey = isset($data[&#39;faqkey&#39;]) && is_numeric($data[&#39;faqkey&#39;]) ? $data[&#39;faqkey&#39;] : 0;
if($GLOBALS[&#39;gdfaq_ask&#39;] == &#39;Y&#39;)
{
global $safefaqs;
if($safefaqs[$faqkey][&#39;answer&#39;] != $data[&#39;safeanswer&#39;] || $data[&#39;safeanswer&#39;] ==&#39;&#39;)
{
ShowMsg(&#39;验证问题答案错误&#39;, &#39;-1&#39;);
exit();
}
}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!