test_interface('header'); if( !isset($this->context) || ( ($this->context != 'post') && ($this->context != 'page') ) ) { $this->context = 'post'; } $this->check_user_permissions('edit_' . $this->context . 's'); $fancy_text = ucfirst($this->context); $offset = (int) $_GET['offset']; $limit = 10; // Note: Getting $limit + 1 to know if we do need a next button. $query_limit = ($limit + 1); $entries_query_param = 'numberposts=' . $query_limit . "&offset=$offset&order=DESC"; if ( $this->context == 'page' ) { // get_pages() ignores unpublished pages $entries = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' ORDER BY post_title ASC LIMIT $query_limit OFFSET $offset"); $page_header = __('Pages'); $previous_caption = __('« Previous Pages', 'wphone'); $next_caption = __('Next Pages »', 'wphone'); $more_caption = __('More Pages »', 'wphone'); $parent = 'edit-pages'; } else { global $user_ID; if ( file_exists( ABSPATH . 'wp-admin/includes/admin.php' ) ) require_once( ABSPATH . 'wp-admin/includes/admin.php' ); else require_once( ABSPATH . 'wp-admin/admin-db.php' ); switch ( $_GET['post_status'] ) { case 'draft': $page_header = ( function_exists('_c') ) ? _c('Drafts|manage posts header') : __('Drafts'); $author = (int) $_GET['author']; if ( 0 < $author ) { $limit = 50; // get_users_drafts does not support offset $entries = get_users_drafts($user_ID); if ( $author == '-' . $user_ID ) { // author exclusion $page_header .= ' ' . __('by other authors'); } else { $author_user = get_userdata( $author ); $page_header .= ' ' . sprintf(__('by %s'), wp_specialchars( $author_user->display_name )); } } else { $limit = 50; // get_others_drafts does not support offset $entries = get_others_drafts($user_ID); } break; case 'pending': $limit = 50; // get_others_pending does not support offset $entries = get_others_pending($user_ID); $page_header = __('Pending Review'); break; default: $entries = get_posts('numberposts=' . $query_limit . "&offset=$offset&order=DESC"); $page_header = __('Posts'); } $previous_caption = __('« Previous Entries'); $next_caption = __('Next Entries »'); $more_caption = __('More Entries', 'wphone'); $parent = 'edit'; } if ( ( !$this->iscompat ) || ( $offset < $limit ) ) { echo '

' . $page_header . '

'."\n"; echo '\n"; $this->test_interface('footer'); ?>