Changeset 2770
- Timestamp:
- 02/22/2010 05:04:45 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs.php
r2761 r2770 677 677 } 678 678 679 /* DEPRECATED - scheduled for removal. Please use the activity stream with a 'new_blog_post' filter. */ 679 680 function bp_blogs_get_posts_for_user( $user_id ) { 680 681 return BP_Blogs_Post::get_posts_for_user( $user_id ); 681 682 } 682 683 684 /* DEPRECATED - scheduled for removal. Please use the activity stream with a 'new_blog_comment' filter. */ 683 685 function bp_blogs_get_comments_for_user( $user_id ) { 684 686 return BP_Blogs_Comment::get_comments_for_user( $user_id ); -
trunk/bp-blogs/bp-blogs-classes.php
r2761 r2770 102 102 if ( !empty( $search_terms ) ) { 103 103 $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}" ); 105 105 $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}" ); 106 106 } 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}" ) ); 108 108 $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}" ) ); 109 109 } … … 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, 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 ) ); 165 165 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 ) ); 167 167 168 168 $total_blog_count = BP_Blogs_Blog::total_blog_count_for_user( $user_id ); … … 173 173 $user_blogs[$blog->id]->siteurl = ( is_ssl() ) ? 'https://' . $blog->domain . $blog->path : 'http://' . $blog->domain . $blog->path; 174 174 $user_blogs[$blog->id]->name = $blog->name; 175 $user_blogs[$blog->id]->description = $blog->description;176 175 } 177 176 … … 291 290 } 292 291 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 293 302 return $paged_blogs; 294 303 } … … 307 316 } 308 317 318 /* DEPRECATED - Post DB recording is scheduled for removal. Please use the activity stream to fetch a user's posts. */ 309 319 Class BP_Blogs_Post { 310 320 var $id; … … 514 524 } 515 525 526 /* DEPRECATED - Comment DB recording is scheduled for removal. Please use the activity stream to fetch a user's comments. */ 516 527 Class BP_Blogs_Comment { 517 528 var $id; -
trunk/bp-core/bp-core-adminbar.php
r2695 r2770 92 92 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; 93 93 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>'; 95 95 echo '</ul>'; 96 96 echo '</li>'; … … 120 120 foreach ( (array)$blogs['blogs'] as $blog ) { 121 121 $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; 122 $site_url = esc_attr( $blog->siteurl ); 122 123 123 124 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>'; 125 126 126 127 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>'; 131 132 echo '</ul>'; 132 133 -
trunk/bp-forums/bp-forums-filters.php
r2659 r2770 29 29 add_filter( 'bp_get_the_topic_title', 'stripslashes_deep' ); 30 30 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'stripslashes_deep' ); 31 add_filter( 'bp_get_the_topic_poster_name', 'stripslashes_deep' ); 32 add_filter( 'bp_get_the_topic_last_poster_name', 'stripslashes_deep' ); 31 33 32 34 add_filter( 'bp_get_the_topic_post_content', 'make_clickable' ); … … 35 37 add_filter( 'bp_get_forum_topic_count', 'bp_core_number_format' ); 36 38 39 add_filter( 'bp_get_the_topic_title', 'bp_forums_make_nofollow_filter' ); 40 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_make_nofollow_filter' ); 41 add_filter( 'bp_get_the_topic_post_content', 'bp_forums_make_nofollow_filter' ); 37 42 38 43 function bp_forums_filter_kses( $content ) { … … 70 75 add_filter( 'bb_get_tag_link', 'bp_forums_filter_tag_link', 10, 4); 71 76 77 function 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 72 86 ?> -
trunk/bp-groups/bp-groups-classes.php
r2761 r2770 1137 1137 if ( $this->enable_nav_item ) { 1138 1138 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 ) ); 1140 1140 1141 1141 /* When we are viewing the extension display page, set the title and options title */ -
trunk/bp-groups/bp-groups-filters.php
r2663 r2770 29 29 add_filter( 'bp_get_group_description_excerpt', 'stripslashes' ); 30 30 add_filter( 'bp_get_group_name', 'stripslashes' ); 31 add_filter( 'bp_get_group_member_name', 'stripslashes' ); 32 add_filter( 'bp_get_group_member_link', 'stripslashes' ); 31 33 32 34 add_filter( 'groups_new_group_forum_desc', 'bp_create_excerpt' ); -
trunk/bp-groups/bp-groups-templatetags.php
r2702 r2770 192 192 function bp_group_is_visible( $group = false ) { 193 193 global $bp, $groups_template; 194 195 if ( $bp->loggedin_user->is_site_admin ) 196 return true; 194 197 195 198 if ( !$group ) -
trunk/bp-themes/bp-default/groups/create.php
r2662 r2770 24 24 <?php do_action( 'bp_before_group_details_creation_step' ); ?> 25 25 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> 27 27 <input type="text" name="group-name" id="group-name" value="<?php bp_new_group_name() ?>" /> 28 28 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> 30 30 <textarea name="group-desc" id="group-desc"><?php bp_new_group_description() ?></textarea> 31 31 -
trunk/bp-xprofile.php
r2761 r2770 72 72 ) {$charset_collate};"; 73 73 74 if ( empty( $bp->site_options['bp-xprofile-db-version']) ) {74 if ( '' == get_site_option( 'bp-xprofile-db-version' ) ) { 75 75 if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_groups} WHERE id = 1" ) ) 76 76 $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.