includes/paths.php
changeset 567 7f196509bf78
parent 555 ac4c6a7f01d8
child 571 66e14e61613e
--- a/includes/paths.php	Sat Jun 07 22:50:31 2008 -0400
+++ b/includes/paths.php	Mon Jun 09 20:52:34 2008 -0400
@@ -702,7 +702,8 @@
         echo "Running indexing round $j of $loops (offset $offset)\n" . ( isset($_SERVER['REQUEST_URI']) ? '<br />' : '' );
       }
       
-      $texts = $db->sql_query('SELECT p.name, t.page_id, t.namespace, t.page_text FROM ' . table_prefix . "page_text AS t\n"
+      // this is friendly to both MySQL and PostgreSQL.
+      $texts = $db->sql_query('SELECT p.name, p.visible, t.page_id, t.namespace, t.page_text 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 ( p.password = '' OR p.password = '$sha1_blank' )\n"
@@ -727,6 +728,19 @@
             flush();
           }
           
+          // skip this page if it's not supposed to be indexed
+          if ( $row['visible'] == 0 )
+          {
+            if ( $verbose )
+            {
+              echo "skipped";
+              if ( isset($_SERVER['REQUEST_URI']) )
+                echo '<br />';
+              echo "\n";
+            }
+            continue;
+          }
+          
           // Indexing identifier for the page in the DB
           $page_uniqid = "ns={$row['namespace']};pid=" . sanitize_page_id($row['page_id']);
           $page_uniqid = $db->escape($page_uniqid);