一些使用Dedecms建站的同学开通了问答模块,但是由于会员注册控制的不好,导致了垃圾问题信息太多了,最火软件站小编给大家提供一个只有站长(管理员)才能回答问题的修改方法,本修改不涉及用户权限修改,仅仅是加入了简单的判定,
<?PHP if($cfg_ml->isAdmin == 1) { ?>
<div>
<form method=”post” name=”answer” action=”?ct=question&ac=answer&askaid=<?PHP echo $question['id']; ?>”>
<h3><span>我来回答这个问题</span></h3>
<div><?PHP GetFck(“content”,”",400);?></div>
<div><span>回答即可得<?PHP echo $cfg_ask_answerscore;?>分,回答被采纳则获得悬赏分以及奖励<?PHP echo $cfg_ask_bestanswer;?>分。</span><span><label>
<?PHP
if($GLOBALS['cfg_ask_guestanswer'] == ‘Y’)
{
?>
<input name=”anonymous” type=”checkBox” value=”1″/>匿名回答</label><?PHP
}
?></span><button type=”submit”>提交回答</button></div>
</form>
</div>
<?PHP } ?>
<div>
<form method=”post” name=”answer” action=”?ct=question&ac=answer&askaid=<?PHP echo $question['id']; ?>”>
<h3><span>我来回答这个问题</span></h3>
<div><?PHP GetFck(“content”,”",400);?></div>
<div><span>回答即可得<?PHP echo $cfg_ask_answerscore;?>分,回答被采纳则获得悬赏分以及奖励<?PHP echo $cfg_ask_bestanswer;?>分。</span><span><label>
<?PHP
if($GLOBALS['cfg_ask_guestanswer'] == ‘Y’)
{
?>
<input name=”anonymous” type=”checkBox” value=”1″/>匿名回答</label><?PHP
}
?></span><button type=”submit”>提交回答</button></div>
</form>
</div>
<?PHP } ?>