public static function getLatestThreads($amount) { static $latest = true; if ($latest === true) { if ($amount > 0) { $threads = new self(false); $permquery = self::getPermQuery(); $mod = GWF_ForumThread::IN_MODERATION; $inv = GWF_ForumThread::INVISIBLE; $latest = $threads->selectObjects('*', "thread_postcount > 0 AND ({$permquery}) AND (thread_options&{$mod}=0) AND (thread_options&{$inv}=0)", 'thread_lastdate DESC', $amount); } else { $latest = array(); } } return $latest; }
/** * @param $html boolean html or text (html=true, text=false) * @param $langid the language of the newsletter. * @return unknown_type */ public static function getNewsletterEmails($html = true, $langid) { $newsletters = new self(false); $flag = $html === true ? self::WANT_HTML : self::WANT_TEXT; return $newsletters->selectObjects('*', "nl_options&{$flag}"); }