Skip to:
Content

BuddyPress.org

Changeset 3025


Ignore:
Timestamp:
06/10/2010 04:38:18 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Fixes #2431 props r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-blogs/bp-blogs-classes.php

    r2826 r3025  
    162162        // Show logged in users their hidden blogs.
    163163        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, 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.blog_id", $user_id ) );
    165165        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, 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.blog_id", $user_id ) );
    167167
    168168        $total_blog_count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
    169169
    170170        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->id;
     173            $user_blogs[$blog->blog_id]->blog_id = $blog->blog_id;
     174            $user_blogs[$blog->blog_id]->siteurl = ( is_ssl() ) ? 'https://' . $blog->domain . $blog->path : 'http://' . $blog->domain . $blog->path;
     175            $user_blogs[$blog->blog_id]->name = $blog->name;
    175176        }
    176177
Note: See TracChangeset for help on using the changeset viewer.