Changeset 797
- Timestamp:
- 10/09/2006 11:39:17 AM (20 years ago)
- Location:
- trunk
- Files:
-
- 48 edited
-
wp-activate.php (modified) (1 diff)
-
wp-admin/admin-functions.php (modified) (1 diff)
-
wp-admin/comment.php (modified) (1 diff)
-
wp-admin/edit-category-form.php (modified) (1 diff)
-
wp-admin/edit-form-comment.php (modified) (1 diff)
-
wp-admin/export.php (modified) (1 diff)
-
wp-admin/import/mt.php (modified) (7 diffs)
-
wp-admin/import/wordpress.php (modified) (3 diffs)
-
wp-admin/options-privacy.php (modified) (1 diff)
-
wp-admin/options-reading.php (modified) (1 diff)
-
wp-admin/page.php (modified) (1 diff)
-
wp-admin/profile-update.php (modified) (1 diff)
-
wp-admin/themes.php (modified) (2 diffs)
-
wp-admin/upgrade-functions.php (modified) (2 diffs)
-
wp-admin/upgrade.php (modified) (1 diff)
-
wp-admin/upload-functions.php (modified) (9 diffs)
-
wp-admin/upload-js.php (modified) (8 diffs)
-
wp-admin/upload.css (modified) (4 diffs)
-
wp-admin/upload.php (modified) (1 diff)
-
wp-admin/user-edit.php (modified) (1 diff)
-
wp-admin/users.php (modified) (1 diff)
-
wp-admin/wp-admin.css (modified) (13 diffs)
-
wp-content/blogs.php (modified) (3 diffs)
-
wp-content/mu-plugins/pluggable.php (modified) (2 diffs)
-
wp-content/themes/classic/sidebar.php (modified) (1 diff)
-
wp-content/themes/default/sidebar.php (modified) (3 diffs)
-
wp-cron.php (modified) (1 diff)
-
wp-includes/bookmark-template.php (modified) (3 diffs)
-
wp-includes/category-template.php (modified) (2 diffs)
-
wp-includes/cron.php (modified) (3 diffs)
-
wp-includes/default-filters.php (modified) (2 diffs)
-
wp-includes/formatting.php (modified) (2 diffs)
-
wp-includes/functions.php (modified) (20 diffs)
-
wp-includes/general-template.php (modified) (7 diffs)
-
wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js (modified) (1 diff)
-
wp-includes/js/tinymce/tiny_mce_config.php (modified) (2 diffs)
-
wp-includes/l10n.php (modified) (1 diff)
-
wp-includes/pluggable.php (modified) (1 diff)
-
wp-includes/plugin.php (modified) (2 diffs)
-
wp-includes/post-template.php (modified) (3 diffs)
-
wp-includes/post.php (modified) (18 diffs)
-
wp-includes/script-loader.php (modified) (2 diffs)
-
wp-includes/vars.php (modified) (1 diff)
-
wp-includes/wpmu-functions.php (modified) (22 diffs)
-
wp-login.php (modified) (4 diffs)
-
wp-settings.php (modified) (1 diff)
-
wp-signup.php (modified) (5 diffs)
-
xmlrpc.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-activate.php
r596 r797 26 26 if ( empty($_GET['key']) && empty($_POST['key']) ) { 27 27 ?> 28 <h2> Activation Key Required</h2>28 <h2><?php _e('Activation Key Required') ?></h2> 29 29 <form name="activateform" id="activateform" method="post" action="/wp-activate.php"> 30 30 <table border="0" width="100%" cellpadding="9"> 31 31 <tr> 32 <th valign="top"> Activation Key:</th>32 <th valign="top"><?php _e('Activation Key:') ?></th> 33 33 <td><input name="key" type="text" id="key" value="" /></td> 34 34 </tr> 35 35 <tr> 36 36 <th scope="row" valign="top"> </th> 37 <td><input id="submit" type="submit" name="Submit" class="submit" value=" Activate »" /></td>37 <td><input id="submit" type="submit" name="Submit" class="submit" value="<?php _e('Activate »') ?>" /></td> 38 38 </tr> 39 39 </table> -
trunk/wp-admin/admin-functions.php
r789 r797 1985 1985 1986 1986 $icon = get_attachment_icon($post->ID); 1987 1987 $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); 1988 $thumb = isset($attachment_data['thumb']); 1988 1989 ?> 1989 1990 <form id="the-attachment-links"> 1990 1991 <table> 1992 <col /> 1993 <col class="widefat" /> 1991 1994 <tr> 1992 <th scope="row"><?php _e('Text linked to file') ?></th> 1993 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo basename($post->guid) ?></a></textarea></td> 1994 </tr> 1995 <tr> 1996 <th scope="row"><?php _e('Text linked to subpost') ?></th> 1997 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $post->post_title ?></a></textarea></td> 1995 <th scope="row"><?php _e('URL') ?></th> 1996 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo $post->guid ?></textarea></td> 1998 1997 </tr> 1999 1998 <?php if ( $icon ) : ?> 2000 1999 <tr> 2001 <th scope="row"><?php _e('Thumbnail linked to file')?></th>2002 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo $icon ?></a></textarea></td>2000 <th scope="row"><?php $thumb ? _e('Thumbnail linked to file') : _e('Image linked to file'); ?></th> 2001 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td> 2003 2002 </tr> 2004 2003 <tr> 2005 <th scope="row"><?php _e('Thumbnail linked to subpost')?></th>2004 <th scope="row"><?php $thumb ? _e('Thumbnail linked to page') : _e('Image linked to file'); ?></th> 2006 2005 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td> 2006 </tr> 2007 <?php else : ?> 2008 <tr> 2009 <th scope="row"><?php _e('Link to file') ?></th> 2010 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo basename($post->guid); ?></a></textarea></td> 2011 </tr> 2012 <tr> 2013 <th scope="row"><?php _e('Link to page') ?></th> 2014 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td> 2007 2015 </tr> 2008 2016 <?php endif; ?> -
trunk/wp-admin/comment.php
r784 r797 13 13 case 'editcomment': 14 14 $title = __('Edit Comment'); 15 15 if ( user_can_richedit() ) 16 wp_enqueue_script( 'wp_tiny_mce' ); 16 17 require_once ('admin-header.php'); 17 18 -
trunk/wp-admin/edit-category-form.php
r567 r797 30 30 <th scope="row" valign="top"><label for="category_parent"><?php _e('Category parent:') ?></label></th> 31 31 <td> 32 <select name='category_parent' id='category_parent'> 33 <option value='0' <?php if (!$category->category_parent) echo " selected='selected'"; ?>><?php _e('None') ?></option> 34 <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?> 35 </select></td> 32 <?php wp_dropdown_categories('hide_empty=0&name=category_parent&selected=' . $category->category_parent . '&hierarchical=1&show_option_none=' . __('None')); ?> 33 </td> 36 34 </tr> 37 35 <tr> -
trunk/wp-admin/edit-form-comment.php
r788 r797 37 37 </fieldset> 38 38 39 <fieldset style="clear: both;">39 <fieldset id="<?php echo user_can_richedit() ? 'commentdivrich' : 'commentdiv'; ?>" style="clear: both;"> 40 40 <legend><?php _e('Comment') ?></legend> 41 41 <?php the_editor($comment->comment_content, 'content', 'newcomment_author_url'); ?> -
trunk/wp-admin/export.php
r793 r797 20 20 </p> 21 21 </form> 22 <p><?php _e('If you are considering moving your blog to another host we recommend a number of <a href="http://wordpress.org/hosting/">hosting services</a>.'); ?></p> 22 23 </div> 23 24 </div> -
trunk/wp-admin/import/mt.php
r793 r797 53 53 global $wpdb; 54 54 //mtnames is an array with the names in the mt import file 55 $pass = 'changeme'; 56 if (!(in_array($author, $this->mtnames))) { //a new mt author name is found 57 ++ $this->j; 58 $this->mtnames[$this->j] = $author; //add that new mt author name to an array 59 $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user 60 if (!$user_id) { //banging my head against the desk now. 61 if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname 62 $user_id = wp_create_user($author, $pass); 63 $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank. 64 } else { 65 $user_id = wp_create_user($this->newauthornames[$this->j], $pass); 66 } 67 } else { 68 return $user_id; // return pre-existing wp username if it exists 69 } 70 } else { 71 $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array 72 $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames 73 } 55 $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array 56 $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames 74 57 75 58 return $user_id; … … 113 96 $selectnames = array (); 114 97 115 foreach ($_POST['user'] as $key => $line) {116 $newname = trim(stripslashes($line));117 if ($newname == '')118 $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form.119 array_push($formnames, "$newname");120 } // $formnames is the array with the form entered names121 122 98 foreach ($_POST['userselect'] as $user => $key) { 123 99 $selected = trim(stripslashes($key)); … … 151 127 foreach ($authors as $author) { 152 128 ++ $j; 153 echo '<li> '.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />');129 echo '<li><i>'.$author.'</i><br />'.'<input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30">'; 154 130 $this->users_form($j); 155 131 echo '</li>'; 156 132 } 157 133 158 echo '<input type="submit" value=" '.__('Submit').'">'.'<br/>';134 echo '<input type="submit" value="Submit">'.'<br/>'; 159 135 echo '</form>'; 160 136 echo '</ol></div>'; … … 165 141 $file = wp_import_handle_upload(); 166 142 if ( isset($file['error']) ) { 167 $this->header(); 168 echo '<p>'.__('Sorry, there has been an error').'.</p>'; 169 echo '<p><strong>' . $file['error'] . '</strong></p>'; 170 $this->footer(); 143 echo $file['error']; 171 144 return; 172 145 } … … 200 173 // We want the excerpt 201 174 preg_match("|-----\nEXCERPT:(.*)|s", $post, $excerpt); 202 $ post_excerpt = $wpdb->escape(trim($excerpt[1]));175 $excerpt = $wpdb->escape(trim($excerpt[1])); 203 176 $post = preg_replace("|(-----\nEXCERPT:.*)|s", '', $post); 204 177 … … 337 310 } 338 311 if ( $num_comments ) 339 printf( ' '.__('(%s comments)'), $num_comments);312 printf(__(' (%s comments)'), $num_comments); 340 313 341 314 // Finally the pings … … 385 358 } 386 359 if ( $num_pings ) 387 printf( ' '.__('(%s pings)'), $num_pings);360 printf(__(' (%s pings)'), $num_pings); 388 361 389 362 echo "</li>"; -
trunk/wp-admin/import/wordpress.php
r793 r797 27 27 function greet() { 28 28 echo '<div class="narrow">'; 29 echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts and comments into this blog.').'</p>';29 echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we’ll import the posts, comments, custom fields, and categories into this blog.').'</p>'; 30 30 wp_import_upload_form("admin.php?import=wordpress&step=1"); 31 31 echo '</div>'; … … 151 151 foreach ($authors as $author) { 152 152 ++ $j; 153 echo '<li> '.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />');154 $this->users_form($ j);153 echo '<li>Current author: <strong>'.$author.'</strong><br />'.'Map to existing: '; 154 $this->users_form($author); 155 155 echo '</li>'; 156 156 } … … 309 309 $wp_import = new WP_Import(); 310 310 311 register_importer('wordpress', 'WordPress', __('Import postsfrom a WordPress export file'), array ($wp_import, 'dispatch'));311 register_importer('wordpress', 'WordPress', __('Import <strong>posts, comments, custom fields, and categories</strong> from a WordPress export file'), array ($wp_import, 'dispatch')); 312 312 313 313 ?> -
trunk/wp-admin/options-privacy.php
r766 r797 23 23 <br /> 24 24 <input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> /> 25 <label for="blog-norobots"><?php _e( 'I would like to block search engines, but allow normal folks')?></label>25 <label for="blog-norobots"><?php _e( 'I would like to block search engines, but allow normal visitors' ); ?></label> 26 26 <?php do_action('blog_privacy_selector'); ?> 27 27 </td> -
trunk/wp-admin/options-reading.php
r761 r797 6 6 7 7 include('admin-header.php'); 8 9 // Sanity checks 10 if ( 'page' == get_option('show_on_front') ) { 11 $front_page = get_option('page_on_front'); 12 if ( empty($front_page) ) { 13 update_option('show_on_front', 'posts'); 14 delete_option('page_for_posts'); 15 delete_option('page_on_front'); 16 } 17 } 8 18 ?> 9 19 -
trunk/wp-admin/page.php
r793 r797 46 46 $page_ID = $post_ID = $p = (int) $_GET['post']; 47 47 $post = get_post_to_edit($page_ID); 48 if( $post->post_type == 'post' ) { 49 header( "Location: " . str_replace( "page.php", "post.php", $_SERVER[ 'REQUEST_URI' ] ) ); 50 die(); 51 } 48 52 if($post->post_status == 'draft') { 49 53 wp_enqueue_script('prototype'); 50 54 wp_enqueue_script('autosave'); 51 }52 if( $post->post_type == 'post' ) {53 header( "Location: " . str_replace( "page.php", "post.php", $_SERVER[ 'REQUEST_URI' ] ) );54 die();55 55 } 56 56 require_once('admin-header.php'); -
trunk/wp-admin/profile-update.php
r638 r797 22 22 update_user_option( $current_user->id, 'rich_editing', $_POST['rich_editing'], true ); 23 23 24 if ( isset( $_POST['primary_blog'] ) ) { 25 $primary_blog = (int) $_POST['primary_blog']; 26 update_user_option( $current_user->id, 'primary_blog', $primary_blog, true ); 27 } 28 24 29 do_action('personal_options_update'); 25 30 -
trunk/wp-admin/themes.php
r738 r797 70 70 <div id="currenttheme"> 71 71 <?php if ( $ct->screenshot ) : ?> 72 <img src=" <?php echo get_option('siteurl') . '/' .$ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />72 <img src="../<?php echo $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" /> 73 73 <?php endif; ?> 74 <h3><?php printf(__('%1$s %2$s by %3$s'), $ct->title, $ct->version, $ct->author) ; ?></h3>74 <h3><?php printf(__('%1$s %2$s by %3$s'), $ct->title, '', $ct->author) ; ?></h3> 75 75 <p><?php echo $ct->description; ?></p> 76 76 </div> … … 99 99 ?> 100 100 <div class="available-theme"> 101 <h3><a href="<?php echo $activate_link; ?>"><?php echo "$title $version"; ?></a></h3>101 <h3><a href="<?php echo $activate_link; ?>"><?php echo "$title"; ?></a></h3> 102 102 103 103 <a href="<?php echo $activate_link; ?>" class="screenshot"> 104 104 <?php if ( $screenshot ) : ?> 105 <img src=" <?php echo get_option('siteurl') . '/' .$stylesheet_dir . '/' . $screenshot; ?>" alt="" />105 <img src="../<?php echo $stylesheet_dir . '/' . $screenshot; ?>" alt="" /> 106 106 <?php endif; ?> 107 107 </a> -
trunk/wp-admin/upgrade-functions.php
r789 r797 513 513 if ( !empty($posts) ) 514 514 foreach ( $posts as $post ) 515 wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', $post->ID);515 wp_schedule_single_event(mysql2date('U', $post->post_date), 'publish_future_post', array($post->ID)); 516 516 } 517 517 if ( $wp_current_db_version < 3570 ) { … … 687 687 // Create a tablename index for an array ($cqueries) of queries 688 688 foreach($queries as $qry) { 689 if(preg_match("|CREATE TABLE ( [^ ]*)|", $qry, $matches)) {689 if(preg_match("|CREATE TABLE (?:IF NOT EXISTS )?([^ ]*)|", $qry, $matches)) { 690 690 $cqueries[strtolower($matches[1])] = $qry; 691 691 $for_update[$matches[1]] = 'Created table '.$matches[1]; -
trunk/wp-admin/upgrade.php
r784 r797 47 47 $wpdb->query( "INSERT INTO wp_blog_versions ( `blog_id` , `db_version` , `last_updated` ) VALUES ( '{$wpdb->blogid}', '{$wp_db_version}', NOW());" ); 48 48 } 49 50 49 ?> 51 50 <h2><?php _e('Step 1'); ?></h2> -
trunk/wp-admin/upload-functions.php
r793 r797 17 17 $image_src = explode('"', $image_src); 18 18 $image_src = $image_src[1]; 19 $image_rel = wp_make_link_relative($image_src); 19 20 $class = 'image'; 20 $innerHTML = ' ' . $innerHTML; 21 $innerHTML = ' ' . str_replace($image_src, $image_rel, $innerHTML); 22 $image_base = str_replace($image_rel, '', $image_src); 21 23 } 24 25 $src_base = get_the_guid(); 26 $src = wp_make_link_relative( $src_base ); 27 $src_base = str_replace($src, '', $src_base); 22 28 23 29 $r = ''; … … 30 36 $r .= "</a>\n"; 31 37 $r .= "\n\t\t<div class='upload-file-data'>\n\t\t\t<p>\n"; 32 $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='" . get_the_guid() . "' />\n"; 33 34 if ( $image_src ) 35 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$image_src' />\n"; 38 $r .= "\t\t\t\t<input type='hidden' name='attachment-url-$id' id='attachment-url-$id' value='$src' />\n"; 39 $r .= "\t\t\t\t<input type='hidden' name='attachment-url-base-$id' id='attachment-url-base-$id' value='$src_base' />\n"; 40 41 if ( isset($attachment_data['thumb']) ) { 42 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-$id' id='attachment-thumb-url-$id' value='$image_rel' />\n"; 43 $r .= "\t\t\t\t<input type='hidden' name='attachment-thumb-url-base-$id' id='attachment-thumb-url-base-$id' value='$image_base' />\n"; 44 } elseif ( $image_rel ) 45 $r .= "\t\t\t\t<input type='hidden' name='attachment-is-image-$id' id='attachment-is-image-$id' value='1' />\n"; 36 46 if ( isset($width) ) { 37 47 $r .= "\t\t\t\t<input type='hidden' name='attachment-width-$id' id='attachment-width-$id' value='$width' />\n"; … … 46 56 47 57 function wp_upload_view() { 48 global $style, $post_id ;58 global $style, $post_id, $style; 49 59 $id = get_the_ID(); 50 60 $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); … … 52 62 <div id="upload-file"> 53 63 <div id="file-title"> 54 <h2><?php if ( !isset($attachment_data['width']) )64 <h2><?php if ( !isset($attachment_data['width']) && 'inline' != $style ) 55 65 echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; 56 66 the_title(); 57 if ( !isset($attachment_data['width']) )67 if ( !isset($attachment_data['width']) && 'inline' != $style ) 58 68 echo '</a>'; 59 69 ?></h2> … … 69 79 70 80 <div id="upload-file-view" class="alignleft"> 71 <?php if ( isset($attachment_data['width']) )81 <?php if ( isset($attachment_data['width']) && 'inline' != $style ) 72 82 echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; 73 83 echo wp_upload_display( array(171, 128) ); 74 if ( isset($attachment_data['width']) )84 if ( isset($attachment_data['width']) && 'inline' != $style ) 75 85 echo '</a>'; ?> 76 86 </div> 77 87 <?php the_attachment_links( $id ); ?> 78 88 </div> 79 <?php echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' ) . "' /></form>\n";89 <?php echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' ) . "' /></form>\n"; 80 90 } 81 91 … … 92 102 ?> 93 103 <div id="file-title"> 94 <h2><?php if ( !isset($attachment_data['width']) )104 <h2><?php if ( !isset($attachment_data['width']) && 'inline' != $style ) 95 105 echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; 96 106 the_title(); 97 if ( !isset($attachment_data['width']) )107 if ( !isset($attachment_data['width']) && 'inline' != $style ) 98 108 echo '</a>'; 99 109 ?></h2> … … 109 119 110 120 <div id="upload-file-view" class="alignleft"> 111 <?php if ( isset($attachment_data['width']) )121 <?php if ( isset($attachment_data['width']) && 'inline' != $style ) 112 122 echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>"; 113 123 echo wp_upload_display( array(171, 128) ); 114 if ( isset($attachment_data['width']) )124 if ( isset($attachment_data['width']) && 'inline' != $style ) 115 125 echo '</a>'; ?> 116 126 </div> 117 127 <?php endif; ?> 118 <table> 119 <?php if ( !$id ): ?>128 <table><col /><col class="widefat" /> 129 <?php if ( $id ): ?> 120 130 <tr> 121 <th scope="row"><label for="upload"><?php _e('File:'); ?></label></th> 131 <th scope="row"><label for="url"><?php _e('URL'); ?></label></th> 132 <td><input type="text" id="url" class="readonly" value="<?php the_guid(); ?>" readonly="readonly" /></td> 133 </tr> 134 <?php else : ?> 135 <tr> 136 <th scope="row"><label for="upload"><?php _e('File'); ?></label></th> 122 137 <td><input type="file" id="upload" name="image" /></td> 123 138 </tr> 124 139 <?php endif; ?> 125 140 <tr> 126 <th scope="row"><label for="post_title"><?php _e('Title :'); ?></label></th>141 <th scope="row"><label for="post_title"><?php _e('Title'); ?></label></th> 127 142 <td><input type="text" id="post_title" name="post_title" value="<?php echo $attachment->post_title; ?>" /></td> 128 143 </tr> 129 144 <tr> 130 <th scope="row"><label for="post_content"><?php _e('Description :'); ?></label></th>145 <th scope="row"><label for="post_content"><?php _e('Description'); ?></label></th> 131 146 <td><textarea name="post_content" id="post_content"><?php echo $attachment->post_content; ?></textarea></td> 132 147 </tr> 133 <tr id="buttons"> 134 <th></th> 135 <td> 148 <tr id="buttons" class="submit"> 149 <td colspan='2'> 150 <?php if ( $id ) : ?> 151 <input type="submit" name="delete" id="delete" class="delete alignleft" value="<?php _e('Delete File'); ?>" /> 152 <?php endif; ?> 136 153 <input type="hidden" name="from_tab" value="<?php echo $tab; ?>" /> 137 154 <input type="hidden" name="action" value="<?php echo $id ? 'save' : 'upload'; ?>" /> … … 144 161 <div class="submit"> 145 162 <input type="submit" value="<?php $id ? _e('Save') : _e('Upload'); ?> »" /> 146 <?php if ( $id ) : ?>147 <input type="submit" name="delete" class="delete" value="<?php _e('Delete'); ?>" />148 <?php endif; ?>149 163 </div> 150 164 </td> … … 350 364 if ( 'inline' == @$_GET['style'] ) { 351 365 echo "<style type='text/css'>\n"; 352 echo "\tbody { height: 1 4em; overflow: hidden; }\n";366 echo "\tbody { height: 15em; overflow: hidden; }\n"; 353 367 echo "\t#upload-content { overflow-y: auto; }\n"; 354 368 echo "\t#upload-file { position: absolute; }\n"; -
trunk/wp-admin/upload-js.php
r793 r797 38 38 return; 39 39 var thumbEl = $('attachment-thumb-url-' + id); 40 if ( thumbEl ) 40 this.currentImage.isImage = true; 41 if ( thumbEl ) { 41 42 this.currentImage.thumb = ( 0 == id ? '' : thumbEl.value ); 42 else 43 this.currentImage.thumbBase = ( 0 == id ? '' : $('attachment-thumb-url-base-' + id).value ); 44 } else { 43 45 this.currentImage.thumb = false; 46 var isImageEl = $('attachment-is-image-' + id); 47 if ( !isImageEl ) 48 this.currentImage.isImage = false; 49 } 44 50 this.currentImage.src = ( 0 == id ? '' : $('attachment-url-' + id).value ); 51 this.currentImage.srcBase = ( 0 == id ? '' : $('attachment-url-base-' + id).value ); 45 52 this.currentImage.page = ( 0 == id ? '' : $('attachment-page-url-' + id).value ); 46 53 this.currentImage.title = ( 0 == id ? '' : $('attachment-title-' + id).value ); … … 66 73 params.ID = ''; 67 74 params.action = ''; 68 h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>« Back</a>";75 h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>« Back</a>"; 69 76 } else { 70 77 h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files' class='back'>« Back</a>"; 71 78 } 72 79 h += "<div id='file-title'>" 73 if ( !this.currentImage. thumb)74 h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";80 if ( !this.currentImage.isImage ) 81 h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; 75 82 else 76 83 h += "<h2>" + this.currentImage.title + "</h2>"; … … 80 87 h += '</div>' 81 88 h += "<div id='upload-file-view' class='alignleft'>"; 82 if ( this.currentImage.thumb ) 83 h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>"; 84 else 89 if ( this.currentImage.isImage ) { 90 h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>"; 91 h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />"; 92 h += "</a>"; 93 } else 85 94 h += ' '; 86 95 h += "</div>"; … … 120 129 if ( this.postID ) 121 130 action += '&post_id=' + this.postID; 131 122 132 h += "<form id='upload-file' method='post' action='" + action + "'>"; 123 133 if ( this.ID ) { … … 130 140 } 131 141 h += "<div id='file-title'>" 132 if ( !this.currentImage. thumb)133 h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";142 if ( !this.currentImage.isImage ) 143 h += "<h2><a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>" + this.currentImage.title + "</a></h2>"; 134 144 else 135 145 h += "<h2>" + this.currentImage.title + "</h2>"; … … 139 149 h += '</div>' 140 150 h += "<div id='upload-file-view' class='alignleft'>"; 141 if ( this.currentImage.thumb ) 142 h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>"; 143 else 151 if ( this.currentImage.isImage ) { 152 h += "<a href='" + this.currentImage.srcBase + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>"; 153 h += "<img src='" + ( this.currentImage.thumb ? this.currentImage.thumb : this.currentImage.src ) + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />"; 154 h += "</a>"; 155 } else 144 156 h += ' '; 145 157 h += "</div>"; 146 158 147 159 148 h += "<table><tr>" 149 h += "<th scope='row'><label for='post_title'>Title:</label></th>"; 160 h += "<table><col /><col class='widefat' /><tr>" 161 h += "<th scope='row'><label for='url'>URL</label></th>"; 162 h += "<td><input type='text' id='url' class='readonly' value='" + this.currentImage.srcBase + this.currentImage.src + "' readonly='readonly' /></td>"; 163 h += "</tr><tr>"; 164 h += "<th scope='row'><label for='post_title'>Title</label></th>"; 150 165 h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>"; 151 166 h += "</tr><tr>"; 152 h += "<th scope='row'><label for='post_content'>Description :</label></th>";167 h += "<th scope='row'><label for='post_content'>Description</label></th>"; 153 168 h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>"; 154 h += "</tr><tr id='buttons' ><th><input type='button' name='delete' class='delete button' value='Delete' onclick='theFileList.deleteFile(" + id + ");' /></th><td>";169 h += "</tr><tr id='buttons' class='submit'><td colspan='2'><input type='button' id='delete' name='delete' class='delete alignleft' value='Delete File' onclick='theFileList.deleteFile(" + id + ");' />"; 155 170 h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />"; 156 171 h += "<input type='hidden' name='action' id='action-value' value='save' />"; 157 172 h += "<input type='hidden' name='ID' value='" + id + "' />"; 158 173 h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />"; 159 h += "<div class='submit'><input type='submit' value='Save »' /> ";160 h += "</ div></td></tr></table></form>";174 h += "<div class='submit'><input type='submit' value='Save »' /></div>"; 175 h += "</td></tr></table></form>"; 161 176 162 177 new Insertion.Top('upload-content', h); … … 203 218 if ( displayEl ) 204 219 display = displayEl.value; 220 else if ( this.currentImage.isImage ) 221 display = 'full'; 205 222 206 223 if ( 'none' != link ) 207 h += "<a href='" + ( 'file' == link ? this.currentImage.src : this.currentImage.page) + "' title='" + this.currentImage.title + "'>";224 h += "<a href='" + ( 'file' == link ? ( this.currentImage.srcBase + this.currentImage.src ) : ( this.currentImage.page + "' rel='attachment" ) ) + "' title='" + this.currentImage.title + "'>"; 208 225 if ( display ) 209 h += "<img src='" + ( 'thumb' == display ? this.currentImage.thumb : this.currentImage.src) + "' alt='" + this.currentImage.title + "' />";226 h += "<img src='" + ( 'thumb' == display ? ( this.currentImage.thumbBase + this.currentImage.thumb ) : ( this.currentImage.srcBase + this.currentImage.src ) ) + "' alt='" + this.currentImage.title + "' />"; 210 227 else 211 228 h += this.currentImage.title; … … 221 238 else 222 239 win.edInsertContent(win.edCanvas, h); 223 this.cancelView(); 240 if ( !this.ID ) 241 this.cancelView(); 224 242 return false; 225 243 }, -
trunk/wp-admin/upload.css
r793 r797 58 58 top: 0; 59 59 left: 0; 60 width: 45em;60 width: 95%; 61 61 height: 100%; 62 62 background: #f9fcfe; 63 63 } 64 #upload-file th { 64 65 #uupload-file th { 65 66 width: 8em; 66 67 } … … 68 69 form#upload-file input, form#upload-file textarea, div#upload-content.upload table { width: 100%; } 69 70 70 form#upload-file div.submit input { width: auto; }71 form#upload-file .submit input { width: auto; } 71 72 72 73 #upload-file-view { padding: 0 0 0 75px; } … … 135 136 #upload-files a.file-link img { vertical-align: middle; } 136 137 137 #the-attachment-links { float: right; }138 139 138 #the-attachment-links textarea { 140 139 font-size: 10px; … … 174 173 width: 300px; 175 174 } 175 176 input.readonly { background-color: #ddd; } -
trunk/wp-admin/upload.php
r793 r797 14 14 15 15 do_action( "upload_files_$tab" ); 16 17 add_action( 'admin_head', 'wp_upload_admin_head' ); 16 18 17 19 $pid = 0; -
trunk/wp-admin/user-edit.php
r770 r797 37 37 wp_die(__('You do not have permission to edit this user.')); 38 38 39 $cap = $wpdb->get_var( "SELECT meta_value FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$wpmuBaseTablePrefix}{$wpdb->blogid}_capabilities' AND meta_value = 'a:0:{}'" ); 39 40 $errors = edit_user($user_id); 41 if( $cap == null ) 42 $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE user_id = '{$user_id}' AND meta_key = '{$wpmuBaseTablePrefix}{$wpdb->blogid}_capabilities' AND meta_value = 'a:0:{}'" ); 40 43 41 44 if( !is_wp_error( $errors ) ) { -
trunk/wp-admin/users.php
r793 r797 220 220 } 221 221 } 222 $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users, $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '".$wpdb->prefix."capabilities' ");222 $all_logins = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users, $wpdb->usermeta WHERE $wpdb->users.ID = $wpdb->usermeta.user_id AND meta_key = '".$wpdb->prefix."capabilities' ORDER BY user_login"); 223 223 $user_dropdown = '<select name="reassign_user">'; 224 224 foreach ( (array) $all_logins as $login ) -
trunk/wp-admin/wp-admin.css
r793 r797 52 52 display: block; 53 53 height: 60px; 54 overflow: hidden; 54 55 } 55 56 … … 170 171 font: normal 32px/5px serif; 171 172 margin: 5px 10px; 173 } 174 175 h2 small.quickjump { 176 display: block; 177 text-align: right; 178 } 179 180 h2 small.quickjump a { 181 text-decoration: none; 182 border-bottom: 0; 183 font-size: 15px; 184 background: #f0f8ff; 185 padding: 5px 10px; 172 186 } 173 187 … … 206 220 padding: 0px; 207 221 margin-bottom: 16px; 208 height: 1 6em;222 height: 17em; 209 223 width: 100%; 210 224 /* overflow-y: hidden;*/ … … 575 589 } 576 590 577 #postdivrich #quicktags {591 #postdivrich #quicktags, #commentdivrich #quicktags { 578 592 background: #f0f0ee; 579 593 padding: 0px; … … 649 663 clear: both; 650 664 text-align: center; 651 width: 500px;652 margin: auto;653 height: 100px;654 665 } 655 666 … … 675 686 padding: 20px 50px 0; 676 687 width: 325px; 688 _width: 390px; 689 } 690 691 #login form { 692 _width: 325px; 693 _margin: 0 auto; 677 694 } 678 695 … … 697 714 font-weight: normal; 698 715 font-size: 1.1em; 716 _width: 325px; 717 _margin: 0 auto 15px; 699 718 } 700 719 … … 720 739 } 721 740 741 #register #login h2 { 742 border-bottom: 1px solid #1e6491; 743 padding-bottom: 15px; 744 color: #fff; 745 text-align: left; 746 font-weight: normal; 747 font-size: 1.7em; 748 font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana; 749 letter-spacing: -1px; 750 margin: 15px 0 0; 751 _width: 325px; 752 _padding: 15px 0; 753 _margin: 10px auto 5px; 754 } 755 722 756 #login input { 723 757 padding: 4px; … … 728 762 list-style: none; 729 763 margin: 0 -50px; 764 _margin: 10px auto 0; 730 765 padding: 10px 50px 25px;; 766 _padding: 0 0 5px 30px; 731 767 } 732 768 … … 739 775 } 740 776 777 #login ul {display: inline-block;} 778 779 /* Hides from IE-mac \*/ 780 * html #login ul {height: 1%;} 781 #login ul {display: block;} 782 /* End hide from IE-mac */ 783 741 784 #login ul li { 742 785 float: left; … … 752 795 padding: 4px 1px 5px; 753 796 width: 160px; 797 } 798 799 #register #login ul li a { 800 width: 106px; 754 801 } 755 802 … … 1283 1330 } 1284 1331 1285 #postdivrich #content, #postdivrich #content:active {1332 #postdivrich #content, #postdivrich #content:active, #commentdivrich #content, #commentdivrich #content:active { 1286 1333 border: 1px solid #ccc; 1287 1334 } … … 1299 1346 background: #fff url( images/fade-butt.png ) repeat-x 0px 15px; 1300 1347 border-bottom: 1px solid #ccc; 1348 } 1349 1350 #postdivrich .switched table, #postdivrich #quicktags, #commentdivrich .switched table, #commentdivrich #quicktags { 1351 border-top: none; 1352 } 1353 1354 #postdivrich #quicktags, #commentdivrich #quicktags { 1355 border-bottom: none; 1356 padding-bottom: 2px; 1357 margin-bottom: -1px; 1358 } 1359 1360 #edButtons { 1361 border-bottom: 1px solid #ccc 1301 1362 } 1302 1363 -
trunk/wp-content/blogs.php
r783 r797 9 9 ) { 10 10 header("HTTP/1.1 404 Not Found"); 11 die('404 — File not found.');11 graceful_fail('404 — File not found.'); 12 12 } 13 13 … … 69 69 endif; 70 70 71 71 72 $file = $_GET[ 'file' ]; 73 72 74 $file = constant( "ABSPATH" ) . constant( "UPLOADS" ) . $file; 73 74 75 if ( !is_file( $file ) ) { 75 76 header("HTTP/1.1 404 Not Found"); 76 die('404 — File not found.');77 graceful_fail('404 — File not found.'); 77 78 } 78 79 … … 81 82 if ( in_array( preg_replace( '|.*\.(.*)$|', '$1', $file ), $never ) ) { 82 83 header("HTTP/1.1 404 Not Found"); 83 die('404 — File not found.');84 graceful_fail('404 — File not found.'); 84 85 } 85 86 -
trunk/wp-content/mu-plugins/pluggable.php
r661 r797 43 43 return false; 44 44 } else { 45 $primary_blog = get_usermeta( $login->ID, "primary_blog" ); 46 if( $primary_blog ) { 45 if( is_site_admin( $username ) == false && ( $primary_blog = get_usermeta( $login->ID, "primary_blog" ) ) ) { 47 46 $details = get_blog_details( $primary_blog ); 48 if( is_object( $details ) ) { 49 if( $details->archived == 1 || $details->spam == 1 || $details->deleted == 1 ) { 50 $error = __('<strong>Error</strong>: Blog suspended.'); 51 return false; 52 } 47 if( is_object( $details ) && $details->archived == 1 || $details->spam == 1 || $details->deleted == 1 ) { 48 $error = __('<strong>Error</strong>: Blog suspended.'); 49 return false; 53 50 } 54 51 } … … 73 70 $user = wp_cache_get($user_id, 'users'); 74 71 $user_level = $wpmuBaseTablePrefix . $wpdb->blogid . '_user_level'; 75 if( $user->$user_level != '' || $user->user_level != '' ) { 76 if( $user && is_site_admin( $user->user_login ) == true ) { 77 $user->$user_level = 10; 78 $user->user_level = 10; 79 $cap_key = $wpdb->prefix . 'capabilities'; 80 $user->{$cap_key} = array( 'administrator' => '1' ); 81 return $user; 82 } elseif ( $user ) 83 return $user; 72 if ( $user && is_site_admin( $user->user_login ) ) { 73 $user->$user_level = 10; 74 $user->user_level = 10; 75 $cap_key = $wpdb->prefix . 'capabilities'; 76 $user->{$cap_key} = array( 'administrator' => '1' ); 77 return $user; 78 } elseif ( $user ) { 79 return $user; 84 80 } 85 81 -
trunk/wp-content/themes/classic/sidebar.php
r524 r797 4 4 5 5 <ul> 6 <?php wp_list_pages(); ?> 7 <?php get_links_list(); ?> 8 <li id="categories"><?php _e('Categories:'); ?> 9 <ul> 10 <?php wp_list_cats(); ?> 11 </ul> 12 </li> 6 <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : ?> 7 8 </ul> 9 10 </div> 11 12 <?php return; ?> 13 14 <?php endif; ?> 15 16 <?php wp_list_pages('title_li=' . __('Pages:')); ?> 17 <?php wp_list_bookmarks('title_after=&title_before='); ?> 18 <?php wp_list_categories('title_li=' . __('Categories:')); ?> 13 19 <li id="search"> 14 20 <label for="s"><?php _e('Search:'); ?></label> -
trunk/wp-content/themes/default/sidebar.php
r734 r797 2 2 <ul> 3 3 4 <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : ?> 5 6 </ul> 7 </div> 8 <?php return; ?> 9 10 <?php endif; ?> 11 4 12 <li> 5 13 <?php include (TEMPLATEPATH . '/searchform.php'); ?> … … 25 33 for <?php the_time('F, Y'); ?>.</p> 26 34 27 <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>35 <?php /* If this is a yearly archive */ } elseif (is_year()) { ?> 28 36 <p>You are currently browsing the <a href="<?php bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives 29 37 for the year <?php the_time('Y'); ?>.</p> 30 38 31 <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>39 <?php /* If this is a monthly archive */ } elseif (is_search()) { ?> 32 40 <p>You have searched the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives 33 41 for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p> … … 39 47 </li> 40 48 41 <?php wp_list_pages('title_li=<h2>Pages</h2> '); ?>49 <?php wp_list_pages('title_li=<h2>Pages</h2>&sort_column=post_title&sort_order=ASC'); ?> 42 50 43 51 <li><h2>Archives</h2> -
trunk/wp-cron.php
r753 r797 18 18 $schedule = $args['schedule']; 19 19 if ($schedule != false) { 20 $new_args = array _merge( array($timestamp, $schedule, $hook), $args['args']);20 $new_args = array($timestamp, $schedule, $hook, $args['args']); 21 21 call_user_func_array('wp_reschedule_event', $new_args); 22 22 } -
trunk/wp-includes/bookmark-template.php
r788 r797 320 320 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'echo' => 1, 321 321 'categorize' => 1, 'title_li' => __('Bookmarks'), 'title_before' => '<h2>', 'title_after' => '</h2>', 322 'category_orderby' => 'name', 'category_order' => 'ASC' );322 'category_orderby' => 'name', 'category_order' => 'ASC', 'class' => 'linkcat'); 323 323 $r = array_merge($defaults, $r); 324 324 extract($r); 325 325 326 326 $output = ''; 327 328 if ( is_array($class) ) 329 $class = trim(join(' ', $class)); 327 330 328 331 if ( $categorize ) { … … 334 337 if ( empty($bookmarks) ) 335 338 continue; 336 $output .= "<li id='linkcat-$cat->cat_ID' class=' linkcat'>$title_before$cat->cat_name$title_after\n\t<ul>\n";339 $output .= "<li id='linkcat-$cat->cat_ID' class='$class'>$title_before$cat->cat_name$title_after\n\t<ul>\n"; 337 340 $output .= _walk_bookmarks($bookmarks, $r); 338 341 $output .= "\n\t</ul>\n</li>\n"; … … 343 346 344 347 if ( !empty($bookmarks) ) { 345 $output .= "<li id='linkuncat' class=' linkcat'>$title_before$title_li$title_after\n\t<ul>\n";348 $output .= "<li id='linkuncat' class='$class'>$title_before$title_li$title_after\n\t<ul>\n"; 346 349 $output .= _walk_bookmarks($bookmarks, $r); 347 350 $output .= "\n\t</ul>\n</li>\n"; -
trunk/wp-includes/category-template.php
r789 r797 61 61 62 62 function get_the_category($id = false) { 63 global $post, $category_cache ;63 global $post, $category_cache, $blog_id; 64 64 65 65 if ( !$id ) 66 66 $id = $post->ID; 67 67 68 if ( !isset($category_cache[$ id]) )68 if ( !isset($category_cache[$blog_id][$id]) ) 69 69 update_post_category_cache($id); 70 70 71 $categories = $category_cache[$ id];71 $categories = $category_cache[$blog_id][$id]; 72 72 73 73 if ( !empty($categories) ) … … 141 141 142 142 function in_category($category) { // Check if the current post is in the given category 143 global $category_cache, $post ;144 145 if ( isset( $category_cache[$ post->ID][$category] ) )143 global $category_cache, $post, $blog_id; 144 145 if ( isset( $category_cache[$blog_id][$post->ID][$category] ) ) 146 146 return true; 147 147 else -
trunk/wp-includes/cron.php
r789 r797 1 1 <?php 2 2 3 function wp_schedule_single_event( $timestamp, $hook ) { 4 $args = array_slice( func_get_args(), 2 ); 3 function wp_schedule_single_event( $timestamp, $hook, $args = array()) { 5 4 $crons = _get_cron_array(); 6 5 $key = md5(serialize($args)); … … 10 9 } 11 10 12 function wp_schedule_event( $timestamp, $recurrence, $hook ) { 13 $args = array_slice( func_get_args(), 3 ); 11 function wp_schedule_event( $timestamp, $recurrence, $hook, $args = array()) { 14 12 $crons = _get_cron_array(); 15 13 $schedules = wp_get_schedules(); … … 22 20 } 23 21 24 function wp_reschedule_event( $timestamp, $recurrence, $hook ) { 25 $args = array_slice( func_get_args(), 3 ); 22 function wp_reschedule_event( $timestamp, $recurrence, $hook, $args = array()) { 26 23 $crons = _get_cron_array(); 27 24 $schedules = wp_get_schedules(); -
trunk/wp-includes/default-filters.php
r788 r797 146 146 add_filter('mce_plugins', '_mce_load_rtl_plugin'); 147 147 add_filter('mce_buttons', '_mce_add_direction_buttons'); 148 add_filter('tiny_mce_config_url', '_mce_config_url'); 148 149 149 150 // Actions … … 153 154 add_action('wp_head', 'noindex', 1); 154 155 add_action('wp_head', 'wp_print_scripts'); 155 if(!defined('DOING_CRON') )156 if(!defined('DOING_CRON') && !strstr( $_SERVER['REQUEST_URI'], 'wp-cron.php' ) ) 156 157 add_action('init', 'wp_cron'); 157 158 add_action('do_feed_rdf', 'do_feed_rdf', 10, 1); -
trunk/wp-includes/formatting.php
r793 r797 619 619 // HTML loop taken from texturize function, could possible be consolidated 620 620 $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between 621 $stop = count($textarr);// loop stuff 622 for ($i = 0; $i < $stop; $i++) { 623 $content = $textarr[$i]; 624 if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag 625 $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content); 626 } 627 $output .= $content; 628 } 621 $output = implode('', preg_replace($wp_smiliessearch, $wp_smiliesreplace, $textarr)); 629 622 } else { 630 623 // return default text. … … 1071 1064 } 1072 1065 1073 function wp_make_link_relative( $link, $base = '' ) { 1074 if ( !$base ) 1075 $base = get_option( 'home' ); 1076 if ( 0 === strpos($link, $base) ) 1077 $link = substr_replace($link, '', 0, strlen($base)); 1078 return $link; 1079 } 1066 function wp_make_link_relative( $link ) { 1067 return preg_replace('|https?://[^/]+(/.*)|i', '$1', $link ); 1068 } 1069 1080 1070 ?> -
trunk/wp-includes/functions.php
r774 r797 107 107 108 108 function get_lastpostdate($timezone = 'server') { 109 global $cache_lastpostdate, $pagenow, $wpdb ;109 global $cache_lastpostdate, $pagenow, $wpdb, $blog_id; 110 110 $add_seconds_blog = get_option('gmt_offset') * 3600; 111 111 $add_seconds_server = date('Z'); 112 if ( !isset($cache_lastpostdate[$ timezone]) ) {112 if ( !isset($cache_lastpostdate[$blog_id][$timezone]) ) { 113 113 switch(strtolower($timezone)) { 114 114 case 'gmt': … … 122 122 break; 123 123 } 124 $cache_lastpostdate[$ timezone] = $lastpostdate;125 } else { 126 $lastpostdate = $cache_lastpostdate[$ timezone];124 $cache_lastpostdate[$blog_id][$timezone] = $lastpostdate; 125 } else { 126 $lastpostdate = $cache_lastpostdate[$blog_id][$timezone]; 127 127 } 128 128 return $lastpostdate; … … 130 130 131 131 function get_lastpostmodified($timezone = 'server') { 132 global $cache_lastpostmodified, $pagenow, $wpdb ;132 global $cache_lastpostmodified, $pagenow, $wpdb, $blog_id; 133 133 $add_seconds_blog = get_option('gmt_offset') * 3600; 134 134 $add_seconds_server = date('Z'); 135 if ( !isset($cache_lastpostmodified[$ timezone]) ) {135 if ( !isset($cache_lastpostmodified[$blog_id][$timezone]) ) { 136 136 switch(strtolower($timezone)) { 137 137 case 'gmt': … … 149 149 $lastpostmodified = $lastpostdate; 150 150 } 151 $cache_lastpostmodified[$ timezone] = $lastpostmodified;152 } else { 153 $lastpostmodified = $cache_lastpostmodified[$ timezone];151 $cache_lastpostmodified[$blog_id][$timezone] = $lastpostmodified; 152 } else { 153 $lastpostmodified = $cache_lastpostmodified[$blog_id][$timezone]; 154 154 } 155 155 return $lastpostmodified; … … 205 205 wp_cache_set($setting, ($value=='')?'emptystringindb':$value, 'options'); 206 206 } else { 207 wp_cache_set($setting, 'novalueindb', 'options' , 5);207 wp_cache_set($setting, 'novalueindb', 'options'); 208 208 return false; 209 209 } … … 492 492 493 493 function update_post_cache(&$posts) { 494 global $post_cache ;494 global $post_cache, $blog_id; 495 495 496 496 if ( !$posts ) … … 498 498 499 499 for ($i = 0; $i < count($posts); $i++) { 500 $post_cache[$ posts[$i]->ID] = &$posts[$i];500 $post_cache[$blog_id][$posts[$i]->ID] = &$posts[$i]; 501 501 } 502 502 } 503 503 504 504 function clean_post_cache($id) { 505 global $post_cache ;506 507 if ( isset( $post_cache[$ id] ) )508 unset( $post_cache[$ id] );505 global $post_cache, $blog_id; 506 507 if ( isset( $post_cache[$blog_id][$id] ) ) 508 unset( $post_cache[$blog_id][$id] ); 509 509 } 510 510 511 511 function update_page_cache(&$pages) { 512 global $page_cache ;512 global $page_cache, $blog_id; 513 513 514 514 if ( !$pages ) … … 516 516 517 517 for ($i = 0; $i < count($pages); $i++) { 518 $page_cache[$ pages[$i]->ID] = &$pages[$i];518 $page_cache[$blog_id][$pages[$i]->ID] = &$pages[$i]; 519 519 wp_cache_add($pages[$i]->ID, $pages[$i], 'pages'); 520 520 } … … 523 523 524 524 function clean_page_cache($id) { 525 global $page_cache, $wpdb ;526 527 if ( isset( $page_cache[$ id] ) )528 unset( $page_cache[$ id] );525 global $page_cache, $wpdb, $blog_id; 526 527 if ( isset( $page_cache[$blog_id][$id] ) ) 528 unset( $page_cache[$blog_id][$id] ); 529 529 530 530 $page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type='page'"); … … 534 534 535 535 function update_post_category_cache($post_ids) { 536 global $wpdb, $category_cache ;536 global $wpdb, $category_cache, $blog_id; 537 537 538 538 if ( empty($post_ids) ) … … 548 548 549 549 foreach ($dogs as $catt) 550 $category_cache[$ catt->post_id][$catt->category_id] = &get_category($catt->category_id);550 $category_cache[$blog_id][$catt->post_id][$catt->category_id] = &get_category($catt->category_id); 551 551 } 552 552 553 553 function update_post_caches(&$posts) { 554 554 global $post_cache, $category_cache, $post_meta_cache; 555 global $wpdb ;555 global $wpdb, $blog_id; 556 556 557 557 // No point in doing all this work if we didn't match any posts. … … 562 562 for ($i = 0; $i < count($posts); $i++) { 563 563 $post_id_array[] = $posts[$i]->ID; 564 $post_cache[$ posts[$i]->ID] = &$posts[$i];564 $post_cache[$blog_id][$posts[$i]->ID] = &$posts[$i]; 565 565 } 566 566 … … 572 572 if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id IN($post_id_list) ORDER BY post_id, meta_key", ARRAY_A) ) { 573 573 // Change from flat structure to hierarchical: 574 $post_meta_cache = array();574 $post_meta_cache[$blog_id] = array(); 575 575 foreach ($meta_list as $metarow) { 576 576 $mpid = $metarow['post_id']; … … 579 579 580 580 // Force subkeys to be array type: 581 if ( !isset($post_meta_cache[$ mpid]) || !is_array($post_meta_cache[$mpid]) )582 $post_meta_cache[$ mpid] = array();583 if ( !isset($post_meta_cache[$ mpid]["$mkey"]) || !is_array($post_meta_cache[$mpid]["$mkey"]) )584 $post_meta_cache[$ mpid]["$mkey"] = array();581 if ( !isset($post_meta_cache[$blog_id][$mpid]) || !is_array($post_meta_cache[$blog_id][$mpid]) ) 582 $post_meta_cache[$blog_id][$mpid] = array(); 583 if ( !isset($post_meta_cache[$blog_id][$mpid]["$mkey"]) || !is_array($post_meta_cache[$blog_id][$mpid]["$mkey"]) ) 584 $post_meta_cache[$blog_id][$mpid]["$mkey"] = array(); 585 585 586 586 // Add a value to the current pid/key: 587 $post_meta_cache[$ mpid][$mkey][] = $mval;587 $post_meta_cache[$blog_id][$mpid][$mkey][] = $mval; 588 588 } 589 589 } … … 813 813 global $current_blog; 814 814 do_action('do_robotstxt'); 815 815 816 if ( '0' == $current_blog->public ) { 816 817 echo "User-agent: *\n"; … … 1128 1129 1129 1130 function wp_die($message, $title = '') { 1131 global $wp_locale; 1132 1130 1133 header('Content-Type: text/html; charset=utf-8'); 1131 1134 … … 1134 1137 1135 1138 if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') ) 1136 $ logo_src = 'images/wordpress-logo.png';1139 $admin_dir = ''; 1137 1140 else 1138 $ logo_src = 'wp-admin/images/wordpress-logo.png';1141 $admin_dir = 'wp-admin/'; 1139 1142 1140 1143 ?> 1141 1144 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 1142 <html xmlns="http://www.w3.org/1999/xhtml" >1145 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> 1143 1146 <head> 1144 1147 <title><?php echo $title ?></title> 1145 1148 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 1146 <style media="screen" type="text/css"> 1147 <!-- 1148 html { 1149 background: #eee; 1150 } 1151 body { 1152 background: #fff; 1153 color: #000; 1154 font-family: Georgia, "Times New Roman", Times, serif; 1155 margin-left: 25%; 1156 margin-right: 25%; 1157 padding: .2em 2em; 1158 } 1159 1160 h1 { 1161 color: #006; 1162 font-size: 18px; 1163 font-weight: lighter; 1164 } 1165 1166 h2 { 1167 font-size: 16px; 1168 } 1169 1170 p, li, dt { 1171 line-height: 140%; 1172 padding-bottom: 2px; 1173 } 1174 1175 ul, ol { 1176 padding: 5px 5px 5px 20px; 1177 } 1178 #logo { 1179 margin-bottom: 2em; 1180 } 1181 --> 1182 </style> 1149 <link rel="stylesheet" href="<?php echo $admin_dir; ?>install.css" type="text/css" /> 1150 <?php if ( ('rtl' == $wp_locale->text_direction) ) : ?> 1151 <link rel="stylesheet" href="<?php echo $admin_dir; ?>install-rtl.css" type="text/css" /> 1152 <?php endif; ?> 1183 1153 </head> 1184 1154 <body> 1185 <h1 id="logo"><img alt="WordPress" src="<?php echo $ logo_src; ?>" /></h1>1155 <h1 id="logo"><img alt="WordPress" src="<?php echo $admin_dir; ?>images/wordpress-logo.png" /></h1> 1186 1156 <p><?php echo $message; ?></p> 1187 1157 </body> … … 1192 1162 } 1193 1163 1164 function _mce_config_url($url) { 1165 global $wp_locale; 1166 1167 if ( 'rtl' == $wp_locale->text_direction ) 1168 $url = add_query_arg('mce_text_direction', 'rtl', $url); 1169 1170 return $url; 1171 } 1172 1194 1173 function _mce_set_direction() { 1195 1174 global $wp_locale; 1196 1175 1197 if ('rtl' == $wp_locale->text_direction) { 1176 if ( isset($_GET['mce_text_direction']) && 'rtl' == $_GET['mce_text_direction'] ) 1177 $dir = 'rtl'; 1178 else 1179 $dir = $wp_locale->text_direction; 1180 1181 if ( 'rtl' == $dir ) { 1198 1182 echo 'directionality : "rtl" ,'; 1199 1183 echo 'theme_advanced_toolbar_align : "right" ,'; … … 1204 1188 global $wp_locale; 1205 1189 1206 if ('rtl' == $wp_locale->text_direction) 1190 if ( isset($_GET['mce_text_direction']) && 'rtl' == $_GET['mce_text_direction'] ) 1191 $dir = 'rtl'; 1192 else 1193 $dir = $wp_locale->text_direction; 1194 1195 if ( 'rtl' == $dir ) 1207 1196 $input[] = 'directionality'; 1208 1197 … … 1213 1202 global $wp_locale; 1214 1203 1215 if ('rtl' == $wp_locale->text_direction) { 1204 if ( isset($_GET['mce_text_direction']) && 'rtl' == $_GET['mce_text_direction'] ) 1205 $dir = 'rtl'; 1206 else 1207 $dir = $wp_locale->text_direction; 1208 1209 if ( 'rtl' == $dir ) { 1216 1210 $new_buttons = array('separator', 'ltr', 'rtl'); 1217 1211 $input = array_merge($input, $new_buttons); -
trunk/wp-includes/general-template.php
r789 r797 207 207 208 208 $prefix = ''; 209 if ( isset($title) )209 if ( !empty($title) ) 210 210 $prefix = " $sep "; 211 211 … … 334 334 335 335 if ( 'monthly' == $type ) { 336 $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit); 336 $arcresults = wp_cache_get( md5('archives' . $type . $limit), 'general'); 337 if ( !$arcresults ) { 338 $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC" . $limit); 339 wp_cache_set( md5('archives' . $type . $limit), $arcresults, 'general', 600 ); 340 } 337 341 if ( $arcresults ) { 338 342 $afterafter = $after; … … 453 457 $thismonth = ''.zeroise(intval(substr($m, 4, 2)), 2); 454 458 } else { 455 $thisyear = gmdate('Y', current_time('timestamp') + get_option('gmt_offset') * 3600);456 $thismonth = gmdate('m', current_time('timestamp') + get_option('gmt_offset') * 3600);459 $thisyear = gmdate('Y', current_time('timestamp')); 460 $thismonth = gmdate('m', current_time('timestamp')); 457 461 } 458 462 … … 759 763 } 760 764 765 function user_can_switchedit() { 766 $can = true; 767 768 $ua = $_SERVER['HTTP_USER_AGENT']; 769 770 if ( 771 !user_can_richedit() || 772 ( // Mozilla Test 773 strstr($ua, 'Mozilla/5.0') && 774 !strstr($ua, 'ompatible') && 775 !strstr($ua, 'irefox') 776 ) 777 ) 778 $can = false; 779 780 return apply_filters('user_can_switchedit', $can); 781 } 782 761 783 function the_editor($content, $id = 'content', $prev_id = 'title') { 762 784 $rows = get_option('default_post_edit_rows'); … … 769 791 add_filter('the_editor_content', 'wp_richedit_pre'); 770 792 771 // The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it.793 if ( user_can_switchedit() ) : 772 794 ?> 773 <style type="text/css">774 #postdivrich table, #postdivrich #quicktags {border-top: none;}775 #quicktags {border-bottom: none; padding-bottom: 2px; margin-bottom: -1px;}776 #edButtons {border-bottom: 1px solid #ccc;}777 </style>778 795 <div id='edButtons' style='display:none;'> 779 796 <div class='zerosize'><input accesskey='e' type='button' onclick='switchEditors("<?php echo $id; ?>")' /></div> … … 786 803 </script> 787 804 788 <?php endif; ?>805 <?php endif; endif; ?> 789 806 <div id="quicktags"> 790 807 <?php wp_print_scripts( 'quicktags' ); ?> … … 821 838 <?php 822 839 823 $the_editor = apply_filters('the_editor', "<div><textarea class='mceEditor' $rows cols='40' name='$id' tabindex='2' id='$id'>%s</textarea></div>\n"); 840 $class = user_can_switchedit() ? 'switched' : 'unswitched'; 841 842 $the_editor = apply_filters('the_editor', "<div class='$class'><textarea class='mceEditor' $rows cols='40' name='$id' tabindex='2' id='$id'>%s</textarea></div>\n"); 824 843 $the_editor_content = apply_filters('the_editor_content', $content); 825 844 -
trunk/wp-includes/js/tinymce/themes/advanced/jscripts/source_editor.js
r550 r797 18 18 document.forms[0].htmlSource.value = fixContent(tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'))); 19 19 resizeInputs(); 20 21 if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) { 22 setWrap('soft'); 23 document.forms[0].wraped.checked = true; 24 } 20 25 } 21 26 -
trunk/wp-includes/js/tinymce/tiny_mce_config.php
r770 r797 32 32 $mce_buttons = implode($mce_buttons, ','); 33 33 34 if ( !user_can_switchedit() ) 35 $mce_buttons = str_replace('wp_help', 'wp_help,code', $mce_buttons); 36 34 37 $mce_buttons_2 = apply_filters('mce_buttons_2', array()); 35 38 $mce_buttons_2 = implode($mce_buttons_2, ','); … … 63 66 theme_advanced_path_location : "bottom", 64 67 theme_advanced_resizing : true, 68 theme_advanced_source_editor_wrap : true, 65 69 browsers : "<?php echo $mce_browsers; ?>", 66 70 dialog_type : "modal", -
trunk/wp-includes/l10n.php
r773 r797 7 7 8 8 // WPLANG is defined in wp-config. 9 if ( defined('WPLANG'))9 if ( defined('WPLANG') && '' != WPLANG ) 10 10 $locale = WPLANG; 11 else if ( is_admin() ) 12 $locale = get_user_lang_code(); 13 else 14 $locale = get_blog_lang_code(); 11 15 12 16 if (empty($locale)) 13 $locale = 'en _US';17 $locale = 'en'; 14 18 15 19 $locale = apply_filters('locale', $locale); -
trunk/wp-includes/pluggable.php
r789 r797 227 227 (empty($_COOKIE[USER_COOKIE])) ) { 228 228 nocache_headers(); 229 230 wp_clearcookie(); 229 231 230 232 wp_redirect(get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI'])); -
trunk/wp-includes/plugin.php
r789 r797 101 101 102 102 function do_action($tag, $arg = '') { 103 global $wp_filter; 103 global $wp_filter, $wp_actions; 104 104 105 $args = array(); 105 106 if ( is_array($arg) && 1 == count($arg) && is_object($arg[0]) ) // array(&$this) … … 133 134 } 134 135 } 136 137 if ( is_array($wp_actions) ) 138 $wp_actions[] = $tag; 139 else 140 $wp_actions = array($tag); 141 } 142 143 // Returns the number of times an action has been done 144 function did_action($tag) { 145 global $wp_actions; 146 147 return count(array_keys($wp_actions, $tag)); 135 148 } 136 149 137 150 function do_action_ref_array($tag, $args) { 138 global $wp_filter; 151 global $wp_filter, $wp_actions; 152 153 if ( !is_array($wp_actions) ) 154 $wp_actions = array($tag); 155 else 156 $wp_actions[] = $tag; 139 157 140 158 merge_filters($tag); -
trunk/wp-includes/post-template.php
r789 r797 350 350 $file = get_post_meta($post->ID, '_wp_attached_file', true); 351 351 352 $exts = array('jpg', 'gif', 'png'); 353 352 354 if ( !$fullsize && !empty($imagedata['thumb']) 353 355 && ($thumbfile = str_replace(basename($file), $imagedata['thumb'], $file)) … … 360 362 $class = 'attachmentthumb'; 361 363 362 } elseif ( substr($mime, 0, 6) == 'image/'364 } elseif ( ( substr($mime, 0, 6) == 'image/' || 'import' == $mime && in_array(substr($file, -3), $exts) ) 363 365 && file_exists($file) ) { 364 366 … … 375 377 376 378 $types = array(substr($mime, 0, strpos($mime, '/')), substr($mime, strpos($mime, '/') + 1), str_replace('/', '_', $mime)); 377 $exts = array('jpg', 'gif', 'png');378 379 foreach ($types as $type) { 379 380 foreach ($exts as $ext) { -
trunk/wp-includes/post.php
r763 r797 10 10 11 11 function &get_children($post = 0, $output = OBJECT) { 12 global $post_cache, $wpdb ;12 global $post_cache, $wpdb, $blog_id; 13 13 14 14 if ( empty($post) ) { … … 31 31 if ( $children ) { 32 32 foreach ( $children as $key => $child ) { 33 $post_cache[$ child->ID] =& $children[$key];33 $post_cache[$blog_id][$child->ID] =& $children[$key]; 34 34 $kids[$child->ID] =& $children[$key]; 35 35 } … … 73 73 // Handles post caching. 74 74 function &get_post(&$post, $output = OBJECT) { 75 global $post_cache, $wpdb ;75 global $post_cache, $wpdb, $blog_id; 76 76 77 77 if ( empty($post) ) { … … 83 83 if ( 'page' == $post->post_type ) 84 84 return get_page($post, $output); 85 if ( !isset($post_cache[$ post->ID]) )86 $post_cache[$ post->ID] = &$post;87 $_post = & $post_cache[$ post->ID];85 if ( !isset($post_cache[$blog_id][$post->ID]) ) 86 $post_cache[$blog_id][$post->ID] = &$post; 87 $_post = & $post_cache[$blog_id][$post->ID]; 88 88 } else { 89 89 if ( $_post = wp_cache_get($post, 'pages') ) 90 90 return get_page($_post, $output); 91 elseif ( isset($post_cache[$ post]) )92 $_post = & $post_cache[$ post];91 elseif ( isset($post_cache[$blog_id][$post]) ) 92 $_post = & $post_cache[$blog_id][$post]; 93 93 else { 94 94 $query = "SELECT * FROM $wpdb->posts WHERE ID = '$post' LIMIT 1"; … … 96 96 if ( 'page' == $_post->post_type ) 97 97 return get_page($_post, $output); 98 $post_cache[$ post] = & $_post;98 $post_cache[$blog_id][$post] = & $_post; 99 99 } 100 100 } 101 101 102 102 if ( defined('WP_IMPORTING') ) 103 unset($post_cache );103 unset($post_cache[$blog_id]); 104 104 105 105 if ( $output == OBJECT ) { … … 220 220 221 221 function add_post_meta($post_id, $key, $value, $unique = false) { 222 global $wpdb, $post_meta_cache ;222 global $wpdb, $post_meta_cache, $blog_id; 223 223 224 224 if ( $unique ) { … … 235 235 $wpdb->query("INSERT INTO $wpdb->postmeta (post_id,meta_key,meta_value) VALUES ('$post_id','$key','$value')"); 236 236 237 $post_meta_cache[ '$post_id'][$key][] = $original;237 $post_meta_cache[$blog_id]['$post_id'][$key][] = $original; 238 238 239 239 return true; … … 241 241 242 242 function delete_post_meta($post_id, $key, $value = '') { 243 global $wpdb, $post_meta_cache ;243 global $wpdb, $post_meta_cache, $blog_id; 244 244 245 245 if ( empty($value) ) { … … 257 257 $wpdb->query("DELETE FROM $wpdb->postmeta WHERE post_id = '$post_id' 258 258 AND meta_key = '$key'"); 259 unset($post_meta_cache[ '$post_id'][$key]);259 unset($post_meta_cache[$blog_id]['$post_id'][$key]); 260 260 } else { 261 261 $wpdb->query("DELETE FROM $wpdb->postmeta WHERE post_id = '$post_id' 262 262 AND meta_key = '$key' AND meta_value = '$value'"); 263 $cache_key = $post_meta_cache[ '$post_id'][$key];263 $cache_key = $post_meta_cache[$blog_id]['$post_id'][$key]; 264 264 if ($cache_key) foreach ( $cache_key as $index => $data ) 265 265 if ( $data == $value ) 266 unset($post_meta_cache[ '$post_id'][$key][$index]);267 } 268 269 unset($post_meta_cache[ '$post_id'][$key]);266 unset($post_meta_cache[$blog_id]['$post_id'][$key][$index]); 267 } 268 269 unset($post_meta_cache[$blog_id]['$post_id'][$key]); 270 270 271 271 return true; … … 273 273 274 274 function get_post_meta($post_id, $key, $single = false) { 275 global $wpdb, $post_meta_cache ;276 277 if ( isset($post_meta_cache[$ post_id][$key]) ) {275 global $wpdb, $post_meta_cache, $blog_id; 276 277 if ( isset($post_meta_cache[$blog_id][$post_id][$key]) ) { 278 278 if ( $single ) { 279 return maybe_unserialize( $post_meta_cache[$ post_id][$key][0] );279 return maybe_unserialize( $post_meta_cache[$blog_id][$post_id][$key][0] ); 280 280 } else { 281 return maybe_unserialize( $post_meta_cache[$ post_id][$key] );281 return maybe_unserialize( $post_meta_cache[$blog_id][$post_id][$key] ); 282 282 } 283 283 } … … 306 306 307 307 function update_post_meta($post_id, $key, $value, $prev_value = '') { 308 global $wpdb, $post_meta_cache ;308 global $wpdb, $post_meta_cache, $blog_id; 309 309 310 310 $original_value = $value; … … 324 324 $wpdb->query("UPDATE $wpdb->postmeta SET meta_value = '$value' WHERE 325 325 meta_key = '$key' AND post_id = '$post_id'"); 326 $cache_key = $post_meta_cache[ '$post_id'][$key];326 $cache_key = $post_meta_cache[$blog_id]['$post_id'][$key]; 327 327 if ( !empty($cache_key) ) 328 328 foreach ($cache_key as $index => $data) 329 $post_meta_cache[ '$post_id'][$key][$index] = $original_value;329 $post_meta_cache[$blog_id]['$post_id'][$key][$index] = $original_value; 330 330 } else { 331 331 $wpdb->query("UPDATE $wpdb->postmeta SET meta_value = '$value' WHERE 332 332 meta_key = '$key' AND post_id = '$post_id' AND meta_value = '$prev_value'"); 333 $cache_key = $post_meta_cache[ '$post_id'][$key];333 $cache_key = $post_meta_cache[$blog_id]['$post_id'][$key]; 334 334 if ( !empty($cache_key) ) 335 335 foreach ($cache_key as $index => $data) 336 336 if ( $data == $original_prev ) 337 $post_meta_cache[ '$post_id'][$key][$index] = $original_value;337 $post_meta_cache[$blog_id]['$post_id'][$key][$index] = $original_value; 338 338 } 339 339 … … 343 343 344 344 function get_post_custom( $post_id = 0 ) { 345 global $id, $post_meta_cache, $wpdb ;345 global $id, $post_meta_cache, $wpdb, $blog_id; 346 346 347 347 if ( ! $post_id ) 348 348 $post_id = $id; 349 349 350 if ( isset($post_meta_cache[$ post_id]) )351 return $post_meta_cache[$ post_id];350 if ( isset($post_meta_cache[$blog_id][$post_id]) ) 351 return $post_meta_cache[$blog_id][$post_id]; 352 352 353 353 if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id = '$post_id' ORDER BY post_id, meta_key", ARRAY_A) ) { … … 360 360 361 361 // Force subkeys to be array type: 362 if ( !isset($post_meta_cache[$ mpid]) || !is_array($post_meta_cache[$mpid]) )363 $post_meta_cache[$ mpid] = array();364 365 if ( !isset($post_meta_cache[$ mpid]["$mkey"]) || !is_array($post_meta_cache[$mpid]["$mkey"]) )366 $post_meta_cache[$ mpid]["$mkey"] = array();362 if ( !isset($post_meta_cache[$blog_id][$mpid]) || !is_array($post_meta_cache[$blog_id][$mpid]) ) 363 $post_meta_cache[$blog_id][$mpid] = array(); 364 365 if ( !isset($post_meta_cache[$blog_id][$mpid]["$mkey"]) || !is_array($post_meta_cache[$blog_id][$mpid]["$mkey"]) ) 366 $post_meta_cache[$blog_id][$mpid]["$mkey"] = array(); 367 367 368 368 // Add a value to the current pid/key: 369 $post_meta_cache[$ mpid][$mkey][] = $mval;370 } 371 return $post_meta_cache[$ mpid];369 $post_meta_cache[$blog_id][$mpid][$mkey][] = $mval; 370 } 371 return $post_meta_cache[$blog_id][$mpid]; 372 372 } 373 373 } … … 699 699 // Schedule publication. 700 700 if ( 'future' == $post_status ) 701 wp_schedule_single_event(strtotime($post_date_gmt. ' GMT'), 'publish_future_post', $post_ID);701 wp_schedule_single_event(strtotime($post_date_gmt. ' GMT'), 'publish_future_post', array($post_ID)); 702 702 703 703 do_action('save_post', $post_ID); … … 909 909 // Handles page caching. 910 910 function &get_page(&$page, $output = OBJECT) { 911 global $wpdb ;911 global $wpdb, $blog_id; 912 912 913 913 if ( empty($page) ) { … … 927 927 $_page = & $GLOBALS['page']; 928 928 wp_cache_add($_page->ID, $_page, 'pages'); 929 } elseif ( isset($_page) && $_page == $GLOBALS['post_cache'][$ page] ) {929 } elseif ( isset($_page) && $_page == $GLOBALS['post_cache'][$blog_id][$page] ) { 930 930 return get_post($page, $output); 931 931 } elseif ( isset($_page) && $_page == wp_cache_get($page, 'pages') ) { … … 983 983 984 984 function &get_page_children($page_id, $pages) { 985 global $page_cache ;985 global $page_cache, $blog_id; 986 986 987 987 if ( empty($pages) ) 988 $pages = &$page_cache ;988 $pages = &$page_cache[$blog_id]; 989 989 990 990 $page_list = array(); -
trunk/wp-includes/script-loader.php
r789 r797 18 18 $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '09212006a' ); 19 19 $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); 20 $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), ' 09212006' );20 $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20061006' ); 21 21 $this->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.5.0'); 22 22 $this->add( 'autosave', '/wp-includes/js/autosave.js.php', array('prototype', 'sack'), '4211'); … … 36 36 $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '3684' ); 37 37 $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' ); 38 $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), mt_rand());38 $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '4355b' ); 39 39 } 40 40 } -
trunk/wp-includes/vars.php
r789 r797 88 88 // generates smilies' search & replace arrays 89 89 foreach($wpsmiliestrans as $smiley => $img) { 90 $wp_smiliessearch[] = '/(\s|^ )?'.preg_quote($smiley, '/').'(\b|\s)/';90 $wp_smiliessearch[] = '/(\s|^|[^<])?'.preg_quote($smiley, '/').'(\b|\s|$)/'; 91 91 $smiley_masked = htmlspecialchars( trim($smiley) , ENT_QUOTES); 92 92 $wp_smiliesreplace[] = " <img src='" . get_option('siteurl') . "/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> "; -
trunk/wp-includes/wpmu-functions.php
r785 r797 1 <? PHP1 <?php 2 2 /* 3 3 Helper functions for WPMU … … 164 164 165 165 function get_blog_details( $id, $all = true ) { 166 global $wpdb , $wpmuBaseTablePrefix;166 global $wpdb; 167 167 168 168 $details = wp_cache_get( $id, 'blog-details' ); … … 178 178 if( $all == true ) { 179 179 $wpdb->hide_errors(); 180 switch_to_blog($id); 180 181 $details->blogname = get_blog_option($id, 'blogname'); 181 182 $details->siteurl = get_blog_option($id, 'siteurl'); 182 183 $details->post_count = get_blog_option($id, 'post_count'); 184 restore_current_blog(); 183 185 $wpdb->show_errors(); 184 186 … … 289 291 290 292 function get_blog_option( $id, $key, $default='na' ) { 291 global $wpdb, $wpmuBaseTablePrefix, $blog_id, $switched; 292 293 $current_blog_id = $blog_id; 294 $current_options_table = $wpdb->options; 295 $wpdb->options = $wpmuBaseTablePrefix . $id . "_options"; 296 $blog_id = $id; 297 if ($id != $current_blog_id) 298 $switched = true; 293 switch_to_blog($id); 299 294 $opt = get_option( $key ); 300 $switched = false; 301 $blog_id = $current_blog_id; 302 $wpdb->options = $current_options_table; 295 restore_current_blog(); 303 296 304 297 return $opt; … … 306 299 307 300 function add_blog_option( $id, $key, $value ) { 308 global $wpdb, $wpmuBaseTablePrefix, $blog_id; 309 310 $current_blog_id = $blog_id; 311 $current_options_table = $wpdb->options; 312 $wpdb->options = $wpmuBaseTablePrefix . $id . "_options"; 313 $blog_id = $id; 314 $opt = add_option( $key, $value ); 315 $blog_id = $current_blog_id; 316 $wpdb->options = $current_options_table; 301 switch_to_blog($id); 302 add_option( $key, $value ); 303 restore_current_blog(); 317 304 } 318 305 319 306 320 307 function update_blog_option( $id, $key, $value ) { 321 global $wpdb, $wpmuBaseTablePrefix, $blog_id; 322 323 $current_blog_id = $blog_id; 324 $current_options_table = $wpdb->options; 325 $wpdb->options = $wpmuBaseTablePrefix . $id . "_options"; 326 $blog_id = $id; 308 switch_to_blog($id); 327 309 $opt = update_option( $key, $value ); 328 $blog_id = $current_blog_id; 329 $wpdb->options = $current_options_table; 310 restore_current_blog(); 330 311 refresh_blog_details( $id ); 331 312 } 332 313 333 314 function switch_to_blog( $new_blog ) { 334 global $tmpoldblogdetails, $wpdb, $wpmuBaseTablePrefix, $table_prefix, $cache_settings, $category_cache, $cache_categories, $post_cache, $wp_object_cache, $blog_id, $switched, $wp_roles, $current_user; 315 global $tmpoldblogdetails, $wpdb, $wpmuBaseTablePrefix, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $current_user; 316 317 if ( empty($new_blog) ) 318 $new_blog = $blog_id; 319 320 if ( empty($switched_stack) ) 321 $switched_stack = array(); 322 323 $switched_stack[] = $blog_id; 324 325 if ( $new_blog == $blog_id ) 326 return; 335 327 336 328 // backup … … 346 338 $tmpoldblogdetails[ 'postmeta' ] = $wpdb->postmeta; 347 339 $tmpoldblogdetails[ 'prefix' ] = $wpdb->prefix; 348 $tmpoldblogdetails[ 'cache_settings' ] = $cache_settings;349 $tmpoldblogdetails[ 'category_cache' ] = $category_cache;350 $tmpoldblogdetails[ 'cache_categories' ] = $cache_categories;351 340 $tmpoldblogdetails[ 'table_prefix' ] = $table_prefix; 352 $tmpoldblogdetails[ 'post_cache' ] = $post_cache;353 $tmpoldblogdetails[ 'wp_object_cache' ] = $wp_object_cache;354 341 $tmpoldblogdetails[ 'blog_id' ] = $blog_id; 355 342 … … 369 356 $blog_id = $new_blog; 370 357 371 $cache_settings = array();372 unset( $cache_settings );373 unset( $category_cache );374 unset( $cache_categories );375 unset( $post_cache );376 //unset( $wp_object_cache );377 //$wp_object_cache = new WP_Object_Cache();378 //$wp_object_cache->cache_enabled = false;379 wp_cache_flush();380 wp_cache_close();381 358 if( is_object( $wp_roles ) ) { 382 359 $wpdb->hide_errors(); … … 387 364 $current_user->_init_caps(); 388 365 } 389 wp_cache_init();390 366 391 367 do_action('switch_blog', $blog_id, $tmpoldblogdetails[ 'blog_id' ]); … … 395 371 396 372 function restore_current_blog() { 397 global $table_prefix, $tmpoldblogdetails, $wpdb, $wpmuBaseTablePrefix, $cache_settings, $category_cache, $cache_categories, $post_cache, $wp_object_cache, $blog_id, $switched, $wp_roles; 373 global $table_prefix, $tmpoldblogdetails, $wpdb, $wpmuBaseTablePrefix, $blog_id, $switched, $switched_stack, $wp_roles, $current_user; 374 375 if ( !$switched ) 376 return; 377 378 $blog = array_pop($switched_stack); 379 380 if ( $blog_id == $blog ) 381 return; 382 398 383 // backup 399 384 $wpdb->blogid = $tmpoldblogdetails[ 'blogid' ]; … … 408 393 $wpdb->postmeta = $tmpoldblogdetails[ 'postmeta' ]; 409 394 $wpdb->prefix = $tmpoldblogdetails[ 'prefix' ]; 410 $cache_settings = $tmpoldblogdetails[ 'cache_settings' ];411 $category_cache = $tmpoldblogdetails[ 'category_cache' ];412 $cache_categories = $tmpoldblogdetails[ 'cache_categories' ];413 395 $table_prefix = $tmpoldblogdetails[ 'table_prefix' ]; 414 $post_cache = $tmpoldblogdetails[ 'post_cache' ];415 $wp_object_cache = $tmpoldblogdetails[ 'wp_object_cache' ];416 396 $prev_blog_id = $blog_id; 417 397 $blog_id = $tmpoldblogdetails[ 'blog_id' ]; 418 398 unset( $tmpoldblogdetails ); 419 wp_cache_flush(); 420 wp_cache_close(); 399 421 400 if( is_object( $wp_roles ) ) { 422 401 $wpdb->hide_errors(); … … 424 403 $wpdb->show_errors(); 425 404 } 426 wp_cache_init(); 427 405 if ( is_object( $current_user ) ) { 406 $current_user->_init_caps(); 407 } 428 408 do_action('switch_blog', $blog_id, $prev_blog_id); 429 409 … … 454 434 preg_match('/wp_(\d+)_capabilities/', $key, $match); 455 435 $blog = get_blog_details( $match[1] ); 456 if ( $blog && isset( $blog->domain ) ) {436 if ( $blog && $blog->deleted == 0 && isset( $blog->domain ) ) { 457 437 $blogs[$match[1]]->userblog_id = $match[1]; 458 438 $blogs[$match[1]]->domain = $blog->domain; … … 615 595 if( $post == false ) { 616 596 $post = $wpdb->get_row( "SELECT * FROM {$wpmuBaseTablePrefix}{$blog_id}_posts WHERE ID = '{$post_id}'" ); 617 wp_cache_set( $key, $post, "site-options", 30 );597 wp_cache_set( $key, $post, "site-options", 120 ); 618 598 } 619 599 … … 623 603 624 604 function add_user_to_blog( $blog_id, $user_id, $role ) { 625 global $wpdb; 626 627 $switch = false; 628 629 if ( empty($blog_id) ) 630 $blog_id = $wpdb->blogid; 631 632 if ( $blog_id != $wpdb->blogid ) { 633 $switch = true; 634 switch_to_blog($blog_id); 635 } 605 switch_to_blog($blog_id); 636 606 637 607 $user = new WP_User($user_id); … … 657 627 do_action('add_user_to_blog', $user_id, $role, $blog_id); 658 628 659 if ( $switch ) 660 restore_current_blog(); 629 restore_current_blog(); 661 630 } 662 631 663 632 function remove_user_from_blog($user_id, $blog_id = '') { 664 633 global $wpdb; 665 if ( empty($blog_id) ) 666 $blog_id = $wpdb->blogid; 667 668 $blog_id = (int) $blog_id; 669 670 if ( $blog_id != $wpdb->blogid ) { 671 $switch = true; 672 switch_to_blog($blog_id); 673 } 634 635 switch_to_blog($blog_id); 674 636 675 637 $user_id = (int) $user_id; … … 705 667 } 706 668 707 if ( $switch ) 708 restore_current_blog(); 669 restore_current_blog(); 709 670 } 710 671 … … 824 785 825 786 function wpmu_validate_user_signup($user_name, $user_email) { 826 global $wpdb ;787 global $wpdb, $current_site; 827 788 828 789 $errors = new WP_Error(); … … 1071 1032 1072 1033 if ( $signup->active ) 1073 return new WP_Error('already_active', __('The blog is already active.')); 1074 1034 return new WP_Error('already_active', __('The blog is already active.'), $signup); 1035 1036 $meta = unserialize($signup->meta); 1075 1037 $user_login = $wpdb->escape($signup->user_login); 1076 1038 $user_email = $wpdb->escape($signup->user_email); … … 1081 1043 if ( ! $user_id ) 1082 1044 $user_id = wpmu_create_user($user_login, $password, $user_email); 1045 else 1046 $user_already_exists = true; 1083 1047 1084 1048 if ( ! $user_id ) 1085 return new WP_Error('create_user', __('Could not create user') );1049 return new WP_Error('create_user', __('Could not create user'), $signup); 1086 1050 1087 1051 $now = current_time('mysql', true); … … 1089 1053 if ( empty($signup->domain) ) { 1090 1054 $wpdb->query("UPDATE $wpdb->signups SET active = '1', activated = '$now' WHERE activation_key = '$key'"); 1055 if ( isset($user_already_exists) ) 1056 return new WP_Error('user_already_exists', __('That username is already activated.'), $signup); 1091 1057 wpmu_welcome_user_notification($user_id, $password, $meta); 1092 1058 do_action('wpmu_activate_user', $user_id, $password, $meta); … … 1094 1060 } 1095 1061 1096 $meta = unserialize($signup->meta);1097 1062 $blog_id = wpmu_create_blog($signup->domain, $signup->path, $signup->title, $user_id, $meta); 1098 1063 1099 1064 // TODO: What to do if we create a user but cannot create a blog? 1100 if ( is_wp_error($blog_id) ) 1065 if ( is_wp_error($blog_id) ) { 1066 // If blog is taken, that means a previous attempt to activate this blog failed in between creating the blog and 1067 // setting the activation flag. Let's just set the active flag and instruct the user to reset their password. 1068 if ( 'blog_taken' == $blog_id->get_error_code() ) { 1069 $blog_id->add_data($signup); 1070 $wpdb->query("UPDATE $wpdb->signups SET active = '1', activated = '$now' WHERE activation_key = '$key'"); 1071 error_log("Blog $blog_id failed to complete activation.", 0); 1072 } 1073 1101 1074 return $blog_id; 1075 } 1102 1076 1103 1077 $wpdb->query("UPDATE $wpdb->signups SET active = '1', activated = '$now' WHERE activation_key = '$key'"); … … 1123 1097 if ( email_exists($email) ) 1124 1098 return false; 1125 1126 1099 1127 1100 $user_id = wp_create_user( $user_name, $password, $email ); -
trunk/wp-login.php
r791 r797 24 24 // Rather than duplicating this HTML all over the place, we'll stick it in function 25 25 function login_header($title = 'Login', $message = '') { 26 global $errors, $error ;26 global $errors, $error, $wp_locale; 27 27 28 28 ?> 29 29 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 30 <html xmlns="http://www.w3.org/1999/xhtml" >30 <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>> 31 31 <head> 32 32 <title><?php bloginfo('name'); ?> › <?php echo $title; ?></title> 33 33 <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> 34 34 <link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-admin/wp-admin.css?version=<?php bloginfo('version'); ?>" type="text/css" /> 35 <?php if ( ('rtl' == $wp_locale->text_direction) ) : ?> 36 <link rel="stylesheet" href="<?php bloginfo('wpurl'); ?>/wp-admin/rtl.css?version=<?php bloginfo('version'); ?>" type="text/css" /> 37 <?php endif; ?> 35 38 <!--[if IE]><style type="text/css">#login h1 a { margin-top: 35px; } #login ul { padding-bottom: 65px; }</style><![endif]--><!-- Curse you, IE! --> 36 39 <script type="text/javascript"> … … 44 47 <body> 45 48 46 <div id="login"> 47 <h1><a href="<?php echo apply_filters('login_headerurl', 'http://' . $current_site->domain . $current_site->path ); ?>" title="<?php echo apply_filters('login_headertitle', $current_site->site_name ); ?>"><span class="hide"><?php bloginfo('name'); ?></span></a></h1> 49 <div id="login"><h1><a href="<?php echo apply_filters('login_headerurl', 'http://' . $current_site->domain . $current_site->path ); ?>" title="<?php echo apply_filters('login_headertitle', $current_site->site_name ); ?>"><span class="hide"><?php bloginfo('name'); ?></span></a></h1> 48 50 <?php 49 51 if ( !empty( $message ) ) echo apply_filters('login_message', $message) . "\n"; … … 211 213 212 214 if ( $_POST ) { 213 $user_login = $_POST[' user_login'];215 $user_login = $_POST['log']; 214 216 $user_login = sanitize_user( $user_login ); 215 $user_pass = $_POST[' user_pass'];217 $user_pass = $_POST['pwd']; 216 218 $rememberme = $_POST['rememberme']; 217 219 } else { … … 265 267 <p> 266 268 <label><?php _e('Username:') ?><br /> 267 <input type="text" name=" user_login" id="user_login" class="input" value="<?php echo wp_specialchars(stripslashes($user_login), 1); ?>" size="20" tabindex="10" /></label>269 <input type="text" name="log" id="user_login" class="input" value="<?php echo wp_specialchars(stripslashes($user_login), 1); ?>" size="20" tabindex="10" /></label> 268 270 </p> 269 271 <p> 270 272 <label><?php _e('Password:') ?><br /> 271 <input type="password" name=" user_pass" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>273 <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label> 272 274 </p> 273 275 <?php do_action('login_form'); ?> -
trunk/wp-settings.php
r789 r797 100 100 require_once (ABSPATH . WPINC . '/wp-db.php'); 101 101 102 // Table names103 102 $wpdb->blogs = $table_prefix . 'blogs'; 104 103 $wpdb->users = $table_prefix . 'users'; -
trunk/wp-signup.php
r776 r797 28 28 function show_blog_form($blog_id = '', $blog_title = '', $errors = '') { 29 29 global $current_site; 30 $locale = get_locale(); 30 31 31 32 // Blog name/Username … … 106 107 107 108 print '<input name="user_name" type="text" id="user_name" value="'.$user_name.'" maxlength="50" style="width:50%; font-size: 30px;" /><br />'; 108 print __('(Must be at least 4 characters, letters and numbers only.)') .'</td> </tr>';109 _e('(Must be at least 4 characters, letters and numbers only.)'); echo '</td> </tr>'; 109 110 110 111 // User Email … … 119 120 ?><p><strong><?php echo $errmsg ?></strong></p><?php 120 121 } 121 print '122 <input name="user_email" type="text" id="user_email" value=" '.wp_specialchars($user_email, 1).'" maxlength="200" /><br /> ' . __('(We’ll send your password to this address, so <strong>triple-check it</strong>.)') . '</td>123 </tr> ';124 122 ?> 123 <input name="user_email" type="text" id="user_email" value="<?php echo wp_specialchars($user_email, 1) ?>" maxlength="200" /><br /><?php _e('(We’ll send your password to this address, so <strong>triple-check it</strong>.)') ?></td> 124 </tr> 125 <?php 125 126 if ( $errmsg = $errors->get_error_message('generic') ) 126 127 print '<tr class="error"> <th colspan="2">'.$errmsg.'</th> </tr>'; … … 148 149 149 150 if ( $errors->get_error_code() ) { 150 print '<p>'.__('There was a problem, please correct the form below and try again.').'</p>';151 } 152 153 ?> 154 < ?php printf(__("<p>Welcome back, %s. By filling out the form below, you can <strong>add another blog to your account</strong>. There is no limit to the number of blogs you can have, so create to your heart's content, but blog responsibly.</p>"), $current_user->display_name) ?>151 echo "<p>" . __('There was a problem, please correct the form below and try again.') . "</p>"; 152 } 153 154 ?> 155 <p><?php printf(__("Welcome back, %s. By filling out the form below, you can <strong>add another blog to your account</strong>. There is no limit to the number of blogs you can have, so create to your heart's content, but blog responsibly."), $current_user->display_name) ?></p> 155 156 <?php 156 157 $blogs = get_blogs_of_user($current_user->ID); … … 166 167 <form name="setupform" id="setupform" method="post" action="wp-signup.php"> 167 168 <input type="hidden" name="stage" value="gimmeanotherblog"> 169 <?php do_action( "signup_hidden_fields" ); ?> 168 170 <table border="0" width="100%" cellpadding="9"> 169 171 <?php -
trunk/xmlrpc.php
r789 r797 156 156 $this->escape($args); 157 157 158 $user_login = $args[1]; 159 $user_pass = $args[2]; 160 161 if (!$this->login_pass_ok($user_login, $user_pass)) { 162 return $this->error; 163 } 164 165 set_current_user(0, $user_login); 166 $is_admin = current_user_can('level_8'); 167 168 $struct = array( 169 'isAdmin' => $is_admin, 170 'url' => get_option('home') . '/', 171 'blogid' => '1', 172 'blogName' => get_option('blogname') 173 ); 174 175 return array($struct); 158 $user_login = $args[1]; 159 $user_pass = $args[2]; 160 161 if (!$this->login_pass_ok($user_login, $user_pass)) 162 return $this->error; 163 164 $user = set_current_user(0, $user_login); 165 166 $blogs = (array) get_blogs_of_user($user->ID); 167 168 $struct = array(); 169 170 foreach ( $blogs as $blog ) { 171 $blog_id = $blog->userblog_id; 172 173 switch_to_blog($blog_id); 174 175 $is_admin = current_user_can('level_8'); 176 177 $struct[] = array( 178 'isAdmin' => $is_admin, 179 'url' => get_settings('home') . '/', 180 'blogid' => $blog_id, 181 'blogName' => get_settings('blogname') 182 ); 183 } 184 185 return $struct; 176 186 } 177 187 … … 833 843 return $this->error; 834 844 } 845 846 if ( $upload_err = apply_filters( "pre_upload_error", false ) ) 847 return new IXR_Error(500, $upload_err); 835 848 836 849 $upload = wp_upload_bits($name, $type, $bits); … … 1208 1221 $comment_post_ID = (int) $post_ID; 1209 1222 $comment_author = $title; 1210 $ this->escape($comment_author);1223 $wpdb->escape($comment_author); 1211 1224 $comment_author_url = $pagelinkedfrom; 1212 1225 $comment_content = $context; 1213 $ this->escape($comment_content);1226 $wpdb->escape($comment_content); 1214 1227 $comment_type = 'pingback'; 1215 1228 1216 1229 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type'); 1217 1230 1218 wp_new_comment($commentdata);1219 do_action('pingback_post', $ wpdb->insert_id);1231 $comment_ID = wp_new_comment($commentdata); 1232 do_action('pingback_post', $comment_ID); 1220 1233 1221 1234 return "Pingback from $pagelinkedfrom to $pagelinkedto registered. Keep the web talking! :-)";
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)