Changeset 872

Show
Ignore:
Timestamp:
06/21/07 22:54:41 (1 year ago)
Author:
mdawaffe
Message:

fix and deprecate deleted_topics(), get rid of bb_get_deleted_topics_count(), auto paging in BB_Query, fix deleted topic list props fel64. Fixes #664

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bb-admin/admin-functions.php

    r866 r872  
    694694/* Topics */ 
    695695 
    696 function bb_get_deleted_topics_count() { 
    697         global $bbdb; 
    698         return $bbdb->get_var("SELECT COUNT(*) FROM $bbdb->topics WHERE topic_status <> 0"); 
    699 } 
    700  
    701696function bb_move_forum_topics( $from_forum_id, $to_forum_id ) { 
    702697        global $bb_cache, $bbdb; 
  • trunk/bb-admin/content.php

    r792 r872  
    44<?php   if ( !bb_current_user_can('browse_deleted') ) 
    55                die(__("Now how'd you get here?  And what did you think you'd being doing?")); //This should never happen. 
    6         add_filter( 'get_latest_topics_where', 'deleted_topics' ); 
    76        add_filter( 'topic_link', 'bb_make_link_view_all' ); 
    8         $topics = get_latest_topics( 0, $page ); 
     7        $topic_query = new BB_Query('topic', array('topic_status' => 1) ); 
     8        $topics = $topic_query->results; 
     9 
    910?> 
    1011 
     
    2728</table> 
    2829 
    29 <?php $total = bb_get_deleted_topics_count(); echo get_page_number_links( $page, $total ); ?> 
     30<?php echo get_page_number_links( $page, $topic_query->row_count ); ?> 
    3031 
    3132<?php bb_get_admin_footer(); ?> 
  • trunk/bb-includes/classes.php

    r859 r872  
    133133 
    134134                // Both 
    135                 $array['page'] = isset($array['page']) ? (int) $array['page'] : 1; 
     135                if ( isset($array['page']) ) 
     136                        $array['page'] = (int) $array['page']; 
     137                elseif ( isset($GLOBALS['page']) ) 
     138                        $array['page'] = (int) $GLOBALS['page']; 
     139                else 
     140                        $array['page'] = bb_get_uri_page(); 
     141 
    136142                if ( $array['page'] < 1 ) 
    137143                        $array['page'] = 1; 
  • trunk/bb-includes/deprecated.php

    r838 r872  
    346346} 
    347347 
     348function deleted_topics( $where ) { 
     349        return preg_replace( '/(\w+\.)?topic_status = ["\']?0["\']?/', "\\1topic_status = 1", $where); 
     350} 
     351 
    348352?> 
  • trunk/bb-includes/functions.php

    r869 r872  
    19281928} 
    19291929 
    1930 function deleted_topics( $where ) { 
    1931         return str_replace('topic_status = 0', 'topic_status = 1', $where); 
    1932 } 
    1933  
    19341930function no_where( $where ) { 
    19351931        return;