diff --git a/e107_plugins/faqs/controllers/list.php b/e107_plugins/faqs/controllers/list.php index e08c25fa2..0d49d3c47 100644 --- a/e107_plugins/faqs/controllers/list.php +++ b/e107_plugins/faqs/controllers/list.php @@ -76,10 +76,12 @@ class plugin_faqs_list_controller extends eControllerFront $sc = e107::getScBatch('faqs', true); $text = $tp->parseTemplate($FAQ_START, true); + + $sc->counter = 1; while ($rw = $sql->db_Fetch()) { $sc->setVars($rw); - + if($rw['faq_info_order'] != $prevcat) { if($prevcat !='') @@ -93,7 +95,7 @@ class plugin_faqs_list_controller extends eControllerFront $text .= $tp->parseTemplate($FAQ_LISTALL['item'], true); $prevcat = $rw['faq_info_order']; - + $sc->counter++; } $text .= $tp->parseTemplate($FAQ_LISTALL['end'], true); $text .= $tp->parseTemplate($FAQ_END, true); diff --git a/e107_plugins/faqs/faqs_shortcodes.php b/e107_plugins/faqs/faqs_shortcodes.php index e84e83f23..dab98cce8 100644 --- a/e107_plugins/faqs/faqs_shortcodes.php +++ b/e107_plugins/faqs/faqs_shortcodes.php @@ -23,7 +23,14 @@ if (!defined('e107_INIT')) { exit; } class faqs_shortcodes extends e_shortcode { - // var $var; + public $counter = 1; + + // Simply FAQ count when needed. + function sc_faq_counter($parm='') + { + return $this->counter; + } + function sc_faq_question($parm='') { @@ -32,12 +39,12 @@ class faqs_shortcodes extends e_shortcode if($parm == 'expand') { $id = "faq_".$this->var['faq_id']; - $text = "".$tp->toHtml($this->var['faq_question'])." + $text = "".$tp->toHtml($this->var['faq_question'],true)."
".$tp->toHTML($this->var['faq_answer'],TRUE)."
"; } else { - $text = $tp->toHtml($this->var['faq_question']); + $text = $tp->toHtml($this->var['faq_question'],true); } return $text; } @@ -50,8 +57,7 @@ class faqs_shortcodes extends e_shortcode function sc_faq_answer() { - $tp = e107::getParser(); - return "
".$tp -> toHtml($this->var['faq_answer'])."
"; + return e107::getParser()->toHtml($this->var['faq_answer'],true); } function sc_faq_edit()