diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-12-16 10:28:20 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-12-16 10:28:20 +0000 |
| commit | 0ad4b94b5dd2bdbac3314f7e2e8a8d9815935dfe (patch) | |
| tree | 524a881c1c901018837914038476eb37ce173cfa /wp-inst/wp-includes | |
| parent | 631f99c5d026f9863851006f82c753c044f5a5c3 (diff) | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@472 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes')
| -rw-r--r-- | wp-inst/wp-includes/comment-functions.php | 2 | ||||
| -rw-r--r-- | wp-inst/wp-includes/feed-functions.php | 14 | ||||
| -rw-r--r-- | wp-inst/wp-includes/functions-post.php | 24 | ||||
| -rw-r--r-- | wp-inst/wp-includes/functions.php | 58 | ||||
| -rw-r--r-- | wp-inst/wp-includes/js/dbx-key.js | 4 | ||||
| -rw-r--r-- | wp-inst/wp-includes/js/tinymce/tiny_mce_gzip.php | 17 | ||||
| -rw-r--r-- | wp-inst/wp-includes/vars.php | 2 |
7 files changed, 90 insertions, 31 deletions
diff --git a/wp-inst/wp-includes/comment-functions.php b/wp-inst/wp-includes/comment-functions.php index b448ed7..a056835 100644 --- a/wp-inst/wp-includes/comment-functions.php +++ b/wp-inst/wp-includes/comment-functions.php @@ -639,7 +639,7 @@ function pingback($content, $post_ID) { $pingback_server_url = discover_pingback_server_uri($pagelinkedto, 2048); if ($pingback_server_url) { - set_time_limit( 60 ); + @ set_time_limit( 60 ); // Now, the RPC call debug_fwrite($log, "Page Linked To: $pagelinkedto \n"); debug_fwrite($log, 'Page Linked From: '); diff --git a/wp-inst/wp-includes/feed-functions.php b/wp-inst/wp-includes/feed-functions.php index 94eb8dc..40e6778 100644 --- a/wp-inst/wp-includes/feed-functions.php +++ b/wp-inst/wp-includes/feed-functions.php @@ -9,11 +9,15 @@ function bloginfo_rss($show = '') { echo get_bloginfo_rss($show); } -function the_title_rss() { +function get_the_title_rss() { $title = get_the_title(); $title = apply_filters('the_title', $title); $title = apply_filters('the_title_rss', $title); - echo $title; + return $title; +} + +function the_title_rss() { + echo get_the_title_rss(); } function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { @@ -62,9 +66,11 @@ function comment_link() { echo get_comment_link(); } +function get_comment_author_rss() { + return apply_filters('comment_author_rss', get_comment_author() ); +} function comment_author_rss() { - $author = apply_filters('comment_author_rss', get_comment_author() ); - echo $author; + echo get_comment_author_rss(); } function comment_text_rss() { diff --git a/wp-inst/wp-includes/functions-post.php b/wp-inst/wp-includes/functions-post.php index 38c7540..e0136d4 100644 --- a/wp-inst/wp-includes/functions-post.php +++ b/wp-inst/wp-includes/functions-post.php @@ -181,20 +181,21 @@ function wp_insert_post($postarr = array()) { if ($post_status == 'publish') { do_action('publish_post', $post_ID); - if ($post_pingback && !defined('WP_IMPORTING')) - $result = $wpdb->query(" - INSERT INTO $wpdb->postmeta - (post_id,meta_key,meta_value) - VALUES ('$post_ID','_pingme','1') - "); - if ( !defined('WP_IMPORTING') ) + if ( !defined('WP_IMPORTING') ) { + if ( $post_pingback ) + $result = $wpdb->query(" + INSERT INTO $wpdb->postmeta + (post_id,meta_key,meta_value) + VALUES ('$post_ID','_pingme','1') + "); $result = $wpdb->query(" INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value) VALUES ('$post_ID','_encloseme','1') "); - //register_shutdown_function('do_trackbacks', $post_ID); - } else if ($post_status == 'static') { + spawn_pinger(); + } + } else if ($post_status == 'static') { generate_page_rewrite_rules(); if ( !empty($page_template) ) @@ -504,7 +505,8 @@ function wp_set_post_cats($blogid = '1', $post_ID = 0, $post_categories = array( } // Update category counts. - foreach ( $post_categories as $cat_id ) { + $all_affected_cats = array_unique(array_merge($post_categories, $old_categories)); + foreach ( $all_affected_cats as $cat_id ) { $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->post2cat, $wpdb->posts WHERE $wpdb->posts.ID=$wpdb->post2cat.post_id AND post_status='publish' AND category_id = '$cat_id'"); $wpdb->query("UPDATE $wpdb->categories SET category_count = '$count' WHERE cat_ID = '$cat_id'"); wp_cache_delete($cat_id, 'category'); @@ -701,6 +703,8 @@ function do_trackbacks($post_id) { if ( !in_array($tb_ping, $pinged) ) { trackback($tb_ping, $post_title, $excerpt, $post_id); $pinged[] = $tb_ping; + } else { + $wpdb->query("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_ping', '')) WHERE ID = '$post_id'"); } endforeach; endif; } diff --git a/wp-inst/wp-includes/functions.php b/wp-inst/wp-includes/functions.php index f9d2eeb..d4b5f78 100644 --- a/wp-inst/wp-includes/functions.php +++ b/wp-inst/wp-includes/functions.php @@ -600,6 +600,50 @@ function &get_post(&$post, $output = OBJECT) { } } +function &get_children($post = 0, $output = OBJECT) { + global $post_cache, $wpdb; + + if ( empty($post) ) { + if ( isset($GLOBALS['post']) ) + $post_parent = & $GLOBALS['post']->post_parent; + else + return false; + } elseif ( is_object($post) ) { + $post_parent = $post->post_parent; + } else { + $post_parent = $post; + } + + $post_parent = (int) $post_parent; + + $query = "SELECT * FROM $wpdb->posts WHERE post_parent = $post_parent"; + + $children = $wpdb->get_results($query); + + if ( $children ) { + foreach ( $children as $key => $child ) { + $post_cache[$child->ID] =& $children[$key]; + $kids[$child->ID] =& $children[$key]; + } + } else { + return false; + } + + if ( $output == OBJECT ) { + return $kids; + } elseif ( $output == ARRAY_A ) { + foreach ( $kids as $kid ) + $weeuns[$kid->ID] = get_object_vars($kids[$kid->ID]); + return $weeuns; + } elseif ( $output == ARRAY_N ) { + foreach ( $kids as $kid ) + $babes[$kid->ID] = array_values(get_object_vars($kids[$kid->ID])); + return $babes; + } else { + return $kids; + } +} + function set_page_path($page) { $page->fullpath = '/' . $page->post_name; $path = $page->fullpath; @@ -772,7 +816,6 @@ function get_all_page_ids() { } function gzip_compression() { - if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') ) return false; if ( !get_settings('gzipcompression') ) return false; if ( extension_loaded('zlib') ) { @@ -865,7 +908,7 @@ function trackback($trackback_url, $title, $excerpt, $ID) { $tb_url = addslashes( $tb_url ); $wpdb->query("UPDATE $wpdb->posts SET pinged = CONCAT(pinged, '\n', '$tb_url') WHERE ID = '$ID'"); - return $wpdb->query("UPDATE $wpdb->posts SET to_ping = REPLACE(to_ping, '$tb_url', '') WHERE ID = '$ID'"); + return $wpdb->query("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, '$tb_url', '')) WHERE ID = '$ID'"); } function make_url_footnote($content) { @@ -942,7 +985,7 @@ function debug_fclose($fp) { } } -function check_for_pings() { +function spawn_pinger() { global $wpdb; $doping = false; if ( $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != '' LIMIT 1") ) @@ -951,8 +994,13 @@ function check_for_pings() { if ( $wpdb->get_var("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_pingme' OR meta_key = '_encloseme' LIMIT 1") ) $doping = true; - if ( $doping ) - echo '<iframe id="pingcheck" src="' . get_settings('siteurl') .'/wp-admin/execute-pings.php?time=' . time() . '" style="border:none;width:1px;height:1px;"></iframe>'; + if ( $doping ) { + $ping_url = get_settings('siteurl') .'/wp-admin/execute-pings.php'; + $parts = parse_url($ping_url); + $argyle = @ fsockopen($parts['host'], $_SERVER['SERVER_PORT'], $errno, $errstr, 0.01); + if ( $argyle ) + fputs($argyle, "GET {$parts['path']}?time=".time()." HTTP/1.0\r\nHost: {$_SERVER['HTTP_HOST']}\r\n\r\n"); + } } function do_enclose( $content, $post_ID ) { diff --git a/wp-inst/wp-includes/js/dbx-key.js b/wp-inst/wp-includes/js/dbx-key.js index b98a8bc..f7155de 100644 --- a/wp-inst/wp-includes/js/dbx-key.js +++ b/wp-inst/wp-includes/js/dbx-key.js @@ -2,10 +2,6 @@ //initialisation function addLoadEvent( function() { - //initialise the docking boxes manager - var manager = new dbxManager('postmeta'); //session ID [/-_a-zA-Z0-9/] - - //create new docking boxes group var meta = new dbxGroup( 'grabit', // container ID [/-_a-zA-Z0-9/] diff --git a/wp-inst/wp-includes/js/tinymce/tiny_mce_gzip.php b/wp-inst/wp-includes/js/tinymce/tiny_mce_gzip.php index 3feee3b..36e1fca 100644 --- a/wp-inst/wp-includes/js/tinymce/tiny_mce_gzip.php +++ b/wp-inst/wp-includes/js/tinymce/tiny_mce_gzip.php @@ -56,10 +56,7 @@ // General options $expiresOffset = 3600 * 24 * 30; // 30 days util client cache expires - // Only gzip the contents if clients and server support it - $encodings = explode(',', strtolower($_SERVER['HTTP_ACCEPT_ENCODING'])); - if (in_array('gzip', $encodings) && function_exists('ob_gzhandler')) - @ ob_start("ob_gzhandler"); // Don't let warnings foul up the JS + gzip_compression(); // Output rest of headers header("Content-type: text/javascript; charset: UTF-8"); @@ -119,7 +116,8 @@ $mce_browsers = apply_filters('mce_browsers', array('msie', 'gecko', 'opera')); $mce_browsers = implode($mce_browsers, ','); ?> -tinyMCE.init({ + +initArray = { mode : "specific_textareas", textarea_trigger : "title", width : "100%", @@ -145,5 +143,12 @@ tinyMCE.init({ valid_elements : "<?php echo $valid_elements; ?>", <?php do_action('mce_options'); ?> plugins : "<?php echo $plugins; ?>" -}); +}; + +<?php + // For people who really REALLY know what they're doing with TinyMCE + do_action('tinymce_before_init'); +?> + +tinyMCE.init(initArray); diff --git a/wp-inst/wp-includes/vars.php b/wp-inst/wp-includes/vars.php index 53b8d4d..d80cb99 100644 --- a/wp-inst/wp-includes/vars.php +++ b/wp-inst/wp-includes/vars.php @@ -3,7 +3,7 @@ // On which page are we ? $PHP_SELF = $_SERVER['PHP_SELF']; if ( empty($PHP_SELF) ) - $PHP_SELF = $_SERVER["REQUEST_URI"]; + $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace("/(\?.*)?$/",'',$_SERVER["REQUEST_URI"]); if (preg_match('#([^/]+.php)#', $PHP_SELF, $self_matches)) { $pagenow = $self_matches[1]; |
