Changeset 5910
- Timestamp:
- 08/21/2007 06:27:45 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/export.php
r5862 r5910 26 26 <option value="all" selected="selected"><?php _e('All'); ?></option> 27 27 <?php 28 $authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" ); 28 $authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" ); 29 29 foreach ( $authors as $id ) { 30 30 $o = get_userdata( $id ); … … 132 132 133 133 <!-- 134 This is a WordPress eXtended RSS file generated by WordPress as an export of 135 your blog. It contains information about your blog's posts, comments, and 136 categories. You may use this file to transfer that content from one site to 134 This is a WordPress eXtended RSS file generated by WordPress as an export of 135 your blog. It contains information about your blog's posts, comments, and 136 categories. You may use this file to transfer that content from one site to 137 137 another. This file is not intended to serve as a complete backup of your 138 138 blog. … … 144 144 3. Choose "WordPress" from the list of importers. 145 145 4. Upload this file using the form provided on that page. 146 5. You will first be asked to map the authors in this export file to users 147 on the blog. For each author, you may choose to map an existing user on 146 5. You will first be asked to map the authors in this export file to users 147 on the blog. For each author, you may choose to map an existing user on 148 148 the blog or to create a new user. 149 6. WordPress will then import each of the posts, comments, and categories 149 6. WordPress will then import each of the posts, comments, and categories 150 150 contained in this file onto your blog. 151 151 --> … … 175 175 $where = "WHERE ID IN (".join(',', $next_posts).")"; 176 176 $posts = $wpdb->get_results("SELECT * FROM $wpdb->posts $where ORDER BY post_date_gmt ASC"); 177 foreach ($posts as $post) { 177 foreach ($posts as $post) { 178 178 start_wp(); ?> 179 179 <item> 180 180 <title><?php the_title_rss() ?></title> 181 <link><?php permalink_single_rss() ?></link>181 <link><?php the_permalink_rss() ?></link> 182 182 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> 183 183 <dc:creator><?php the_author() ?></dc:creator> -
trunk/wp-app.php
r5843 r5910 1 1 <?php 2 /* 2 /* 3 3 * wp-app.php - Atom Publishing Protocol support for WordPress 4 4 * Original code by: Elias Torres, http://torrez.us/archives/2006/08/31/491/ … … 167 167 } else if(in_array($tag, $this->ATOM_CONTENT_ELEMENTS) || in_array($tag, $this->ATOM_SIMPLE_ELEMENTS)) { 168 168 $this->in_content = array(); 169 $this->is_xhtml = $attrs['type'] == 'xhtml'; 169 $this->is_xhtml = $attrs['type'] == 'xhtml'; 170 170 array_push($this->in_content, array($tag,$this->depth)); 171 171 } else if($tag == 'link') { … … 183 183 184 184 if(!empty($this->in_content)) { 185 if($this->in_content[0][0] == $tag && 185 if($this->in_content[0][0] == $tag && 186 186 $this->in_content[0][1] == $this->depth) { 187 187 array_shift($this->in_content); … … 246 246 } 247 247 } 248 } 248 } 249 249 return $name; 250 250 } … … 252 252 function xml_escape($string) 253 253 { 254 return str_replace(array('&','"',"'",'<','>'), 255 array('&','"',''','<','>'), 254 return str_replace(array('&','"',"'",'<','>'), 255 array('&','"',''','<','>'), 256 256 $string ); 257 257 } … … 285 285 286 286 $this->selectors = array( 287 '@/service@' => 287 '@/service@' => 288 288 array('GET' => 'get_service'), 289 289 '@/categories@' => 290 290 array('GET' => 'get_categories_xml'), 291 '@/post/(\d+)@' => 292 array('GET' => 'get_post', 293 'PUT' => 'put_post', 291 '@/post/(\d+)@' => 292 array('GET' => 'get_post', 293 'PUT' => 'put_post', 294 294 'DELETE' => 'delete_post'), 295 '@/posts/?([^/]+)?@' => 296 array('GET' => 'get_posts', 295 '@/posts/?([^/]+)?@' => 296 array('GET' => 'get_posts', 297 297 'POST' => 'create_post'), 298 '@/attachments/?(\d+)?@' => 299 array('GET' => 'get_attachment', 298 '@/attachments/?(\d+)?@' => 299 array('GET' => 'get_attachment', 300 300 'POST' => 'create_attachment'), 301 '@/attachment/file/(\d+)@' => 302 array('GET' => 'get_file', 303 'PUT' => 'put_file', 301 '@/attachment/file/(\d+)@' => 302 array('GET' => 'get_file', 303 'PUT' => 'put_file', 304 304 'DELETE' => 'delete_file'), 305 '@/attachment/(\d+)@' => 306 array('GET' => 'get_attachment', 307 'PUT' => 'put_attachment', 305 '@/attachment/(\d+)@' => 306 array('GET' => 'get_attachment', 307 'PUT' => 'put_attachment', 308 308 'DELETE' => 'delete_attachment'), 309 309 ); … … 325 325 } 326 326 327 // lame. 327 // lame. 328 328 if(strlen($path) == 0 || $path == '/') { 329 329 $path = '/service'; … … 355 355 log_app('function','get_service()'); 356 356 $entries_url = $this->get_entries_url(); 357 $categories_url = $this->get_categories_url(); 357 $categories_url = $this->get_categories_url(); 358 358 $media_url = $this->get_attachments_url(); 359 359 $accepted_content_types = join(',',$this->media_content_types); 360 360 $introspection = <<<EOD 361 <service xmlns="http://purl.org/atom/app#" xmlns:atom="http://www.w3.org/2005/Atom"> 362 <workspace title="WordPress Workspace"> 363 <collection href="$entries_url" title="Posts"> 364 <atom:title>WordPress Posts</atom:title> 365 <accept>entry</accept> 366 <categories href="$categories_url" /> 367 </collection> 368 <collection href="$media_url" title="Media"> 369 <atom:title>WordPress Media</atom:title> 370 <accept>$accepted_content_types</accept> 371 </collection> 372 </workspace> 361 <service xmlns="http://purl.org/atom/app#" xmlns:atom="http://www.w3.org/2005/Atom"> 362 <workspace title="WordPress Workspace"> 363 <collection href="$entries_url" title="Posts"> 364 <atom:title>WordPress Posts</atom:title> 365 <accept>entry</accept> 366 <categories href="$categories_url" /> 367 </collection> 368 <collection href="$media_url" title="Media"> 369 <atom:title>WordPress Media</atom:title> 370 <accept>$accepted_content_types</accept> 371 </collection> 372 </workspace> 373 373 </service> 374 374 375 375 EOD; 376 376 377 $this->output($introspection, $this->INTROSPECTION_CONTENT_TYPE); 377 $this->output($introspection, $this->INTROSPECTION_CONTENT_TYPE); 378 378 } 379 379 … … 394 394 </app:categories> 395 395 EOD; 396 $this->output($output, $this->CATEGORIES_CONTENT_TYPE); 396 $this->output($output, $this->CATEGORIES_CONTENT_TYPE); 397 397 } 398 398 … … 895 895 $last_page = (int) ceil($total_count / $count); 896 896 $next_page = (($page + 1) > $last_page) ? NULL : $page + 1; 897 $prev_page = ($page - 1) < 1 ? NULL : $page - 1; 897 $prev_page = ($page - 1) < 1 ? NULL : $page - 1; 898 898 $last_page = ((int)$last_page == 1 || (int)$last_page == 0) ? NULL : (int) $last_page; 899 899 ?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://purl.org/atom/app#" xml:lang="<?php echo get_option('rss_language'); ?>"> … … 913 913 <rights type="text">Copyright <?php echo mysql2date('Y', get_lastpostdate('blog')); ?></rights> 914 914 <generator uri="http://wordpress.com/" version="1.0.5-dc">WordPress.com Atom API</generator> 915 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); 915 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); 916 916 $post = $GLOBALS['post']; 917 917 ?> … … 935 935 <link rel="edit-media" href="<?php $this->the_media_url() ?>" /> 936 936 <?php } else { ?> 937 <link href="<?php permalink_single_rss() ?>" />937 <link href="<?php the_permalink_rss() ?>" /> 938 938 <link rel="edit" href="<?php $this->the_entry_url() ?>" /> 939 939 <?php } ?> … … 946 946 </entry> 947 947 <?php 948 endwhile; 948 endwhile; 949 949 endif; 950 950 ?></feed> 951 <?php 951 <?php 952 952 $feed = ob_get_contents(); 953 953 ob_end_clean(); … … 991 991 <content type="<?php echo $GLOBALS['post']->post_mime_type ?>" src="<?php the_guid(); ?>"/> 992 992 <?php } else { ?> 993 <link href="<?php permalink_single_rss() ?>" />993 <link href="<?php the_permalink_rss() ?>" /> 994 994 <link rel="edit" href="<?php $this->the_entry_url() ?>" /> 995 995 <?php } ?> … … 1012 1012 1013 1013 log_app('get_entry returning:',$entry); 1014 return $entry; 1015 } 1016 1017 function ok() { 1014 return $entry; 1015 } 1016 1017 function ok() { 1018 1018 log_app('Status','200: OK'); 1019 1019 header('Content-Type: text/plain'); … … 1022 1022 } 1023 1023 1024 function no_content() { 1024 function no_content() { 1025 1025 log_app('Status','204: No Content'); 1026 1026 header('Content-Type: text/plain'); … … 1110 1110 nocache_headers(); 1111 1111 header('WWW-Authenticate: Basic realm="WordPress Atom Protocol"'); 1112 header('WWW-Authenticate: Form action="' . get_option('siteurl') . '/wp-login.php"', false); 1112 header('WWW-Authenticate: Form action="' . get_option('siteurl') . '/wp-login.php"', false); 1113 1113 header("HTTP/1.1 401 $msg"); 1114 1114 header('Status: ' . $msg); … … 1160 1160 // http://www.besthostratings.com/articles/http-auth-php-cgi.html 1161 1161 if(isset($_SERVER['HTTP_AUTHORIZATION'])) { 1162 list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = 1162 list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = 1163 1163 explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); 1164 1164 } … … 1199 1199 1200 1200 foreach($types as $t) { 1201 list($acceptedType,$acceptedSubtype) = explode('/',$t); 1201 list($acceptedType,$acceptedSubtype) = explode('/',$t); 1202 1202 if($acceptedType == '*' || $acceptedType == $type) { 1203 1203 if($acceptedSubtype == '*' || $acceptedSubtype == $subtype) … … 1234 1234 1235 1235 // Support for Conditional GET 1236 if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) 1236 if (isset($_SERVER['HTTP_IF_NONE_MATCH'])) 1237 1237 $client_etag = stripslashes($_SERVER['HTTP_IF_NONE_MATCH']); 1238 else 1238 else 1239 1239 $client_etag = false; 1240 1240 -
trunk/wp-includes/deprecated.php
r5569 r5910 237 237 if ( !$cat ) 238 238 return false; 239 $cat_id = $cat->term_id; 239 $cat_id = $cat->term_id; 240 240 241 241 $args = add_query_arg('category', $cat_id, $args); … … 267 267 $cat = get_term_by('name', $cat_name, 'link_category'); 268 268 if ( $cat ) 269 $cat_id = $cat->term_id; 269 $cat_id = $cat->term_id; 270 270 271 271 return get_linkobjects($cat_id, $orderby, $limit); … … 315 315 $links_array = array(); 316 316 foreach ($links as $link) { 317 $links_array[] = $link; 317 $links_array[] = $link; 318 318 } 319 319 … … 485 485 } 486 486 487 // Use the_permalink_rss() 488 function permalink_single_rss($file = '') { 489 the_permalink_rss(); 490 } 491 487 492 ?> -
trunk/wp-includes/feed-atom.php
r5699 r5910 32 32 </author> 33 33 <title type="<?php html_type_rss(); ?>"><![CDATA[<?php the_title_rss() ?>]]></title> 34 <link rel="alternate" type="text/html" href="<?php permalink_single_rss() ?>" />34 <link rel="alternate" type="text/html" href="<?php the_permalink_rss() ?>" /> 35 35 <id><?php the_guid(); ?></id> 36 36 <updated><?php echo get_post_time('Y-m-d\TH:i:s\Z', true); ?></updated> … … 39 39 <summary type="<?php html_type_rss(); ?>"><![CDATA[<?php the_excerpt_rss(); ?>]]></summary> 40 40 <?php if ( !get_option('rss_use_excerpt') ) : ?> 41 <content type="<?php html_type_rss(); ?>" xml:base="<?php permalink_single_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content>41 <content type="<?php html_type_rss(); ?>" xml:base="<?php the_permalink_rss() ?>"><![CDATA[<?php the_content('', 0, '') ?>]]></content> 42 42 <?php endif; ?> 43 43 <?php atom_enclosure(); ?> -
trunk/wp-includes/feed-rdf.php
r5640 r5910 28 28 <rdf:Seq> 29 29 <?php while (have_posts()): the_post(); ?> 30 <rdf:li rdf:resource="<?php permalink_single_rss() ?>"/>30 <rdf:li rdf:resource="<?php the_permalink_rss() ?>"/> 31 31 <?php endwhile; ?> 32 32 </rdf:Seq> … … 34 34 </channel> 35 35 <?php rewind_posts(); while (have_posts()): the_post(); ?> 36 <item rdf:about="<?php permalink_single_rss() ?>">36 <item rdf:about="<?php the_permalink_rss() ?>"> 37 37 <title><?php the_title_rss() ?></title> 38 <link><?php permalink_single_rss() ?></link>38 <link><?php the_permalink_rss() ?></link> 39 39 <dc:date><?php echo mysql2date('Y-m-d\TH:i:s\Z', $post->post_date_gmt, false); ?></dc:date> 40 40 <dc:creator><?php the_author() ?></dc:creator> -
trunk/wp-includes/feed-rss.php
r5640 r5910 24 24 <description><?php the_content_rss('', 0, '', get_option('rss_excerpt_length')) ?></description> 25 25 <?php } ?> 26 <link><?php permalink_single_rss() ?></link>26 <link><?php the_permalink_rss() ?></link> 27 27 <?php do_action('rss_item'); ?> 28 28 </item> -
trunk/wp-includes/feed-rss2-comments.php
r5881 r5910 18 18 printf(__('Comments for %s'), get_bloginfo_rss( 'name' ) . get_wp_title_rss()); 19 19 ?></title> 20 <link><?php (is_single()) ? permalink_single_rss() : bloginfo_rss("url") ?></link>20 <link><?php (is_single()) ? the_permalink_rss() : bloginfo_rss("url") ?></link> 21 21 <description><?php bloginfo_rss("description") ?></description> 22 22 <pubDate><?php echo gmdate('r'); ?></pubDate> 23 23 <generator>http://wordpress.org/?v=<?php echo $wp_version ?></generator> 24 24 25 <?php 25 <?php 26 26 if ( have_comments() ) : while ( have_comments() ) : the_comment(); 27 27 $comment_post = get_post($comment->comment_post_ID); -
trunk/wp-includes/feed-rss2.php
r5640 r5910 25 25 <item> 26 26 <title><?php the_title_rss() ?></title> 27 <link><?php permalink_single_rss() ?></link>27 <link><?php the_permalink_rss() ?></link> 28 28 <comments><?php comments_link(); ?></comments> 29 29 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate> -
trunk/wp-includes/feed.php
r5755 r5910 70 70 } 71 71 72 73 function permalink_single_rss($file = '') { 74 echo get_permalink(); 75 } 76 72 function the_permalink_rss() { 73 echo apply_filters('the_permalink_rss', get_permalink()); 74 75 } 77 76 78 77 function comment_link() {
Note: See TracChangeset
for help on using the changeset viewer.