Ticket #9031: wp-app-more_urls.diff
| File wp-app-more_urls.diff, 1.8 KB (added by , 17 years ago) |
|---|
-
wp-app.php
262 262 '@/posts/?(\d+)?$@' => 263 263 array('GET' => 'get_posts', 264 264 'POST' => 'create_post'), 265 '@/posts/?@' => 266 array('GET' => 'get_posts', 267 'POST' => 'create_post'), 265 268 '@/attachments/?(\d+)?$@' => 266 269 array('GET' => 'get_attachment', 267 270 'POST' => 'create_attachment'), … … 858 861 function get_entries_url($page = null) { 859 862 if($GLOBALS['post_type'] == 'attachment') { 860 863 $path = $this->MEDIA_PATH; 864 $url = $this->app_base . $this->MEDIA_PATH; 865 if(isset($page) && is_int($page)) { 866 $url .= "/$page"; 867 } 861 868 } else { 862 869 $path = $this->ENTRIES_PATH; 870 $url = get_pagenum_link( (int)$page ); 863 871 } 864 $url = $this->app_base . $path;865 if(isset($page) && is_int($page)) {866 $url .= "/$page";867 }868 872 return $url; 869 873 } 870 874 … … 1067 1071 log_app('function',"get_feed($page, '$post_type')"); 1068 1072 ob_start(); 1069 1073 1070 if(!isset($page)) { 1071 $page = 1; 1072 } 1073 $page = (int) $page; 1074 wp('what_to_show=posts&orderby=modified')); 1074 1075 1075 $count = get_option('posts_per_rss');1076 1077 wp('what_to_show=posts&posts_per_page=' . $count . '&offset=' . ($count * ($page-1) . '&orderby=modified'));1078 1079 1076 $post = $GLOBALS['post']; 1080 1077 $posts = $GLOBALS['posts']; 1081 1078 $wp = $GLOBALS['wp']; … … 1085 1082 log_app('function',"query_posts(# " . print_r($wp_query, true) . "#)"); 1086 1083 1087 1084 log_app('function',"total_count(# $wp_query->max_num_pages #)"); 1085 $paged = $wp_query->query['paged']; 1086 $page = empty($paged) ? 1 : (int)$paged; 1088 1087 $last_page = $wp_query->max_num_pages; 1089 1088 $next_page = (($page + 1) > $last_page) ? NULL : $page + 1; 1090 1089 $prev_page = ($page - 1) < 1 ? NULL : $page - 1;