# HG changeset patch # User Dan # Date 1214528425 14400 # Node ID 0f6f1ace701fe7b398658ac50885a3a0b5339ccd # Parent 499193a6dbe4a4d7feb98267455a2965b5639a94# Parent a21faa57e6c6fa772f2b8f3156f1a54272e38b4f Merging scribus and nighthawk branches diff -r 499193a6dbe4 -r 0f6f1ace701f includes/paths.php --- a/includes/paths.php Thu Jun 26 20:59:57 2008 -0400 +++ b/includes/paths.php Thu Jun 26 21:00:25 2008 -0400 @@ -759,6 +759,15 @@ { $page = array('name' => dirtify_page_id($row['page_id'])); } + // make sure the page is indexable + if ( isset($page['visible']) ) + { + if ( $page['visible'] == 0 ) + { + // not indexable, just continue + continue; + } + } $texts[(string)$row['page_idstring']] = $row['page_text'] . ' ' . $page['name']; } if ( $verbose ) @@ -819,7 +828,15 @@ $row = $db->fetchrow(); $db->free_result(); $search = new Searcher(); - $search->buildIndex(Array("ns={$namespace};pid={$page_id}"=>$row['page_text'] . ' ' . $this->pages[$idstring]['name'])); + // if the page shouldn't be indexed, send a blank set of strings to the indexing engine + if ( $this->pages[$idstring]['visible'] == 0 ) + { + $search->buildIndex(Array("ns={$namespace};pid={$page_id}"=>'')); + } + else + { + $search->buildIndex(Array("ns={$namespace};pid={$page_id}"=>$row['page_text'] . ' ' . $this->pages[$idstring]['name'])); + } $new_index = $search->index; if ( ENANO_DBLAYER == 'MYSQL' ) diff -r 499193a6dbe4 -r 0f6f1ace701f includes/search.php --- a/includes/search.php Thu Jun 26 20:59:57 2008 -0400 +++ b/includes/search.php Thu Jun 26 21:00:25 2008 -0400 @@ -391,7 +391,7 @@ $sql = 'SELECT ' . $concat_column . ' AS id, p.name FROM ' . table_prefix . "page_text AS t\n" . " LEFT JOIN " . table_prefix . "pages AS p\n" . " ON ( p.urlname = t.page_id AND p.namespace = t.namespace )\n" - . " WHERE\n $where_any\n $where_req;"; + . " WHERE p.visible = 1 AND (\n $where_any\n $where_req\n );"; if ( !($q = $db->sql_unbuffered_query($sql)) ) $db->_die('Error is in perform_search(), includes/search.php, query 2. Parsed query dump follows:
(indexable) ' . htmlspecialchars(print_r($query, true)) . '(non-indexable) ' . htmlspecialchars(print_r($query_phrase, true)) . ''); @@ -463,7 +463,7 @@ $sql = 'SELECT ' . $concat_column . ' AS id, t.page_id, t.namespace, CHAR_LENGTH(t.page_text) AS page_length, t.page_text, p.name AS page_name FROM ' . table_prefix . "page_text AS t LEFT JOIN " . table_prefix . "pages AS p ON ( p.urlname = t.page_id AND p.namespace = t.namespace ) - WHERE $text_where $where_not;"; + WHERE p.visible = 1 AND ( $text_where $where_not );"; if ( !($q = $db->sql_unbuffered_query($sql)) ) $db->_die('Error is in perform_search(), includes/search.php, query 3'); @@ -496,7 +496,7 @@ foreach ( $paths->pages as $id => $page ) { - if ( $page['namespace'] != 'Special' ) + if ( $page['namespace'] != 'Special' || $page['visible'] == 0 ) continue; if ( !is_int($id) ) continue;