LANA_FAQ_CRON_1, 'function' => "unanswered", 'category' => "notify", 'description' => $tp->lanVars(LANA_FAQ_CRON_2, $siteadminemail) ); return $cron; } function unanswered() { $sql = e107::getDb(); $tp = e107::getParser(); $limit = 25; $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)) { return; } $questions = array(); foreach($existing as $row) { $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." ".LAN_AUTOMATION; $email = e107::pref('core','siteadminemail'); $name = e107::pref('core','siteadmin'); $link = $tp->replaceConstants("{e_PLUGIN}faqs/admin_config.php?mode=main&action=list&filter=pending", 'full'); $body = "

".$tp->lanVars(LANA_FAQ_CRON_3, count($count), SITENAME)."

";// Unanswered Questions at $body .= LANA_FAQ_CRON_4."
"; //To answer these qus. $body .= "".LAN_CLICK_HERE."
"; $body .= $tp->lanVars(LANA_FAQ_CRON_5,$limit);//The limit $body .= ""; $eml = array( 'subject' => $tp->lanVars(LANA_FAQ_CRON_6, array('x'=>count($count), 'y'=> date('d-M-Y'))), // 'sender_email' => $email, 'sender_name' => SITENAME." ".LAN_AUTOMATION, // 'replyto' => $email, 'html' => true, 'template' => 'default', 'body' => $body ); e107::getEmail()->sendEmail($email, $name, $eml); } }