Changeset 2925
- Timestamp:
- 04/15/2010 11:59:40 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-activity/bp-activity-notifications.php
r2719 r2925 13 13 14 14 foreach( (array)$usernames as $username ) { 15 if ( !$receiver_user_id = bp_core_get_userid( $username) )15 if ( !$receiver_user_id = bp_core_get_userid( $username ) ) 16 16 continue; 17 17 18 18 // Now email the user with the contents of the message (if they have enabled email notifications) 19 if ( 'no' != get_usermeta( $ user_id, 'notification_activity_new_mention' ) ) {19 if ( 'no' != get_usermeta( $receiver_user_id, 'notification_activity_new_mention' ) ) { 20 20 $poster_name = bp_core_get_user_displayname( $poster_user_id ); 21 21 -
trunk/bp-blogs.php
r2863 r2925 340 340 bp_blogs_remove_post( $post_id, $blog_id ); 341 341 342 bp_blogs_update_blogmeta( $blog_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) ); 343 342 344 do_action( 'bp_blogs_new_blog_post', $post_id, $post, $user_id ); 343 345 } … … 348 350 349 351 $comment = get_comment($comment_id); 352 353 if ( !$is_approved ) 354 return false; 355 350 356 $comment->post = get_post( $comment->comment_post_ID ); 351 357 … … 380 386 } 381 387 388 bp_blogs_update_blogmeta( $blog_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) ); 389 382 390 return $recorded_comment; 383 391 } -
trunk/bp-core.php
r2919 r2925 460 460 } 461 461 462 do_action( 'bp_core_action_ set_spammer_status', $errors );462 do_action( 'bp_core_action_delete_user', $errors ); 463 463 464 464 if ( $errors ) … … 494 494 'search_terms' => false, // Limit to users that match these search terms 495 495 496 'include' => false, // Pass comma separated list of user_ids to limit to only these users 496 497 'per_page' => 20, // The number of results to return per page 497 498 'page' => 1, // The page to return if limiting per page … … 502 503 extract( $params, EXTR_SKIP ); 503 504 504 return apply_filters( 'bp_core_get_users', BP_Core_User::get_users( $type, $per_page, $page, $user_id, $ search_terms, $populate_extras ), &$params );505 return apply_filters( 'bp_core_get_users', BP_Core_User::get_users( $type, $per_page, $page, $user_id, $include, $search_terms, $populate_extras ), &$params ); 505 506 } 506 507 … … 914 915 global $wpdb; 915 916 916 if ( !empty( $username ) ) 917 return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ) ); 917 if ( empty( $username ) ) 918 return false; 919 920 return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ) ); 918 921 } 919 922 … … 937 940 return apply_filters( 'bp_core_get_userid_from_nicename', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_nicename = %s", $user_nicename ) ) ); 938 941 } 939 940 942 941 943 /** … … 1430 1432 return $number; 1431 1433 1432 return apply_filters( 'bp_core_ bp_core_number_format', number_format( $number, $decimals ), $number, $decimals );1434 return apply_filters( 'bp_core_number_format', number_format( $number, $decimals ), $number, $decimals ); 1433 1435 } 1434 1436 … … 1477 1479 unset( $site_path[2] ); 1478 1480 1479 $site_path = '/' . implode( '/', $site_path ) . '/'; 1481 if ( !count( $site_path ) ) 1482 $site_path = '/'; 1483 else 1484 $site_path = '/' . implode( '/', $site_path ) . '/'; 1480 1485 } 1481 1486 } … … 1483 1488 return apply_filters( 'bp_core_get_site_path', $site_path ); 1484 1489 } 1485 1486 1490 /** 1487 1491 * bp_core_get_site_options() … … 1606 1610 * @package BuddyPress Core 1607 1611 * @global $bp The global BuddyPress settings variable created in bp_core_setup_globals() 1608 * @uses check_admin_referer() Checks for a valid security nonce.1609 1612 * @uses is_site_admin() Checks to see if the user is a site administrator. 1610 * @uses wpmu_delete_user() Deletes a user from the system. 1613 * @uses wpmu_delete_user() Deletes a user from the system on multisite installs. 1614 * @uses wp_delete_user() Deletes a user from the system on singlesite installs. 1615 * @uses get_site_option Checks if account deletion is allowed 1611 1616 */ 1612 1617 function bp_core_delete_account( $user_id = false ) { … … 1620 1625 return false; 1621 1626 1622 /* Site admins should not be allowed to be deleted */ 1623 if ( bp_core_is_multisite() && is_site_admin( bp_core_get_username( $user_id ) ) ) 1624 return false; 1625 1626 if ( bp_core_is_multisite() && function_exists('wpmu_delete_user') ) { 1627 /* Specifically handle multi-site environment */ 1628 if ( bp_core_is_multisite() ) { 1629 /* Site admins cannot be deleted */ 1630 if ( is_site_admin( bp_core_get_username( $user_id ) ) ) 1631 return false; 1632 1627 1633 require_once( ABSPATH . '/wp-admin/includes/mu.php' ); 1628 1634 require_once( ABSPATH . '/wp-admin/includes/user.php' ); … … 1631 1637 } 1632 1638 1639 /* Single site user deletion */ 1633 1640 require_once( ABSPATH . '/wp-admin/includes/user.php' ); 1634 1641 return wp_delete_user( $user_id ); … … 1741 1748 ?> 1742 1749 1743 <!-- Generated in <?php timer_stop(1); ?> seconds. (<?php echo get_num_queries(); ?> q)-->1750 <!-- Generated in <?php timer_stop(1); ?> seconds. --> 1744 1751 1745 1752 <?php … … 1812 1819 $user = get_userdatabylogin( $username ); 1813 1820 1814 if ( ( int)$user->spam)1821 if ( ( bp_core_is_multisite() && (int)$user->spam ) || 1 == (int)$user->user_status ) 1815 1822 bp_core_redirect( $bp->root_domain ); 1816 1823 else -
trunk/bp-core/bp-core-avatars.php
r2729 r2925 155 155 } 156 156 157 if ( is_ssl() ) 158 $host = 'https://secure.gravatar.com/avatar/'; 159 else 160 $host = 'http://www.gravatar.com/avatar/'; 161 157 162 $email = apply_filters( 'bp_core_gravatar_email', $email, $item_id, $object ); 158 $gravatar = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/') . md5( $email ) . '?d=' . $default_grav . '&s=' . $grav_size;163 $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( $email ) . '?d=' . $default_grav . '&s=' . $grav_size; 159 164 160 165 return apply_filters( 'bp_core_fetch_avatar', "<img src='{$gravatar}' alt='{$alt}' class='{$class}'{$css_id}{$html_width}{$html_height} />", $params ); … … 389 394 if ( !$path = get_option( 'upload_path' ) ) 390 395 $path = WP_CONTENT_DIR . '/uploads'; 396 else 397 $path = ABSPATH . $path; 391 398 } 392 399 -
trunk/bp-core/bp-core-classes.php
r2920 r2925 107 107 /* Static Functions */ 108 108 109 function get_users( $type, $limit = null, $page = 1, $user_id = false, $ search_terms = false, $populate_extras = true ) {109 function get_users( $type, $limit = null, $page = 1, $user_id = false, $include = false, $search_terms = false, $populate_extras = true ) { 110 110 global $wpdb, $bp; 111 111 … … 137 137 138 138 if ( 'online' == $type ) 139 $sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= NOW()";139 $sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= UTC_TIMESTAMP()"; 140 140 141 141 if ( 'alphabetical' == $type ) 142 142 $sql['where_alpha'] = "AND pd.field_id = 1"; 143 143 144 if ( $user_id && bp_is_active( 'friends' ) ) { 144 if ( $include ) { 145 if ( is_array( $include ) ) 146 $uids = $wpdb->escape( implode( ',', (array)$include ) ); 147 else 148 $uids = $wpdb->escape( $include ); 149 150 if ( !empty( $uids ) ) 151 $sql['where_users'] = "AND u.ID IN ({$uids})"; 152 } 153 154 else if ( $user_id && function_exists( 'friends_install' ) ) { 145 155 $friend_ids = friends_get_friend_user_ids( $user_id ); 146 156 $friend_ids = $wpdb->escape( implode( ',', (array)$friend_ids ) ); … … 254 264 } 255 265 256 function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) {257 global $wpdb, $bp;258 259 if ( $limit && $page )260 $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );261 262 $user_sql = " AND user_id IN ( " . $wpdb->escape( $user_ids ) . " ) ";263 $status_sql = bp_core_get_status_sql();264 265 $total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT ID) FROM " . CUSTOM_USER_TABLE . " WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) " ), $wpdb->escape( $user_ids ) );266 $paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', $wpdb->prepare( "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM " . CUSTOM_USER_TABLE . " WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}" ), $wpdb->escape( $user_ids ) );267 268 $total_users = $wpdb->get_var( $total_users_sql );269 $paged_users = $wpdb->get_results( $paged_users_sql );270 271 /***272 * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.273 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)274 */275 276 /* Add additional data to the returned results */277 if ( $populate_extras )278 $paged_users = BP_Core_User::get_user_extras( &$paged_users, &$user_ids );279 280 281 return array( 'users' => $paged_users, 'total' => $total_users );282 }283 284 266 function search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true ) { 285 267 global $wpdb, $bp; … … 321 303 /* Fetch the user's full name */ 322 304 if ( bp_is_active( 'xprofile' ) && 'alphabetical' != $type ) { 305 /* Ensure xprofile globals are set */ 306 if ( !defined( 'BP_XPROFILE_FULLNAME_FIELD_NAME' ) ) 307 xprofile_setup_globals(); 308 323 309 $names = $wpdb->get_results( $wpdb->prepare( "SELECT pd.user_id as id, pd.value as fullname FROM {$bp->profile->table_name_fields} pf, {$bp->profile->table_name_data} pd WHERE pf.id = pd.field_id AND pf.name = %s AND pd.user_id IN ( {$user_ids} )", BP_XPROFILE_FULLNAME_FIELD_NAME ) ); 324 310 for ( $i = 0; $i < count( $paged_users ); $i++ ) { -
trunk/bp-core/bp-core-signup.php
r2909 r2925 361 361 * Now generate an activation key and send an email to the user so they can activate their account 362 362 * and validate their email address. Multisite installs send their own email, so this is only for single blog installs. 363 * 364 * To disable sending activation emails you can user the filter 'bp_core_signup_send_activation_key' and return false. 363 365 */ 364 if ( !bp_core_is_multisite() ) { 365 $activation_key = wp_hash( $user_id ); 366 update_usermeta( $user_id, 'activation_key', $activation_key ); 367 bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key ); 366 if ( apply_filters( 'bp_core_signup_send_activation_key', true ) ) { 367 if ( !bp_core_is_multisite() ) { 368 $activation_key = wp_hash( $user_id ); 369 update_usermeta( $user_id, 'activation_key', $activation_key ); 370 bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key ); 371 } 368 372 } 369 373 -
trunk/bp-core/bp-core-templatetags.php
r2920 r2925 27 27 if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] ) { 28 28 $this->members = BP_Core_User::get_users_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page, $populate_extras ); 29 } 30 else if ( false !== $include ) { 31 $this->members = BP_Core_User::get_specific_users( $include, $this->pag_num, $this->pag_page, $populate_extras ); 32 } 33 else { 34 $this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras ) ); 29 } else { 30 $this->members = bp_core_get_users( array( 'type' => $this->type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'include' => $include, 'search_terms' => $search_terms, 'populate_extras' => $populate_extras ) ); 35 31 } 36 32 … … 159 155 } 160 156 157 /* Make sure we return no members if we looking at friendship requests and there are none. */ 158 if ( empty( $include ) && $bp->friends->slug == $bp->current_component && 'requests' == $bp->current_action ) 159 return false; 160 161 161 $members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras ); 162 163 return $members_template->has_members(); 162 return apply_filters( 'bp_has_members', $members_template->has_members(), &$members_template ); 164 163 } 165 164 -
trunk/bp-core/bp-core-wpabstraction.php
r2842 r2925 69 69 70 70 if ( !function_exists( 'is_site_admin' ) ) { 71 function is_site_admin( ) {71 function is_site_admin( $user_id = false ) { 72 72 if ( current_user_can( 'manage_options' ) ) 73 73 return true; -
trunk/bp-forums.php
r2919 r2925 441 441 $post_position = $post->post_position; 442 442 443 $post = bb_insert_post( array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'post_text' => stripslashes( trim( $post_text ) ), 'post_time' => $post_time, 'poster_id' => $poster_id, 'poster_ip' => $poster_ip, 'post_status' => $post_status, 'post_position' => $post_position ) );444 445 if ( $post )443 $post_id = bb_insert_post( array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'post_text' => stripslashes( trim( $post_text ) ), 'post_time' => $post_time, 'poster_id' => $poster_id, 'poster_ip' => $poster_ip, 'post_status' => $post_status, 'post_position' => $post_position ) ); 444 445 if ( $post_id ) 446 446 do_action( 'bp_forums_new_post', $post_id ); 447 447 448 return $post ;448 return $post_id; 449 449 } 450 450 -
trunk/bp-friends.php
r2863 r2925 595 595 global $bp; 596 596 597 if ( isset( $_GET['new']) )598 bp_core_delete_notifications_for_user_by_type( $bp-> displayed_user->id, $bp->friends->id, 'friendship_accepted' );597 if ( isset( $_GET['new'] ) ) 598 bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_accepted' ); 599 599 } 600 600 add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' ); -
trunk/bp-groups.php
r2919 r2925 492 492 493 493 if ( $bp->is_single_item ) { 494 /* Refresh the group member count meta */ 495 groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) ); 496 494 497 do_action( 'groups_screen_group_members', $bp->groups->current_group->id ); 495 498 bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) ); … … 1650 1653 } 1651 1654 1655 function groups_get_total_member_count( $group_id ) { 1656 return BP_Groups_Group::get_total_member_count( $group_id ); 1657 } 1658 1652 1659 /*** Group Fetching, Filtering & Searching *************************************/ 1653 1660 -
trunk/bp-groups/bp-groups-classes.php
r2919 r2925 498 498 return $wpdb->get_var( "SELECT COUNT(t.topic_id) FROM {$bbdb->topics} AS t, {$bp->groups->table_name} AS g LEFT JOIN {$bp->groups->table_name_groupmeta} AS gm ON g.id = gm.group_id WHERE (gm.meta_key = 'forum_id' AND gm.meta_value = t.forum_id) AND g.status = 'public' AND t.topic_status = '0' AND t.topic_sticky != '2' {$extra_sql} " ); 499 499 } 500 501 function get_total_member_count( $group_id ) { 502 global $wpdb, $bp; 503 504 return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 AND is_banned = 0", $group_id ) ); 505 } 500 506 } 501 507 -
trunk/bp-loader.php
r2863 r2925 7 7 Version: 1.3-bleeding 8 8 Author URI: http://buddypress.org/developers/ 9 Site Wide Only: true9 Network: true 10 10 */ 11 11 -
trunk/bp-messages/bp-messages-notifications.php
r2719 r2925 34 34 ', 'buddypress' ), $sender_name, $subject, $content, $message_link ); 35 35 36 $ content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );36 $email_content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 37 37 38 38 /* Send the message */ -
trunk/bp-themes/bp-default/_inc/global.js
r2842 r2925 1 1 // AJAX Functions 2 var j = jQuery;2 var jq = jQuery; 3 3 4 4 // Global variable to prevent multiple AJAX requests 5 5 var bp_ajax_request = null; 6 6 7 j (document).ready( function() {7 jq(document).ready( function() { 8 8 /**** Page Load Actions *******************************************************/ 9 9 10 10 /* Hide Forums Post Form */ 11 if ( j ('div.forums').length )12 j ('div#new-topic-post').hide();11 if ( jq('div.forums').length ) 12 jq('div#new-topic-post').hide(); 13 13 14 14 /* Activity filter and scope set */ … … 20 20 21 21 /* @mention Compose Scrolling */ 22 if ( j .query.get('r') ) {23 if ( j ('textarea#whats-new').length ) {24 j .scrollTo( j('textarea#whats-new'), 500, { offset:-125, easing:'easeout' } );25 j ('textarea#whats-new').focus();22 if ( jq.query.get('r') ) { 23 if ( jq('textarea#whats-new').length ) { 24 jq.scrollTo( jq('textarea#whats-new'), 500, { offset:-125, easing:'easeout' } ); 25 jq('textarea#whats-new').focus(); 26 26 } 27 27 } 28 28 29 29 /* @mention username help button display */ 30 if ( j ( 'span.highlight span' ).length )31 j ( 'span.highlight span' ).toggle();30 if ( jq( 'span.highlight span' ).length ) 31 jq( 'span.highlight span' ).toggle(); 32 32 33 33 /**** Activity Posting ********************************************************/ 34 34 35 35 /* New posts */ 36 j ("input#aw-whats-new-submit").click( function() {37 var button = j (this);36 jq("input#aw-whats-new-submit").click( function() { 37 var button = jq(this); 38 38 var form = button.parent().parent().parent().parent(); 39 39 40 40 form.children().each( function() { 41 if ( j .nodeName(this, "textarea") || j.nodeName(this, "input") )42 j (this).attr( 'disabled', 'disabled' );43 }); 44 45 j ( 'form#' + form.attr('id') + ' span.ajax-loader' ).show();41 if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") ) 42 jq(this).attr( 'disabled', 'disabled' ); 43 }); 44 45 jq( 'form#' + form.attr('id') + ' span.ajax-loader' ).show(); 46 46 47 47 /* Remove any errors */ 48 j ('div.error').remove();48 jq('div.error').remove(); 49 49 button.attr('disabled','disabled'); 50 50 51 51 /* Default POST values */ 52 52 var object = ''; 53 var item_id = j ("#whats-new-post-in").val();54 var content = j ("textarea#whats-new").val();53 var item_id = jq("#whats-new-post-in").val(); 54 var content = jq("textarea#whats-new").val(); 55 55 56 56 /* Set object for non-profile posts */ 57 57 if ( item_id > 0 ) { 58 object = j ("#whats-new-post-object").val();59 } 60 61 j .post( ajaxurl, {58 object = jq("#whats-new-post-object").val(); 59 } 60 61 jq.post( ajaxurl, { 62 62 action: 'post_update', 63 63 'cookie': encodeURIComponent(document.cookie), 64 '_wpnonce_post_update': j ("input#_wpnonce_post_update").val(),64 '_wpnonce_post_update': jq("input#_wpnonce_post_update").val(), 65 65 'content': content, 66 66 'object': object, … … 69 69 function(response) 70 70 { 71 j ( 'form#' + form.attr('id') + ' span.ajax-loader' ).hide();71 jq( 'form#' + form.attr('id') + ' span.ajax-loader' ).hide(); 72 72 73 73 form.children().each( function() { 74 if ( j .nodeName(this, "textarea") || j.nodeName(this, "input") )75 j (this).attr( 'disabled', '' );74 if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") ) 75 jq(this).attr( 'disabled', '' ); 76 76 }); 77 77 … … 79 79 if ( response[0] + response[1] == '-1' ) { 80 80 form.prepend( response.substr( 2, response.length ) ); 81 j ( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );81 jq( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 ); 82 82 button.attr("disabled", ''); 83 83 } else { 84 if ( 0 == j ("ul.activity-list").length ) {85 j ("div.error").slideUp(100).remove();86 j ("div#message").slideUp(100).remove();87 j ("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );84 if ( 0 == jq("ul.activity-list").length ) { 85 jq("div.error").slideUp(100).remove(); 86 jq("div#message").slideUp(100).remove(); 87 jq("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' ); 88 88 } 89 89 90 j ("ul.activity-list").prepend(response);91 j ("ul.activity-list li:first").addClass('new-update');92 j ("li.new-update").hide().slideDown( 300 );93 j ("li.new-update").removeClass( 'new-update' );94 j ("textarea#whats-new").val('');90 jq("ul.activity-list").prepend(response); 91 jq("ul.activity-list li:first").addClass('new-update'); 92 jq("li.new-update").hide().slideDown( 300 ); 93 jq("li.new-update").removeClass( 'new-update' ); 94 jq("textarea#whats-new").val(''); 95 95 96 96 /* Re-enable the submit button after 8 seconds. */ … … 103 103 104 104 /* List tabs event delegation */ 105 j ('div.activity-type-tabs').click( function(event) {106 var target = j (event.target).parent();105 jq('div.activity-type-tabs').click( function(event) { 106 var target = jq(event.target).parent(); 107 107 108 108 if ( event.target.nodeName == 'STRONG' || event.target.nodeName == 'SPAN' ) … … 112 112 113 113 /* Reset the page */ 114 j .cookie( 'bp-activity-oldestpage', 1, {path: '/'} );114 jq.cookie( 'bp-activity-oldestpage', 1, {path: '/'} ); 115 115 116 116 /* Activity Stream Tabs */ 117 117 var scope = target.attr('id').substr( 9, target.attr('id').length ); 118 var filter = j ("#activity-filter-select select").val();118 var filter = jq("#activity-filter-select select").val(); 119 119 120 120 if ( scope == 'mentions' ) 121 j ( 'li#' + target.attr('id') + ' a strong' ).remove();121 jq( 'li#' + target.attr('id') + ' a strong' ).remove(); 122 122 123 123 bp_activity_request(scope, filter, target); … … 127 127 128 128 /* Activity filter select */ 129 j ('#activity-filter-select select').change( function() {130 var selected_tab = j ( 'div.activity-type-tabs li.selected' );129 jq('#activity-filter-select select').change( function() { 130 var selected_tab = jq( 'div.activity-type-tabs li.selected' ); 131 131 132 132 if ( !selected_tab.length ) … … 135 135 var scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length ); 136 136 137 var filter = j (this).val();137 var filter = jq(this).val(); 138 138 139 139 bp_activity_request(scope, filter); … … 143 143 144 144 /* Stream event delegation */ 145 j ('div.activity').click( function(event) {146 var target = j (event.target);145 jq('div.activity').click( function(event) { 146 var target = jq(event.target); 147 147 148 148 /* Favoriting activity stream items */ … … 154 154 target.addClass('loading'); 155 155 156 j .post( ajaxurl, {156 jq.post( ajaxurl, { 157 157 action: 'activity_mark_' + type, 158 158 'cookie': encodeURIComponent(document.cookie), … … 163 163 164 164 target.fadeOut( 100, function() { 165 j (this).html(response);166 j (this).fadeIn(100);165 jq(this).html(response); 166 jq(this).fadeIn(100); 167 167 }); 168 168 169 169 if ( 'fav' == type ) { 170 if ( !j ('div.item-list-tabs li#activity-favorites').length )171 j ('div.item-list-tabs ul li#activity-mentions').before( '<li id="activity-favorites"><a href="#">' + bp_terms_my_favs + ' (<span>0</span>)</a></li>');170 if ( !jq('div.item-list-tabs li#activity-favorites').length ) 171 jq('div.item-list-tabs ul li#activity-mentions').before( '<li id="activity-favorites"><a href="#">' + bp_terms_my_favs + ' (<span>0</span>)</a></li>'); 172 172 173 173 target.removeClass('fav'); 174 174 target.addClass('unfav'); 175 175 176 j ('div.item-list-tabs ul li#activity-favorites span').html( Number( j('div.item-list-tabs ul li#activity-favorites span').html() ) + 1 );176 jq('div.item-list-tabs ul li#activity-favorites span').html( Number( jq('div.item-list-tabs ul li#activity-favorites span').html() ) + 1 ); 177 177 } else { 178 178 target.removeClass('unfav'); 179 179 target.addClass('fav'); 180 180 181 j ('div.item-list-tabs ul li#activity-favorites span').html( Number( j('div.item-list-tabs ul li#activity-favorites span').html() ) - 1 );182 183 if ( !Number( j ('div.item-list-tabs ul li#activity-favorites span').html() ) ) {184 if ( j ('div.item-list-tabs ul li#activity-favorites').hasClass('selected') )181 jq('div.item-list-tabs ul li#activity-favorites span').html( Number( jq('div.item-list-tabs ul li#activity-favorites span').html() ) - 1 ); 182 183 if ( !Number( jq('div.item-list-tabs ul li#activity-favorites span').html() ) ) { 184 if ( jq('div.item-list-tabs ul li#activity-favorites').hasClass('selected') ) 185 185 bp_activity_request( null, null ); 186 186 187 j ('div.item-list-tabs ul li#activity-favorites').remove();187 jq('div.item-list-tabs ul li#activity-favorites').remove(); 188 188 } 189 189 } 190 190 191 if ( 'activity-favorites' == j ( 'div.item-list-tabs li.selected').attr('id') )191 if ( 'activity-favorites' == jq( 'div.item-list-tabs li.selected').attr('id') ) 192 192 target.parent().parent().parent().slideUp(100); 193 193 }); … … 207 207 target.addClass('loading'); 208 208 209 j .post( ajaxurl, {209 jq.post( ajaxurl, { 210 210 action: 'delete_activity', 211 211 'cookie': encodeURIComponent(document.cookie), … … 229 229 /* Load more updates at the end of the page */ 230 230 if ( target.parent().attr('class') == 'load-more' ) { 231 j ("li.load-more").addClass('loading');232 233 if ( null == j .cookie('bp-activity-oldestpage') )234 j .cookie('bp-activity-oldestpage', 1, {path: '/'} );235 236 var oldest_page = ( j .cookie('bp-activity-oldestpage') * 1 ) + 1;237 238 j .post( ajaxurl, {231 jq("li.load-more").addClass('loading'); 232 233 if ( null == jq.cookie('bp-activity-oldestpage') ) 234 jq.cookie('bp-activity-oldestpage', 1, {path: '/'} ); 235 236 var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1; 237 238 jq.post( ajaxurl, { 239 239 action: 'activity_get_older_updates', 240 240 'cookie': encodeURIComponent(document.cookie), … … 243 243 function(response) 244 244 { 245 j ("li.load-more").removeClass('loading');246 j .cookie( 'bp-activity-oldestpage', oldest_page, {path: '/'} );247 j ("ul.activity-list").append(response.contents);245 jq("li.load-more").removeClass('loading'); 246 jq.cookie( 'bp-activity-oldestpage', oldest_page, {path: '/'} ); 247 jq("ul.activity-list").append(response.contents); 248 248 249 249 target.parent().hide(); … … 257 257 258 258 /* Hide all activity comment forms */ 259 j ('form.ac-form').hide();259 jq('form.ac-form').hide(); 260 260 261 261 /* Hide excess comments */ 262 if ( j ('div.activity-comments').length )262 if ( jq('div.activity-comments').length ) 263 263 bp_dtheme_hide_comments(); 264 264 265 265 /* Activity list event delegation */ 266 j ('div.activity').click( function(event) {267 var target = j (event.target);266 jq('div.activity').click( function(event) { 267 var target = jq(event.target); 268 268 269 269 /* Comment / comment reply links */ … … 277 277 var a_id = ids[2] 278 278 var c_id = target.attr('href').substr( 10, target.attr('href').length ); 279 var form = j ( '#ac-form-' + a_id );280 281 var form = j ( '#ac-form-' + ids[2] );279 var form = jq( '#ac-form-' + a_id ); 280 281 var form = jq( '#ac-form-' + ids[2] ); 282 282 283 283 form.css( 'display', 'none' ); 284 284 form.removeClass('root'); 285 j ('.ac-form').hide();285 jq('.ac-form').hide(); 286 286 287 287 /* Hide any error messages */ 288 288 form.children('div').each( function() { 289 if ( j (this).hasClass( 'error' ) )290 j (this).hide();289 if ( jq(this).hasClass( 'error' ) ) 290 jq(this).hide(); 291 291 }); 292 292 293 293 if ( ids[1] != 'comment' ) { 294 j ('div.activity-comments li#acomment-' + c_id).append( form );294 jq('div.activity-comments li#acomment-' + c_id).append( form ); 295 295 } else { 296 j ('li#activity-' + a_id + ' div.activity-comments').append( form );296 jq('li#activity-' + a_id + ' div.activity-comments').append( form ); 297 297 } 298 298 … … 301 301 302 302 form.slideDown( 200 ); 303 j .scrollTo( form, 500, { offset:-100, easing:'easeout' } );304 j ('#ac-form-' + ids[2] + ' textarea').focus();303 jq.scrollTo( form, 500, { offset:-100, easing:'easeout' } ); 304 jq('#ac-form-' + ids[2] + ' textarea').focus(); 305 305 306 306 return false; … … 321 321 322 322 /* Hide any error messages */ 323 j ( 'form#' + form + ' div.error').hide();323 jq( 'form#' + form + ' div.error').hide(); 324 324 form.addClass('loading'); 325 325 target.css('disabled', 'disabled'); 326 326 327 j .post( ajaxurl, {327 jq.post( ajaxurl, { 328 328 action: 'new_activity_comment', 329 329 'cookie': encodeURIComponent(document.cookie), 330 '_wpnonce_new_activity_comment': j ("input#_wpnonce_new_activity_comment").val(),330 '_wpnonce_new_activity_comment': jq("input#_wpnonce_new_activity_comment").val(), 331 331 'comment_id': comment_id, 332 332 'form_id': form_id[2], 333 'content': j ('form#' + form.attr('id') + ' textarea').val()333 'content': jq('form#' + form.attr('id') + ' textarea').val() 334 334 }, 335 335 function(response) … … 356 356 } 357 357 ); 358 j ( 'form#' + form + ' textarea').val('');358 jq( 'form#' + form + ' textarea').val(''); 359 359 360 360 /* Increase the "Reply (X)" button count */ 361 j ('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( j('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 );361 jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 ); 362 362 363 363 /* Re-enable the submit button after 5 seconds. */ … … 385 385 386 386 /* Remove any error messages */ 387 j ('div.activity-comments ul div.error').remove();387 jq('div.activity-comments ul div.error').remove(); 388 388 389 389 /* Reset the form position */ 390 390 comment_li.parents('div.activity-comments').append(form); 391 391 392 j .post( ajaxurl, {392 jq.post( ajaxurl, { 393 393 action: 'delete_activity_comment', 394 394 'cookie': encodeURIComponent(document.cookie), … … 402 402 comment_li.prepend( response.substr( 2, response.length ) ).hide().fadeIn( 200 ); 403 403 } else { 404 var children = j ( 'li#' + comment_li.attr('id') + ' ul' ).children('li');404 var children = jq( 'li#' + comment_li.attr('id') + ' ul' ).children('li'); 405 405 var child_count = 0; 406 j (children).each( function() {407 if ( !j (this).is(':hidden') )406 jq(children).each( function() { 407 if ( !jq(this).is(':hidden') ) 408 408 child_count++; 409 409 }); … … 412 412 /* Decrease the "Reply (X)" button count */ 413 413 var parent_li = comment_li.parents('ul#activity-stream > li'); 414 j ('li#' + parent_li.attr('id') + ' a.acomment-reply span').html( j('li#' + parent_li.attr('id') + ' a.acomment-reply span').html() - ( 1 + child_count ) );414 jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html( jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html() - ( 1 + child_count ) ); 415 415 } 416 416 }); … … 434 434 435 435 /* Escape Key Press for cancelling comment forms */ 436 j (document).keydown( function(e) {436 jq(document).keydown( function(e) { 437 437 e = e || window.event; 438 438 if (e.target) … … 451 451 if ( keyCode == 27 ) { 452 452 if (element.tagName == 'TEXTAREA') { 453 if ( j (element).attr('class') == 'ac-input' )454 j (element).parent().parent().parent().slideUp( 200 );453 if ( jq(element).attr('class') == 'ac-input' ) 454 jq(element).parent().parent().parent().slideUp( 200 ); 455 455 } 456 456 } … … 459 459 /**** @mention username help tooltip **************************************/ 460 460 461 j ('span.highlight span').click( function() {462 if ( !j ('div.help').length ) {463 j (this).parent().after( '<div id="message" class="info help"><p>' + bp_terms_mention_explain + '</p></div>' );464 j ('div.help').hide().slideDown(200);461 jq('span.highlight span').click( function() { 462 if ( !jq('div.help').length ) { 463 jq(this).parent().after( '<div id="message" class="info help"><p>' + bp_terms_mention_explain + '</p></div>' ); 464 jq('div.help').hide().slideDown(200); 465 465 } else { 466 j ('div.help').hide().remove();466 jq('div.help').hide().remove(); 467 467 } 468 468 }) … … 471 471 472 472 /* The search form on all directory pages */ 473 j ('div.dir-search').click( function(event) {474 if ( j (this).hasClass('no-ajax') )473 jq('div.dir-search').click( function(event) { 474 if ( jq(this).hasClass('no-ajax') ) 475 475 return; 476 476 477 var target = j (event.target);477 var target = jq(event.target); 478 478 479 479 if ( target.attr('type') == 'submit' ) { 480 var css_id = j ('div.item-list-tabs li.selected').attr('id').split( '-' );480 var css_id = jq('div.item-list-tabs li.selected').attr('id').split( '-' ); 481 481 var object = css_id[0]; 482 482 483 bp_filter_request( object, j .cookie('bp-' + object + '-filter'), j.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, j.cookie('bp-' + object + '-extras') );483 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, jq.cookie('bp-' + object + '-extras') ); 484 484 485 485 return false; … … 490 490 491 491 /* When a navigation tab is clicked - e.g. | All Groups | My Groups | */ 492 j ('div.item-list-tabs').click( function(event) {493 if ( j (this).hasClass('no-ajax') )492 jq('div.item-list-tabs').click( function(event) { 493 if ( jq(this).hasClass('no-ajax') ) 494 494 return; 495 495 496 var target = j (event.target).parent();496 var target = jq(event.target).parent(); 497 497 498 498 if ( 'LI' == event.target.parentNode.nodeName && !target.hasClass('last') ) { … … 504 504 505 505 var scope = css_id[1]; 506 var filter = j ("#" + object + "-order-select select").val();507 var search_terms = j ("#" + object + "_search").val();508 509 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, j .cookie('bp-' + object + '-extras') );506 var filter = jq("#" + object + "-order-select select").val(); 507 var search_terms = jq("#" + object + "_search").val(); 508 509 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') ); 510 510 511 511 return false; … … 514 514 515 515 /* When the filter select box is changed re-query */ 516 j ('li.filter select').change( function() {517 if ( j ('div.item-list-tabs li.selected').length )518 var el = j ('div.item-list-tabs li.selected');516 jq('li.filter select').change( function() { 517 if ( jq('div.item-list-tabs li.selected').length ) 518 var el = jq('div.item-list-tabs li.selected'); 519 519 else 520 var el = j (this);520 var el = jq(this); 521 521 522 522 var css_id = el.attr('id').split('-'); 523 523 var object = css_id[0]; 524 524 var scope = css_id[1]; 525 var filter = j (this).val();525 var filter = jq(this).val(); 526 526 var search_terms = false; 527 527 528 if ( j ('div.dir-search input').length )529 search_terms = j ('div.dir-search input').val();528 if ( jq('div.dir-search input').length ) 529 search_terms = jq('div.dir-search input').val(); 530 530 531 531 if ( 'friends' == object ) 532 532 object = 'members'; 533 533 534 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, j .cookie('bp-' + object + '-extras') );534 bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') ); 535 535 536 536 return false; … … 538 538 539 539 /* All pagination links run through this function */ 540 j ('div#content').click( function(event) {541 var target = j (event.target);540 jq('div#content').click( function(event) { 541 var target = jq(event.target); 542 542 543 543 if ( target.hasClass('button') ) … … 548 548 return false; 549 549 550 if ( j ('div.item-list-tabs li.selected').length )551 var el = j ('div.item-list-tabs li.selected');550 if ( jq('div.item-list-tabs li.selected').length ) 551 var el = jq('div.item-list-tabs li.selected'); 552 552 else 553 var el = j ('li.filter select');553 var el = jq('li.filter select'); 554 554 555 555 var page_number = 1; … … 558 558 var search_terms = false; 559 559 560 if ( j ('div.dir-search input').length )561 search_terms = j ('div.dir-search input').val();562 563 if ( j (target).hasClass('next') )564 var page_number = Number( j ('div.pagination span.current').html() ) + 1;565 else if ( j (target).hasClass('prev') )566 var page_number = Number( j ('div.pagination span.current').html() ) - 1;560 if ( jq('div.dir-search input').length ) 561 search_terms = jq('div.dir-search input').val(); 562 563 if ( jq(target).hasClass('next') ) 564 var page_number = Number( jq('div.pagination span.current').html() ) + 1; 565 else if ( jq(target).hasClass('prev') ) 566 var page_number = Number( jq('div.pagination span.current').html() ) - 1; 567 567 else 568 var page_number = Number( j (target).html() );569 570 bp_filter_request( object, j .cookie('bp-' + object + '-filter'), j.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, j.cookie('bp-' + object + '-extras') );568 var page_number = Number( jq(target).html() ); 569 570 bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, jq.cookie('bp-' + object + '-extras') ); 571 571 572 572 return false; … … 578 578 579 579 /* Hit the "New Topic" button on the forums directory page */ 580 j ('a#new-topic-button').click( function() {581 if ( !j ('div#new-topic-post').length )582 return false; 583 584 if ( j ('div#new-topic-post').is(":visible") )585 j ('div#new-topic-post').slideUp(200);580 jq('a#new-topic-button').click( function() { 581 if ( !jq('div#new-topic-post').length ) 582 return false; 583 584 if ( jq('div#new-topic-post').is(":visible") ) 585 jq('div#new-topic-post').slideUp(200); 586 586 else 587 j ('div#new-topic-post').slideDown(200);587 jq('div#new-topic-post').slideDown(200); 588 588 589 589 return false; … … 591 591 592 592 /* Cancel the posting of a new forum topic */ 593 j ('input#submit_topic_cancel').click( function() {594 if ( !j ('div#new-topic-post').length )595 return false; 596 597 j ('div#new-topic-post').slideUp(200);593 jq('input#submit_topic_cancel').click( function() { 594 if ( !jq('div#new-topic-post').length ) 595 return false; 596 597 jq('div#new-topic-post').slideUp(200); 598 598 return false; 599 599 }); 600 600 601 601 /* Clicking a forum tag */ 602 j ('div#forum-directory-tags a').click( function() {603 bp_filter_request( 'forums', 'tags', j .cookie('bp-forums-scope'), 'div.forums', j(this).html().replace( / /g, '-' ), 1, j.cookie('bp-forums-extras') );602 jq('div#forum-directory-tags a').click( function() { 603 bp_filter_request( 'forums', 'tags', jq.cookie('bp-forums-scope'), 'div.forums', jq(this).html().replace( / /g, '-' ), 1, jq.cookie('bp-forums-extras') ); 604 604 return false; 605 605 }); … … 608 608 609 609 /* Select a user from the list of friends and add them to the invite list */ 610 j ("div#invite-list input").click( function() {611 j ('.ajax-loader').toggle();612 613 var friend_id = j (this).val();614 615 if ( j (this).attr('checked') == true )610 jq("div#invite-list input").click( function() { 611 jq('.ajax-loader').toggle(); 612 613 var friend_id = jq(this).val(); 614 615 if ( jq(this).attr('checked') == true ) 616 616 var friend_action = 'invite'; 617 617 else 618 618 var friend_action = 'uninvite'; 619 619 620 j ('div.item-list-tabs li.selected').addClass('loading');621 622 j .post( ajaxurl, {620 jq('div.item-list-tabs li.selected').addClass('loading'); 621 622 jq.post( ajaxurl, { 623 623 action: 'groups_invite_user', 624 624 'friend_action': friend_action, 625 625 'cookie': encodeURIComponent(document.cookie), 626 '_wpnonce': j ("input#_wpnonce_invite_uninvite_user").val(),626 '_wpnonce': jq("input#_wpnonce_invite_uninvite_user").val(), 627 627 'friend_id': friend_id, 628 'group_id': j ("input#group_id").val()628 'group_id': jq("input#group_id").val() 629 629 }, 630 630 function(response) 631 631 { 632 if ( j ("#message") )633 j ("#message").hide();634 635 j ('.ajax-loader').toggle();632 if ( jq("#message") ) 633 jq("#message").hide(); 634 635 jq('.ajax-loader').toggle(); 636 636 637 637 if ( friend_action == 'invite' ) { 638 j ('#friend-list').append(response);638 jq('#friend-list').append(response); 639 639 } else if ( friend_action == 'uninvite' ) { 640 j ('#friend-list li#uid-' + friend_id).remove();641 } 642 643 j ('div.item-list-tabs li.selected').removeClass('loading');640 jq('#friend-list li#uid-' + friend_id).remove(); 641 } 642 643 jq('div.item-list-tabs li.selected').removeClass('loading'); 644 644 }); 645 645 }); 646 646 647 647 /* Remove a user from the list of users to invite to a group */ 648 j ("#friend-list li a.remove").live('click', function() {649 j ('.ajax-loader').toggle();650 651 var friend_id = j (this).attr('id');648 jq("#friend-list li a.remove").live('click', function() { 649 jq('.ajax-loader').toggle(); 650 651 var friend_id = jq(this).attr('id'); 652 652 friend_id = friend_id.split('-'); 653 653 friend_id = friend_id[1]; 654 654 655 j .post( ajaxurl, {655 jq.post( ajaxurl, { 656 656 action: 'groups_invite_user', 657 657 'friend_action': 'uninvite', 658 658 'cookie': encodeURIComponent(document.cookie), 659 '_wpnonce': j ("input#_wpnonce_invite_uninvite_user").val(),659 '_wpnonce': jq("input#_wpnonce_invite_uninvite_user").val(), 660 660 'friend_id': friend_id, 661 'group_id': j ("input#group_id").val()661 'group_id': jq("input#group_id").val() 662 662 }, 663 663 function(response) 664 664 { 665 j ('.ajax-loader').toggle();666 j ('#friend-list li#uid-' + friend_id).remove();667 j ('#invite-list input#f-' + friend_id).attr('checked', false);665 jq('.ajax-loader').toggle(); 666 jq('#friend-list li#uid-' + friend_id).remove(); 667 jq('#invite-list input#f-' + friend_id).attr('checked', false); 668 668 }); 669 669 … … 674 674 675 675 /* Accept and Reject friendship request buttons */ 676 j ("ul#friend-list a.accept, ul#friend-list a.reject").click( function() {677 var button = j (this);678 var li = j (this).parents('ul#friend-list li');679 var action_div = j (this).parents('li div.action');676 jq("ul#friend-list a.accept, ul#friend-list a.reject").click( function() { 677 var button = jq(this); 678 var li = jq(this).parents('ul#friend-list li'); 679 var action_div = jq(this).parents('li div.action'); 680 680 681 681 var id = li.attr('id').substr( 11, li.attr('id').length ); … … 685 685 nonce = nonce[1]; 686 686 687 if ( j (this).hasClass('accepted') || j(this).hasClass('rejected') )688 return false; 689 690 if ( j (this).hasClass('accept') ) {687 if ( jq(this).hasClass('accepted') || jq(this).hasClass('rejected') ) 688 return false; 689 690 if ( jq(this).hasClass('accept') ) { 691 691 var action = 'accept_friendship'; 692 692 action_div.children('a.reject').css( 'visibility', 'hidden' ); … … 698 698 button.addClass('loading'); 699 699 700 j .post( ajaxurl, {700 jq.post( ajaxurl, { 701 701 action: action, 702 702 'cookie': encodeURIComponent(document.cookie), … … 712 712 } else { 713 713 button.fadeOut( 100, function() { 714 if ( j (this).hasClass('accept') ) {715 j (this).html( bp_terms_accepted ).fadeIn(50);716 j (this).addClass('accepted');714 if ( jq(this).hasClass('accept') ) { 715 jq(this).html( bp_terms_accepted ).fadeIn(50); 716 jq(this).addClass('accepted'); 717 717 } else { 718 j (this).html( bp_terms_rejected ).fadeIn(50);719 j (this).addClass('rejected');718 jq(this).html( bp_terms_rejected ).fadeIn(50); 719 jq(this).addClass('rejected'); 720 720 } 721 721 }); … … 727 727 728 728 /* Add / Remove friendship buttons */ 729 j ("div.friendship-button a").live('click', function() {730 j (this).parent().addClass('loading');731 var fid = j (this).attr('id');729 jq("div.friendship-button a").live('click', function() { 730 jq(this).parent().addClass('loading'); 731 var fid = jq(this).attr('id'); 732 732 fid = fid.split('-'); 733 733 fid = fid[1]; 734 734 735 var nonce = j (this).attr('href');735 var nonce = jq(this).attr('href'); 736 736 nonce = nonce.split('?_wpnonce='); 737 737 nonce = nonce[1].split('&'); 738 738 nonce = nonce[0]; 739 739 740 var thelink = j (this);741 742 j .post( ajaxurl, {740 var thelink = jq(this); 741 742 jq.post( ajaxurl, { 743 743 action: 'addremove_friend', 744 744 'cookie': encodeURIComponent(document.cookie), … … 752 752 753 753 if ( action == 'add' ) { 754 j (parentdiv).fadeOut(200,754 jq(parentdiv).fadeOut(200, 755 755 function() { 756 756 parentdiv.removeClass('add_friend'); … … 762 762 763 763 } else if ( action == 'remove' ) { 764 j (parentdiv).fadeOut(200,764 jq(parentdiv).fadeOut(200, 765 765 function() { 766 766 parentdiv.removeClass('remove_friend'); … … 777 777 /** Group Join / Leave Buttons **************************************/ 778 778 779 j ("div.group-button a").live('click', function() {780 var gid = j (this).parent().attr('id');779 jq("div.group-button a").live('click', function() { 780 var gid = jq(this).parent().attr('id'); 781 781 gid = gid.split('-'); 782 782 gid = gid[1]; 783 783 784 var nonce = j (this).attr('href');784 var nonce = jq(this).attr('href'); 785 785 nonce = nonce.split('?_wpnonce='); 786 786 nonce = nonce[1].split('&'); 787 787 nonce = nonce[0]; 788 788 789 var thelink = j (this);790 791 j .post( ajaxurl, {789 var thelink = jq(this); 790 791 jq.post( ajaxurl, { 792 792 action: 'joinleave_group', 793 793 'cookie': encodeURIComponent(document.cookie), … … 799 799 var parentdiv = thelink.parent(); 800 800 801 if ( !j ('body.directory').length )801 if ( !jq('body.directory').length ) 802 802 location.href = location.href; 803 803 else { 804 j (parentdiv).fadeOut(200,804 jq(parentdiv).fadeOut(200, 805 805 function() { 806 806 parentdiv.fadeIn(200).html(response); … … 814 814 /** Button disabling ************************************************/ 815 815 816 j ('div.pending').click(function() {816 jq('div.pending').click(function() { 817 817 return false; 818 818 }); … … 820 820 /** Alternate Highlighting ******************************************/ 821 821 822 j ('table tr, div.message-box, ul#topic-post-list li').each( function(i) {822 jq('table tr, div.message-box, ul#topic-post-list li').each( function(i) { 823 823 if ( i % 2 != 1 ) 824 j (this).addClass('alt');824 jq(this).addClass('alt'); 825 825 }); 826 826 … … 828 828 829 829 /* AJAX send reply functionality */ 830 j ("input#send_reply_button").click(830 jq("input#send_reply_button").click( 831 831 function() { 832 j ('form#send-reply span.ajax-loader').toggle();833 834 j .post( ajaxurl, {832 jq('form#send-reply span.ajax-loader').toggle(); 833 834 jq.post( ajaxurl, { 835 835 action: 'messages_send_reply', 836 836 'cookie': encodeURIComponent(document.cookie), 837 '_wpnonce': j ("input#send_message_nonce").val(),838 839 'content': j ("#message_content").val(),840 'send_to': j ("input#send_to").val(),841 'subject': j ("input#subject").val(),842 'thread_id': j ("input#thread_id").val()837 '_wpnonce': jq("input#send_message_nonce").val(), 838 839 'content': jq("#message_content").val(), 840 'send_to': jq("input#send_to").val(), 841 'subject': jq("input#subject").val(), 842 'thread_id': jq("input#thread_id").val() 843 843 }, 844 844 function(response) 845 845 { 846 846 if ( response[0] + response[1] == "-1" ) { 847 j ('form#send-reply').prepend( response.substr( 2, response.length ) );847 jq('form#send-reply').prepend( response.substr( 2, response.length ) ); 848 848 } else { 849 j ('form#send-reply div#message').remove();850 j ("#message_content").val('');851 j ('form#send-reply').before( response );852 853 j ("div.new-message").hide().slideDown( 200, function() {854 j ('div.new-message').removeClass('new-message');849 jq('form#send-reply div#message').remove(); 850 jq("#message_content").val(''); 851 jq('form#send-reply').before( response ); 852 853 jq("div.new-message").hide().slideDown( 200, function() { 854 jq('div.new-message').removeClass('new-message'); 855 855 }); 856 856 857 j ('div.message-box').each( function(i) {858 j (this).removeClass('alt');857 jq('div.message-box').each( function(i) { 858 jq(this).removeClass('alt'); 859 859 if ( i % 2 != 1 ) 860 j (this).addClass('alt');860 jq(this).addClass('alt'); 861 861 }); 862 862 } 863 j ('form#send-reply span.ajax-loader').toggle();863 jq('form#send-reply span.ajax-loader').toggle(); 864 864 }); 865 865 … … 869 869 870 870 /* Marking private messages as read and unread */ 871 j ("a#mark_as_read, a#mark_as_unread").click(function() {871 jq("a#mark_as_read, a#mark_as_unread").click(function() { 872 872 var checkboxes_tosend = ''; 873 var checkboxes = j ("#message-threads tr td input[type='checkbox']");874 875 if ( 'mark_as_unread' == j (this).attr('id') ) {873 var checkboxes = jq("#message-threads tr td input[type='checkbox']"); 874 875 if ( 'mark_as_unread' == jq(this).attr('id') ) { 876 876 var currentClass = 'read' 877 877 var newClass = 'unread' … … 890 890 891 891 checkboxes.each( function(i) { 892 if(j (this).is(':checked')) {893 if ( j ('tr#m-' + j(this).attr('value')).hasClass(currentClass) ) {894 checkboxes_tosend += j (this).attr('value');895 j ('tr#m-' + j(this).attr('value')).removeClass(currentClass);896 j ('tr#m-' + j(this).attr('value')).addClass(newClass);897 var thread_count = j ('tr#m-' + j(this).attr('value') + ' td span.unread-count').html();898 899 j ('tr#m-' + j(this).attr('value') + ' td span.unread-count').html(unreadCount);900 j ('tr#m-' + j(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay);901 var inboxcount = j ('a#user-messages strong').html().substr( 1, j('a#user-messages strong').html().length );892 if(jq(this).is(':checked')) { 893 if ( jq('tr#m-' + jq(this).attr('value')).hasClass(currentClass) ) { 894 checkboxes_tosend += jq(this).attr('value'); 895 jq('tr#m-' + jq(this).attr('value')).removeClass(currentClass); 896 jq('tr#m-' + jq(this).attr('value')).addClass(newClass); 897 var thread_count = jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').html(); 898 899 jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').html(unreadCount); 900 jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay); 901 var inboxcount = jq('a#user-messages strong').html().substr( 1, jq('a#user-messages strong').html().length ); 902 902 var inboxcount = inboxcount.substr( 0, inboxcount.length - 1 ); 903 903 … … 905 905 inboxcount = 0; 906 906 if ( parseInt(inboxcount) == inboxCount ) { 907 j ('a#user-messages strong').css('display', unreadCountDisplay);908 j ('a#user-messages strong').html( '(' + unreadCount + ')' );907 jq('a#user-messages strong').css('display', unreadCountDisplay); 908 jq('a#user-messages strong').html( '(' + unreadCount + ')' ); 909 909 } else { 910 910 if ( 'read' == currentClass ) 911 j ('a#user-messages strong').html('(' + ( parseInt(inboxcount) + 1 ) + ')');911 jq('a#user-messages strong').html('(' + ( parseInt(inboxcount) + 1 ) + ')'); 912 912 else 913 j ('a#user-messages strong').html('(' + ( parseInt(inboxcount) - thread_count ) + ')');913 jq('a#user-messages strong').html('(' + ( parseInt(inboxcount) - thread_count ) + ')'); 914 914 } 915 915 … … 920 920 } 921 921 }); 922 j .post( ajaxurl, {922 jq.post( ajaxurl, { 923 923 action: action, 924 924 'thread_ids': checkboxes_tosend … … 928 928 929 929 /* Selecting unread and read messages in inbox */ 930 j ("select#message-type-select").change(930 jq("select#message-type-select").change( 931 931 function() { 932 var selection = j ("select#message-type-select").val();933 var checkboxes = j ("td input[type='checkbox']");932 var selection = jq("select#message-type-select").val(); 933 var checkboxes = jq("td input[type='checkbox']"); 934 934 checkboxes.each( function(i) { 935 935 checkboxes[i].checked = ""; … … 938 938 switch(selection) { 939 939 case 'unread': 940 var checkboxes = j ("tr.unread td input[type='checkbox']");940 var checkboxes = jq("tr.unread td input[type='checkbox']"); 941 941 break; 942 942 case 'read': 943 var checkboxes = j ("tr.read td input[type='checkbox']");943 var checkboxes = jq("tr.read td input[type='checkbox']"); 944 944 break; 945 945 } … … 957 957 958 958 /* Bulk delete messages */ 959 j ("a#delete_inbox_messages").click( function() {959 jq("a#delete_inbox_messages").click( function() { 960 960 checkboxes_tosend = ''; 961 checkboxes = j ("#message-threads tr td input[type='checkbox']");962 963 j ('div#message').remove();964 j (this).addClass('loading');965 966 j (checkboxes).each( function(i) {967 if( j (this).is(':checked') )968 checkboxes_tosend += j (this).attr('value') + ',';961 checkboxes = jq("#message-threads tr td input[type='checkbox']"); 962 963 jq('div#message').remove(); 964 jq(this).addClass('loading'); 965 966 jq(checkboxes).each( function(i) { 967 if( jq(this).is(':checked') ) 968 checkboxes_tosend += jq(this).attr('value') + ','; 969 969 }); 970 970 971 971 if ( '' == checkboxes_tosend ) { 972 j (this).removeClass('loading');973 return false; 974 } 975 976 j .post( ajaxurl, {972 jq(this).removeClass('loading'); 973 return false; 974 } 975 976 jq.post( ajaxurl, { 977 977 action: 'messages_delete', 978 978 'thread_ids': checkboxes_tosend 979 979 }, function(response) { 980 980 if ( response[0] + response[1] == "-1" ) { 981 j ('#message-threads').prepend( response.substr( 2, response.length ) );981 jq('#message-threads').prepend( response.substr( 2, response.length ) ); 982 982 } else { 983 j ('#message-threads').before( '<div id="message" class="updated"><p>' + response + '</p></div>' );984 985 j (checkboxes).each( function(i) {986 if( j (this).is(':checked') )987 j (this).parent().parent().fadeOut(150);983 jq('#message-threads').before( '<div id="message" class="updated"><p>' + response + '</p></div>' ); 984 985 jq(checkboxes).each( function(i) { 986 if( jq(this).is(':checked') ) 987 jq(this).parent().parent().fadeOut(150); 988 988 }); 989 989 } 990 990 991 j ('div#message').hide().slideDown(150);992 j ("a#delete_inbox_messages").removeClass('loading');991 jq('div#message').hide().slideDown(150); 992 jq("a#delete_inbox_messages").removeClass('loading'); 993 993 }); 994 994 return false; … … 996 996 997 997 /* Close site wide notices in the sidebar */ 998 j ("a#close-notice").click( function() {999 j (this).addClass('loading');1000 j ('div#sidebar div.error').remove();1001 1002 j .post( ajaxurl, {998 jq("a#close-notice").click( function() { 999 jq(this).addClass('loading'); 1000 jq('div#sidebar div.error').remove(); 1001 1002 jq.post( ajaxurl, { 1003 1003 action: 'messages_close_notice', 1004 'notice_id': j ('.notice').attr('rel').substr( 2, j('.notice').attr('rel').length )1004 'notice_id': jq('.notice').attr('rel').substr( 2, jq('.notice').attr('rel').length ) 1005 1005 }, 1006 1006 function(response) { 1007 j ("a#close-notice").removeClass('loading');1007 jq("a#close-notice").removeClass('loading'); 1008 1008 1009 1009 if ( response[0] + response[1] == '-1' ) { 1010 j ('.notice').prepend( response.substr( 2, response.length ) );1011 j ( 'div#sidebar div.error').hide().fadeIn( 200 );1010 jq('.notice').prepend( response.substr( 2, response.length ) ); 1011 jq( 'div#sidebar div.error').hide().fadeIn( 200 ); 1012 1012 } else { 1013 j ('.notice').slideUp( 100 );1013 jq('.notice').slideUp( 100 ); 1014 1014 } 1015 1015 }); … … 1018 1018 1019 1019 /* Admin Bar Javascript */ 1020 j ("#wp-admin-bar ul.main-nav li").mouseover( function() {1021 j (this).addClass('sfhover');1022 }); 1023 1024 j ("#wp-admin-bar ul.main-nav li").mouseout( function() {1025 j (this).removeClass('sfhover');1020 jq("#wp-admin-bar ul.main-nav li").mouseover( function() { 1021 jq(this).addClass('sfhover'); 1022 }); 1023 1024 jq("#wp-admin-bar ul.main-nav li").mouseout( function() { 1025 jq(this).removeClass('sfhover'); 1026 1026 }); 1027 1027 1028 1028 /* Clear BP cookies on logout */ 1029 j ('a.logout').click( function() {1030 j .cookie('bp-activity-scope', null, {path: '/'});1031 j .cookie('bp-activity-filter', null, {path: '/'});1032 j .cookie('bp-activity-oldestpage', null, {path: '/'});1029 jq('a.logout').click( function() { 1030 jq.cookie('bp-activity-scope', null, {path: '/'}); 1031 jq.cookie('bp-activity-filter', null, {path: '/'}); 1032 jq.cookie('bp-activity-oldestpage', null, {path: '/'}); 1033 1033 1034 1034 var objects = [ 'members', 'groups', 'blogs', 'forums' ]; 1035 j (objects).each( function(i) {1036 j .cookie('bp-' + objects[i] + '-scope', null, {path: '/'} );1037 j .cookie('bp-' + objects[i] + '-filter', null, {path: '/'} );1038 j .cookie('bp-' + objects[i] + '-extras', null, {path: '/'} );1035 jq(objects).each( function(i) { 1036 jq.cookie('bp-' + objects[i] + '-scope', null, {path: '/'} ); 1037 jq.cookie('bp-' + objects[i] + '-filter', null, {path: '/'} ); 1038 jq.cookie('bp-' + objects[i] + '-extras', null, {path: '/'} ); 1039 1039 }); 1040 1040 }); … … 1044 1044 function bp_init_activity() { 1045 1045 /* Reset the page */ 1046 j .cookie( 'bp-activity-oldestpage', 1, {path: '/'} );1047 1048 if ( null != j .cookie('bp-activity-filter') && j('#activity-filter-select').length )1049 j ('#activity-filter-select select option[value=' + j.cookie('bp-activity-filter') + ']').attr( 'selected', 'selected' );1046 jq.cookie( 'bp-activity-oldestpage', 1, {path: '/'} ); 1047 1048 if ( null != jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length ) 1049 jq('#activity-filter-select select option[value=' + jq.cookie('bp-activity-filter') + ']').attr( 'selected', 'selected' ); 1050 1050 1051 1051 /* Activity Tab Set */ 1052 if ( null != j .cookie('bp-activity-scope') && j('div.activity-type-tabs').length ) {1053 j ('div.activity-type-tabs li').each( function() {1054 j (this).removeClass('selected');1055 }); 1056 j ('li#activity-' + j.cookie('bp-activity-scope') + ', div.item-list-tabs li.current').addClass('selected');1052 if ( null != jq.cookie('bp-activity-scope') && jq('div.activity-type-tabs').length ) { 1053 jq('div.activity-type-tabs li').each( function() { 1054 jq(this).removeClass('selected'); 1055 }); 1056 jq('li#activity-' + jq.cookie('bp-activity-scope') + ', div.item-list-tabs li.current').addClass('selected'); 1057 1057 } 1058 1058 } … … 1060 1060 /* Setup object scope and filter based on the current cookie settings for the object. */ 1061 1061 function bp_init_objects(objects) { 1062 j (objects).each( function(i) {1063 if ( null != j .cookie('bp-' + objects[i] + '-filter') && j('li#' + objects[i] + '-order-select select').length )1064 j ('li#' + objects[i] + '-order-select select option[value=' + j.cookie('bp-' + objects[i] + '-filter') + ']').attr( 'selected', 'selected' );1065 1066 if ( null != j .cookie('bp-' + objects[i] + '-scope') && j('div.' + objects[i]).length ) {1067 j ('div.item-list-tabs li').each( function() {1068 j (this).removeClass('selected');1062 jq(objects).each( function(i) { 1063 if ( null != jq.cookie('bp-' + objects[i] + '-filter') && jq('li#' + objects[i] + '-order-select select').length ) 1064 jq('li#' + objects[i] + '-order-select select option[value=' + jq.cookie('bp-' + objects[i] + '-filter') + ']').attr( 'selected', 'selected' ); 1065 1066 if ( null != jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) { 1067 jq('div.item-list-tabs li').each( function() { 1068 jq(this).removeClass('selected'); 1069 1069 }); 1070 j ('div.item-list-tabs li#' + objects[i] + '-' + j.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected');1070 jq('div.item-list-tabs li#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected'); 1071 1071 } 1072 1072 }); … … 1078 1078 return false; 1079 1079 1080 if ( j .query.get('s') )1081 search_terms = j .query.get('s');1080 if ( jq.query.get('s') ) 1081 search_terms = jq.query.get('s'); 1082 1082 1083 1083 if ( null == scope ) … … 1085 1085 1086 1086 /* Save the settings we want to remain persistent to a cookie */ 1087 j .cookie( 'bp-' + object + '-scope', scope, {path: '/'} );1088 j .cookie( 'bp-' + object + '-filter', filter, {path: '/'} );1089 j .cookie( 'bp-' + object + '-extras', extras, {path: '/'} );1087 jq.cookie( 'bp-' + object + '-scope', scope, {path: '/'} ); 1088 jq.cookie( 'bp-' + object + '-filter', filter, {path: '/'} ); 1089 jq.cookie( 'bp-' + object + '-extras', extras, {path: '/'} ); 1090 1090 1091 1091 /* Set the correct selected nav and filter */ 1092 j ('div.item-list-tabs li').each( function() {1093 j (this).removeClass('selected');1094 }); 1095 j ('div.item-list-tabs li#' + object + '-' + scope + ', div.item-list-tabs#object-nav li.current').addClass('selected');1096 j ('div.item-list-tabs li.selected').addClass('loading');1097 j ('div.item-list-tabs select option[value=' + filter + ']').attr( 'selected', 'selected' );1092 jq('div.item-list-tabs li').each( function() { 1093 jq(this).removeClass('selected'); 1094 }); 1095 jq('div.item-list-tabs li#' + object + '-' + scope + ', div.item-list-tabs#object-nav li.current').addClass('selected'); 1096 jq('div.item-list-tabs li.selected').addClass('loading'); 1097 jq('div.item-list-tabs select option[value=' + filter + ']').attr( 'selected', 'selected' ); 1098 1098 1099 1099 if ( 'friends' == object ) … … 1103 1103 bp_ajax_request.abort(); 1104 1104 1105 bp_ajax_request = j .post( ajaxurl, {1105 bp_ajax_request = jq.post( ajaxurl, { 1106 1106 action: object + '_filter', 1107 1107 'cookie': encodeURIComponent(document.cookie), … … 1115 1115 function(response) 1116 1116 { 1117 j (target).fadeOut( 100, function() {1118 j (this).html(response);1119 j (this).fadeIn(100);1117 jq(target).fadeOut( 100, function() { 1118 jq(this).html(response); 1119 jq(this).fadeIn(100); 1120 1120 }); 1121 j ('div.item-list-tabs li.selected').removeClass('loading');1121 jq('div.item-list-tabs li.selected').removeClass('loading'); 1122 1122 }); 1123 1123 } … … 1126 1126 function bp_activity_request(scope, filter) { 1127 1127 /* Save the type and filter to a session cookie */ 1128 j .cookie( 'bp-activity-scope', scope, {path: '/'} );1129 j .cookie( 'bp-activity-filter', filter, {path: '/'} );1130 j .cookie( 'bp-activity-oldestpage', 1 );1128 jq.cookie( 'bp-activity-scope', scope, {path: '/'} ); 1129 jq.cookie( 'bp-activity-filter', filter, {path: '/'} ); 1130 jq.cookie( 'bp-activity-oldestpage', 1 ); 1131 1131 1132 1132 /* Remove selected and loading classes from tabs */ 1133 j ('div.item-list-tabs li').each( function() {1134 j (this).removeClass('selected loading');1133 jq('div.item-list-tabs li').each( function() { 1134 jq(this).removeClass('selected loading'); 1135 1135 }); 1136 1136 /* Set the correct selected nav and filter */ 1137 j ('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected');1138 j ('div#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading');1139 j ('#activity-filter-select select option[value=' + filter + ']').attr( 'selected', 'selected' );1137 jq('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected'); 1138 jq('div#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading'); 1139 jq('#activity-filter-select select option[value=' + filter + ']').attr( 'selected', 'selected' ); 1140 1140 1141 1141 /* Reload the activity stream based on the selection */ 1142 j ('.widget_bp_activity_widget h2 span.ajax-loader').show();1142 jq('.widget_bp_activity_widget h2 span.ajax-loader').show(); 1143 1143 1144 1144 if ( bp_ajax_request ) 1145 1145 bp_ajax_request.abort(); 1146 1146 1147 bp_ajax_request = j .post( ajaxurl, {1147 bp_ajax_request = jq.post( ajaxurl, { 1148 1148 action: 'activity_widget_filter', 1149 1149 'cookie': encodeURIComponent(document.cookie), 1150 '_wpnonce_activity_filter': j ("input#_wpnonce_activity_filter").val(),1150 '_wpnonce_activity_filter': jq("input#_wpnonce_activity_filter").val(), 1151 1151 'scope': scope, 1152 1152 'filter': filter … … 1154 1154 function(response) 1155 1155 { 1156 j ('.widget_bp_activity_widget h2 span.ajax-loader').hide();1157 1158 j ('div.activity').fadeOut( 100, function() {1159 j (this).html(response.contents);1160 j (this).fadeIn(100);1156 jq('.widget_bp_activity_widget h2 span.ajax-loader').hide(); 1157 1158 jq('div.activity').fadeOut( 100, function() { 1159 jq(this).html(response.contents); 1160 jq(this).fadeIn(100); 1161 1161 }); 1162 1162 1163 1163 /* Update the feed link */ 1164 1164 if ( null != response.feed_url ) 1165 j ('.directory div#subnav li.feed a, .home-page div#subnav li.feed a').attr('href', response.feed_url);1166 1167 j ('div.item-list-tabs li.selected').removeClass('loading');1165 jq('.directory div#subnav li.feed a, .home-page div#subnav li.feed a').attr('href', response.feed_url); 1166 1167 jq('div.item-list-tabs li.selected').removeClass('loading'); 1168 1168 1169 1169 /* Selectively hide comments */ … … 1175 1175 /* Hide long lists of activity comments, only show the latest five root comments. */ 1176 1176 function bp_dtheme_hide_comments() { 1177 var comments_divs = j ('div.activity-comments');1177 var comments_divs = jq('div.activity-comments'); 1178 1178 1179 1179 if ( !comments_divs.length ) … … 1181 1181 1182 1182 comments_divs.each( function() { 1183 if ( j (this).children('ul').children('li').length < 5 ) return;1184 1185 var comments_div = j (this);1183 if ( jq(this).children('ul').children('li').length < 5 ) return; 1184 1185 var comments_div = jq(this); 1186 1186 var parent_li = comments_div.parents('ul#activity-stream > li'); 1187 var comment_lis = j (this).children('ul').children('li');1187 var comment_lis = jq(this).children('ul').children('li'); 1188 1188 var comment_count = ' '; 1189 1189 1190 if ( j ('li#' + parent_li.attr('id') + ' a.acomment-reply span').length )1191 var comment_count = j ('li#' + parent_li.attr('id') + ' a.acomment-reply span').html();1190 if ( jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').length ) 1191 var comment_count = jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html(); 1192 1192 1193 1193 comment_lis.each( function(i) { 1194 1194 /* Show the latest 5 root comments */ 1195 1195 if ( i < comment_lis.length - 5 ) { 1196 j (this).addClass('hidden');1197 j (this).toggle();1196 jq(this).addClass('hidden'); 1197 jq(this).toggle(); 1198 1198 1199 1199 if ( !i ) 1200 j (this).before( '<li class="show-all"><a href="#' + parent_li.attr('id') + '/show-all/" title="' + bp_terms_show_all_comments + '">' + bp_terms_show_all + ' ' + comment_count + ' ' + bp_terms_comments + '</a></li>' );1200 jq(this).before( '<li class="show-all"><a href="#' + parent_li.attr('id') + '/show-all/" title="' + bp_terms_show_all_comments + '">' + bp_terms_show_all + ' ' + comment_count + ' ' + bp_terms_comments + '</a></li>' ); 1201 1201 } 1202 1202 }); -
trunk/bp-themes/bp-default/blogs/create.php
r2428 r2925 1 1 <?php get_header() ?> 2 2 3 <?php do_action( 'bp_before_directory_ groups_content' ) ?>3 <?php do_action( 'bp_before_directory_blogs_content' ) ?> 4 4 5 5 <div id="content"> … … 31 31 <?php locate_template( array( 'sidebar.php' ), true ) ?> 32 32 33 <?php do_action( 'bp_after_directory_ groups_content' ) ?>33 <?php do_action( 'bp_after_directory_blogs_content' ) ?> 34 34 35 35 <?php get_footer() ?> -
trunk/bp-themes/bp-default/forums/forums-loop.php
r2712 r2925 31 31 <th id="th-postcount"><?php _e( 'Posts', 'buddypress' ) ?></th> 32 32 <th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ) ?></th> 33 34 <?php do_action( 'bp_directory_forums_extra_cell_head' ) ?> 35 33 36 </tr> 34 37 -
trunk/bp-themes/bp-default/forums/index.php
r2908 r2925 1 1 <?php get_header() ?> 2 3 <?php do_action( 'bp_before_directory_forums_content' ) ?>4 2 5 3 <div id="content"> … … 7 5 8 6 <form action="" method="post" id="forums-search-form" class="dir-form"> 7 9 8 <h3><?php _e( 'Group Forums Directory', 'buddypress' ) ?><?php if ( is_user_logged_in() ) : ?> <a class="button" href="#new-topic" id="new-topic-button"><?php _e( 'New Topic', 'buddypress' ) ?></a><?php endif; ?></h3> 9 10 <?php do_action( 'bp_before_directory_forums_content' ) ?> 10 11 11 12 <div id="forums-dir-search" class="dir-search"> -
trunk/bp-themes/bp-default/groups/index.php
r2908 r2925 15 15 <div class="item-list-tabs"> 16 16 <ul> 17 <li class="selected" id="groups-all"><a href="<?php bp_root_domain()?>"><?php printf( __( 'All Groups (%s)', 'buddypress' ), bp_get_total_group_count() ) ?></a></li>17 <li class="selected" id="groups-all"><a href="<?php echo bp_get_root_domain() . '/' . BP_GROUPS_SLUG ?>"><?php printf( __( 'All Groups (%s)', 'buddypress' ), bp_get_total_group_count() ) ?></a></li> 18 18 19 19 <?php if ( is_user_logged_in() && bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?> -
trunk/bp-themes/bp-default/members/single/home.php
r2695 r2925 15 15 <?php bp_get_displayed_user_nav() ?> 16 16 17 <?php do_action( 'bp_member s_directory_member_types' ) ?>17 <?php do_action( 'bp_member_options_nav' ) ?> 18 18 </ul> 19 19 </div> -
trunk/bp-themes/bp-default/sidebar.php
r2631 r2925 38 38 </p> 39 39 40 <form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login ' ) ?>" method="post">40 <form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post"> 41 41 <label><?php _e( 'Username', 'buddypress' ) ?><br /> 42 42 <input type="text" name="log" id="sidebar-user-login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" /></label> -
trunk/readme.txt
r2842 r2925 2 2 Contributors: apeatling 3 3 Tags: buddypress, social networking, activity, profiles, messaging, friends, groups, forums, microblogging, twitter, facebook, mingle, social, community, networks, networking, cms 4 Requires at least: WordPress2.9.15 Tested up to: WordPress2.9.26 Stable tag: 1.2. 24 Requires at least: 2.9.1 5 Tested up to: 2.9.2 6 Stable tag: 1.2.3 7 7 8 8 == Description == … … 21 21 22 22 More and more WordPress with BuddyPress powered sites are popping up. You can take a look at some of the best sites on the <a href="http://buddypress.org/demo/">BuddyPress demo page</a> or the <a href="http://wordpress.org/showcase/flavor/buddypress/">BuddyPress section of the WordPress showcase</a>. 23 24 <h4>Plugins: Adding So Much More</h4> 25 26 BuddyPress boasts an ever growing array of new features developed by the awesome plugin development community. Some of most popular BuddyPress plugins currently available are: 27 28 * <a href="http://wordpress.org/extend/plugins/wp-fb-autoconnect">WP-FB-AutoConnect</a> - allow your users to instantly log in to your site using their Facebook credentials. 29 * <a href="http://wordpress.org/extend/plugins/buddypress-like">BuddyPress Like</a> - add a "like" button to site activity. 30 * <a href="http://wordpress.org/extend/plugins/buddypress-links">BuddyPress Links</a> - rich media embedding for your BuddyPress powered site. 31 * <a href="http://wordpress.org/extend/plugins/tweetstream">BuddyPress Tweetstream</a> - allow your users to sync and post to their Twitter stream. 32 * <a href="http://wordpress.org/extend/plugins/facestream">BuddyPress Facestream</a> - allow your users to sync and post to their Facebook stream. 33 * <a href="http://wordpress.org/extend/plugins/bp-album">BuddyPress Album+</a> - allow your users to upload photos and create albums. 34 * <a href="http://wordpress.org/extend/plugins/buddypress-group-documents">BuddyPress Group Documents</a> - add file upload and document repositories to your groups. 35 * <a href="http://wordpress.org/extend/plugins/bp-profile-privacy">BuddyPress Profile Privacy</a> - allow your users to set privacy options on their profile data. 36 * <a href="http://wordpress.org/extend/plugins/welcome-pack">BuddyPress Welcome Pack</a> - set defaults for new users, auto join them to groups or send welcome messages. 37 * <a href="http://wordpress.org/extend/plugins/bp-groupblog">BuddyPress Group Blog</a> (WordPress MU only) - allow your groups to include a fully functional WordPress blog. 38 * <a href="http://wordpress.org/extend/plugins/buddypress-group-wiki/">BuddyPress Group Wiki</a> - add wiki functionality to your groups so all members can contribute to pages. 39 40 There are already more than 125 BuddyPress plugins available, the list is growing every day. For a full list of plugins, please visit the <a href="http://buddypress.org/extend/plugins/">BuddyPress.org plugins page</a>. You can also install any of these plugins automatically through the plugin installer menu inside of your WordPress installation. 23 41 24 42 <h4>More Information</h4> … … 44 62 = Can I use my existing WordPress theme? = 45 63 46 Yes you can. First install and activate BuddyPress, then download and activate the <a href="http://wordpress.org/extend/plugins/bp-template-pack/">template extension pack</a>. This plugin will run you through the process step-by-step. 64 Of course! First install and activate BuddyPress, then download and activate the <a href="http://wordpress.org/extend/plugins/bp-template-pack/">template extension pack</a>. This plugin will run you through the process step-by-step. 65 66 Be sure to also try out the default theme bundled with BuddyPress. It provides all the awesome features of a standard WordPress blog, but also integrates the BuddyPress features both seamlessly and beautfully. It's also really easy to modify with custom header support, widget support and via a <a href="http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/">child theme</a>. 47 67 48 68 = Will this work on standard WordPress and WordPress MU? = … … 66 86 BuddyPress subversion trunk can be found at: http://svn.buddypress.org/trunk/ 67 87 88 == Screenshots == 89 90 1. **Activity Streams** - Global, personal and group activity streams with threaded commenting, direct posting, favoriting and @mentions. All with full RSS feed and email notification support. 91 2. **Extended Profiles** - Fully editable profile fields allow you to define the fields users can fill in to describe themselves. Tailor profile fields to suit your audience. 92 3. **Extensible Groups** - Powerful public, private or hidden groups allow your users to break the discussion down into specific topics. Extend groups with your own custom features using the group extension API. 93 4. **Friend Connections** - Let your users make connections so they can track the activity of others, or filter on only those users they care about the most. 94 5. **Private Messaging** - Private messaging will allow your users to talk to each other directly, and in private. Not just limited to one on one discussions, your users can send messages to multiple recipients. 95 6. **Discussion Forums** - Full powered discussion forums built directly into groups allow for more conventional in-depth conversations. 96 7. **WordPress Blogging** - Start a blog built on the best blogging software in the world. Even allow each of your users to start their own full powered WordPress blog (with WordPress MU). Track new posts and comments across your site. 97 98 == Languages == 99 100 BuddyPress is available in more than 20 languages. For more information about BuddyPress in your language please select a langauge site from the list below. Is your language missing? Please send a message to the <a href="http://lists.automattic.com/mailman/listinfo/wp-polyglots">WP-Polygots</a> mailing list and request for your language to be set up. 101 102 * <a href="http://br.buddypress.org/">Brasil</a> 103 * <a href="http://ca.buddypress.org/">Català</a> 104 * <a href="http://de.buddypress.org/">Deutsch</a> 105 * <a href="http://es.buddypress.org/">Español</a> 106 * <a href="http://fr.buddypress.org/">Français</a> 107 * <a href="http://id.buddypress.org/">Indonesia</a> 108 * <a href="http://it.buddypress.org/">Italia</a> 109 * <a href="http://lv.buddypress.org/">Latviešu valodā</a> 110 * <a href="http://nl.buddypress.org/">Nederland</a> 111 * <a href="http://pl.buddypress.org/">Polska</a> 112 * <a href="http://pt.buddypress.org/">Portugal</a> 113 * <a href="http://ru.buddypress.org/">Русский</a> 114 * <a href="http://fi.buddypress.org/">Suomi</a> 115 * <a href="http://th.buddypress.org/">Thai</a> 116 * <a href="http://uk.buddypress.org/">Україна</a> 117 * <a href="http://ja.buddypress.org/">日本語</a> 118 * <a href="http://cn.buddypress.org/">简体中文</a> 119 * <a href="http://ko.buddypress.org/">한국어</a> 120 * <a href="http://tw.buddypress.org/">正體中文</a> 121 122 The <a href="http://i18n.svn.buddypress.org/">BuddyPress langauge file repository</a> includes some language that have not yet set up a localization site. 123 124 == Upgrade Notice == 125 126 = 1.2.2.1 = 127 Fixes a bug where new account activation emails would not be sent correctly. Important upgrade. 128 68 129 == Changelog == 69 130
Note: See TracChangeset
for help on using the changeset viewer.