mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 15:46:44 +02:00
Plugin FAQs: Added "Ask a Question" limit preference
This commit is contained in:
@@ -204,9 +204,11 @@ class faq
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
|
||||
if($sql->select('faqs','faq_id',"faq_answer='' AND faq_author_ip = '".USERIP."' LIMIT 1"))
|
||||
$existing = $sql->select('faqs','faq_id',"faq_answer='' AND faq_author_ip = '".USERIP."' ");
|
||||
|
||||
if(!empty($this->pref['submit_question_limit']) && $existing >= $this->pref['submit_question_limit'])
|
||||
{
|
||||
e107::getMessage()->setTitle('Sorry',E_MESSAGE_INFO)->addInfo("You may only ask another question once your other question has been answered.");
|
||||
e107::getMessage()->setTitle('Sorry',E_MESSAGE_INFO)->addInfo("You have reached the maximum number of new questions. You may ask more once your existing questions have been answered.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user