/** * If there is new stuff in the forum since $time this returns true * Otherwise it returns false. * * @param stdClass $forum the forum object * @param stdClass $cm Course Module object * @param int $time check for items since this epoch timestamp * @return bool True for new items */ function forum_rss_newstuff($forum, $cm, $time) { global $DB; list($sql, $params) = forum_rss_get_sql($forum, $cm, $time); return $DB->record_exists_sql($sql, $params); }
/** * If there is new stuff in the forum since $time this returns true * Otherwise it returns false. * * @param stdClass $forum the forum object * @param stdClass $cm Course Module object * @param int $time check for items since this epoch timestamp * @return bool True for new items */ function forum_rss_newstuff($forum, $cm, $time) { global $DB; $sql = forum_rss_get_sql($forum, $cm, $time); $recs = $DB->get_records_sql($sql, null, 0, 1); //limit of 1. If we get even 1 back we have new stuff return $recs && !empty($recs); }