/** * Get any reports / warnings / messages from the WPSearch server. * @return mized A string if a message was found, FALSE if not */ public static function getWPSearchMessage() { //self::setOption(WPSearch_Core::KEY_LAST_MESSAGE_DATE, time() - 60*60*13); $date = self::getOption(WPSearch_Core::KEY_LAST_MESSAGE_DATE); if ($date !== FALSE && $date + 12 * 60 * 60 > time()) { return self::getOption(WPSearch_Core::KEY_LAST_MESSAGE); } $driver = WPSearch_Config::get('driver'); $count = WPSearch_Model::getPublishedPostCount(); $url = "http://report.wpsearch2.com/messages?d={$driver}&c={$count}"; $content = file_get_contents($url); self::setOption(WPSearch_Core::KEY_LAST_MESSAGE, $content); self::setOption(WPSearch_Core::KEY_LAST_MESSAGE_DATE, time()); if (strlen($content) == 0 || $content == "0") { return FALSE; } return $content; }
private function _getCommentsAsString($post_id) { $comments = WPSearch_Model::getPostComments($post_id); $comment_blob = ''; foreach ($comments as $comment) { $comment_blob .= "{$comment->comment_author} {$comment->comment_content} "; } return $comment_blob; }