Ticket #2431: 2431.patch
File 2431.patch, 2.7 KB (added by , 15 years ago) |
---|
-
bp-blogs-classes.php
161 161 162 162 // Show logged in users their hidden blogs. 163 163 if ( !bp_is_my_profile() && !$show_hidden ) 164 $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b. id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.id", $user_id ) );164 $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.blog_id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.id", $user_id ) ); 165 165 else 166 $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b. id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.id", $user_id ) );166 $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.blog_id, bm1.meta_value as name, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND bm1.meta_key = 'name' AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND b.user_id = %d ORDER BY b.id", $user_id ) ); 167 167 168 168 $total_blog_count = BP_Blogs_Blog::total_blog_count_for_user( $user_id ); 169 169 170 170 foreach ( (array)$blogs as $blog ) { 171 $user_blogs[$blog-> id] = new stdClass;172 $user_blogs[$blog-> id]->id = $blog->id;173 $user_blogs[$blog-> id]->siteurl = ( is_ssl() ) ? 'https://' . $blog->domain . $blog->path : 'http://' . $blog->domain . $blog->path;174 $user_blogs[$blog-> id]->name = $blog->name;171 $user_blogs[$blog->blog_id] = new stdClass; 172 $user_blogs[$blog->blog_id]->id = $blog->blog_id; 173 $user_blogs[$blog->blog_id]->siteurl = ( is_ssl() ) ? 'https://' . $blog->domain . $blog->path : 'http://' . $blog->domain . $blog->path; 174 $user_blogs[$blog->blog_id]->name = $blog->name; 175 175 } 176 176 177 177 return array( 'blogs' => $user_blogs, 'count' => $total_blog_count );