Skip to:
Content

BuddyPress.org

Changeset 373 for trunk/bp-blogs.php


Ignore:
Timestamp:
10/07/2008 07:16:51 AM (18 years ago)
Author:
apeatling
Message:

Bug fixes:

  • Fixed group avatar upload issues
  • Fixed validation on group name/desc/news
  • Fixed support for https://
  • Base support for upcoming home theme and widgets
  • Re-factored JS and CSS inclusion with wp_enqueue_script/styles
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r371 r373  
    33
    44define ( 'BP_BLOGS_IS_INSTALLED', 1 );
    5 define ( 'BP_BLOGS_VERSION', '0.1.1' );
     5define ( 'BP_BLOGS_VERSION', '0.1.2' );
    66
    77/* These will be moved into admin configurable settings */
     
    1010
    1111include_once( 'bp-blogs/bp-blogs-classes.php' );
     12include_once( 'bp-blogs/bp-blogs-cssjs.php' );
     13include_once( 'bp-blogs/bp-blogs-templatetags.php' );
     14include_once( 'bp-blogs/bp-blogs-widgets.php' );
    1215//include_once( 'bp-blogs/bp-blogs-ajax.php' );
    13 include_once( 'bp-blogs/bp-blogs-cssjs.php' );
    14 /*include_once( 'bp-blogs/bp-blogs-admin.php' );*/
    15 include_once( 'bp-blogs/bp-blogs-templatetags.php' );
    16 
     16//include_once( 'bp-blogs/bp-blogs-admin.php' );
    1717
    1818/**************************************************************************
     
    105105                'table_name_blog_comments' => $wpdb->base_prefix . 'bp_user_blogs_comments',
    106106                'format_activity_function' => 'bp_blogs_format_activity',
    107                 'image_base' => get_option('siteurl') . '/wp-content/mu-plugins/bp-groups/images',
     107                'image_base' => site_url() . '/wp-content/mu-plugins/bp-groups/images',
    108108                'slug'           => 'blogs'
    109109        );
     
    455455
    456456function bp_blogs_register_existing_content( $blog_id ) {
    457         global $wpdb, $bp;
     457        global $bp, $current_blog;
    458458       
    459459        if ( !$bp ) {
     
    470470                                bp_blogs_record_blog( (int)$blog->userblog_id, (int)$user_id );
    471471
    472                                 $wpdb->set_blog_id( $blog->userblog_id );
     472                                switch_to_blog( $blog->userblog_id );
    473473                                $posts_for_blog = bp_core_get_all_posts_for_user( $user_id );
    474474                       
     
    479479                }
    480480        }       
     481       
     482        switch_to_blog( $current_blog->blog_id );
    481483}
    482484add_action( 'bp_homebase_signup_completed', 'bp_blogs_register_existing_content', 10 );
    483485
     486function bp_blogs_get_latest_posts( $blog_id = null, $limit = 5 ) {
     487        global $bp;
     488       
     489        if ( !is_numeric( $limit ) )
     490                $limit = 5;
     491       
     492        return BP_Blogs_Post::get_latest_posts( $blog_id, $limit );
     493}
     494
    484495
    485496?>
Note: See TracChangeset for help on using the changeset viewer.