/** * * @return string */ public function get_suggestion() { if (!$this->suggestion && $this->is_corrected()) { $this->suggestion = sprintf(NETCAT_MODULE_SEARCH_CORRECTION_GENERIC, nc_search_util::convert($this->original_phrase), nc_search_util::convert($this->to_string())); } return $this->suggestion; }
} $this->get_ui()->add_lists_toolbar(); $query_string = $this->get_input('query'); if (!strlen($query_string)) { $this->redirect("?view=queries"); } $per_page = 100; $offset = (int) $this->get_input('offset'); $query = "SELECT SQL_CALC_FOUND_ROWS q.*, u.Login\n FROM Search_Query AS q \n LEFT JOIN User AS u ON (q.User_ID = u.User_ID)\n WHERE q.QueryString='" . nc_search_util::db_escape($query_string) . "'\n ORDER BY Timestamp DESC\n LIMIT {$per_page} OFFSET {$offset}"; $db = $this->get_db(); $db->query("SET NAMES utf8"); $res = $db->get_results($query, ARRAY_A); $found_rows = $db->get_var("SELECT FOUND_ROWS()"); $db->query("SET NAMES " . nc_core('MYSQL_CHARSET')); // this is actually incorrect: echo "<div class='query_details_header'>", "<b>", sprintf(NETCAT_MODULE_SEARCH_ADMIN_QUERY_ALL_QUERIES, nc_search_util::convert($query_string)), "</b> (", NETCAT_MODULE_SEARCH_ADMIN_QUERY_OPEN_RESULTS_HINT, "):", "</div>"; // таблица с результатами echo "<table class='nc-table nc--large nc--hovered nc--striped list'>\n", "<tr>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_TIME, "</th>", "<th class='nc-text-center' width='40%'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_AREA, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_RESULTS_COUNT, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_USER, "</th>", "<th class='nc-text-center'>", NETCAT_MODULE_SEARCH_ADMIN_QUERY_IP, "</th>", "</tr>\n"; foreach ($res as $row) { $has_area = strlen($row['Area']) > 0; $site_area = new nc_search_area("site{$row['Catalogue_ID']}"); list($site_description) = $site_area->get_description(false); if (!$has_area) { $area_cell = "<td>" . NETCAT_MODULE_SEARCH_ADMIN_RULE_AREA_DESCRIPTION_ALLSITES . "</td>"; } else { $area = new nc_search_area($row['Area'], $row['Catalogue_ID']); $description = array("included" => $area->get_description(false), "excluded" => $area->get_description(true)); $hint = "<div class='header'><strong>{$site_description}</strong></div>"; if ($description["included"]) { $hint .= "<div class='header'><strong>" . NETCAT_MODULE_SEARCH_ADMIN_QUERY_AREA_INCLUDED . "</strong>:</div><div class='list'>"; foreach ($description["included"] as $item) {
/** * * @return string */ public function get_body() { return nc_search_util::convert($this->body, 1); }