/** * Parse search results * * @param array $r Search result * @return array $html Blocks of HTML */ public function parseAndFetchHtmlBlocks($rows) { if (IPSSearchRegistry::get('members.searchInKey') == 'comments') { $this->registry->getClass('output')->addJSModule('status', 0); } return parent::parseAndFetchHtmlBlocks($rows); }
/** * Constructor * * @return @e void */ public function __construct(ipsRegistry $registry) { /* Get class forums, used for displaying forum names on results */ if (ipsRegistry::isClassLoaded('class_forums') !== TRUE) { $classToLoad = IPSLib::loadLibrary(IPSLib::getAppDir('forums') . "/sources/classes/forums/class_forums.php", 'class_forums', 'forums'); ipsRegistry::setClass('class_forums', new $classToLoad(ipsRegistry::instance())); ipsRegistry::getClass('class_forums')->strip_invisible = 1; ipsRegistry::getClass('class_forums')->forumsInit(); } /* Load tagging stuff */ if (!$registry->isClassLoaded('tags')) { require_once IPS_ROOT_PATH . 'sources/classes/tags/bootstrap.php'; /*noLibHook*/ $registry->setClass('tags', classes_tags_bootstrap::run('forums', 'topics')); } /* Get live or archive */ $this->searchArchives = ipsRegistry::$request['search_app_filters']['forums']['liveOrArchive'] == 'archive' ? true : false; if ($this->searchArchives) { /* Load up archive class */ $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/archive/reader.php', 'classes_archive_reader'); $this->archiveReader = new $classToLoad(); $this->archiveReader->setApp('forums'); $this->table = $this->archiveReader->getFields(); $this->table['_table_'] = 'forums_archive_posts'; $this->table['_prefix_'] = 'p.archive_'; } else { $this->table = array('_table_' => 'posts', '_prefix_' => 'p.', 'pid' => 'pid', 'author_id' => 'author_id', 'author_name' => 'author_name', 'ip_address' => 'ip_address', 'post_date' => 'post_date', 'post' => 'post', 'queued' => 'queued', 'topic_id' => 'topic_id', 'new_topic' => 'new_topic', 'post_bwoptions' => 'post_bwoptions', 'post_key' => 'post_key', 'post_htmlstate' => 'post_htmlstate', 'use_sig' => 'use_sig', 'use_emo' => 'use_emo', 'append_edit' => 'append_edit', 'edit_time' => 'edit_time', 'edit_name' => 'edit_name', 'post_edit_reason' => 'post_edit_reason'); } parent::__construct($registry); /* Set up wrapper */ $this->templates = array('group' => 'search', 'template' => 'searchResultsAsForum'); }
/** * Parse search results * * @param array $r Search result * @return array $html Blocks of HTML */ public function parseAndFetchHtmlBlocks($rows) { return parent::parseAndFetchHtmlBlocks($rows); }