summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-admin
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-21 09:24:59 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-21 09:24:59 +0000
commitca9480281cb3cb331788f8475b1e080bff59ec8d (patch)
tree03c3457f2c0be80543aec170ff2781087b532b62 /wp-inst/wp-admin
parentefcb857423cc3556d2283152cc1de82f6c56cc74 (diff)
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@442 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin')
-rw-r--r--wp-inst/wp-admin/admin-db.php3
-rw-r--r--wp-inst/wp-admin/admin-functions.php6
-rw-r--r--wp-inst/wp-admin/admin-header.php9
-rw-r--r--wp-inst/wp-admin/admin.php3
-rw-r--r--wp-inst/wp-admin/inline-uploading.php9
-rw-r--r--wp-inst/wp-admin/install.php8
-rw-r--r--wp-inst/wp-admin/options-writing.php47
-rw-r--r--wp-inst/wp-admin/post.php5
-rw-r--r--wp-inst/wp-admin/upgrade-functions.php6
9 files changed, 25 insertions, 71 deletions
diff --git a/wp-inst/wp-admin/admin-db.php b/wp-inst/wp-admin/admin-db.php
index 4912876..5ae4d84 100644
--- a/wp-inst/wp-admin/admin-db.php
+++ b/wp-inst/wp-admin/admin-db.php
@@ -324,7 +324,8 @@ function wp_update_link($linkdata) {
function wp_delete_link($link_id) {
global $wpdb;
- return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
+ do_action('delete_link', $link_id);
+ return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'");
}
function post_exists($title, $content = '', $post_date = '') {
diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php
index f0f862b..1c959b0 100644
--- a/wp-inst/wp-admin/admin-functions.php
+++ b/wp-inst/wp-admin/admin-functions.php
@@ -350,8 +350,6 @@ function edit_user($user_id = 0) {
}
if (isset ($_POST['first_name']))
$user->first_name = wp_specialchars(trim($_POST['first_name']));
- if (isset ($_POST['middle_name']))
- $user->middle_name = wp_specialchars(trim($_POST['middle_name']));
if (isset ($_POST['last_name']))
$user->last_name = wp_specialchars(trim($_POST['last_name']));
if (isset ($_POST['nickname']))
@@ -366,8 +364,6 @@ function edit_user($user_id = 0) {
$user->aim = wp_specialchars(trim($_POST['aim']));
if (isset ($_POST['yim']))
$user->yim = wp_specialchars(trim($_POST['yim']));
- if (isset ($_POST['flickr_username']))
- $user->flickr_username = wp_specialchars(trim($_POST['flickr_username']));
$errors = array ();
@@ -397,7 +393,7 @@ function edit_user($user_id = 0) {
if (!empty ($pass1))
$user->user_pass = $pass1;
- if (!$update && username_exists($user_login))
+ if (!$update && username_exists($user->user_login))
$errors['user_login'] = __('<strong>ERROR</strong>: This username is already registered, please choose another one.');
/* checking e-mail address */
diff --git a/wp-inst/wp-admin/admin-header.php b/wp-inst/wp-admin/admin-header.php
index ac1b341..14e28c7 100644
--- a/wp-inst/wp-admin/admin-header.php
+++ b/wp-inst/wp-admin/admin-header.php
@@ -80,14 +80,14 @@ addLoadEvent(blurry);
<script type="text/javascript" src="list-manipulation.js"></script>
<?php if ( isset( $editing ) ) : ?>
<?php if ( 'true' == get_user_option('rich_editing') ) :?>
-<script language="javascript" type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?index=0&theme=advanced&plugins=wordpress,autosave"></script>
+<script language="javascript" type="text/javascript" src="../wp-includes/js/tinymce/tiny_mce_gzip.php?index=0&theme=advanced&plugins=wordpress,autosave,wphelp"></script>
<script type="text/javascript">
tinyMCE.init({
mode : "specific_textareas",
textarea_trigger : "title",
width : "100%",
theme : "advanced",
- theme_advanced_buttons1 : "bold,italic,strikethrough,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,image,emotions,separator,wordpress,separator,undo,redo,code",
+ theme_advanced_buttons1 : "bold,italic,strikethrough,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,image,emotions,wordpress,separator,undo,redo,code,wphelp",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
@@ -105,8 +105,8 @@ tinyMCE.init({
convert_newlines_to_brs : false,
remove_linebreaks : true,
save_callback : "wp_save_callback",
- valid_elements : "-a[id|href|title|rel],-strong/b,-em/i,-strike,-del,-u,p[class|align],-ol,-ul,-li,br,img[class|src|alt|title|width|height|align],-sub,-sup,-blockquote,-table[border=0|cellspacing|cellpadding|width|height|class|align],tr[class|rowspan|width|height|align|valign],td[dir|class|colspan|rowspan|width|height|align|valign],-div[dir|class|align],-span[class|align],-pre[class],address,-h1[class|align],-h2[class|align],-h3[class|align],-h4[class|align],-h5[class|align],-h6[class|align],hr",
- plugins : "wordpress,autosave"
+ valid_elements : "-a[id|href|title|rel],-strong/b,-em/i,-strike,-del,-u,p[class|align],-ol,-ul,-li,br,img[class|src|alt|title|width|height|align],-sub,-sup,-blockquote,-table[border=0|cellspacing|cellpadding|width|height|class|align],tr[class|rowspan|width|height|align|valign],td[dir|class|colspan|rowspan|width|height|align|valign],-div[dir|class|align],-span[class|align],-pre[class],-code[class],-address,-h1[class|align],-h2[class|align],-h3[class|align],-h4[class|align],-h5[class|align],-h6[class|align],hr",
+ plugins : "wordpress,autosave,wphelp"
<?php do_action('mce_options'); ?>
});
</script>
@@ -221,7 +221,6 @@ function newCatCompletion() {
ids = myPload( ajaxCat.response );
names = myPload( newcat.value );
-
for ( i = 0; i < ids.length; i++ ) {
id = ids[i];
// alert(id);
diff --git a/wp-inst/wp-admin/admin.php b/wp-inst/wp-admin/admin.php
index 010e4b3..6d1a183 100644
--- a/wp-inst/wp-admin/admin.php
+++ b/wp-inst/wp-admin/admin.php
@@ -3,6 +3,9 @@ if ( defined('ABSPATH') )
require_once( ABSPATH . 'wp-config.php');
else
require_once('../wp-config.php');
+
+if ( get_option('db_version') != $wp_db_version )
+ die (sprintf(__("Your database is out-of-date. Please <a href='%s'>upgrade</a>."), get_option('siteurl') . '/wp-admin/upgrade.php'));
require_once(ABSPATH . 'wp-admin/admin-functions.php');
require_once(ABSPATH . 'wp-admin/admin-db.php');
diff --git a/wp-inst/wp-admin/inline-uploading.php b/wp-inst/wp-admin/inline-uploading.php
index eaa8d16..d2b2a61 100644
--- a/wp-inst/wp-admin/inline-uploading.php
+++ b/wp-inst/wp-admin/inline-uploading.php
@@ -380,7 +380,6 @@ form {
}
#descr {
height: 35px;
- v-align: top;
}
#buttons {
width: 98%;
@@ -418,7 +417,9 @@ form {
<?php if ( $attachments = $wpdb->get_results("SELECT ID FROM $wpdb->posts WHERE post_parent = '$post'") ) { ?>
<li<?php echo $current_2; ?>><a href="<?php echo basename(__FILE__); ?>?action=view&amp;post=<?php echo $post; ?>"><?php _e('Attached Images'); ?></a></li>
<?php } ?>
+<?php if ($wpdb->get_var("SELECT count(ID) FROM $wpdb->posts WHERE post_status = 'attachment' AND left(post_mime_type, 5) = 'image'")) { ?>
<li<?php echo $current_3; ?>><a href="<?php echo basename(__FILE__); ?>?action=view&amp;post=<?php echo $post; ?>&amp;all=true"><?php _e('All Images'); ?></a></li>
+<?php } ?>
<li> </li>
<?php if ( $action != 'upload' ) { ?>
<?php if ( false !== $back ) : ?>
@@ -461,7 +462,7 @@ form {
<td><input type="text" id="title" name="imgtitle" /></td>
</tr>
<tr>
-<th scope="row" style="text-align: right;"><label for="descr"><?php _e('Description:'); ?></th>
+<th scope="row" style="text-align: right;"><label for="descr"><?php _e('Description:'); ?></label></th>
<td><input type="textarea" name="descr" id="descr" value="" /></td>
</tr>
</table>
@@ -471,12 +472,10 @@ form {
<input type="hidden" name="all" value="<?php echo $all; ?>" />
<input type="submit" value="<?php _e('Upload'); ?>" />
<input type="button" value="<?php _e('Cancel'); ?>" onclick="cancelUpload()" />
+</p>
</div>
</form>
<?php } ?>
<?php endif; ?>
</body>
</html>
-
-
-
diff --git a/wp-inst/wp-admin/install.php b/wp-inst/wp-admin/install.php
index 8681f3b..dddb9be 100644
--- a/wp-inst/wp-admin/install.php
+++ b/wp-inst/wp-admin/install.php
@@ -119,8 +119,8 @@ switch($step) {
case 2:
// Fill in the data we gathered
-$weblog_title = $_POST['weblog_title'];
-$admin_email = $_POST['admin_email'];
+$weblog_title = stripslashes($_POST['weblog_title']);
+$admin_email = stripslashes($_POST['admin_email']);
// check e-mail address
if (empty($admin_email)) {
die (__("<strong>ERROR</strong>: please type your e-mail address"));
@@ -161,7 +161,7 @@ $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename
// First post
$now = date('Y-m-d H:i:s');
$now_gmt = gmdate('Y-m-d H:i:s');
-$wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_category, post_name, post_modified, post_modified_gmt) VALUES ('1', '$now', '$now_gmt', '".$wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'))."', '".$wpdb->escape(__('Hello world!'))."', '0', '".$wpdb->escape(__('hello-world'))."', '$now', '$now_gmt')");
+$wpdb->query("INSERT INTO $wpdb->posts (post_author, post_date, post_date_gmt, post_content, post_title, post_category, post_name, post_modified, post_modified_gmt, comment_count) VALUES ('1', '$now', '$now_gmt', '".$wpdb->escape(__('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!'))."', '".$wpdb->escape(__('Hello world!'))."', '0', '".$wpdb->escape(__('hello-world'))."', '$now', '$now_gmt', '1')");
$wpdb->query( "INSERT INTO $wpdb->post2cat (`rel_id`, `post_id`, `category_id`) VALUES (1, 1, 1)" );
@@ -181,7 +181,7 @@ $wpdb->query("INSERT INTO $wpdb->usermeta (user_id, meta_key, meta_value) VALUES
$admin_caps = serialize(array('administrator' => true));
$wpdb->query("INSERT INTO $wpdb->usermeta (user_id, meta_key, meta_value) VALUES ({$wpdb->insert_id}, '{$table_prefix}capabilities', '{$admin_caps}');");
-$message_headers = 'From: ' . stripslashes($_POST['weblog_title']) . ' <wordpress@' . $_SERVER['SERVER_NAME'] . '>';
+$message_headers = 'From: ' . $weblog_title . ' <wordpress@' . $_SERVER['SERVER_NAME'] . '>';
$message = sprintf(__("Your new WordPress blog has been successfully set up at:
%1\$s
diff --git a/wp-inst/wp-admin/options-writing.php b/wp-inst/wp-admin/options-writing.php
index b065735..d41ad6d 100644
--- a/wp-inst/wp-admin/options-writing.php
+++ b/wp-inst/wp-admin/options-writing.php
@@ -19,9 +19,6 @@ include('admin-header.php');
<tr valign="top">
<th scope="row"><?php _e('Formatting:') ?></th>
<td>
-<label for="rich_editing">
-<input name="rich_editing" type="checkbox" id="rich_editing" value="true" <?php checked('true', get_settings('rich_editing')); ?> />
-<?php _e('Use the visual rich editor when writing') ?></label><br />
<label for="use_smilies">
<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked('1', get_settings('use_smilies')); ?> />
<?php _e('Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display') ?></label>
@@ -42,53 +39,11 @@ endforeach;
</tr>
</table>
-<?php
-
-/*
-<fieldset class="options">
-<legend><?php _e('Writing by e-mail') ?></legend>
-<p><?php printf(__('To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: <code>%s</code>, <code>%s</code>, <code>%s</code>.'), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5), substr(md5(uniqid(microtime())),0,5)) ?></p>
-
-<table width="100%" cellspacing="2" cellpadding="5" class="editform">
-<tr valign="top">
-<th scope="row"><?php _e('Mail server:') ?></th>
-<td><input name="mailserver_url" type="text" id="mailserver_url" value="<?php form_option('mailserver_url'); ?>" size="40" />
-<label for="mailserver_port"><?php _e('Port:') ?></label>
-<input name="mailserver_port" type="text" id="mailserver_port" value="<?php form_option('mailserver_port'); ?>" size="6" />
-</td>
-</tr>
-<tr valign="top">
-<th width="33%" scope="row"><?php _e('Login name:') ?></th>
-<td><input name="mailserver_login" type="text" id="mailserver_login" value="<?php form_option('mailserver_login'); ?>" size="40" /></td>
-</tr>
-<tr valign="top">
-<th scope="row"><?php _e('Password:') ?></th>
-<td>
-<input name="mailserver_pass" type="text" id="mailserver_pass" value="<?php form_option('mailserver_pass'); ?>" size="40" />
-</td>
-</tr>
-<tr valign="top">
-<th scope="row"><?php _e('Default post by mail category:') ?></th>
-<td><select name="default_email_category" id="default_email_category">
-<?php
-//Alreay have $categories from default_category
-foreach ($categories as $category) :
-if ($category->cat_ID == get_settings('default_email_category')) $selected = " selected='selected'";
-else $selected = '';
-echo "\n\t<option value='$category->cat_ID' $selected>$category->cat_name</option>";
-endforeach;
-?>
-</select></td>
-</tr>
-</table>
-</fieldset>
-*/
-?>
<p class="submit">
<input type="hidden" name="action" value="update" />
-<input type="hidden" name="page_options" value="default_post_edit_rows,use_smilies,rich_editing,ping_sites,mailserver_url,mailserver_port,mailserver_login,mailserver_pass,default_category,default_email_category" />
+<input type="hidden" name="page_options" value="default_post_edit_rows,use_smilies,ping_sites,mailserver_url,mailserver_port,mailserver_login,mailserver_pass,default_category,default_email_category" />
<input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
</p>
</form>
diff --git a/wp-inst/wp-admin/post.php b/wp-inst/wp-admin/post.php
index e0620ab..b73a05e 100644
--- a/wp-inst/wp-admin/post.php
+++ b/wp-inst/wp-admin/post.php
@@ -22,8 +22,9 @@ if (isset($_POST['deletepost'])) {
$action = "delete";
}
- // Fix submenu highlighting for pages.
-if (false !== strpos($_SERVER['HTTP_REFERER'], 'edit-pages.php')) $submenu_file = 'page-new.php';
+// Fix submenu highlighting for pages.
+if ( isset($_REQUEST['post']) && 'static' == get_post_status($_REQUEST['post']) )
+ $submenu_file = 'page-new.php';
$editing = true;
diff --git a/wp-inst/wp-admin/upgrade-functions.php b/wp-inst/wp-admin/upgrade-functions.php
index 9c9f2e2..2c7bfb4 100644
--- a/wp-inst/wp-admin/upgrade-functions.php
+++ b/wp-inst/wp-admin/upgrade-functions.php
@@ -31,7 +31,7 @@ function upgrade_all() {
upgrade_130();
}
- if ( $wp_current_db_version < 3104 )
+ if ( $wp_current_db_version < 3183 )
upgrade_160();
save_mod_rewrite_rules();
@@ -317,7 +317,7 @@ function upgrade_160() {
$comments = $wpdb->get_results( "SELECT comment_post_ID, COUNT(*) as c FROM $wpdb->comments GROUP BY comment_post_ID" );
if( is_array( $comments ) ) {
foreach ($comments as $comment) {
- $wpdb->query( "UPDATE $wpdb->posts SET comment_count = $comment->c WHERE ID = '$comment->comment_post_ID}'" );
+ $wpdb->query( "UPDATE $wpdb->posts SET comment_count = $comment->c WHERE ID = '$comment->comment_post_ID'" );
}
}
@@ -426,7 +426,7 @@ function __get_option($setting) {
$option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'");
- if ( 'home' == $setting && '' == $value )
+ if ( 'home' == $setting && '' == $option )
return __get_option('siteurl');
if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting )