diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php
index 7c892c339..5aace55e9 100644
--- a/e107_handlers/e_parse_class.php
+++ b/e107_handlers/e_parse_class.php
@@ -829,11 +829,9 @@ class e_parse extends e_parser
{
if(!empty($extraCodes) && $this->isSimpleParse($extraCodes)) // support for a combined simple and standard template parse. - (eg. used by signup email template.)
{
- $text = $this->simpleParse($text, $extraCodes, false);
+ $text = $this->simpleParse($text, $extraCodes, false);
}
-
-
-
+
return e107::getScParser()->parseCodes($text, $parseSCFiles, $extraCodes, $eVars);
}
@@ -851,15 +849,23 @@ class e_parse extends e_parser
}
foreach ($extraCodes as $sc => $code)
- {
- if(!strpos($code, 'return '))
+ {
+ if(preg_match('/return(.*);/',$code)) // still problematic. 'return;' Might be used in common speech.
+ {
+ return false;
+ }
+ else
+ {
+ return true;
+ }
+ /* if(!strpos($code, 'return '))
{
return true;
}
else
{
return false;
- }
+ }*/
}
}
diff --git a/e107_plugins/faqs/e_cron.php b/e107_plugins/faqs/e_cron.php
index 446f31891..b70e52670 100644
--- a/e107_plugins/faqs/e_cron.php
+++ b/e107_plugins/faqs/e_cron.php
@@ -33,8 +33,11 @@
$sql = e107::getDb();
$tp = e107::getParser();
+ $limit = 25;
- $existing = $sql->retrieve('faqs','faq_question,faq_datestamp',"faq_answer='' ORDER BY faq_datestamp ", true);
+ $count = $sql->retrieve('faqs','faq_id',"faq_answer='' ", true);
+
+ $existing = $sql->retrieve('faqs','faq_id,faq_question,faq_datestamp',"faq_answer='' ORDER BY faq_datestamp DESC LIMIT ".$limit, true);
if(empty($existing))
{
@@ -45,9 +48,15 @@
foreach($existing as $row)
{
- $questions[] = "".$row['faq_question']."
".$tp->toDate($row['faq_datestamp'],'short')."";
+ $questions[] = "".$row['faq_question']."
".$tp->toDate($row['faq_datestamp'],'short')."\n";
+ // $questions[] = $row['faq_question'];
}
+
+ //
+ // $questions = array( "Test Question
".$tp->toDate(time(),'short')."");
+
+
$name = SITENAME . " Automation";
$email = e107::pref('core','siteadminemail');
@@ -55,6 +64,14 @@
$link = $tp->replaceConstants("{e_PLUGIN}faqs/admin_config.php?mode=main&action=list&filter=pending", 'full');
+ $body = "