Changeset 1280

Show
Ignore:
Timestamp:
01/19/08 15:16:24 (7 months ago)
Author:
Neal
Message:

Backported [968] and [1279] from 1.3 branch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/upload/admin_maintenance.php

    r858 r1280  
    7070        } 
    7171 
    72         $end_at = $start_at + $per_page; 
    73  
    7472?> 
    7573<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    9694 
    9795        // Fetch posts to process 
    98         $result = $db->query('SELECT DISTINCT t.id, p.id, p.message FROM '.$db->prefix.'topics AS t INNER JOIN '.$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__, $db->error()); 
     96        $result = $db->query('SELECT DISTINCT t.id, p.id, p.message FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id WHERE t.id>='.$start_at.' ORDER BY t.id LIMIT '.$per_page) or error('Unable to fetch topic/post info', __FILE__, __LINE__, $db->error()); 
    9997 
    10098        $cur_topic = 0; 
     
    119117 
    120118        // Check if there is more work to do 
    121         $result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE id>'.$end_at) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error()); 
     119        $result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE id>'.$cur_topic.' ORDER BY id ASC LIMIT 1') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error()); 
    122120 
    123         $query_str = ($db->num_rows($result)) ? '?i_per_page='.$per_page.'&i_start_at='.$end_at : ''; 
     121        $query_str = ($db->num_rows($result)) ? '?i_per_page='.$per_page.'&i_start_at='.$db->result($result) : ''; 
    124122 
    125123        $db->end_transaction();