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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user