mirror of
https://github.com/e107inc/e107.git
synced 2025-08-16 03:24:20 +02:00
Parser fix and FAQ 'ask a question' permissions fix.
This commit is contained in:
@@ -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[] = "<i>".$row['faq_question']."</i><br /><small>".$tp->toDate($row['faq_datestamp'],'short')."</small>";
|
||||
$questions[] = "<i>".$row['faq_question']."</i><br /><small>".$tp->toDate($row['faq_datestamp'],'short')."</small>\n";
|
||||
// $questions[] = $row['faq_question'];
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// $questions = array( "<i>Test Question</i><br /><small>".$tp->toDate(time(),'short')."</small>");
|
||||
|
||||
|
||||
$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 = "<h2>".count($count)." Unuanswered Questions at ".SITENAME."</h2>To answer these questions, please login to ".SITENAME." and then <a href='{$link}'>click here</a>.<br />
|
||||
The ".$limit." most recent questions are displayed below.
|
||||
<ul><li>".implode("</li><li>",$questions)."</li></ul>";
|
||||
|
||||
$body = "I find the timing of their return very interesting";
|
||||
// file_put_contents(e_LOG."faq.log", $body);
|
||||
// return;
|
||||
|
||||
$eml = array(
|
||||
'subject' => count($existing)." Unuanswered Question as of ".date('d-M-Y')." ",
|
||||
// 'sender_email' => $email,
|
||||
@@ -62,9 +79,7 @@
|
||||
// 'replyto' => $email,
|
||||
'html' => true,
|
||||
'template' => 'default',
|
||||
'body' => "
|
||||
<h2>".count($existing)." Unuanswered Questions at ".SITENAME."</h2>To answer these questions, please login to ".SITENAME." and then <a href='{$link}'>click here</a>.<br />
|
||||
<ul><li>".implode("</li><li>",$questions)."</li></ul>"
|
||||
'body' => $body
|
||||
);
|
||||
|
||||
e107::getEmail()->sendEmail($email, $name, $eml);
|
||||
|
Reference in New Issue
Block a user