function tagEntry($tag, $noClass = false, $app = 'all', $section = '') { $IPBHTML = ""; if (IPSLib::locationHasHooks('skin_global_other', $this->_funcHooks['tagEntry'])) { $count_989b8d252285b3ae5b5f829693e0a807 = is_array($this->functionData['tagEntry']) ? count($this->functionData['tagEntry']) : 0; $this->functionData['tagEntry'][$count_989b8d252285b3ae5b5f829693e0a807]['tag'] = $tag; $this->functionData['tagEntry'][$count_989b8d252285b3ae5b5f829693e0a807]['noClass'] = $noClass; $this->functionData['tagEntry'][$count_989b8d252285b3ae5b5f829693e0a807]['app'] = $app; $this->functionData['tagEntry'][$count_989b8d252285b3ae5b5f829693e0a807]['section'] = $section; } $IPBHTML .= "<a " . (!$noClass ? "class='ipsTag'" : "") . " href=\"" . $this->registry->getClass('output')->formatUrl($this->registry->getClass('output')->buildUrl("app=core&module=search&do=search&search_tags=" . IPSText::urlencode_furlSafe($tag) . "&search_app=" . ((isset($this->request['search_app']) and $this->request['search_app']) ? "{$this->request['search_app']}" : "{$app}") . "" . ($section ? "&search_app_filters[" . ((isset($this->request['search_app']) and $this->request['search_app']) ? "{$this->request['search_app']}" : "{$app}") . "][searchInKey]={$section}" : "") . "", "public", ''), "false", "tags") . "\" data-tooltip=\"" . sprintf($this->lang->words['find_more_tags'], $tag) . "\"><span>{$tag}</span></a>"; return $IPBHTML; }
/** * Class entry point * * @param object Registry reference * @return @e void [Outputs to screen/redirects] */ public function doExecute(ipsRegistry $registry) { /* Load language */ $this->registry->class_localization->loadLanguageFile(array('public_search'), 'core'); $this->registry->class_localization->loadLanguageFile(array('public_forums', 'public_topic'), 'forums'); /* Reset engine type */ $this->settings['search_method'] = $this->settings['search_method'] == 'traditional' ? 'sql' : $this->settings['search_method']; /* Force SQL for view new content? */ if (!empty($this->settings['force_sql_vnc']) && $this->request['do'] == 'viewNewContent') { $this->settings['search_method'] = 'sql'; } $this->request['search_app_filters'] = $this->_cleanInputFilters($this->request['search_app_filters']); /* Special consideration for contextual search */ if (isset($this->request['search_app']) and is_string($this->request['search_app']) and strstr($this->request['search_app'], ':')) { list($app, $type, $id) = explode(':', $this->request['search_app']); $this->request['search_app'] = $app; $this->request['cType'] = $type; $this->request['cId'] = $id; } else { /* Force forums as default search */ $this->request['search_in'] = ($this->request['search_in'] and IPSLib::appIsSearchable($this->request['search_in'], 'search')) ? $this->request['search_in'] : 'forums'; $this->request['search_app'] = $this->request['search_app'] ? $this->request['search_app'] : $this->request['search_in']; } /* Check Access */ $this->_canSearch(); /* Start session - needs to be called before the controller is initiated */ $this->_startSession(); /* Load the controller */ $classToLoad = IPSLib::loadLibrary(IPS_ROOT_PATH . 'sources/classes/search/controller.php', 'IPSSearch'); /* Sanitzie */ if (!is_string($this->request['search_app'])) { $this->request['search_app'] = 'forums'; } try { $this->searchController = new $classToLoad($registry, $this->settings['search_method'], $this->request['search_app']); } catch (Exception $error) { $msg = $error->getMessage(); /* Start session */ $this->_endSession(); switch ($msg) { case 'NO_SUCH_ENGINE': case 'NO_SUCH_APP': case 'NO_SUCH_APP_ENGINE': $this->registry->output->showError(sprintf($this->lang->words['no_search_app'], ipsRegistry::$applications[$this->request['search_app']]['app_title']), 10145.1); break; } } /* Log type */ IPSDebug::addMessage("Search type: " . $this->settings['search_method']); /* Set up some defaults */ IPSSearchRegistry::set('opt.noPostPreview', false); IPSSearchRegistry::set('in.start', intval($this->request['st'])); IPSSearchRegistry::set('opt.search_per_page', intval($this->settings['search_per_page']) ? intval($this->settings['search_per_page']) : 25); $this->settings['search_ucontent_days'] = $this->settings['search_ucontent_days'] ? $this->settings['search_ucontent_days'] : 365; /* Contextuals */ if (isset($this->request['cType'])) { IPSSearchRegistry::set('contextual.type', $this->request['cType']); IPSSearchRegistry::set('contextual.id', $this->request['cId']); } /* What to do */ switch ($this->request['do']) { case 'user_activity': $this->viewUserContent(); break; case 'new_posts': case 'viewNewContent': case 'active': $this->viewNewContent(); break; case 'search': case 'quick_search': $this->searchResults(); break; case 'followed': $this->viewFollowedContent(); break; case 'manageFollowed': $this->updateFollowedContent(); break; default: case 'search_form': $this->searchAdvancedForm(); break; } /* Start session */ $this->_endSession(); /* If we have any HTML to print, do so... */ if ($this->request['do'] == 'search' && !empty($this->request['search_tags'])) { $this->registry->output->setTitle(IPSText::urldecode_furlSafe($this->request['search_tags']) . ' - ' . $this->lang->words['st_tags'] . ' - ' . IPSLib::getAppTitle($this->request['search_app']) . ' - ' . ipsRegistry::$settings['board_name']); /* Add canonical tag */ $extra = $this->request['st'] ? '&st=' . $this->request['st'] : ''; $this->registry->output->addCanonicalTag('app=core&module=search&do=search&search_tags=' . IPSText::urlencode_furlSafe($this->request['search_tags']) . '&search_app=' . $this->request['search_app'] . $extra, $this->request['search_tags'], 'tags'); } else { $this->registry->output->setTitle($this->title . ' - ' . ipsRegistry::$settings['board_name']); } $this->registry->output->addContent($this->output); $this->registry->output->sendOutput(); }