Changeset 968

Show
Ignore:
Timestamp:
06/10/07 11:45:06 (1 year ago)
Author:
Neal
Message:

Make the reindexing process more efficient for forums which do not have sequential topic IDs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/punbb-1.3-dev/upload/admin/reindex.php

    r921 r968  
    115115 
    116116        // Check if there is more work to do 
    117         $result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE id>'.$end_at) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error()); 
     117        $result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE id>'.$end_at.' ORDER BY id ASC LIMIT 1') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error()); 
    118118 
    119         $query_str = ($db->num_rows($result)) ? '?i_per_page='.$per_page.'&i_start_at='.$end_at : ''; 
     119        $query_str = ($db->num_rows($result)) ? '?i_per_page='.$per_page.'&i_start_at='.$db->result($result) : ''; 
    120120 
    121121        $db->end_transaction();