Skip to:
Content

BuddyPress.org

Changeset 2770


Ignore:
Timestamp:
02/22/2010 05:04:45 PM (15 years ago)
Author:
apeatling
Message:

Merging 1.2 branch with trunk

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r2761 r2770  
    677677}
    678678
     679/* DEPRECATED - scheduled for removal. Please use the activity stream with a 'new_blog_post' filter. */
    679680function bp_blogs_get_posts_for_user( $user_id ) {
    680681    return BP_Blogs_Post::get_posts_for_user( $user_id );
    681682}
    682683
     684/* DEPRECATED - scheduled for removal. Please use the activity stream with a 'new_blog_comment' filter. */
    683685function bp_blogs_get_comments_for_user( $user_id ) {
    684686    return BP_Blogs_Comment::get_comments_for_user( $user_id );
  • trunk/bp-blogs/bp-blogs-classes.php

    r2761 r2770  
    102102        if ( !empty( $search_terms ) ) {
    103103            $filter = like_escape( $wpdb->escape( $search_terms ) );
    104             $paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name, bm3.meta_value as description FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$bp->blogs->table_name_blogmeta} bm3, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND b.blog_id = bm3.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm3.meta_key = 'description' AND ( bm2.meta_value LIKE '%%$filter%%' || bm3.meta_value LIKE '%%$filter%%' ) {$user_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
     104            $paged_blogs = $wpdb->get_results( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm2.meta_value LIKE '%%$filter%%' {$user_sql} GROUP BY b.blog_id {$order_sql} {$pag_sql}" );
    105105            $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND bm.blog_id = b.blog_id AND bm2.blog_id = b.blog_id AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'name' AND bm2.meta_key = 'description' AND ( bm.meta_value LIKE '%%$filter%%' || bm2.meta_value LIKE '%%$filter%%' ) {$user_sql}" );
    106106        } else {
    107             $paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name, bm3.meta_value as description FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$bp->blogs->table_name_blogmeta} bm3, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id AND b.blog_id = bm3.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' AND bm3.meta_key = 'description' GROUP BY b.blog_id {$order_sql} {$pag_sql}" ) );
     107            $paged_blogs = $wpdb->get_results( $wpdb->prepare( "SELECT b.blog_id, b.user_id as admin_user_id, u.user_email as admin_user_email, wb.domain, wb.path, bm.meta_value as last_activity, bm2.meta_value as name FROM {$bp->blogs->table_name} b, {$bp->blogs->table_name_blogmeta} bm, {$bp->blogs->table_name_blogmeta} bm2, {$wpdb->base_prefix}blogs wb, {$wpdb->users} u WHERE b.blog_id = wb.blog_id AND b.user_id = u.ID AND b.blog_id = bm.blog_id AND b.blog_id = bm2.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql} AND bm.meta_key = 'last_activity' AND bm2.meta_key = 'name' GROUP BY b.blog_id {$order_sql} {$pag_sql}" ) );
    108108            $total_blogs = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb WHERE b.blog_id = wb.blog_id {$user_sql} AND wb.archived = '0' AND wb.spam = 0 AND wb.mature = 0 AND wb.deleted = 0 {$hidden_sql}" ) );
    109109        }
     
    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, bm2.meta_value as description, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND b.blog_id = bm2.blog_id AND bm1.meta_key = 'name' AND bm2.meta_key = 'description' 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.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 ) );
    165165        else
    166             $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT b.id, bm1.meta_value as name, bm2.meta_value as description, wb.domain, wb.path FROM {$bp->blogs->table_name} b, {$wpdb->base_prefix}blogs wb, {$bp->blogs->table_name_blogmeta} bm1, {$bp->blogs->table_name_blogmeta} bm2 WHERE b.blog_id = wb.blog_id AND b.blog_id = bm1.blog_id AND b.blog_id = bm2.blog_id AND bm1.meta_key = 'name' AND bm2.meta_key = 'description' 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.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 ) );
    167167
    168168        $total_blog_count = BP_Blogs_Blog::total_blog_count_for_user( $user_id );
     
    173173            $user_blogs[$blog->id]->siteurl = ( is_ssl() ) ? 'https://' . $blog->domain . $blog->path : 'http://' . $blog->domain . $blog->path;
    174174            $user_blogs[$blog->id]->name = $blog->name;
    175             $user_blogs[$blog->id]->description = $blog->description;
    176175        }
    177176
     
    291290        }
    292291
     292        /* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */
     293        $blog_descs = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, meta_value as description FROM {$bp->blogs->table_name_blogmeta} WHERE meta_key = 'description' blog_id IN ( {$blog_ids} )" ) );
     294
     295        for ( $i = 0; $i < count( $paged_blogs ); $i++ ) {
     296            foreach ( (array)$blog_descs as $desc ) {
     297                if ( $desc->blog_id == $paged_blogs[$i]->blog_id )
     298                    $paged_blogs[$i]->description = $desc->description;
     299            }
     300        }
     301
    293302        return $paged_blogs;
    294303    }
     
    307316}
    308317
     318/* DEPRECATED - Post DB recording is scheduled for removal. Please use the activity stream to fetch a user's posts. */
    309319Class BP_Blogs_Post {
    310320    var $id;
     
    514524}
    515525
     526/* DEPRECATED - Comment DB recording is scheduled for removal. Please use the activity stream to fetch a user's comments. */
    516527Class BP_Blogs_Comment {
    517528    var $id;
  • trunk/bp-core/bp-core-adminbar.php

    r2695 r2770  
    9292    $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
    9393
    94     echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url(site_url()) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
     94    echo '<li' . $alt . '><a id="bp-admin-logout" class="logout" href="' . wp_logout_url( site_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
    9595    echo '</ul>';
    9696    echo '</li>';
     
    120120        foreach ( (array)$blogs['blogs'] as $blog ) {
    121121            $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
     122            $site_url = esc_attr( $blog->siteurl );
    122123
    123124            echo '<li' . $alt . '>';
    124             echo '<a href="' . esc_attr( $blog->siteurl ) . '">' . esc_html( $blog->name ) . '</a>';
     125            echo '<a href="' . $site_url . '">' . esc_html( $blog->name ) . '</a>';
    125126
    126127            echo '<ul>';
    127             echo '<li class="alt"><a href="' . esc_attr( $blog->siteurl ) . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
    128             echo '<li><a href="' . esc_attr( $blog->siteurl ) . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
    129             echo '<li class="alt"><a href="' . esc_attr( $blog->siteurl ) . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
    130             echo '<li><a href="' . esc_attr( $blog->siteurl ) . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
     128            echo '<li class="alt"><a href="' . $site_url . 'wp-admin/">' . __( 'Dashboard', 'buddypress' ) . '</a></li>';
     129            echo '<li><a href="' . $site_url . 'wp-admin/post-new.php">' . __( 'New Post', 'buddypress' ) . '</a></li>';
     130            echo '<li class="alt"><a href="' . $site_url . 'wp-admin/edit.php">' . __( 'Manage Posts', 'buddypress' ) . '</a></li>';
     131            echo '<li><a href="' . $site_url . 'wp-admin/edit-comments.php">' . __( 'Manage Comments', 'buddypress' ) . '</a></li>';
    131132            echo '</ul>';
    132133
  • trunk/bp-forums/bp-forums-filters.php

    r2659 r2770  
    2929add_filter( 'bp_get_the_topic_title', 'stripslashes_deep' );
    3030add_filter( 'bp_get_the_topic_latest_post_excerpt', 'stripslashes_deep' );
     31add_filter( 'bp_get_the_topic_poster_name', 'stripslashes_deep' );
     32add_filter( 'bp_get_the_topic_last_poster_name', 'stripslashes_deep' );
    3133
    3234add_filter( 'bp_get_the_topic_post_content', 'make_clickable' );
     
    3537add_filter( 'bp_get_forum_topic_count', 'bp_core_number_format' );
    3638
     39add_filter( 'bp_get_the_topic_title', 'bp_forums_make_nofollow_filter' );
     40add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_make_nofollow_filter' );
     41add_filter( 'bp_get_the_topic_post_content', 'bp_forums_make_nofollow_filter' );
    3742
    3843function bp_forums_filter_kses( $content ) {
     
    7075add_filter( 'bb_get_tag_link', 'bp_forums_filter_tag_link', 10, 4);
    7176
     77function bp_forums_make_nofollow_filter( $text ) {
     78    return preg_replace_callback( '|<a (.+?)>|i', 'bp_forums_make_nofollow_filter_callback', $text );
     79}
     80    function bp_forums_make_nofollow_filter_callback( $matches ) {
     81        $text = $matches[1];
     82        $text = str_replace( array( ' rel="nofollow"', " rel='nofollow'"), '', $text );
     83        return "<a $text rel=\"nofollow\">";
     84    }
     85
    7286?>
  • trunk/bp-groups/bp-groups-classes.php

    r2761 r2770  
    11371137            if ( $this->enable_nav_item ) {
    11381138                if ( $bp->current_component == $bp->groups->slug && $bp->is_single_item )
    1139                     bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ) . '/', 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
     1139                    bp_core_new_subnav_item( array( 'name' => ( !$this->nav_item_name ) ? $this->name : $this->nav_item_name, 'slug' => $this->slug, 'parent_slug' => BP_GROUPS_SLUG, 'parent_url' => bp_get_group_permalink( $bp->groups->current_group ), 'position' => $this->nav_item_position, 'item_css_id' => 'nav-' . $this->slug, 'screen_function' => array( &$this, '_display_hook' ), 'user_has_access' => $this->enable_nav_item ) );
    11401140
    11411141                /* When we are viewing the extension display page, set the title and options title */
  • trunk/bp-groups/bp-groups-filters.php

    r2663 r2770  
    2929add_filter( 'bp_get_group_description_excerpt', 'stripslashes' );
    3030add_filter( 'bp_get_group_name', 'stripslashes' );
     31add_filter( 'bp_get_group_member_name', 'stripslashes' );
     32add_filter( 'bp_get_group_member_link', 'stripslashes' );
    3133
    3234add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' );
  • trunk/bp-groups/bp-groups-templatetags.php

    r2702 r2770  
    192192function bp_group_is_visible( $group = false ) {
    193193    global $bp, $groups_template;
     194
     195    if ( $bp->loggedin_user->is_site_admin )
     196        return true;
    194197
    195198    if ( !$group )
  • trunk/bp-themes/bp-default/groups/create.php

    r2662 r2770  
    2424                    <?php do_action( 'bp_before_group_details_creation_step' ); ?>
    2525
    26                     <label for="group-name"><?php _e('* Group Name', 'buddypress') ?> <? _e( '(required)', 'buddypress' )?></label>
     26                    <label for="group-name"><?php _e('* Group Name', 'buddypress') ?> <?php _e( '(required)', 'buddypress' )?></label>
    2727                    <input type="text" name="group-name" id="group-name" value="<?php bp_new_group_name() ?>" />
    2828
    29                     <label for="group-desc"><?php _e('* Group Description', 'buddypress') ?> <? _e( '(required)', 'buddypress' )?></label>
     29                    <label for="group-desc"><?php _e('* Group Description', 'buddypress') ?> <?php _e( '(required)', 'buddypress' )?></label>
    3030                    <textarea name="group-desc" id="group-desc"><?php bp_new_group_description() ?></textarea>
    3131
  • trunk/bp-xprofile.php

    r2761 r2770  
    7272    ) {$charset_collate};";
    7373
    74     if ( empty( $bp->site_options['bp-xprofile-db-version'] ) ) {
     74    if ( '' == get_site_option( 'bp-xprofile-db-version' ) ) {
    7575        if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_groups} WHERE id = 1" ) )
    7676            $sql[] = "INSERT INTO {$bp->profile->table_name_groups} VALUES ( 1, '" . get_site_option( 'bp-xprofile-base-group-name' ) . "', '', 0 );";
Note: See TracChangeset for help on using the changeset viewer.