summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-09-08 10:57:32 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-09-08 10:57:32 +0000
commite30516b2ee40c1c45c8f288c20a3d4372e478624 (patch)
treebd6b8bcc4c06697f50e6985a6b08620e25bc572e
parente20c9aa016d6885c6e3fc7425525b4090f05ac2a (diff)
downloadwordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.tar.gz
wordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.tar.xz
wordpress-mu-e30516b2ee40c1c45c8f288c20a3d4372e478624.zip
WP Merge to #4124
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@734 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-admin/admin-functions.php12
-rw-r--r--wp-admin/cat-js.php2
-rw-r--r--wp-admin/edit-form-advanced.php2
-rw-r--r--wp-admin/edit-page-form.php6
-rw-r--r--wp-admin/edit.php2
-rw-r--r--wp-admin/import/blogger.php2
-rw-r--r--wp-admin/import/blogware.php2
-rw-r--r--wp-admin/import/dotclear.php8
-rw-r--r--wp-admin/import/greymatter.php75
-rw-r--r--wp-admin/import/livejournal.php2
-rw-r--r--wp-admin/import/mt.php47
-rw-r--r--wp-admin/import/rss.php23
-rw-r--r--wp-admin/import/textpattern.php6
-rw-r--r--wp-admin/import/wordpress.php35
-rw-r--r--wp-admin/options-privacy.php39
-rw-r--r--wp-admin/page.php2
-rw-r--r--wp-admin/post.php2
-rw-r--r--wp-content/themes/default/archive.php3
-rw-r--r--wp-content/themes/default/searchform.php2
-rw-r--r--wp-content/themes/default/sidebar.php2
-rw-r--r--wp-includes/bookmark-template.php7
-rw-r--r--wp-includes/category-template.php3
-rw-r--r--wp-includes/category.php5
-rw-r--r--wp-includes/classes.php10
-rw-r--r--wp-includes/formatting.php6
-rw-r--r--wp-includes/functions.php20
-rw-r--r--wp-includes/general-template.php31
-rw-r--r--wp-includes/post-template.php2
-rw-r--r--wp-settings.php19
29 files changed, 241 insertions, 136 deletions
diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index bb86180..d96d9e8 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -972,7 +972,7 @@ function list_meta($meta) {
global $post_ID;
// Exit if no meta
if (!$meta) {
- echo '<tbody id="the-list"></tbody>'; //TBODY needed for list-manipulation JS
+ echo '<tbody id="the-list"><tr style="display: none;"><td>&nbsp;</td></tr></tbody>'; //TBODY needed for list-manipulation JS
return;
}
$count = 0;
@@ -1265,16 +1265,18 @@ function save_mod_rewrite_rules() {
}
function the_quicktags() {
- // Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP
- if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari')) {
echo '
<div id="quicktags">
';
wp_print_scripts( 'quicktags' );
- echo ' <script type="text/javascript">if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();</script>
+ echo ' <script type="text/javascript">
+ //<![CDATA[
+ if ( typeof tinyMCE == "undefined" || tinyMCE.configs.length < 1 ) edToolbar();
+ //]]>
+ </script>
</div>
';
- } else echo '
+ echo '
<script type="text/javascript">
function edInsertContent(myField, myValue) {
//IE support
diff --git a/wp-admin/cat-js.php b/wp-admin/cat-js.php
index c286168..77305ac 100644
--- a/wp-admin/cat-js.php
+++ b/wp-admin/cat-js.php
@@ -21,7 +21,7 @@ function newCatAddIn() {
newcatSub.type = 'button';
newcatSub.name = 'Button';
newcatSub.id = 'catadd';
- newcatSub.value = 'Add';
+ newcatSub.value = '<?php _e('Add'); ?>';
newcatSub.onclick = function() { catList.ajaxAdder('category', 'categorydiv'); };
ajaxcat.appendChild(newcat);
diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index ca69129..336bae3 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -188,7 +188,7 @@ if (current_user_can('upload_files')) {
$uploading_iframe_src = wp_nonce_url("inline-uploading.php?action=view&amp;post=$uploading_iframe_ID", 'inlineuploading');
$uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
if ( false != $uploading_iframe_src )
- echo '<iframe id="uploading" border="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
+ echo '<iframe id="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
}
?>
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php
index aea02c8..d68e71b 100644
--- a/wp-admin/edit-page-form.php
+++ b/wp-admin/edit-page-form.php
@@ -159,7 +159,7 @@ if (current_user_can('upload_files')) {
$uploading_iframe_src = wp_nonce_url("inline-uploading.php?action=view&amp;post=$uploading_iframe_ID", 'inlineuploading');
$uploading_iframe_src = apply_filters('uploading_iframe_src', $uploading_iframe_src);
if ( false != $uploading_iframe_src )
- echo '<iframe id="uploading" border="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
+ echo '<iframe id="uploading" frameborder="0" src="' . $uploading_iframe_src . '">' . __('This feature requires iframe support.') . '</iframe>';
}
?>
@@ -191,8 +191,8 @@ list_meta($metadata);
if ( current_user_can('delete_page', $post->ID) ) ?>
<input name="deletepost" class="button" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> />
<?php endif; ?>
-</form>
-
</div>
+</form>
+
</div>
diff --git a/wp-admin/edit.php b/wp-admin/edit.php
index c473e46..008b570 100644
--- a/wp-admin/edit.php
+++ b/wp-admin/edit.php
@@ -115,7 +115,7 @@ if ( count($arc_result) ) { ?>
<form name="viewcat" action="" method="get" style="float: left; width: 30em; margin-bottom: 1em;">
<fieldset>
<legend><?php _e('Browse Category&hellip;') ?></legend>
- <?php wp_dropdown_categories('show_option_all=All&hide_empty=0&hierarchical=1&show_count=1&selected='.$cat);?>
+ <?php wp_dropdown_categories('show_option_all='.__('All').'&hide_empty=0&hierarchical=1&show_count=1&selected='.$cat);?>
<input type="submit" name="submit" value="<?php _e('Show Category') ?>" />
</fieldset>
</form>
diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php
index 6328f16..c7c41d3 100644
--- a/wp-admin/import/blogger.php
+++ b/wp-admin/import/blogger.php
@@ -670,6 +670,6 @@ class Blogger_Import {
$blogger_import = new Blogger_Import();
-register_importer('blogger', 'Blogger and Blogspot', __('Import <strong>posts and comments</strong> from your Blogger account'), array ($blogger_import, 'start'));
+register_importer('blogger', __('Blogger and Blogspot'), __('Import <strong>posts and comments</strong> from your Blogger account'), array ($blogger_import, 'start'));
?>
diff --git a/wp-admin/import/blogware.php b/wp-admin/import/blogware.php
index 35ab610..abb43d5 100644
--- a/wp-admin/import/blogware.php
+++ b/wp-admin/import/blogware.php
@@ -188,5 +188,5 @@ class BW_Import {
$blogware_import = new BW_Import();
-register_importer('blogware', 'Blogware', __('Import posts from Blogware'), array ($blogware_import, 'dispatch'));
+register_importer('blogware', __('Blogware'), __('Import posts from Blogware'), array ($blogware_import, 'dispatch'));
?>
diff --git a/wp-admin/import/dotclear.php b/wp-admin/import/dotclear.php
index 27ce6e6..ba988f6 100644
--- a/wp-admin/import/dotclear.php
+++ b/wp-admin/import/dotclear.php
@@ -632,15 +632,15 @@ class Dotclear_Import {
echo '<h3>'.__('Preserving Authors').'</h3>';
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
echo '<h3>'.__('Textile').'</h3>';
- echo '<p>'.__('Also, since you\'re coming from Dotclear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/2004/04/19/wordpress-plugin-textile-20/">Textile for WordPress</a>. Trust me... You\'ll want it.').'</p>';
+ echo '<p>'.__('Also, since you\'re coming from Dotclear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me... You\'ll want it.').'</p>';
echo '<h3>'.__('WordPress Resources').'</h3>';
echo '<p>'.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'</p>';
echo '<ul>';
echo '<li>'.__('<a href="http://www.wordpress.org">The official WordPress site</a>').'</li>';
- echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums').'</li>';
+ echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
echo '</ul>';
- echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '/wp-login.php').'</p>';
+ echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '../wp-login.php').'</p>';
}
function db_form()
@@ -743,5 +743,5 @@ class Dotclear_Import {
}
$dc_import = new Dotclear_Import();
-register_importer('dotclear', 'Dotclear', __('Import posts from a Dotclear Blog'), array ($dc_import, 'dispatch'));
+register_importer('dotclear', __('Dotclear'), __('Import posts from a Dotclear Blog'), array ($dc_import, 'dispatch'));
?>
diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php
index 8f7b34a..5494197 100644
--- a/wp-admin/import/greymatter.php
+++ b/wp-admin/import/greymatter.php
@@ -16,44 +16,44 @@ class GM_Import {
function greet() {
$this->header();
?>
-<p>This is a basic GreyMatter to WordPress import script.</p>
-<p>What it does:</p>
+<p><?php _e('This is a basic GreyMatter to WordPress import script.') ?></p>
+<p><?php _e('What it does:') ?></p>
<ul>
-<li>Parses gm-authors.cgi to import (new) authors. Everyone is imported at level 1.</li>
-<li>Parses the entries cgi files to import posts, comments, and karma on posts (although karma is not used on WordPress yet).<br />If authors are found not to be in gm-authors.cgi, imports them at level 0.</li>
-<li>Detects duplicate entries or comments. If you don't import everything the first time, or this import should fail in the middle, duplicate entries will not be made when you try again.</li>
+<li><?php _e('Parses gm-authors.cgi to import (new) authors. Everyone is imported at level 1.') ?></li>
+<li><?php _e('Parses the entries cgi files to import posts, comments, and karma on posts (although karma is not used on WordPress yet).<br />If authors are found not to be in gm-authors.cgi, imports them at level 0.') ?></li>
+<li><?php _e("Detects duplicate entries or comments. If you don't import everything the first time, or this import should fail in the middle, duplicate entries will not be made when you try again.") ?></li>
</ul>
-<p>What it does not:</p>
+<p><?php _e('What it does not:') ?></p>
<ul>
-<li>Parse gm-counter.cgi, gm-banlist.cgi, gm-cplog.cgi (you can make a CP log hack if you really feel like it, but I question the need of a CP log).</li>
-<li>Import gm-templates.</li>
-<li>Doesn't keep entries on top.</li>
+<li><?php _e('Parse gm-counter.cgi, gm-banlist.cgi, gm-cplog.cgi (you can make a CP log hack if you really feel like it, but I question the need of a CP log).') ?></li>
+<li><?php _e('Import gm-templates.') ?></li>
+<li><?php _e("Doesn't keep entries on top.")?></li>
</ul>
<p>&nbsp;</p>
<form name="stepOne" method="get">
<input type="hidden" name="import" value="greymatter" />
<input type="hidden" name="step" value="1" />
-<h3>Second step: GreyMatter details:</h3>
+<h3><?php _e('Second step: GreyMatter details:') ?></h3>
<p><table cellpadding="0">
<tr>
-<td>Path to GM files:</td>
+<td><?php _e('Path to GM files:') ?></td>
<td><input type="text" style="width:300px" name="gmpath" value="/home/my/site/cgi-bin/greymatter/" /></td>
</tr>
<tr>
-<td>Path to GM entries:</td>
+<td><?php _e('Path to GM entries:') ?></td>
<td><input type="text" style="width:300px" name="archivespath" value="/home/my/site/cgi-bin/greymatter/archives/" /></td>
</tr>
<tr>
-<td colspan="2"><br />This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don't know that number, just log into your FTP and look it out<br />in the entries' folder)</td>
+<td colspan="2"><br /><?php _e("This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don't know that number, just log into your FTP and look it out<br />in the entries' folder)") ?></td>
</tr>
<tr>
-<td>Last entry's number:</td>
+<td><?php _e("Last entry's number:") ?></td>
<td><input type="text" name="lastentry" value="00000001" /></td>
</tr>
</table>
</p>
-<p>When you're ready, click OK to start importing: <input type="submit" name="submit" value="OK" class="search" /></p>
+<p><?php _e("When you're ready, click OK to start importing: ") ?><input type="submit" name="submit" value="<?php _e('OK') ?>" class="search" /></p>
</form>
<p>&nbsp</p>
<?php
@@ -87,16 +87,16 @@ class GM_Import {
}
if (!chdir($archivespath))
- wp_die("Wrong path, $archivespath\ndoesn't exist\non the server");
+ wp_die(sprintf(__("Wrong path, %s\ndoesn't exist\non the server"), $archivespath));
if (!chdir($gmpath))
- wp_die("Wrong path, $gmpath\ndoesn't exist\non the server");
+ wp_die(sprintf(__("Wrong path, %s\ndoesn't exist\non the server"), $gmpath));
$this->header();
?>
-<p>The importer is running...</p>
+<p><?php _e('The importer is running...') ?></p>
<ul>
-<li>importing users... <ul><?php
+<li><?php _e('importing users...') ?><ul><?php
chdir($gmpath);
$userbase = file("gm-authors.cgi");
@@ -120,7 +120,7 @@ class GM_Import {
$user_id = username_exists($user_login);
if ($user_id) {
- echo "<li>user <i>$user_login</i>... <b>Already exists</b></li>";
+ printf('<li>'.__('user %s').'<strong>'.__('Already exists').'</strong></li>', "<em>$user_login</em>");
$this->gmnames[$userdata[0]] = $user_id;
continue;
}
@@ -129,12 +129,11 @@ class GM_Import {
$user_id = wp_insert_user($user_info);
$this->gmnames[$userdata[0]] = $user_id;
- echo "<li>user <i>$user_login</i>... <b>Done</b></li>";
-
+ printf('<li>'.__('user %s...').' <strong>'.__('Done').'</strong></li>', "<em>$user_login</em>");
}
-?></ul><b>Done</b></li>
-<li>importing posts, comments, and karma...<br /><ul><?php
+?></ul><strong><?php _e('Done') ?></strong></li>
+<li><?php _e('importing posts, comments, and karma...') ?><br /><ul><?php
chdir($archivespath);
@@ -163,7 +162,6 @@ class GM_Import {
if (is_file($entryfile.".cgi")) {
$entry=file($entryfile.".cgi");
- echo "<li>entry # $entryfile ";
$postinfo=explode("|",$entry[0]);
$postmaincontent=$this->gm2autobr($entry[2]);
$postmorecontent=$this->gm2autobr($entry[3]);
@@ -171,7 +169,7 @@ class GM_Import {
$post_author=trim($wpdb->escape($postinfo[1]));
$post_title=$this->gm2autobr($postinfo[2]);
- echo " : $post_title : by $postinfo[1]";
+ printf('<li>'.__('entry # %s : %s : by %s'), $entryfile, $post_title, $postinfo[1]);
$post_title=$wpdb->escape($post_title);
$postyear=$postinfo[6];
@@ -198,7 +196,8 @@ class GM_Import {
$ping_status = 'closed';
if ($post_ID = post_exists($post_title, '', $post_date)) {
- echo ' (already exists)';
+ echo ' ';
+ _e('(already exists)');
} else {
//just so that if a post already exists, new users are not created by checkauthor
// we'll check the author is registered, or if it's a deleted author
@@ -219,7 +218,8 @@ class GM_Import {
$user_id = wp_insert_user($user_info);
$this->gmnames[$postinfo[1]] = $user_id;
- echo ": registered deleted user <i>$user_login</i> at level 0 ";
+ echo ': ';
+ printf(__('registered deleted user %s at level 0 '), "<em>$user_login</em>");
}
if (array_key_exists($postinfo[1], $this->gmnames)) {
@@ -266,21 +266,22 @@ class GM_Import {
$numComments++;
}
if ($numAddedComments > 0) {
- echo ": imported $numAddedComments comment";
- if ($numAddedComments != 1)
- echo "s";
+ echo ': ';
+ printf(__('imported %d comment(s)'), $numAddedComments);
}
$preExisting = $numComments - numAddedComments;
- if ($preExisting > 0)
- echo " (ignored $preExisting pre-existing comments)";
+ if ($preExisting > 0) {
+ echo ' ';
+ printf(__('ignored %d pre-existing comments'), $preExisting);
+ }
}
- echo "... <b>Done</b></li>";
+ echo '... <strong>'.__('Done').'</strong></li>';
}
}
?>
-</ul><b>Done</b></li></ul>
+</ul><strong><?php _e('Done') ?></strong></li></ul>
<p>&nbsp;</p>
-<p>Completed Greymatter import !</p>
+<p><?php _e('Completed Greymatter import!') ?></p>
<?php
$this->footer();
}
@@ -308,5 +309,5 @@ class GM_Import {
$gm_import = new GM_Import();
-register_importer('greymatter', 'Greymatter', __('Import posts and comments from your Greymatter blog'), array ($gm_import, 'dispatch'));
+register_importer('greymatter', __('Greymatter'), __('Import posts and comments from your Greymatter blog'), array ($gm_import, 'dispatch'));
?>
diff --git a/wp-admin/import/livejournal.php b/wp-admin/import/livejournal.php
index 44b92a5..d0c6102 100644
--- a/wp-admin/import/livejournal.php
+++ b/wp-admin/import/livejournal.php
@@ -164,5 +164,5 @@ class LJ_Import {
$livejournal_import = new LJ_Import();
-register_importer('livejournal', 'LiveJournal', __('Import posts from LiveJournal'), array ($livejournal_import, 'dispatch'));
+register_importer('livejournal', __('LiveJournal'), __('Import posts from LiveJournal'), array ($livejournal_import, 'dispatch'));
?>
diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php
index 59259ea..bf33718 100644
--- a/wp-admin/import/mt.php
+++ b/wp-admin/import/mt.php
@@ -32,7 +32,7 @@ class MT_Import {
global $wpdb, $testing;
$users = get_users_of_blog($wpdb->blogid);
?><select name="userselect[<?php echo $n; ?>]">
- <option value="#NONE#">- Select -</option>
+ <option value="#NONE#"><?php _e('- Select -') ?></option>
<?php
@@ -50,8 +50,25 @@ class MT_Import {
function checkauthor($author) {
global $wpdb;
//mtnames is an array with the names in the mt import file
- $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array
- $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames
+ $pass = 'changeme';
+ if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
+ ++ $this->j;
+ $this->mtnames[$this->j] = $author; //add that new mt author name to an array
+ $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user
+ if (!$user_id) { //banging my head against the desk now.
+ if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
+ $user_id = wp_create_user($author, $pass);
+ $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank.
+ } else {
+ $user_id = wp_create_user($this->newauthornames[$this->j], $pass);
+ }
+ } else {
+ return $user_id; // return pre-existing wp username if it exists
+ }
+ } else {
+ $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array
+ $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames
+ }
return $user_id;
}
@@ -93,6 +110,13 @@ class MT_Import {
$formnames = array ();
$selectnames = array ();
+ foreach ($_POST['user'] as $key => $line) {
+ $newname = trim(stripslashes($line));
+ if ($newname == '')
+ $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.
+ array_push($formnames, "$newname");
+ } // $formnames is the array with the form entered names
+
foreach ($_POST['userselect'] as $user => $key) {
$selected = trim(stripslashes($key));
array_push($selectnames, "$selected");
@@ -124,12 +148,12 @@ class MT_Import {
$j = -1;
foreach ($authors as $author) {
++ $j;
- echo '<li><i>'.$author.'</i><br />'.'<input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30">';
+ 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 />');
$this->users_form($j);
echo '</li>';
}
- echo '<input type="submit" value="Submit">'.'<br/>';
+ echo '<input type="submit" value="'.__('Submit').'">'.'<br/>';
echo '</form>';
echo '</ol></div>';
@@ -138,7 +162,10 @@ class MT_Import {
function select_authors() {
$file = wp_import_handle_upload();
if ( isset($file['error']) ) {
- echo $file['error'];
+ $this->header();
+ echo '<p>'.__('Sorry, there has been an error').'.</p>';
+ echo '<p><strong>' . $file['error'] . '</strong></p>';
+ $this->footer();
return;
}
$this->file = $file['file'];
@@ -170,7 +197,7 @@ class MT_Import {
// We want the excerpt
preg_match("|-----\nEXCERPT:(.*)|s", $post, $excerpt);
- $excerpt = $wpdb->escape(trim($excerpt[1]));
+ $post_excerpt = $wpdb->escape(trim($excerpt[1]));
$post = preg_replace("|(-----\nEXCERPT:.*)|s", '', $post);
// We're going to put extended body into main body with a more tag
@@ -307,7 +334,7 @@ class MT_Import {
}
}
if ( $num_comments )
- printf(__(' (%s comments)'), $num_comments);
+ printf(' '.__('(%s comments)'), $num_comments);
// Finally the pings
// fix the double newline on the first one
@@ -355,7 +382,7 @@ class MT_Import {
}
}
if ( $num_pings )
- printf(__(' (%s pings)'), $num_pings);
+ printf(' '.__('(%s pings)'), $num_pings);
echo "</li>";
}
@@ -403,5 +430,5 @@ class MT_Import {
$mt_import = new MT_Import();
-register_importer('mt', 'Movable Type and Typepad', __('Imports <strong>posts and comments</strong> from your Movable Type or Typepad blog'), array ($mt_import, 'dispatch'));
+register_importer('mt', __('Movable Type and Typepad'), __('Imports <strong>posts and comments</strong> from your Movable Type or Typepad blog'), array ($mt_import, 'dispatch'));
?>
diff --git a/wp-admin/import/rss.php b/wp-admin/import/rss.php
index 69972f3..aabfe4e 100644
--- a/wp-admin/import/rss.php
+++ b/wp-admin/import/rss.php
@@ -38,21 +38,22 @@ class RSS_Import {
$index = 0;
foreach ($this->posts as $post) {
preg_match('|<title>(.*?)</title>|is', $post, $post_title);
- $post_title = $wpdb->escape(trim($post_title[1]));
+ $post_title = str_replace(array('<![CDATA[', ']]>'), '', $wpdb->escape( trim($post_title[1]) ));
- preg_match('|<pubdate>(.*?)</pubdate>|is', $post, $post_date);
+ preg_match('|<pubdate>(.*?)</pubdate>|is', $post, $post_date_gmt);
- if ($post_date) {
- $post_date = strtotime($post_date[1]);
+ if ($post_date_gmt) {
+ $post_date_gmt = strtotime($post_date_gmt[1]);
} else {
// if we don't already have something from pubDate
- preg_match('|<dc:date>(.*?)</dc:date>|is', $post, $post_date);
- $post_date = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date[1]);
- $post_date = str_replace('T', ' ', $post_date);
- $post_date = strtotime($post_date);
+ preg_match('|<dc:date>(.*?)</dc:date>|is', $post, $post_date_gmt);
+ $post_date_gmt = preg_replace('|([-+])([0-9]+):([0-9]+)$|', '\1\2\3', $post_date_gmt[1]);
+ $post_date_gmt = str_replace('T', ' ', $post_date_gmt);
+ $post_date_gmt = strtotime($post_date_gmt);
}
- $post_date = gmdate('Y-m-d H:i:s', $post_date);
+ $post_date_gmt = gmdate('Y-m-d H:i:s', $post_date_gmt);
+ $post_date = get_date_from_gmt( $post_date_gmt );
preg_match_all('|<category>(.*?)</category>|is', $post, $categories);
$categories = $categories[1];
@@ -90,7 +91,7 @@ class RSS_Import {
$post_author = 1;
$post_status = 'publish';
- $this->posts[$index] = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status', 'guid', 'categories');
+ $this->posts[$index] = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_status', 'guid', 'categories');
$index++;
}
}
@@ -167,5 +168,5 @@ class RSS_Import {
$rss_import = new RSS_Import();
-register_importer('rss', 'RSS', __('Import posts from an RSS feed'), array ($rss_import, 'dispatch'));
+register_importer('rss', __('RSS'), __('Import posts from an RSS feed'), array ($rss_import, 'dispatch'));
?>
diff --git a/wp-admin/import/textpattern.php b/wp-admin/import/textpattern.php
index 4a123de..6af31aa 100644
--- a/wp-admin/import/textpattern.php
+++ b/wp-admin/import/textpattern.php
@@ -555,12 +555,12 @@ class Textpattern_Import {
echo '<h3>'.__('Preserving Authors').'</h3>';
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
echo '<h3>'.__('Textile').'</h3>';
- echo '<p>'.__('Also, since you\'re coming from Textpattern, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/2004/04/19/wordpress-plugin-textile-20/">Textile for WordPress</a>. Trust me... You\'ll want it.').'</p>';
+ echo '<p>'.__('Also, since you\'re coming from Textpattern, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me... You\'ll want it.').'</p>';
echo '<h3>'.__('WordPress Resources').'</h3>';
echo '<p>'.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'</p>';
echo '<ul>';
echo '<li>'.__('<a href="http://www.wordpress.org">The official WordPress site</a>').'</li>';
- echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums').'</li>';
+ echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
echo '</ul>';
echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '/wp-login.php').'</p>';
@@ -659,5 +659,5 @@ class Textpattern_Import {
}
$txp_import = new Textpattern_Import();
-register_importer('textpattern', 'Textpattern', __('Import posts from a Textpattern Blog'), array ($txp_import, 'dispatch'));
+register_importer('textpattern', __('Textpattern'), __('Import posts from a Textpattern Blog'), array ($txp_import, 'dispatch'));
?>
diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php
index 997628b..ded4b94 100644
--- a/wp-admin/import/wordpress.php
+++ b/wp-admin/import/wordpress.php
@@ -54,8 +54,24 @@ class WP_Import {
global $wpdb;
//mtnames is an array with the names in the mt import file
$pass = 'changeme';
- $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array
- $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames
+ if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
+ ++ $this->j;
+ $this->mtnames[$this->j] = $author; //add that new mt author name to an array
+ $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user
+ if (!$user_id) { //banging my head against the desk now.
+ if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
+ $user_id = wp_create_user($author, $pass);
+ $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank.
+ } else {
+ $user_id = wp_create_user($this->newauthornames[$this->j], $pass);
+ }
+ } else {
+ return $user_id; // return pre-existing wp username if it exists
+ }
+ } else {
+ $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array
+ $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames
+ }
return $user_id;
}
@@ -96,6 +112,13 @@ class WP_Import {
$formnames = array ();
$selectnames = array ();
+ foreach ($_POST['user'] as $key => $line) {
+ $newname = trim(stripslashes($line));
+ if ($newname == '')
+ $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.
+ array_push($formnames, "$newname");
+ } // $formnames is the array with the form entered names
+
foreach ($_POST['userselect'] as $user => $key) {
$selected = trim(stripslashes($key));
array_push($selectnames, "$selected");
@@ -125,7 +148,7 @@ class WP_Import {
$j = -1;
foreach ($authors as $author) {
++ $j;
- echo '<li>Current author: <strong>'.$author.'</strong><br />'.'Map to existing: ';
+ 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 />');
$this->users_form($j);
echo '</li>';
}
@@ -140,7 +163,7 @@ class WP_Import {
$file = wp_import_handle_upload();
if ( isset($file['error']) ) {
$this->header();
- echo '<p>Sorry, there has been an error.</p>';
+ echo '<p>'.__('Sorry, there has been an error.').'</p>';
echo '<p><strong>' . $file['error'] . '</strong></p>';
$this->footer();
return;
@@ -225,7 +248,7 @@ class WP_Import {
}
} }
if ( $num_comments )
- printf(__(' (%s comments)'), $num_comments);
+ printf(' '.__('(%s comments)'), $num_comments);
// Now for post meta
preg_match_all('|<wp:postmeta>(.*?)</wp:postmeta>|is', $post, $postmeta);
@@ -243,7 +266,7 @@ class WP_Import {
wp_import_cleanup($this->id);
- echo '<h3>'.sprintf(__('All done. <a href="%s">Have fun!</a>'), get_option('home')).'</h3>';
+ echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
}
function import() {
diff --git a/wp-admin/options-privacy.php b/wp-admin/options-privacy.php
new file mode 100644
index 0000000..64b2546
--- /dev/null
+++ b/wp-admin/options-privacy.php
@@ -0,0 +1,39 @@
+<?php
+require_once('./admin.php');
+
+$title = __('Privacy Options');
+$parent_file = 'options-general.php';
+
+include('./admin-header.php');
+
+if( trim( get_option('blog_public') ) == '' )
+ update_option('blog_public', get_blog_status( $wpdb->blogid, 'public'));
+?>
+
+<div class="wrap">
+<h2><?php _e('Privacy Options') ?></h2>
+<form method="post" action="options.php">
+<?php wp_nonce_field('update-options') ?>
+<table class="optiontable">
+<tr valign="top">
+<th scope="row"><?php _e('Blog visibility:') ?> </th>
+<td>
+<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
+ <label for="blog-public"><?php _e('I would like my blog to be visible to anyone who visits, including search engines and archivers') ?></label>
+<br />
+<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
+ <label for="blog-norobots"><?php _e('I would like to block search engines, but allow normal folks') ?></label>
+<?php do_action('blog_privacy_selector'); ?>
+</td>
+</tr>
+</table>
+
+<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
+<input type="hidden" name="action" value="update" />
+<input type="hidden" name="page_options" value="blog_public" />
+</p>
+</form>
+
+</div>
+
+<?php include('./admin-footer.php') ?>
diff --git a/wp-admin/page.php b/wp-admin/page.php
index 78f17d2..025014d 100644
--- a/wp-admin/page.php
+++ b/wp-admin/page.php
@@ -62,7 +62,7 @@ case 'edit':
?>
<div id='preview' class='wrap'>
<h2 id="preview-post"><?php _e('Page Preview (updated when page is saved)'); ?> <small class="quickjump"><a href="#write-post"><?php _e('edit &uarr;'); ?></a></small></h2>
- <iframe src="<?php echo add_query_arg('preview', 'true', get_permalink($post->ID)); ?>" width="100%" height="600" ></iframe>
+ <iframe src="<?php echo wp_specialchars(apply_filters('preview_page_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe>
</div>
<?php
break;
diff --git a/wp-admin/post.php b/wp-admin/post.php
index 7b1c71c..3c514c7 100644
--- a/wp-admin/post.php
+++ b/wp-admin/post.php
@@ -63,7 +63,7 @@ case 'edit':
?>
<div id='preview' class='wrap'>
<h2 id="preview-post"><?php _e('Post Preview (updated when post is saved)'); ?> <small class="quickjump"><a href="#write-post"><?php _e('edit &uarr;'); ?></a></small></h2>
- <iframe src="<?php echo add_query_arg('preview', 'true', get_permalink($post->ID)); ?>" width="100%" height="600" ></iframe>
+ <iframe src="<?php echo wp_specialchars(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>" width="100%" height="600" ></iframe>
</div>
<?php
break;
diff --git a/wp-content/themes/default/archive.php b/wp-content/themes/default/archive.php
index c648abd..c6acaab 100644
--- a/wp-content/themes/default/archive.php
+++ b/wp-content/themes/default/archive.php
@@ -17,9 +17,6 @@
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
- <?php /* If this is a search */ } elseif (is_search()) { ?>
- <h2 class="pagetitle">Search Results</h2>
-
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2 class="pagetitle">Author Archive</h2>
diff --git a/wp-content/themes/default/searchform.php b/wp-content/themes/default/searchform.php
index c7c73f1..c6f7140 100644
--- a/wp-content/themes/default/searchform.php
+++ b/wp-content/themes/default/searchform.php
@@ -1,5 +1,5 @@
<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
-<div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
+<div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
diff --git a/wp-content/themes/default/sidebar.php b/wp-content/themes/default/sidebar.php
index 3dc24b1..b20b5de 100644
--- a/wp-content/themes/default/sidebar.php
+++ b/wp-content/themes/default/sidebar.php
@@ -30,7 +30,7 @@
<?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
<p>You have searched the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives
- for <strong>'<?php echo wp_specialchars($s); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
+ 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>
<?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<p>You are currently browsing the <a href="<?php echo bloginfo('home'); ?>/"><?php echo bloginfo('name'); ?></a> weblog archives.</p>
diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php
index da3626b..3c14c3c 100644
--- a/wp-includes/bookmark-template.php
+++ b/wp-includes/bookmark-template.php
@@ -271,8 +271,11 @@ function _walk_bookmarks($bookmarks, $args = '' ) {
$title = $desc;
if ( $show_updated )
- if ( '00' != substr($bookmark->link_updated_f, 0, 2) )
- $title .= ' (Last updated ' . date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600)) . ')';
+ if ( '00' != substr($bookmark->link_updated_f, 0, 2) ) {
+ $title .= ' ';
+ $title .= sprintf(__('Last updated: %s'), date(get_option('links_updated_date_format'), $bookmark->link_updated_f + (get_option('gmt_offset') * 3600)));
+ $title .= ')';
+ }
if ( '' != $title )
$title = ' title="' . $title . '"';
diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index 2c7db3a..346fbb6 100644
--- a/wp-includes/category-template.php
+++ b/wp-includes/category-template.php
@@ -47,7 +47,7 @@ function get_category_parents($id, $link = FALSE, $separator = '/', $nicename =
else
$name = $parent->cat_name;
- if ( $parent->category_parent )
+ if ( $parent->category_parent && ($parent->category_parent != $parent->cat_ID) )
$chain .= get_category_parents($parent->category_parent, $link, $separator, $nicename);
if ( $link )
@@ -169,6 +169,7 @@ function wp_dropdown_categories($args = '') {
'hide_empty' => 1, 'child_of' => 0, 'exclude' => '', 'echo' => 1,
'selected' => 0, 'hierarchical' => 0, 'name' => 'cat',
'class' => 'postform');
+ $defaults['selected'] = ( is_category() ) ? get_query_var('cat') : 0;
$r = array_merge($defaults, $r);
$r['include_last_update_time'] = $r['show_last_update'];
extract($r);
diff --git a/wp-includes/category.php b/wp-includes/category.php
index 648ef4f..6ffb210 100644
--- a/wp-includes/category.php
+++ b/wp-includes/category.php
@@ -172,7 +172,7 @@ function get_category_by_path($category_path, $full_match = true, $output = OBJE
foreach ($categories as $category) {
$path = '/' . $leaf_path;
$curcategory = $category;
- while ($curcategory->category_parent != 0) {
+ while ( ($curcategory->category_parent != 0) && ($curcategory->category_parent != $curcategory->cat_ID) ) {
$curcategory = $wpdb->get_row("SELECT cat_ID, category_nicename, category_parent FROM $wpdb->categories WHERE cat_ID = '$curcategory->category_parent'");
$path = '/' . $curcategory->category_nicename . $path;
}
@@ -219,6 +219,9 @@ function &_get_cat_children($category_id, $categories) {
$category_list = array();
foreach ( $categories as $category ) {
+ if ( $category->cat_ID == $category_id )
+ continue;
+
if ( $category->category_parent == $category_id ) {
$category_list[] = $category;
if ( $children = _get_cat_children($category->cat_ID, $categories) )
diff --git a/wp-includes/classes.php b/wp-includes/classes.php
index bf6caba..3c1db01 100644
--- a/wp-includes/classes.php
+++ b/wp-includes/classes.php
@@ -25,9 +25,9 @@ class retrospam_mgr {
$cnt++;
}
}
- echo "<div class='updated'><p>$cnt comment";
- if ($cnt != 1 ) echo "s";
- echo " moved to the moderation queue.</p></div>\n";
+ echo "<div class='updated'><p> ";
+ printf(__('%d comment(s) moved to the moderation queue.'), $cnt);
+ echo "</p></div>\n";
} // End function move_spam
function find_spam() {
@@ -56,7 +56,7 @@ class retrospam_mgr {
$numfound = count($counters[found]);
$numqueue = $counters[in_queue];
- $body = '<p>' . sprintf(__('Suspected spam comments: <strong>%s</strong>'), $numfound) . '</p>';
+ $body = '<p>' . sprintf(__('Suspected spam comments: %s'), "<strong>$numfound</strong>") . '</p>';
if ( count($counters[found]) > 0 ) {
$id_list = implode( ',', $counters[found] );
@@ -696,7 +696,7 @@ class Walker_CategoryDropdown extends Walker {
if ( $category->cat_ID == $args['selected'] )
$output .= ' selected="selected"';
$output .= '>';
- $output .= $cat_name;
+ $output .= $pad.$cat_name;
if ( $args['show_count'] )
$output .= '&nbsp;&nbsp;('. $category->category_count .')';
if ( $args['show_last_update'] ) {
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 1be7f1e..0f5cc74 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -76,7 +76,7 @@ function wpautop($pee, $br = 1) {
$pee = str_replace('<WPPreserveNewline />', "\n", $pee);
}
$pee = preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee);
- $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee);
+ $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee);
$pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee);
return $pee;
@@ -1037,7 +1037,9 @@ function wp_richedit_pre($text) {
function clean_url( $url ) {
if ('' == $url) return $url;
- $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url);
+ $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $url);
+ $strip = array('%0d', '%0a');
+ $url = str_replace($strip, '', $url);
$url = str_replace(';//', '://', $url);
$url = (!strstr($url, '://')) ? 'http://'.$url : $url;
$url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 68e9427..de40712 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -320,22 +320,6 @@ function gzip_compression() {
}
}
-
-// functions to count the page generation time (from phpBB2)
-// ( or just any time between timer_start() and timer_stop() )
-
-function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
- global $timestart, $timeend;
- $mtime = microtime();
- $mtime = explode(' ',$mtime);
- $mtime = $mtime[1] + $mtime[0];
- $timeend = $mtime;
- $timetotal = $timeend-$timestart;
- if ( $display )
- echo number_format($timetotal,$precision);
- return $timetotal;
-}
-
function make_url_footnote($content) {
preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
$j = 0;
@@ -979,7 +963,7 @@ function wp_upload_bits($name, $type, $bits) {
$ifp = @ fopen($new_file, 'wb');
if ( ! $ifp )
- return array('error' => "Could not write file $new_file.");
+ return array('error' => sprintf(__('Could not write file %s'), $new_file));
$success = @ fwrite($ifp, $bits);
fclose($ifp);
@@ -1123,7 +1107,7 @@ function wp_explain_nonce($action) {
}
}
- return __('Are you sure you want to do this');
+ return __('Are you sure you want to do this?');
}
function wp_nonce_ays($action) {
diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php
index 34ed1c3..dd390aa 100644
--- a/wp-includes/general-template.php
+++ b/wp-includes/general-template.php
@@ -63,6 +63,8 @@ function bloginfo($show='') {
!strstr($show, 'home')) {
$info = apply_filters('bloginfo', $info, $show);
$info = convert_chars($info);
+ } else {
+ $info = apply_filters('bloginfo_url', $info, $show);
}
echo $info;
@@ -323,12 +325,9 @@ function wp_get_archives($args = '') {
$afterafter = $after;
foreach ( $arcresults as $arcresult ) {
$url = get_month_link($arcresult->year, $arcresult->month);
- if ( $show_post_count ) {
- $text = sprintf('%s %d', $wp_locale->get_month($arcresult->month), $arcresult->year);
+ $text = sprintf('%s %d', $wp_locale->get_month($arcresult->month), $arcresult->year);
+ if ( $show_post_count )
$after = '&nbsp;('.$arcresult->posts.')' . $afterafter;
- } else {
- $text = sprintf('%s %d', $wp_locale->get_month($arcresult->month), $arcresult->year);
- }
echo get_archives_link($url, $text, $format, $before, $after);
}
}
@@ -338,29 +337,30 @@ function wp_get_archives($args = '') {
$afterafter = $after;
foreach ($arcresults as $arcresult) {
$url = get_year_link($arcresult->year);
- if ($show_post_count) {
- $text = sprintf('%d', $arcresult->year);
+ $text = sprintf('%d', $arcresult->year);
+ if ($show_post_count)
$after = '&nbsp;('.$arcresult->posts.')' . $afterafter;
- } else {
- $text = sprintf('%d', $arcresult->year);
- }
echo get_archives_link($url, $text, $format, $before, $after);
}
}
} elseif ( 'daily' == $type ) {
- $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth` FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
+ $arcresults = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date DESC" . $limit);
if ( $arcresults ) {
+ $afterafter = $after;
foreach ( $arcresults as $arcresult ) {
$url = get_day_link($arcresult->year, $arcresult->month, $arcresult->dayofmonth);
$date = sprintf("%d-%02d-%02d 00:00:00", $arcresult->year, $arcresult->month, $arcresult->dayofmonth);
$text = mysql2date($archive_day_date_format, $date);
+ if ($show_post_count)
+ $after = '&nbsp;('.$arcresult->posts.')'.$afterafter;
echo get_archives_link($url, $text, $format, $before, $after);
}
}
} elseif ( 'weekly' == $type ) {
$start_of_week = get_option('start_of_week');
- $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC" . $limit);
+ $arcresults = $wpdb->get_results("SELECT DISTINCT WEEK(post_date, $start_of_week) AS `week`, YEAR(post_date) AS yr, DATE_FORMAT(post_date, '%Y-%m-%d') AS yyyymmdd, count(ID) as posts FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' GROUP BY WEEK(post_date, $start_of_week), YEAR(post_date) ORDER BY post_date DESC" . $limit);
$arc_w_last = '';
+ $afterafter = $after;
if ( $arcresults ) {
foreach ( $arcresults as $arcresult ) {
if ( $arcresult->week != $arc_w_last ) {
@@ -371,6 +371,8 @@ function wp_get_archives($args = '') {
$arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
$url = sprintf('%s/%s%sm%s%s%sw%s%d', get_option('home'), '', '?', '=', $arc_year, '&amp;', '=', $arcresult->week);
$text = $arc_week_start . $archive_week_separator . $arc_week_end;
+ if ($show_post_count)
+ $after = '&nbsp;('.$arcresult->posts.')'.$afterafter;
echo get_archives_link($url, $text, $format, $before, $after);
}
}
@@ -800,4 +802,9 @@ function the_editor($content, $id = 'content', $prev_id = 'title') {
<?php
}
+function the_search_query() {
+ global $s;
+ echo wp_specialchars( stripslashes($s), 1 );
+}
+
?>
diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php
index d339c7f..7acd655 100644
--- a/wp-includes/post-template.php
+++ b/wp-includes/post-template.php
@@ -330,7 +330,7 @@ function get_the_attachment_link($id = 0, $fullsize = false, $max_dims = false)
return "<a href=\"{$_post->guid}\" title=\"{$_post->post_title}\" >{$innerHTML}</a>";
} else {
- $p .= __('Missing attachment');
+ $p .= __('Missing Attachment');
}
return $p;
}
diff --git a/wp-settings.php b/wp-settings.php
index a79773a..c02e019 100644
--- a/wp-settings.php
+++ b/wp-settings.php
@@ -62,6 +62,18 @@ function timer_start() {
$timestart = $mtime;
return true;
}
+
+function timer_stop($display = 0, $precision = 3) { //if called like timer_stop(1), will echo $timetotal
+ global $timestart, $timeend;
+ $mtime = microtime();
+ $mtime = explode(' ',$mtime);
+ $mtime = $mtime[1] + $mtime[0];
+ $timeend = $mtime;
+ $timetotal = $timeend-$timestart;
+ if ( $display )
+ echo number_format($timetotal,$precision);
+ return $timetotal;
+}
timer_start();
// Change to E_ALL for development/debugging
@@ -72,7 +84,10 @@ if ( defined('WP_CACHE') )
require (ABSPATH . 'wp-content/advanced-cache.php');
define('WPINC', 'wp-includes');
-require_once (ABSPATH . WPINC . '/wp-db.php');
+if ( file_exists(ABSPATH . 'wp-content/db.php') )
+ require (ABSPATH . 'wp-content/db.php');
+else
+ require_once (ABSPATH . WPINC . '/wp-db.php');
// Table names
$wpdb->blogs = $table_prefix . 'blogs';
@@ -134,7 +149,7 @@ if ( !$db_check && (!strstr($_SERVER['PHP_SELF'], 'install.php') && !defined('WP
$link = 'install.php';
else
$link = 'wp-admin/install.php';
- die(sprintf(__("It doesn't look like you've installed WP yet. Try running <a href='%s'>install.php</a>."), $link));
+ wp_die(sprintf(__("It doesn't look like you've installed WP yet. Try running <a href='%s'>install.php</a>."), $link));
}
$wpdb->show_errors();