diff -r e3d7322305bf -r 5e1f1e916419 punbb/admin_maintenance.php
--- a/punbb/admin_maintenance.php Sun Sep 02 11:00:57 2007 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-query($truncate_sql.$pun_db->prefix.'search_matches') or error('Unable to empty search index match table', __FILE__, __LINE__, $pun_db->error());
- $pun_db->query($truncate_sql.$pun_db->prefix.'search_words') or error('Unable to empty search index words table', __FILE__, __LINE__, $pun_db->error());
-
- // Reset the sequence for the search words (not needed for SQLite)
- switch ($db_type)
- {
- case 'mysql':
- case 'mysqli':
- $result = $pun_db->query('ALTER TABLE '.$pun_db->prefix.'search_words auto_increment=1') or error('Unable to update table auto_increment', __FILE__, __LINE__, $pun_db->error());
- break;
-
- case 'pgsql';
- $result = $pun_db->query('SELECT setval(\''.$pun_db->prefix.'search_words_id_seq\', 1, false)') or error('Unable to update sequence', __FILE__, __LINE__, $pun_db->error());
- }
- }
-
- $end_at = $start_at + $per_page;
-
-?>
-
-
-
-
-
- / Rebuilding search index …
-
-
-
-
-Rebuilding index … This might be a good time to put on some coffee :-)
-
-query('SELECT DISTINCT t.id, p.id, p.message FROM '.$pun_db->prefix.'topics AS t INNER JOIN '.$pun_db->prefix.'posts AS p ON t.id=p.topic_id WHERE t.id>='.$start_at.' AND t.id<'.$end_at.' ORDER BY t.id') or error('Unable to fetch topic/post info', __FILE__, __LINE__, $pun_db->error());
-
- $cur_topic = 0;
- while ($cur_post = $pun_db->fetch_row($result))
- {
- if ($cur_post[0] <> $cur_topic)
- {
- // Fetch subject and ID of first post in topic
- $result2 = $pun_db->query('SELECT p.id, t.subject, MIN(p.posted) AS first FROM '.$pun_db->prefix.'posts AS p INNER JOIN '.$pun_db->prefix.'topics AS t ON t.id=p.topic_id WHERE t.id='.$cur_post[0].' GROUP BY p.id, t.subject ORDER BY first LIMIT 1') or error('Unable to fetch topic info', __FILE__, __LINE__, $pun_db->error());
- list($first_post, $subject) = $pun_db->fetch_row($result2);
-
- $cur_topic = $cur_post[0];
- }
-
- echo 'Processing post '.$cur_post[1].' in topic '.$cur_post[0].'
'."\n";
-
- if ($cur_post[1] == $first_post) // This is the "topic post" so we have to index the subject as well
- update_search_index('post', $cur_post[1], $cur_post[2], $subject);
- else
- update_search_index('post', $cur_post[1], $cur_post[2]);
- }
-
- // Check if there is more work to do
- $result = $pun_db->query('SELECT id FROM '.$pun_db->prefix.'topics WHERE id>'.$end_at) or error('Unable to fetch topic info', __FILE__, __LINE__, $pun_db->error());
-
- $query_str = ($pun_db->num_rows($result)) ? '?i_per_page='.$per_page.'&i_start_at='.$end_at : '';
-
- $pun_db->end_transaction();
- $pun_db->close();
-
- exit('
JavaScript redirect unsuccessful. Click here to continue.');
-}
-
-
-// Get the first post ID from the db
-$result = $pun_db->query('SELECT id FROM '.$pun_db->prefix.'topics ORDER BY id LIMIT 1') or error('Unable to fetch topic info', __FILE__, __LINE__, $pun_db->error());
-if ($pun_db->num_rows($result))
- $first_id = $pun_db->result($result);
-
-$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / Admin / Maintenance';
-require PUN_ROOT.'header.php';
-
-generate_admin_menu('maintenance');
-
-?>
-
-
-
-