1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

character limit option added to FAQs "ask a question".

This commit is contained in:
Cameron
2016-10-06 14:48:35 -07:00
parent 9f381be882
commit 4ac0cea664
3 changed files with 17 additions and 4 deletions

View File

@@ -27,11 +27,14 @@ class faqs_shortcodes extends e_shortcode
public $item = false;
private $share = false;
private $datestamp = false;
private $questionCharLimit = 255;
function __construct()
public function __construct()
{
$pref = e107::pref('faqs');
if(!empty($pref['display_social']) && e107::isInstalled('social')==true)
{
$this->share = true;
@@ -41,6 +44,12 @@ class faqs_shortcodes extends e_shortcode
{
$this->datestamp = true;
}
if(!empty($pref['submit_question_char_limit']))
{
$this->questionCharLimit = intval($pref['submit_question_char_limit']);
}
}
// Simply FAQ count when needed.
@@ -287,8 +296,9 @@ class faqs_shortcodes extends e_shortcode
if(check_class($faqpref['submit_question']))
{
$text .= $frm->open('faq-ask-question','post');
$text .= "<div>".$frm->textarea('ask_a_question','',3, 80 ,array('maxlength'=>255, 'size'=>'xxlarge','placeholder'=>'Type your question here..', 'wrap'=>'soft')).'<br />'.$frm->submit('submit_a_question','Submit')."</div>";
//TODO LAN ie. [x] character limit.
$text .= "<div>".$frm->textarea('ask_a_question','',3, 80 ,array('maxlength'=>$this->questionCharLimit, 'size'=>'xxlarge','placeholder'=>'Type your question here..', 'wrap'=>'soft'))."
<div class='faq-char-limit'><small>".$this->questionCharLimit." character limit</small></div>".$frm->submit('submit_a_question','Submit')."</div>";
$text .= $frm->close();
}