Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement dedecms visitors can ask, answer and view

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how dedecms enables tourists to ask, answer and view questions. I hope you will learn a lot after reading this article. Let's discuss it together.

How does dedecms make it possible for tourists to ask, answer and view questions?

In some cases in dedecms, we need to give visitors certain permissions, such as asking questions, answering questions, checking, and so on. The solutions are as follows:

1. Tourists ask questions:

Locate the question.php file in the / ask/control directory of dedecms5.7, find a piece of code like this, and delete:

The code is as follows:

If (empty ($this- > cfg_ml- > M_ID) {ShowMsg ('you are not logged in, please log in first', $GLOBALS ['cfg_ask_member']); exit;} if ($this- > cfg_ml- > M_Spacesta

< 0){ShowMsg('您还没有通过审核,暂时不能提问,请耐心等....','-1');exit;} 2、游客问答,提示"请勿重复回复同一问题": 同样找到找到并删除dedecms5.7的/ask/control目录下的question.php文件,找到其中的这样一段代码: 代码如下: if($rs){ShowMsg('请勿重复回复同一问题!','-1');exit;} 3、问题已过期、提问者自己不能回答自己的问题 同样找到找到并删除dedecms5.7的/ask/control目录下的question.php文件,找到其中的这样一段代码 代码如下: if($question){if($question['uid'] == $this->

Cfg_ml- > M_ID) {ShowMsg ('the questioner cannot answer his own question','- 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、"您尚未登录,请先登录" 找到找到并删除dedecms5.7的/ask/control目录下的myask.php文件 代码如下: if(empty($this->

Cfg_ml- > M_ID) {ShowMsg ('you are not logged in, please log in first', $GLOBALS ['cfg_ask_member']); exit;}

Locate and delete the search.php file in the / ask/control directory of dedecms5.7

The code is as follows:

If (empty ($cfg_ml- > M_ID)) {ShowMsg ('you are not logged in, please log in first', $GLOBALS ['cfg_ask_member']); exit;} if ($cfg_ml- > M_Spacesta = 0) {ShowMsg (' you haven't passed the audit yet, you can't ask questions yet, please be patient.','- 1'); exit;}

5. "wrong CAPTCHA!"wrong answer to the verification question"

Locate and delete the question.php file in the / ask/control directory of dedecms5.7

The code is as follows:

If (preg_match ("# verification", $GLOBALS ['safe_gdopen'])) {$svali= GetCkVdValue (); if (strtolower ($data [' vdcode'])! = $svali | | $svali=='') {ResetVdValue (); ShowMsg ('CAPTCHA error!','- 1'); exit ();}} / / check the verification problem $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 ('incorrect answer to verification question','- 1'); exit () }} after reading this article, I believe you have a certain understanding of how dedecms enables tourists to ask, answer and view questions. If you want to know more about it, welcome to follow the industry information channel. Thank you for your reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report