} $url_params = array('keywords' => $keywords, 'sf' => $search_fields, 'type' => $search_type, 'c' => $categories, 'sc' => $search_subcategories, 'versions' => $phpbb_versions); foreach ($url_params as $name => $value) { if ($value) { titania_url::$params[$name] = $value; } } // Redirect if sent through POST so the parameters are in the URL (for easy copying/pasting to other users) redirect(titania_url::build_url(titania_url::$current_page, titania_url::$params)); } // Setup the sort tool $sort = new titania_sort(); $sort->set_defaults(phpbb::$config['posts_per_page']); $sort->request(); // Setup the search tool and make sure it is working titania_search::initialize(); if (titania_search::$do_not_index) { // Solr service is down trigger_error('SEARCH_UNAVAILABLE'); } // Initialize the query $query = titania_search::create_find_query(); // Query fields $query_fields = array(); switch ($search_fields) { case 'titleonly': $query_fields[] = 'title'; break; case 'msgonly': $query_fields[] = 'text'; break;