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 | |
| parent | 631f99c5d026f9863851006f82c753c044f5a5c3 (diff) | |
| download | wordpress-mu-0ad4b94b5dd2bdbac3314f7e2e8a8d9815935dfe.tar.gz wordpress-mu-0ad4b94b5dd2bdbac3314f7e2e8a8d9815935dfe.tar.xz wordpress-mu-0ad4b94b5dd2bdbac3314f7e2e8a8d9815935dfe.zip | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@472 7be80a69-a1ef-0310-a953-fb0f7c49ff36
| -rw-r--r-- | wp-inst/wp-admin/admin-footer.php | 1 | ||||
| -rw-r--r-- | wp-inst/wp-admin/admin-header.php | 17 | ||||
| -rw-r--r-- | wp-inst/wp-admin/execute-pings.php | 15 | ||||
| -rw-r--r-- | wp-inst/wp-admin/post.php | 9 | ||||
| -rw-r--r-- | wp-inst/wp-admin/profile.php | 2 | ||||
| -rw-r--r-- | wp-inst/wp-commentsrss2.php | 13 | ||||
| -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 |
13 files changed, 129 insertions, 49 deletions
diff --git a/wp-inst/wp-admin/admin-footer.php b/wp-inst/wp-admin/admin-footer.php index c7bbee5..3df83a5 100644 --- a/wp-inst/wp-admin/admin-footer.php +++ b/wp-inst/wp-admin/admin-footer.php @@ -6,7 +6,6 @@ </p> </div> -<?php check_for_pings(); ?> <?php do_action('admin_footer', ''); ?> <script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script> </body> diff --git a/wp-inst/wp-admin/admin-header.php b/wp-inst/wp-admin/admin-header.php index 7ac2a48..15ae0b1 100644 --- a/wp-inst/wp-admin/admin-header.php +++ b/wp-inst/wp-admin/admin-header.php @@ -83,9 +83,20 @@ addLoadEvent(blurry); <script type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20051211"></script> <?php endif; ?> <script type="text/javascript" src="../wp-includes/js/dbx.js"></script> +<script type="text/javascript"> +//<![CDATA[ + addLoadEvent( function() { +<?php switch ( $pagenow ) : case 'post.php' : ?> + var manager = new dbxManager('postmeta'); //session ID [/-_a-zA-Z0-9/] +<?php break; case 'page-new.php' : ?> + var manager = new dbxManager('pagemeta'); //session ID [/-_a-zA-Z0-9/] +<?php break; endswitch; ?> + }); +//]]> +</script> <script type="text/javascript" src="../wp-includes/js/dbx-key.js"></script> -<?php if ( isset($editing) && current_user_can('manage_categories') ) : ?> +<?php if ( current_user_can('manage_categories') ) : ?> <style type="text/css"> #newcat { width: 120px; margin-right: 5px; } input#catadd { background: #a4a4a4; @@ -113,6 +124,7 @@ input#catadd { background: #a4a4a4; } </style> <script type="text/javascript"> +//<![CDATA[ var ajaxCat = new sack(); var newcat; @@ -245,8 +257,6 @@ function newCatCompletion() { } p.parentNode.removeChild(p); // var id = parseInt(ajaxCat.response, 10); - - } function ajaxNewCatKeyPress(e) { @@ -302,6 +312,7 @@ function myPload( str ) { fixedExplode[count] = currentElement; return fixedExplode; } +//]]> </script> <?php endif; ?> diff --git a/wp-inst/wp-admin/execute-pings.php b/wp-inst/wp-admin/execute-pings.php index 69811f7..10be97b 100644 --- a/wp-inst/wp-admin/execute-pings.php +++ b/wp-inst/wp-admin/execute-pings.php @@ -1,10 +1,6 @@ <?php -require_once('admin.php'); +require_once('../wp-config.php'); -if ( ! current_user_can('edit_posts') ) - die (__("Cheatin' uh?")); - -echo '/* No Styles Here */'; register_shutdown_function('execute_all_pings'); //execute_all_pings(); @@ -14,7 +10,7 @@ function execute_all_pings() { if($pings = $wpdb->get_results("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_pingme';")) { foreach($pings as $ping) { pingback($ping->post_content, $ping->ID); - //echo "Pingback: $ping->post_title : $ping->ID<br/>"; + echo "Pingback: $ping->post_title : $ping->ID<br/>"; $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$ping->ID} AND meta_key = '_pingme';"); } } @@ -22,16 +18,19 @@ function execute_all_pings() { if($enclosures = $wpdb->get_results("SELECT * FROM {$wpdb->posts}, {$wpdb->postmeta} WHERE {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id AND {$wpdb->postmeta}.meta_key = '_encloseme';")) { foreach($enclosures as $enclosure) { do_enclose($enclosure->post_content, $enclosure->ID); - //echo "Enclosure: $enclosure->post_title : $enclosure->ID<br/>"; + echo "Enclosure: $enclosure->post_title : $enclosure->ID<br/>"; $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id = {$enclosure->ID} AND meta_key = '_encloseme';"); } } // Do Trackbacks if($trackbacks = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE TRIM(to_ping) != '' AND post_status != 'draft'")) { foreach($trackbacks as $trackback) { - //echo "trackback : $trackback->ID<br/>"; + echo "Trackback : $trackback->ID<br/>"; do_trackbacks($trackback->ID); } } } + +_e('Done.'); + ?> diff --git a/wp-inst/wp-admin/post.php b/wp-inst/wp-admin/post.php index ea53a07..e3456b6 100644 --- a/wp-inst/wp-admin/post.php +++ b/wp-inst/wp-admin/post.php @@ -136,8 +136,13 @@ case 'delete': if ( !current_user_can('edit_post', $post_id) ) die( __('You are not allowed to delete this post.') ); - if ( (($post->post_status != 'attachment') && !wp_delete_post($post_id)) || !wp_delete_attachment($post_id)) - die( __('Error in deleting...') ); + if ( $post->post_status == 'attachment' ) { + if ( ! wp_delete_attachment($post_id) ) + die( __('Error in deleting...') ); + } else { + if ( !wp_delete_post($post_id) ) + die( __('Error in deleting...') ); + } $sendback = $_SERVER['HTTP_REFERER']; if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php'; diff --git a/wp-inst/wp-admin/profile.php b/wp-inst/wp-admin/profile.php index f612c3a..4d71e7c 100644 --- a/wp-inst/wp-admin/profile.php +++ b/wp-inst/wp-admin/profile.php @@ -39,7 +39,7 @@ $bookmarklet_height= 440; <p><label><?php _e('Nickname:') ?><br /> <input type="text" name="nickname" value="<?php echo $profileuser->nickname ?>" /></label></p> -</p><label><?php _e('Display name publicly as:') ?> <br /> +<p><label><?php _e('Display name publicly as:') ?> <br /> <select name="display_name"> <option value="<?php echo $profileuser->display_name; ?>"><?php echo $profileuser->display_name; ?></option> <option value="<?php echo $profileuser->nickname ?>"><?php echo $profileuser->nickname ?></option> diff --git a/wp-inst/wp-commentsrss2.php b/wp-inst/wp-commentsrss2.php index 8de760d..caddaa0 100644 --- a/wp-inst/wp-commentsrss2.php +++ b/wp-inst/wp-commentsrss2.php @@ -20,7 +20,7 @@ if (have_posts()) : if ($i < 1) { $i++; ?> - <title><?php if (is_single() || is_page()) { echo "Comments on: "; the_title_rss(); } else { bloginfo_rss("name"); echo " Comments"; } ?></title> + <title><?php if (is_single() || is_page() ) { printf(__('Comments on: %s'), get_the_title_rss()); } else { printf(__('Comments for %s'), get_bloginfo_rss("name")); } ?></title> <link><?php (is_single()) ? permalink_single_rss() : bloginfo_rss("url") ?></link> <description><?php bloginfo_rss("description") ?></description> <pubDate><?php echo gmdate('r'); ?></pubDate> @@ -51,14 +51,21 @@ if (have_posts()) : get_post_custom($comment->comment_post_ID); ?> <item> - <title>by: <?php comment_author_rss() ?></title> + <title><?php if ( ! (is_single() || is_page()) ) { + $title = get_the_title($comment->comment_post_ID); + $title = apply_filters('the_title', $title); + $title = apply_filters('the_title_rss', $title); + printf(__('Comment on %1$s by %2$s'), $title, get_comment_author_rss()); + } else { + printf(__('by: %s'), get_comment_author_rss()); + } ?></title> <link><?php comment_link() ?></link> <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate> <guid><?php comment_link() ?></guid> <?php if (!empty($comment->post_password) && $_COOKIE['wp-postpass'] != $comment->post_password) { ?> - <description>Protected Comments: Please enter your password to view comments.</description> + <description><?php _e('Protected Comments: Please enter your password to view comments.'); ?></description> <content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded> <?php } else { 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]; |
