summaryrefslogtreecommitdiffstats
path: root/wp-includes
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-08-01 17:14:06 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-08-01 17:14:06 +0000
commit8a0f5fc158bcd43251486dff98524753fc11f74b (patch)
treef2be926c859d61f7f946bd8e7bc6ab13b5eae87b /wp-includes
parent503214a304ab0ce46df6feae4c052abcd941af98 (diff)
downloadwordpress-mu-8a0f5fc158bcd43251486dff98524753fc11f74b.tar.gz
wordpress-mu-8a0f5fc158bcd43251486dff98524753fc11f74b.tar.xz
wordpress-mu-8a0f5fc158bcd43251486dff98524753fc11f74b.zip
WP Merge
Display newest updated blogs on home page Sidebar and footer: added links to signup and main blog git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@713 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes')
-rw-r--r--wp-includes/author-template.php11
-rw-r--r--wp-includes/wp-db.php4
-rw-r--r--wp-includes/wpmu-functions.php13
3 files changed, 16 insertions, 12 deletions
diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php
index f265b3b..c52a17e 100644
--- a/wp-includes/author-template.php
+++ b/wp-includes/author-template.php
@@ -133,7 +133,7 @@ function the_author_posts_link($idmode='') {
echo '<a href="' . get_author_link(0, $authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), wp_specialchars(the_author($idmode, false))) . '">' . the_author($idmode, false) . '</a>';
}
-function get_author_link($echo = false, $author_id, $author_nicename) {
+function get_author_link($echo = false, $author_id, $author_nicename = '') {
global $wpdb, $wp_rewrite, $post, $cache_userdata;
$auth_ID = $author_id;
$link = $wp_rewrite->get_author_permastruct();
@@ -142,8 +142,11 @@ function get_author_link($echo = false, $author_id, $author_nicename) {
$file = get_settings('home') . '/';
$link = $file . '?author=' . $auth_ID;
} else {
- if ( '' == $author_nicename )
- $author_nicename = $cache_userdata[$author_id]->user_nicename;
+ if ( '' == $author_nicename ) {
+ $user = get_userdata($author_id);
+ if ( !empty($user->user_nicename) )
+ $author_nicename = $user->user_nicename;
+ }
$link = str_replace('%author%', $author_nicename, $link);
$link = get_settings('home') . trailingslashit($link);
}
@@ -230,4 +233,4 @@ function wp_list_authors($args = '') {
}
}
-?> \ No newline at end of file
+?>
diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php
index 37f361a..03b3bc0 100644
--- a/wp-includes/wp-db.php
+++ b/wp-includes/wp-db.php
@@ -100,12 +100,14 @@ class wpdb {
$EZSQL_ERROR[] =
array ('query' => $this->last_query, 'error_str' => $str);
+ $str = htmlspecialchars($str, ENT_QUOTES);
+ $query = htmlspecialchars($this->last_query, ENT_QUOTES);
// Is error output turned on or not..
if ( $this->show_errors ) {
// If there is an error then take note of it
print "<div id='error'>
<p class='wpdberror'><strong>WordPress database error:</strong> [$str]<br />
- <code>$this->last_query</code></p>
+ <code>$query</code></p>
</div>";
} else {
return false;
diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php
index b003adc..f40579d 100644
--- a/wp-includes/wpmu-functions.php
+++ b/wp-includes/wpmu-functions.php
@@ -502,13 +502,7 @@ function get_blog_status( $id, $pref ) {
function get_last_updated( $display = false ) {
global $wpdb;
- $blogs = $wpdb->get_results( "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = '$wpdb->siteid' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit 0,40", ARRAY_A );
- if( is_array( $blogs ) ) {
- while( list( $key, $details ) = each( $blogs ) ) {
- if( get_blog_status( $details[ 'blog_id' ], 'archived' ) == '1' )
- unset( $blogs[ $key ] );
- }
- }
+ $blogs = $wpdb->get_results( "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = '$wpdb->siteid' AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND last_updated != '0000-00-00 00:00:00' ORDER BY last_updated DESC limit 0,40", ARRAY_A );
return $blogs;
}
@@ -1365,4 +1359,9 @@ SITE_NAME" );
wp_mail($user->user_email, $subject, $message, $message_headers);
}
+function get_current_site() {
+ global $current_site;
+ return $current_site;
+}
+
?>