Skip to:
Content

BuddyPress.org

Changeset 2755


Ignore:
Timestamp:
02/21/2010 10:27:20 PM (17 years ago)
Author:
apeatling
Message:

Fixing bug where private blogs would not be recorded on activation and displayed on a logged in user's blog list.

File:
1 edited

Legend:

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

    r2747 r2755  
    11<?php
    22
    3 define ( 'BP_BLOGS_DB_VERSION', '2000' );
     3define ( 'BP_BLOGS_DB_VERSION', '2015' );
    44
    55/* Define the slug for the component */
    … …  
    5353
    5454        $sql[] = "CREATE TABLE {$bp->blogs->table_name_blogmeta} (
    55                         id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
    56                         blog_id bigint(20) NOT NULL,
    57                         meta_key varchar(255) DEFAULT NULL,
    58                         meta_value longtext DEFAULT NULL,
    59                         KEY blog_id (blog_id),
    60                         KEY meta_key (meta_key)
    61                    ) {$charset_collate};";
     55                                id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,
     56                                blog_id bigint(20) NOT NULL,
     57                                meta_key varchar(255) DEFAULT NULL,
     58                                meta_value longtext DEFAULT NULL,
     59                                KEY blog_id (blog_id),
     60                                KEY meta_key (meta_key)
     61                     ) {$charset_collate};";
    6262
    6363
    … …  
    333333
    334334function bp_blogs_record_existing_blogs() {
    335         global $wpdb;
    336 
    337         $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE public = 1 AND mature = 0 AND spam = 0 AND deleted = 0" ) );
     335        global $bp, $wpdb;
     336
     337        /* Truncate user blogs table and re-record. */
     338        $wpdb->query( "TRUNCATE TABLE {$bp->blogs->table_name}" );
     339
     340        $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" ) );
    338341
    339342        if ( $blog_ids ) {
    … …  
    361364        $name = get_blog_option( $blog_id, 'blogname' );
    362365        $description = get_blog_option( $blog_id, 'blogdescription' );
     366
     367        if ( empty( $name ) )
     368                return false;
    363369
    364370        $recorded_blog = new BP_Blogs_Blog;
Note: See TracChangeset for help on using the changeset viewer.