Index: /trunk/bp-activity/bp-activity-notifications.php
===================================================================
--- /trunk/bp-activity/bp-activity-notifications.php (revision 2924)
+++ /trunk/bp-activity/bp-activity-notifications.php (revision 2925)
@@ -13,9 +13,9 @@
foreach( (array)$usernames as $username ) {
- if ( !$receiver_user_id = bp_core_get_userid($username) )
+ if ( !$receiver_user_id = bp_core_get_userid( $username ) )
continue;
// Now email the user with the contents of the message (if they have enabled email notifications)
- if ( 'no' != get_usermeta( $user_id, 'notification_activity_new_mention' ) ) {
+ if ( 'no' != get_usermeta( $receiver_user_id, 'notification_activity_new_mention' ) ) {
$poster_name = bp_core_get_user_displayname( $poster_user_id );
Index: /trunk/bp-blogs.php
===================================================================
--- /trunk/bp-blogs.php (revision 2924)
+++ /trunk/bp-blogs.php (revision 2925)
@@ -340,4 +340,6 @@
bp_blogs_remove_post( $post_id, $blog_id );
+ bp_blogs_update_blogmeta( $blog_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
+
do_action( 'bp_blogs_new_blog_post', $post_id, $post, $user_id );
}
@@ -348,4 +350,8 @@
$comment = get_comment($comment_id);
+
+ if ( !$is_approved )
+ return false;
+
$comment->post = get_post( $comment->comment_post_ID );
@@ -380,4 +386,6 @@
}
+ bp_blogs_update_blogmeta( $blog_id, 'last_activity', gmdate( "Y-m-d H:i:s" ) );
+
return $recorded_comment;
}
Index: /trunk/bp-core.php
===================================================================
--- /trunk/bp-core.php (revision 2924)
+++ /trunk/bp-core.php (revision 2925)
@@ -460,5 +460,5 @@
}
- do_action( 'bp_core_action_set_spammer_status', $errors );
+ do_action( 'bp_core_action_delete_user', $errors );
if ( $errors )
@@ -494,4 +494,5 @@
'search_terms' => false, // Limit to users that match these search terms
+ 'include' => false, // Pass comma separated list of user_ids to limit to only these users
'per_page' => 20, // The number of results to return per page
'page' => 1, // The page to return if limiting per page
@@ -502,5 +503,5 @@
extract( $params, EXTR_SKIP );
- return apply_filters( 'bp_core_get_users', BP_Core_User::get_users( $type, $per_page, $page, $user_id, $search_terms, $populate_extras ), &$params );
+ return apply_filters( 'bp_core_get_users', BP_Core_User::get_users( $type, $per_page, $page, $user_id, $include, $search_terms, $populate_extras ), &$params );
}
@@ -914,6 +915,8 @@
global $wpdb;
- if ( !empty( $username ) )
- return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ) );
+ if ( empty( $username ) )
+ return false;
+
+ return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . CUSTOM_USER_TABLE . " WHERE user_login = %s", $username ) ) );
}
@@ -937,5 +940,4 @@
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 ) ) );
}
-
/**
@@ -1430,5 +1432,5 @@
return $number;
- return apply_filters( 'bp_core_bp_core_number_format', number_format( $number, $decimals ), $number, $decimals );
+ return apply_filters( 'bp_core_number_format', number_format( $number, $decimals ), $number, $decimals );
}
@@ -1477,5 +1479,8 @@
unset( $site_path[2] );
- $site_path = '/' . implode( '/', $site_path ) . '/';
+ if ( !count( $site_path ) )
+ $site_path = '/';
+ else
+ $site_path = '/' . implode( '/', $site_path ) . '/';
}
}
@@ -1483,5 +1488,4 @@
return apply_filters( 'bp_core_get_site_path', $site_path );
}
-
/**
* bp_core_get_site_options()
@@ -1606,7 +1610,8 @@
* @package BuddyPress Core
* @global $bp The global BuddyPress settings variable created in bp_core_setup_globals()
- * @uses check_admin_referer() Checks for a valid security nonce.
* @uses is_site_admin() Checks to see if the user is a site administrator.
- * @uses wpmu_delete_user() Deletes a user from the system.
+ * @uses wpmu_delete_user() Deletes a user from the system on multisite installs.
+ * @uses wp_delete_user() Deletes a user from the system on singlesite installs.
+ * @uses get_site_option Checks if account deletion is allowed
*/
function bp_core_delete_account( $user_id = false ) {
@@ -1620,9 +1625,10 @@
return false;
- /* Site admins should not be allowed to be deleted */
- if ( bp_core_is_multisite() && is_site_admin( bp_core_get_username( $user_id ) ) )
- return false;
-
- if ( bp_core_is_multisite() && function_exists('wpmu_delete_user') ) {
+ /* Specifically handle multi-site environment */
+ if ( bp_core_is_multisite() ) {
+ /* Site admins cannot be deleted */
+ if ( is_site_admin( bp_core_get_username( $user_id ) ) )
+ return false;
+
require_once( ABSPATH . '/wp-admin/includes/mu.php' );
require_once( ABSPATH . '/wp-admin/includes/user.php' );
@@ -1631,4 +1637,5 @@
}
+ /* Single site user deletion */
require_once( ABSPATH . '/wp-admin/includes/user.php' );
return wp_delete_user( $user_id );
@@ -1741,5 +1748,5 @@
?>
-
+
spam )
+ if ( ( bp_core_is_multisite() && (int)$user->spam ) || 1 == (int)$user->user_status )
bp_core_redirect( $bp->root_domain );
else
Index: /trunk/bp-core/bp-core-avatars.php
===================================================================
--- /trunk/bp-core/bp-core-avatars.php (revision 2924)
+++ /trunk/bp-core/bp-core-avatars.php (revision 2925)
@@ -155,6 +155,11 @@
}
+ if ( is_ssl() )
+ $host = 'https://secure.gravatar.com/avatar/';
+ else
+ $host = 'http://www.gravatar.com/avatar/';
+
$email = apply_filters( 'bp_core_gravatar_email', $email, $item_id, $object );
- $gravatar = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' ) . md5( $email ) . '?d=' . $default_grav . '&s=' . $grav_size;
+ $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( $email ) . '?d=' . $default_grav . '&s=' . $grav_size;
return apply_filters( 'bp_core_fetch_avatar', "", $params );
@@ -389,4 +394,6 @@
if ( !$path = get_option( 'upload_path' ) )
$path = WP_CONTENT_DIR . '/uploads';
+ else
+ $path = ABSPATH . $path;
}
Index: /trunk/bp-core/bp-core-classes.php
===================================================================
--- /trunk/bp-core/bp-core-classes.php (revision 2924)
+++ /trunk/bp-core/bp-core-classes.php (revision 2925)
@@ -107,5 +107,5 @@
/* Static Functions */
- function get_users( $type, $limit = null, $page = 1, $user_id = false, $search_terms = false, $populate_extras = true ) {
+ function get_users( $type, $limit = null, $page = 1, $user_id = false, $include = false, $search_terms = false, $populate_extras = true ) {
global $wpdb, $bp;
@@ -137,10 +137,20 @@
if ( 'online' == $type )
- $sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= NOW()";
+ $sql['where_online'] = "AND DATE_ADD( um.meta_value, INTERVAL 5 MINUTE ) >= UTC_TIMESTAMP()";
if ( 'alphabetical' == $type )
$sql['where_alpha'] = "AND pd.field_id = 1";
- if ( $user_id && bp_is_active( 'friends' ) ) {
+ if ( $include ) {
+ if ( is_array( $include ) )
+ $uids = $wpdb->escape( implode( ',', (array)$include ) );
+ else
+ $uids = $wpdb->escape( $include );
+
+ if ( !empty( $uids ) )
+ $sql['where_users'] = "AND u.ID IN ({$uids})";
+ }
+
+ else if ( $user_id && function_exists( 'friends_install' ) ) {
$friend_ids = friends_get_friend_user_ids( $user_id );
$friend_ids = $wpdb->escape( implode( ',', (array)$friend_ids ) );
@@ -254,32 +264,4 @@
}
- function get_specific_users( $user_ids, $limit = null, $page = 1, $populate_extras = true ) {
- global $wpdb, $bp;
-
- if ( $limit && $page )
- $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
-
- $user_sql = " AND user_id IN ( " . $wpdb->escape( $user_ids ) . " ) ";
- $status_sql = bp_core_get_status_sql();
-
- $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 ) );
- $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 ) );
-
- $total_users = $wpdb->get_var( $total_users_sql );
- $paged_users = $wpdb->get_results( $paged_users_sql );
-
- /***
- * Lets fetch some other useful data in a separate queries, this will be faster than querying the data for every user in a list.
- * 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)
- */
-
- /* Add additional data to the returned results */
- if ( $populate_extras )
- $paged_users = BP_Core_User::get_user_extras( &$paged_users, &$user_ids );
-
-
- return array( 'users' => $paged_users, 'total' => $total_users );
- }
-
function search_users( $search_terms, $limit = null, $page = 1, $populate_extras = true ) {
global $wpdb, $bp;
@@ -321,4 +303,8 @@
/* Fetch the user's full name */
if ( bp_is_active( 'xprofile' ) && 'alphabetical' != $type ) {
+ /* Ensure xprofile globals are set */
+ if ( !defined( 'BP_XPROFILE_FULLNAME_FIELD_NAME' ) )
+ xprofile_setup_globals();
+
$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 ) );
for ( $i = 0; $i < count( $paged_users ); $i++ ) {
Index: /trunk/bp-core/bp-core-signup.php
===================================================================
--- /trunk/bp-core/bp-core-signup.php (revision 2924)
+++ /trunk/bp-core/bp-core-signup.php (revision 2925)
@@ -361,9 +361,13 @@
* Now generate an activation key and send an email to the user so they can activate their account
* and validate their email address. Multisite installs send their own email, so this is only for single blog installs.
+ *
+ * To disable sending activation emails you can user the filter 'bp_core_signup_send_activation_key' and return false.
*/
- if ( !bp_core_is_multisite() ) {
- $activation_key = wp_hash( $user_id );
- update_usermeta( $user_id, 'activation_key', $activation_key );
- bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key );
+ if ( apply_filters( 'bp_core_signup_send_activation_key', true ) ) {
+ if ( !bp_core_is_multisite() ) {
+ $activation_key = wp_hash( $user_id );
+ update_usermeta( $user_id, 'activation_key', $activation_key );
+ bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key );
+ }
}
Index: /trunk/bp-core/bp-core-templatetags.php
===================================================================
--- /trunk/bp-core/bp-core-templatetags.php (revision 2924)
+++ /trunk/bp-core/bp-core-templatetags.php (revision 2925)
@@ -27,10 +27,6 @@
if ( isset( $_REQUEST['letter'] ) && '' != $_REQUEST['letter'] ) {
$this->members = BP_Core_User::get_users_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page, $populate_extras );
- }
- else if ( false !== $include ) {
- $this->members = BP_Core_User::get_specific_users( $include, $this->pag_num, $this->pag_page, $populate_extras );
- }
- else {
- $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 ) );
+ } else {
+ $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 ) );
}
@@ -159,7 +155,10 @@
}
+ /* Make sure we return no members if we looking at friendship requests and there are none. */
+ if ( empty( $include ) && $bp->friends->slug == $bp->current_component && 'requests' == $bp->current_action )
+ return false;
+
$members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras );
-
- return $members_template->has_members();
+ return apply_filters( 'bp_has_members', $members_template->has_members(), &$members_template );
}
Index: /trunk/bp-core/bp-core-wpabstraction.php
===================================================================
--- /trunk/bp-core/bp-core-wpabstraction.php (revision 2924)
+++ /trunk/bp-core/bp-core-wpabstraction.php (revision 2925)
@@ -69,5 +69,5 @@
if ( !function_exists( 'is_site_admin' ) ) {
- function is_site_admin() {
+ function is_site_admin( $user_id = false ) {
if ( current_user_can( 'manage_options' ) )
return true;
Index: /trunk/bp-forums.php
===================================================================
--- /trunk/bp-forums.php (revision 2924)
+++ /trunk/bp-forums.php (revision 2925)
@@ -441,10 +441,10 @@
$post_position = $post->post_position;
- $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 ) );
-
- if ( $post )
+ $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 ) );
+
+ if ( $post_id )
do_action( 'bp_forums_new_post', $post_id );
- return $post;
+ return $post_id;
}
Index: /trunk/bp-friends.php
===================================================================
--- /trunk/bp-friends.php (revision 2924)
+++ /trunk/bp-friends.php (revision 2925)
@@ -595,6 +595,6 @@
global $bp;
- if ( isset($_GET['new']) )
- bp_core_delete_notifications_for_user_by_type( $bp->displayed_user->id, $bp->friends->id, 'friendship_accepted' );
+ if ( isset( $_GET['new'] ) )
+ bp_core_delete_notifications_for_user_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_accepted' );
}
add_action( 'bp_activity_screen_my_activity', 'friends_clear_friend_notifications' );
Index: /trunk/bp-groups.php
===================================================================
--- /trunk/bp-groups.php (revision 2924)
+++ /trunk/bp-groups.php (revision 2925)
@@ -492,4 +492,7 @@
if ( $bp->is_single_item ) {
+ /* Refresh the group member count meta */
+ groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) );
+
do_action( 'groups_screen_group_members', $bp->groups->current_group->id );
bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) );
@@ -1650,4 +1653,8 @@
}
+function groups_get_total_member_count( $group_id ) {
+ return BP_Groups_Group::get_total_member_count( $group_id );
+}
+
/*** Group Fetching, Filtering & Searching *************************************/
Index: /trunk/bp-groups/bp-groups-classes.php
===================================================================
--- /trunk/bp-groups/bp-groups-classes.php (revision 2924)
+++ /trunk/bp-groups/bp-groups-classes.php (revision 2925)
@@ -498,4 +498,10 @@
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} " );
}
+
+ function get_total_member_count( $group_id ) {
+ global $wpdb, $bp;
+
+ 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 ) );
+ }
}
Index: /trunk/bp-loader.php
===================================================================
--- /trunk/bp-loader.php (revision 2924)
+++ /trunk/bp-loader.php (revision 2925)
@@ -7,5 +7,5 @@
Version: 1.3-bleeding
Author URI: http://buddypress.org/developers/
-Site Wide Only: true
+Network: true
*/
Index: /trunk/bp-messages/bp-messages-notifications.php
===================================================================
--- /trunk/bp-messages/bp-messages-notifications.php (revision 2924)
+++ /trunk/bp-messages/bp-messages-notifications.php (revision 2925)
@@ -34,5 +34,5 @@
', 'buddypress' ), $sender_name, $subject, $content, $message_link );
- $content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
+ $email_content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
/* Send the message */
Index: /trunk/bp-themes/bp-default/_inc/global.js
===================================================================
--- /trunk/bp-themes/bp-default/_inc/global.js (revision 2924)
+++ /trunk/bp-themes/bp-default/_inc/global.js (revision 2925)
@@ -1,14 +1,14 @@
// AJAX Functions
-var j = jQuery;
+var jq = jQuery;
// Global variable to prevent multiple AJAX requests
var bp_ajax_request = null;
-j(document).ready( function() {
+jq(document).ready( function() {
/**** Page Load Actions *******************************************************/
/* Hide Forums Post Form */
- if ( j('div.forums').length )
- j('div#new-topic-post').hide();
+ if ( jq('div.forums').length )
+ jq('div#new-topic-post').hide();
/* Activity filter and scope set */
@@ -20,47 +20,47 @@
/* @mention Compose Scrolling */
- if ( j.query.get('r') ) {
- if ( j('textarea#whats-new').length ) {
- j.scrollTo( j('textarea#whats-new'), 500, { offset:-125, easing:'easeout' } );
- j('textarea#whats-new').focus();
+ if ( jq.query.get('r') ) {
+ if ( jq('textarea#whats-new').length ) {
+ jq.scrollTo( jq('textarea#whats-new'), 500, { offset:-125, easing:'easeout' } );
+ jq('textarea#whats-new').focus();
}
}
/* @mention username help button display */
- if ( j( 'span.highlight span' ).length )
- j( 'span.highlight span' ).toggle();
+ if ( jq( 'span.highlight span' ).length )
+ jq( 'span.highlight span' ).toggle();
/**** Activity Posting ********************************************************/
/* New posts */
- j("input#aw-whats-new-submit").click( function() {
- var button = j(this);
+ jq("input#aw-whats-new-submit").click( function() {
+ var button = jq(this);
var form = button.parent().parent().parent().parent();
form.children().each( function() {
- if ( j.nodeName(this, "textarea") || j.nodeName(this, "input") )
- j(this).attr( 'disabled', 'disabled' );
- });
-
- j( 'form#' + form.attr('id') + ' span.ajax-loader' ).show();
+ if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") )
+ jq(this).attr( 'disabled', 'disabled' );
+ });
+
+ jq( 'form#' + form.attr('id') + ' span.ajax-loader' ).show();
/* Remove any errors */
- j('div.error').remove();
+ jq('div.error').remove();
button.attr('disabled','disabled');
/* Default POST values */
var object = '';
- var item_id = j("#whats-new-post-in").val();
- var content = j("textarea#whats-new").val();
+ var item_id = jq("#whats-new-post-in").val();
+ var content = jq("textarea#whats-new").val();
/* Set object for non-profile posts */
if ( item_id > 0 ) {
- object = j("#whats-new-post-object").val();
- }
-
- j.post( ajaxurl, {
+ object = jq("#whats-new-post-object").val();
+ }
+
+ jq.post( ajaxurl, {
action: 'post_update',
'cookie': encodeURIComponent(document.cookie),
- '_wpnonce_post_update': j("input#_wpnonce_post_update").val(),
+ '_wpnonce_post_update': jq("input#_wpnonce_post_update").val(),
'content': content,
'object': object,
@@ -69,9 +69,9 @@
function(response)
{
- j( 'form#' + form.attr('id') + ' span.ajax-loader' ).hide();
+ jq( 'form#' + form.attr('id') + ' span.ajax-loader' ).hide();
form.children().each( function() {
- if ( j.nodeName(this, "textarea") || j.nodeName(this, "input") )
- j(this).attr( 'disabled', '' );
+ if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") )
+ jq(this).attr( 'disabled', '' );
});
@@ -79,18 +79,18 @@
if ( response[0] + response[1] == '-1' ) {
form.prepend( response.substr( 2, response.length ) );
- j( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
+ jq( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
button.attr("disabled", '');
} else {
- if ( 0 == j("ul.activity-list").length ) {
- j("div.error").slideUp(100).remove();
- j("div#message").slideUp(100).remove();
- j("div.activity").append( '
' );
+ if ( 0 == jq("ul.activity-list").length ) {
+ jq("div.error").slideUp(100).remove();
+ jq("div#message").slideUp(100).remove();
+ jq("div.activity").append( '' );
}
- j("ul.activity-list").prepend(response);
- j("ul.activity-list li:first").addClass('new-update');
- j("li.new-update").hide().slideDown( 300 );
- j("li.new-update").removeClass( 'new-update' );
- j("textarea#whats-new").val('');
+ jq("ul.activity-list").prepend(response);
+ jq("ul.activity-list li:first").addClass('new-update');
+ jq("li.new-update").hide().slideDown( 300 );
+ jq("li.new-update").removeClass( 'new-update' );
+ jq("textarea#whats-new").val('');
/* Re-enable the submit button after 8 seconds. */
@@ -103,6 +103,6 @@
/* List tabs event delegation */
- j('div.activity-type-tabs').click( function(event) {
- var target = j(event.target).parent();
+ jq('div.activity-type-tabs').click( function(event) {
+ var target = jq(event.target).parent();
if ( event.target.nodeName == 'STRONG' || event.target.nodeName == 'SPAN' )
@@ -112,12 +112,12 @@
/* Reset the page */
- j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
+ jq.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
/* Activity Stream Tabs */
var scope = target.attr('id').substr( 9, target.attr('id').length );
- var filter = j("#activity-filter-select select").val();
+ var filter = jq("#activity-filter-select select").val();
if ( scope == 'mentions' )
- j( 'li#' + target.attr('id') + ' a strong' ).remove();
+ jq( 'li#' + target.attr('id') + ' a strong' ).remove();
bp_activity_request(scope, filter, target);
@@ -127,6 +127,6 @@
/* Activity filter select */
- j('#activity-filter-select select').change( function() {
- var selected_tab = j( 'div.activity-type-tabs li.selected' );
+ jq('#activity-filter-select select').change( function() {
+ var selected_tab = jq( 'div.activity-type-tabs li.selected' );
if ( !selected_tab.length )
@@ -135,5 +135,5 @@
var scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length );
- var filter = j(this).val();
+ var filter = jq(this).val();
bp_activity_request(scope, filter);
@@ -143,6 +143,6 @@
/* Stream event delegation */
- j('div.activity').click( function(event) {
- var target = j(event.target);
+ jq('div.activity').click( function(event) {
+ var target = jq(event.target);
/* Favoriting activity stream items */
@@ -154,5 +154,5 @@
target.addClass('loading');
- j.post( ajaxurl, {
+ jq.post( ajaxurl, {
action: 'activity_mark_' + type,
'cookie': encodeURIComponent(document.cookie),
@@ -163,31 +163,31 @@
target.fadeOut( 100, function() {
- j(this).html(response);
- j(this).fadeIn(100);
+ jq(this).html(response);
+ jq(this).fadeIn(100);
});
if ( 'fav' == type ) {
- if ( !j('div.item-list-tabs li#activity-favorites').length )
- j('div.item-list-tabs ul li#activity-mentions').before( '- ' + bp_terms_my_favs + ' (0)
');
+ if ( !jq('div.item-list-tabs li#activity-favorites').length )
+ jq('div.item-list-tabs ul li#activity-mentions').before( '- ' + bp_terms_my_favs + ' (0)
');
target.removeClass('fav');
target.addClass('unfav');
- j('div.item-list-tabs ul li#activity-favorites span').html( Number( j('div.item-list-tabs ul li#activity-favorites span').html() ) + 1 );
+ jq('div.item-list-tabs ul li#activity-favorites span').html( Number( jq('div.item-list-tabs ul li#activity-favorites span').html() ) + 1 );
} else {
target.removeClass('unfav');
target.addClass('fav');
- j('div.item-list-tabs ul li#activity-favorites span').html( Number( j('div.item-list-tabs ul li#activity-favorites span').html() ) - 1 );
-
- if ( !Number( j('div.item-list-tabs ul li#activity-favorites span').html() ) ) {
- if ( j('div.item-list-tabs ul li#activity-favorites').hasClass('selected') )
+ jq('div.item-list-tabs ul li#activity-favorites span').html( Number( jq('div.item-list-tabs ul li#activity-favorites span').html() ) - 1 );
+
+ if ( !Number( jq('div.item-list-tabs ul li#activity-favorites span').html() ) ) {
+ if ( jq('div.item-list-tabs ul li#activity-favorites').hasClass('selected') )
bp_activity_request( null, null );
- j('div.item-list-tabs ul li#activity-favorites').remove();
+ jq('div.item-list-tabs ul li#activity-favorites').remove();
}
}
- if ( 'activity-favorites' == j( 'div.item-list-tabs li.selected').attr('id') )
+ if ( 'activity-favorites' == jq( 'div.item-list-tabs li.selected').attr('id') )
target.parent().parent().parent().slideUp(100);
});
@@ -207,5 +207,5 @@
target.addClass('loading');
- j.post( ajaxurl, {
+ jq.post( ajaxurl, {
action: 'delete_activity',
'cookie': encodeURIComponent(document.cookie),
@@ -229,12 +229,12 @@
/* Load more updates at the end of the page */
if ( target.parent().attr('class') == 'load-more' ) {
- j("li.load-more").addClass('loading');
-
- if ( null == j.cookie('bp-activity-oldestpage') )
- j.cookie('bp-activity-oldestpage', 1, {path: '/'} );
-
- var oldest_page = ( j.cookie('bp-activity-oldestpage') * 1 ) + 1;
-
- j.post( ajaxurl, {
+ jq("li.load-more").addClass('loading');
+
+ if ( null == jq.cookie('bp-activity-oldestpage') )
+ jq.cookie('bp-activity-oldestpage', 1, {path: '/'} );
+
+ var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
+
+ jq.post( ajaxurl, {
action: 'activity_get_older_updates',
'cookie': encodeURIComponent(document.cookie),
@@ -243,7 +243,7 @@
function(response)
{
- j("li.load-more").removeClass('loading');
- j.cookie( 'bp-activity-oldestpage', oldest_page, {path: '/'} );
- j("ul.activity-list").append(response.contents);
+ jq("li.load-more").removeClass('loading');
+ jq.cookie( 'bp-activity-oldestpage', oldest_page, {path: '/'} );
+ jq("ul.activity-list").append(response.contents);
target.parent().hide();
@@ -257,13 +257,13 @@
/* Hide all activity comment forms */
- j('form.ac-form').hide();
+ jq('form.ac-form').hide();
/* Hide excess comments */
- if ( j('div.activity-comments').length )
+ if ( jq('div.activity-comments').length )
bp_dtheme_hide_comments();
/* Activity list event delegation */
- j('div.activity').click( function(event) {
- var target = j(event.target);
+ jq('div.activity').click( function(event) {
+ var target = jq(event.target);
/* Comment / comment reply links */
@@ -277,22 +277,22 @@
var a_id = ids[2]
var c_id = target.attr('href').substr( 10, target.attr('href').length );
- var form = j( '#ac-form-' + a_id );
-
- var form = j( '#ac-form-' + ids[2] );
+ var form = jq( '#ac-form-' + a_id );
+
+ var form = jq( '#ac-form-' + ids[2] );
form.css( 'display', 'none' );
form.removeClass('root');
- j('.ac-form').hide();
+ jq('.ac-form').hide();
/* Hide any error messages */
form.children('div').each( function() {
- if ( j(this).hasClass( 'error' ) )
- j(this).hide();
+ if ( jq(this).hasClass( 'error' ) )
+ jq(this).hide();
});
if ( ids[1] != 'comment' ) {
- j('div.activity-comments li#acomment-' + c_id).append( form );
+ jq('div.activity-comments li#acomment-' + c_id).append( form );
} else {
- j('li#activity-' + a_id + ' div.activity-comments').append( form );
+ jq('li#activity-' + a_id + ' div.activity-comments').append( form );
}
@@ -301,6 +301,6 @@
form.slideDown( 200 );
- j.scrollTo( form, 500, { offset:-100, easing:'easeout' } );
- j('#ac-form-' + ids[2] + ' textarea').focus();
+ jq.scrollTo( form, 500, { offset:-100, easing:'easeout' } );
+ jq('#ac-form-' + ids[2] + ' textarea').focus();
return false;
@@ -321,15 +321,15 @@
/* Hide any error messages */
- j( 'form#' + form + ' div.error').hide();
+ jq( 'form#' + form + ' div.error').hide();
form.addClass('loading');
target.css('disabled', 'disabled');
- j.post( ajaxurl, {
+ jq.post( ajaxurl, {
action: 'new_activity_comment',
'cookie': encodeURIComponent(document.cookie),
- '_wpnonce_new_activity_comment': j("input#_wpnonce_new_activity_comment").val(),
+ '_wpnonce_new_activity_comment': jq("input#_wpnonce_new_activity_comment").val(),
'comment_id': comment_id,
'form_id': form_id[2],
- 'content': j('form#' + form.attr('id') + ' textarea').val()
+ 'content': jq('form#' + form.attr('id') + ' textarea').val()
},
function(response)
@@ -356,8 +356,8 @@
}
);
- j( 'form#' + form + ' textarea').val('');
+ jq( 'form#' + form + ' textarea').val('');
/* Increase the "Reply (X)" button count */
- j('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( j('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 );
+ jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 );
/* Re-enable the submit button after 5 seconds. */
@@ -385,10 +385,10 @@
/* Remove any error messages */
- j('div.activity-comments ul div.error').remove();
+ jq('div.activity-comments ul div.error').remove();
/* Reset the form position */
comment_li.parents('div.activity-comments').append(form);
- j.post( ajaxurl, {
+ jq.post( ajaxurl, {
action: 'delete_activity_comment',
'cookie': encodeURIComponent(document.cookie),
@@ -402,8 +402,8 @@
comment_li.prepend( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
} else {
- var children = j( 'li#' + comment_li.attr('id') + ' ul' ).children('li');
+ var children = jq( 'li#' + comment_li.attr('id') + ' ul' ).children('li');
var child_count = 0;
- j(children).each( function() {
- if ( !j(this).is(':hidden') )
+ jq(children).each( function() {
+ if ( !jq(this).is(':hidden') )
child_count++;
});
@@ -412,5 +412,5 @@
/* Decrease the "Reply (X)" button count */
var parent_li = comment_li.parents('ul#activity-stream > li');
- 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 ) );
+ 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 ) );
}
});
@@ -434,5 +434,5 @@
/* Escape Key Press for cancelling comment forms */
- j(document).keydown( function(e) {
+ jq(document).keydown( function(e) {
e = e || window.event;
if (e.target)
@@ -451,6 +451,6 @@
if ( keyCode == 27 ) {
if (element.tagName == 'TEXTAREA') {
- if ( j(element).attr('class') == 'ac-input' )
- j(element).parent().parent().parent().slideUp( 200 );
+ if ( jq(element).attr('class') == 'ac-input' )
+ jq(element).parent().parent().parent().slideUp( 200 );
}
}
@@ -459,10 +459,10 @@
/**** @mention username help tooltip **************************************/
- j('span.highlight span').click( function() {
- if ( !j('div.help').length ) {
- j(this).parent().after( '' + bp_terms_mention_explain + '
' );
- j('div.help').hide().slideDown(200);
+ jq('span.highlight span').click( function() {
+ if ( !jq('div.help').length ) {
+ jq(this).parent().after( '' + bp_terms_mention_explain + '
' );
+ jq('div.help').hide().slideDown(200);
} else {
- j('div.help').hide().remove();
+ jq('div.help').hide().remove();
}
})
@@ -471,15 +471,15 @@
/* The search form on all directory pages */
- j('div.dir-search').click( function(event) {
- if ( j(this).hasClass('no-ajax') )
+ jq('div.dir-search').click( function(event) {
+ if ( jq(this).hasClass('no-ajax') )
return;
- var target = j(event.target);
+ var target = jq(event.target);
if ( target.attr('type') == 'submit' ) {
- var css_id = j('div.item-list-tabs li.selected').attr('id').split( '-' );
+ var css_id = jq('div.item-list-tabs li.selected').attr('id').split( '-' );
var object = css_id[0];
- 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') );
+ 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') );
return false;
@@ -490,9 +490,9 @@
/* When a navigation tab is clicked - e.g. | All Groups | My Groups | */
- j('div.item-list-tabs').click( function(event) {
- if ( j(this).hasClass('no-ajax') )
+ jq('div.item-list-tabs').click( function(event) {
+ if ( jq(this).hasClass('no-ajax') )
return;
- var target = j(event.target).parent();
+ var target = jq(event.target).parent();
if ( 'LI' == event.target.parentNode.nodeName && !target.hasClass('last') ) {
@@ -504,8 +504,8 @@
var scope = css_id[1];
- var filter = j("#" + object + "-order-select select").val();
- var search_terms = j("#" + object + "_search").val();
-
- bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, j.cookie('bp-' + object + '-extras') );
+ var filter = jq("#" + object + "-order-select select").val();
+ var search_terms = jq("#" + object + "_search").val();
+
+ bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') );
return false;
@@ -514,23 +514,23 @@
/* When the filter select box is changed re-query */
- j('li.filter select').change( function() {
- if ( j('div.item-list-tabs li.selected').length )
- var el = j('div.item-list-tabs li.selected');
+ jq('li.filter select').change( function() {
+ if ( jq('div.item-list-tabs li.selected').length )
+ var el = jq('div.item-list-tabs li.selected');
else
- var el = j(this);
+ var el = jq(this);
var css_id = el.attr('id').split('-');
var object = css_id[0];
var scope = css_id[1];
- var filter = j(this).val();
+ var filter = jq(this).val();
var search_terms = false;
- if ( j('div.dir-search input').length )
- search_terms = j('div.dir-search input').val();
+ if ( jq('div.dir-search input').length )
+ search_terms = jq('div.dir-search input').val();
if ( 'friends' == object )
object = 'members';
- bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, j.cookie('bp-' + object + '-extras') );
+ bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') );
return false;
@@ -538,6 +538,6 @@
/* All pagination links run through this function */
- j('div#content').click( function(event) {
- var target = j(event.target);
+ jq('div#content').click( function(event) {
+ var target = jq(event.target);
if ( target.hasClass('button') )
@@ -548,8 +548,8 @@
return false;
- if ( j('div.item-list-tabs li.selected').length )
- var el = j('div.item-list-tabs li.selected');
+ if ( jq('div.item-list-tabs li.selected').length )
+ var el = jq('div.item-list-tabs li.selected');
else
- var el = j('li.filter select');
+ var el = jq('li.filter select');
var page_number = 1;
@@ -558,15 +558,15 @@
var search_terms = false;
- if ( j('div.dir-search input').length )
- search_terms = j('div.dir-search input').val();
-
- if ( j(target).hasClass('next') )
- var page_number = Number( j('div.pagination span.current').html() ) + 1;
- else if ( j(target).hasClass('prev') )
- var page_number = Number( j('div.pagination span.current').html() ) - 1;
+ if ( jq('div.dir-search input').length )
+ search_terms = jq('div.dir-search input').val();
+
+ if ( jq(target).hasClass('next') )
+ var page_number = Number( jq('div.pagination span.current').html() ) + 1;
+ else if ( jq(target).hasClass('prev') )
+ var page_number = Number( jq('div.pagination span.current').html() ) - 1;
else
- var page_number = Number( j(target).html() );
-
- 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') );
+ var page_number = Number( jq(target).html() );
+
+ 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') );
return false;
@@ -578,12 +578,12 @@
/* Hit the "New Topic" button on the forums directory page */
- j('a#new-topic-button').click( function() {
- if ( !j('div#new-topic-post').length )
- return false;
-
- if ( j('div#new-topic-post').is(":visible") )
- j('div#new-topic-post').slideUp(200);
+ jq('a#new-topic-button').click( function() {
+ if ( !jq('div#new-topic-post').length )
+ return false;
+
+ if ( jq('div#new-topic-post').is(":visible") )
+ jq('div#new-topic-post').slideUp(200);
else
- j('div#new-topic-post').slideDown(200);
+ jq('div#new-topic-post').slideDown(200);
return false;
@@ -591,15 +591,15 @@
/* Cancel the posting of a new forum topic */
- j('input#submit_topic_cancel').click( function() {
- if ( !j('div#new-topic-post').length )
- return false;
-
- j('div#new-topic-post').slideUp(200);
+ jq('input#submit_topic_cancel').click( function() {
+ if ( !jq('div#new-topic-post').length )
+ return false;
+
+ jq('div#new-topic-post').slideUp(200);
return false;
});
/* Clicking a forum tag */
- j('div#forum-directory-tags a').click( function() {
- bp_filter_request( 'forums', 'tags', j.cookie('bp-forums-scope'), 'div.forums', j(this).html().replace( / /g, '-' ), 1, j.cookie('bp-forums-extras') );
+ jq('div#forum-directory-tags a').click( function() {
+ bp_filter_request( 'forums', 'tags', jq.cookie('bp-forums-scope'), 'div.forums', jq(this).html().replace( / /g, '-' ), 1, jq.cookie('bp-forums-extras') );
return false;
});
@@ -608,62 +608,62 @@
/* Select a user from the list of friends and add them to the invite list */
- j("div#invite-list input").click( function() {
- j('.ajax-loader').toggle();
-
- var friend_id = j(this).val();
-
- if ( j(this).attr('checked') == true )
+ jq("div#invite-list input").click( function() {
+ jq('.ajax-loader').toggle();
+
+ var friend_id = jq(this).val();
+
+ if ( jq(this).attr('checked') == true )
var friend_action = 'invite';
else
var friend_action = 'uninvite';
- j('div.item-list-tabs li.selected').addClass('loading');
-
- j.post( ajaxurl, {
+ jq('div.item-list-tabs li.selected').addClass('loading');
+
+ jq.post( ajaxurl, {
action: 'groups_invite_user',
'friend_action': friend_action,
'cookie': encodeURIComponent(document.cookie),
- '_wpnonce': j("input#_wpnonce_invite_uninvite_user").val(),
+ '_wpnonce': jq("input#_wpnonce_invite_uninvite_user").val(),
'friend_id': friend_id,
- 'group_id': j("input#group_id").val()
+ 'group_id': jq("input#group_id").val()
},
function(response)
{
- if ( j("#message") )
- j("#message").hide();
-
- j('.ajax-loader').toggle();
+ if ( jq("#message") )
+ jq("#message").hide();
+
+ jq('.ajax-loader').toggle();
if ( friend_action == 'invite' ) {
- j('#friend-list').append(response);
+ jq('#friend-list').append(response);
} else if ( friend_action == 'uninvite' ) {
- j('#friend-list li#uid-' + friend_id).remove();
- }
-
- j('div.item-list-tabs li.selected').removeClass('loading');
+ jq('#friend-list li#uid-' + friend_id).remove();
+ }
+
+ jq('div.item-list-tabs li.selected').removeClass('loading');
});
});
/* Remove a user from the list of users to invite to a group */
- j("#friend-list li a.remove").live('click', function() {
- j('.ajax-loader').toggle();
-
- var friend_id = j(this).attr('id');
+ jq("#friend-list li a.remove").live('click', function() {
+ jq('.ajax-loader').toggle();
+
+ var friend_id = jq(this).attr('id');
friend_id = friend_id.split('-');
friend_id = friend_id[1];
- j.post( ajaxurl, {
+ jq.post( ajaxurl, {
action: 'groups_invite_user',
'friend_action': 'uninvite',
'cookie': encodeURIComponent(document.cookie),
- '_wpnonce': j("input#_wpnonce_invite_uninvite_user").val(),
+ '_wpnonce': jq("input#_wpnonce_invite_uninvite_user").val(),
'friend_id': friend_id,
- 'group_id': j("input#group_id").val()
+ 'group_id': jq("input#group_id").val()
},
function(response)
{
- j('.ajax-loader').toggle();
- j('#friend-list li#uid-' + friend_id).remove();
- j('#invite-list input#f-' + friend_id).attr('checked', false);
+ jq('.ajax-loader').toggle();
+ jq('#friend-list li#uid-' + friend_id).remove();
+ jq('#invite-list input#f-' + friend_id).attr('checked', false);
});
@@ -674,8 +674,8 @@
/* Accept and Reject friendship request buttons */
- j("ul#friend-list a.accept, ul#friend-list a.reject").click( function() {
- var button = j(this);
- var li = j(this).parents('ul#friend-list li');
- var action_div = j(this).parents('li div.action');
+ jq("ul#friend-list a.accept, ul#friend-list a.reject").click( function() {
+ var button = jq(this);
+ var li = jq(this).parents('ul#friend-list li');
+ var action_div = jq(this).parents('li div.action');
var id = li.attr('id').substr( 11, li.attr('id').length );
@@ -685,8 +685,8 @@
nonce = nonce[1];
- if ( j(this).hasClass('accepted') || j(this).hasClass('rejected') )
- return false;
-
- if ( j(this).hasClass('accept') ) {
+ if ( jq(this).hasClass('accepted') || jq(this).hasClass('rejected') )
+ return false;
+
+ if ( jq(this).hasClass('accept') ) {
var action = 'accept_friendship';
action_div.children('a.reject').css( 'visibility', 'hidden' );
@@ -698,5 +698,5 @@
button.addClass('loading');
- j.post( ajaxurl, {
+ jq.post( ajaxurl, {
action: action,
'cookie': encodeURIComponent(document.cookie),
@@ -712,10 +712,10 @@
} else {
button.fadeOut( 100, function() {
- if ( j(this).hasClass('accept') ) {
- j(this).html( bp_terms_accepted ).fadeIn(50);
- j(this).addClass('accepted');
+ if ( jq(this).hasClass('accept') ) {
+ jq(this).html( bp_terms_accepted ).fadeIn(50);
+ jq(this).addClass('accepted');
} else {
- j(this).html( bp_terms_rejected ).fadeIn(50);
- j(this).addClass('rejected');
+ jq(this).html( bp_terms_rejected ).fadeIn(50);
+ jq(this).addClass('rejected');
}
});
@@ -727,18 +727,18 @@
/* Add / Remove friendship buttons */
- j("div.friendship-button a").live('click', function() {
- j(this).parent().addClass('loading');
- var fid = j(this).attr('id');
+ jq("div.friendship-button a").live('click', function() {
+ jq(this).parent().addClass('loading');
+ var fid = jq(this).attr('id');
fid = fid.split('-');
fid = fid[1];
- var nonce = j(this).attr('href');
+ var nonce = jq(this).attr('href');
nonce = nonce.split('?_wpnonce=');
nonce = nonce[1].split('&');
nonce = nonce[0];
- var thelink = j(this);
-
- j.post( ajaxurl, {
+ var thelink = jq(this);
+
+ jq.post( ajaxurl, {
action: 'addremove_friend',
'cookie': encodeURIComponent(document.cookie),
@@ -752,5 +752,5 @@
if ( action == 'add' ) {
- j(parentdiv).fadeOut(200,
+ jq(parentdiv).fadeOut(200,
function() {
parentdiv.removeClass('add_friend');
@@ -762,5 +762,5 @@
} else if ( action == 'remove' ) {
- j(parentdiv).fadeOut(200,
+ jq(parentdiv).fadeOut(200,
function() {
parentdiv.removeClass('remove_friend');
@@ -777,17 +777,17 @@
/** Group Join / Leave Buttons **************************************/
- j("div.group-button a").live('click', function() {
- var gid = j(this).parent().attr('id');
+ jq("div.group-button a").live('click', function() {
+ var gid = jq(this).parent().attr('id');
gid = gid.split('-');
gid = gid[1];
- var nonce = j(this).attr('href');
+ var nonce = jq(this).attr('href');
nonce = nonce.split('?_wpnonce=');
nonce = nonce[1].split('&');
nonce = nonce[0];
- var thelink = j(this);
-
- j.post( ajaxurl, {
+ var thelink = jq(this);
+
+ jq.post( ajaxurl, {
action: 'joinleave_group',
'cookie': encodeURIComponent(document.cookie),
@@ -799,8 +799,8 @@
var parentdiv = thelink.parent();
- if ( !j('body.directory').length )
+ if ( !jq('body.directory').length )
location.href = location.href;
else {
- j(parentdiv).fadeOut(200,
+ jq(parentdiv).fadeOut(200,
function() {
parentdiv.fadeIn(200).html(response);
@@ -814,5 +814,5 @@
/** Button disabling ************************************************/
- j('div.pending').click(function() {
+ jq('div.pending').click(function() {
return false;
});
@@ -820,7 +820,7 @@
/** Alternate Highlighting ******************************************/
- j('table tr, div.message-box, ul#topic-post-list li').each( function(i) {
+ jq('table tr, div.message-box, ul#topic-post-list li').each( function(i) {
if ( i % 2 != 1 )
- j(this).addClass('alt');
+ jq(this).addClass('alt');
});
@@ -828,38 +828,38 @@
/* AJAX send reply functionality */
- j("input#send_reply_button").click(
+ jq("input#send_reply_button").click(
function() {
- j('form#send-reply span.ajax-loader').toggle();
-
- j.post( ajaxurl, {
+ jq('form#send-reply span.ajax-loader').toggle();
+
+ jq.post( ajaxurl, {
action: 'messages_send_reply',
'cookie': encodeURIComponent(document.cookie),
- '_wpnonce': j("input#send_message_nonce").val(),
-
- 'content': j("#message_content").val(),
- 'send_to': j("input#send_to").val(),
- 'subject': j("input#subject").val(),
- 'thread_id': j("input#thread_id").val()
+ '_wpnonce': jq("input#send_message_nonce").val(),
+
+ 'content': jq("#message_content").val(),
+ 'send_to': jq("input#send_to").val(),
+ 'subject': jq("input#subject").val(),
+ 'thread_id': jq("input#thread_id").val()
},
function(response)
{
if ( response[0] + response[1] == "-1" ) {
- j('form#send-reply').prepend( response.substr( 2, response.length ) );
+ jq('form#send-reply').prepend( response.substr( 2, response.length ) );
} else {
- j('form#send-reply div#message').remove();
- j("#message_content").val('');
- j('form#send-reply').before( response );
-
- j("div.new-message").hide().slideDown( 200, function() {
- j('div.new-message').removeClass('new-message');
+ jq('form#send-reply div#message').remove();
+ jq("#message_content").val('');
+ jq('form#send-reply').before( response );
+
+ jq("div.new-message").hide().slideDown( 200, function() {
+ jq('div.new-message').removeClass('new-message');
});
- j('div.message-box').each( function(i) {
- j(this).removeClass('alt');
+ jq('div.message-box').each( function(i) {
+ jq(this).removeClass('alt');
if ( i % 2 != 1 )
- j(this).addClass('alt');
+ jq(this).addClass('alt');
});
}
- j('form#send-reply span.ajax-loader').toggle();
+ jq('form#send-reply span.ajax-loader').toggle();
});
@@ -869,9 +869,9 @@
/* Marking private messages as read and unread */
- j("a#mark_as_read, a#mark_as_unread").click(function() {
+ jq("a#mark_as_read, a#mark_as_unread").click(function() {
var checkboxes_tosend = '';
- var checkboxes = j("#message-threads tr td input[type='checkbox']");
-
- if ( 'mark_as_unread' == j(this).attr('id') ) {
+ var checkboxes = jq("#message-threads tr td input[type='checkbox']");
+
+ if ( 'mark_as_unread' == jq(this).attr('id') ) {
var currentClass = 'read'
var newClass = 'unread'
@@ -890,14 +890,14 @@
checkboxes.each( function(i) {
- if(j(this).is(':checked')) {
- if ( j('tr#m-' + j(this).attr('value')).hasClass(currentClass) ) {
- checkboxes_tosend += j(this).attr('value');
- j('tr#m-' + j(this).attr('value')).removeClass(currentClass);
- j('tr#m-' + j(this).attr('value')).addClass(newClass);
- var thread_count = j('tr#m-' + j(this).attr('value') + ' td span.unread-count').html();
-
- j('tr#m-' + j(this).attr('value') + ' td span.unread-count').html(unreadCount);
- j('tr#m-' + j(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay);
- var inboxcount = j('a#user-messages strong').html().substr( 1, j('a#user-messages strong').html().length );
+ if(jq(this).is(':checked')) {
+ if ( jq('tr#m-' + jq(this).attr('value')).hasClass(currentClass) ) {
+ checkboxes_tosend += jq(this).attr('value');
+ jq('tr#m-' + jq(this).attr('value')).removeClass(currentClass);
+ jq('tr#m-' + jq(this).attr('value')).addClass(newClass);
+ var thread_count = jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').html();
+
+ jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').html(unreadCount);
+ jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay);
+ var inboxcount = jq('a#user-messages strong').html().substr( 1, jq('a#user-messages strong').html().length );
var inboxcount = inboxcount.substr( 0, inboxcount.length - 1 );
@@ -905,11 +905,11 @@
inboxcount = 0;
if ( parseInt(inboxcount) == inboxCount ) {
- j('a#user-messages strong').css('display', unreadCountDisplay);
- j('a#user-messages strong').html( '(' + unreadCount + ')' );
+ jq('a#user-messages strong').css('display', unreadCountDisplay);
+ jq('a#user-messages strong').html( '(' + unreadCount + ')' );
} else {
if ( 'read' == currentClass )
- j('a#user-messages strong').html('(' + ( parseInt(inboxcount) + 1 ) + ')');
+ jq('a#user-messages strong').html('(' + ( parseInt(inboxcount) + 1 ) + ')');
else
- j('a#user-messages strong').html('(' + ( parseInt(inboxcount) - thread_count ) + ')');
+ jq('a#user-messages strong').html('(' + ( parseInt(inboxcount) - thread_count ) + ')');
}
@@ -920,5 +920,5 @@
}
});
- j.post( ajaxurl, {
+ jq.post( ajaxurl, {
action: action,
'thread_ids': checkboxes_tosend
@@ -928,8 +928,8 @@
/* Selecting unread and read messages in inbox */
- j("select#message-type-select").change(
+ jq("select#message-type-select").change(
function() {
- var selection = j("select#message-type-select").val();
- var checkboxes = j("td input[type='checkbox']");
+ var selection = jq("select#message-type-select").val();
+ var checkboxes = jq("td input[type='checkbox']");
checkboxes.each( function(i) {
checkboxes[i].checked = "";
@@ -938,8 +938,8 @@
switch(selection) {
case 'unread':
- var checkboxes = j("tr.unread td input[type='checkbox']");
+ var checkboxes = jq("tr.unread td input[type='checkbox']");
break;
case 'read':
- var checkboxes = j("tr.read td input[type='checkbox']");
+ var checkboxes = jq("tr.read td input[type='checkbox']");
break;
}
@@ -957,38 +957,38 @@
/* Bulk delete messages */
- j("a#delete_inbox_messages").click( function() {
+ jq("a#delete_inbox_messages").click( function() {
checkboxes_tosend = '';
- checkboxes = j("#message-threads tr td input[type='checkbox']");
-
- j('div#message').remove();
- j(this).addClass('loading');
-
- j(checkboxes).each( function(i) {
- if( j(this).is(':checked') )
- checkboxes_tosend += j(this).attr('value') + ',';
+ checkboxes = jq("#message-threads tr td input[type='checkbox']");
+
+ jq('div#message').remove();
+ jq(this).addClass('loading');
+
+ jq(checkboxes).each( function(i) {
+ if( jq(this).is(':checked') )
+ checkboxes_tosend += jq(this).attr('value') + ',';
});
if ( '' == checkboxes_tosend ) {
- j(this).removeClass('loading');
- return false;
- }
-
- j.post( ajaxurl, {
+ jq(this).removeClass('loading');
+ return false;
+ }
+
+ jq.post( ajaxurl, {
action: 'messages_delete',
'thread_ids': checkboxes_tosend
}, function(response) {
if ( response[0] + response[1] == "-1" ) {
- j('#message-threads').prepend( response.substr( 2, response.length ) );
+ jq('#message-threads').prepend( response.substr( 2, response.length ) );
} else {
- j('#message-threads').before( '' );
-
- j(checkboxes).each( function(i) {
- if( j(this).is(':checked') )
- j(this).parent().parent().fadeOut(150);
+ jq('#message-threads').before( '' );
+
+ jq(checkboxes).each( function(i) {
+ if( jq(this).is(':checked') )
+ jq(this).parent().parent().fadeOut(150);
});
}
- j('div#message').hide().slideDown(150);
- j("a#delete_inbox_messages").removeClass('loading');
+ jq('div#message').hide().slideDown(150);
+ jq("a#delete_inbox_messages").removeClass('loading');
});
return false;
@@ -996,20 +996,20 @@
/* Close site wide notices in the sidebar */
- j("a#close-notice").click( function() {
- j(this).addClass('loading');
- j('div#sidebar div.error').remove();
-
- j.post( ajaxurl, {
+ jq("a#close-notice").click( function() {
+ jq(this).addClass('loading');
+ jq('div#sidebar div.error').remove();
+
+ jq.post( ajaxurl, {
action: 'messages_close_notice',
- 'notice_id': j('.notice').attr('rel').substr( 2, j('.notice').attr('rel').length )
+ 'notice_id': jq('.notice').attr('rel').substr( 2, jq('.notice').attr('rel').length )
},
function(response) {
- j("a#close-notice").removeClass('loading');
+ jq("a#close-notice").removeClass('loading');
if ( response[0] + response[1] == '-1' ) {
- j('.notice').prepend( response.substr( 2, response.length ) );
- j( 'div#sidebar div.error').hide().fadeIn( 200 );
+ jq('.notice').prepend( response.substr( 2, response.length ) );
+ jq( 'div#sidebar div.error').hide().fadeIn( 200 );
} else {
- j('.notice').slideUp( 100 );
+ jq('.notice').slideUp( 100 );
}
});
@@ -1018,23 +1018,23 @@
/* Admin Bar Javascript */
- j("#wp-admin-bar ul.main-nav li").mouseover( function() {
- j(this).addClass('sfhover');
- });
-
- j("#wp-admin-bar ul.main-nav li").mouseout( function() {
- j(this).removeClass('sfhover');
+ jq("#wp-admin-bar ul.main-nav li").mouseover( function() {
+ jq(this).addClass('sfhover');
+ });
+
+ jq("#wp-admin-bar ul.main-nav li").mouseout( function() {
+ jq(this).removeClass('sfhover');
});
/* Clear BP cookies on logout */
- j('a.logout').click( function() {
- j.cookie('bp-activity-scope', null, {path: '/'});
- j.cookie('bp-activity-filter', null, {path: '/'});
- j.cookie('bp-activity-oldestpage', null, {path: '/'});
+ jq('a.logout').click( function() {
+ jq.cookie('bp-activity-scope', null, {path: '/'});
+ jq.cookie('bp-activity-filter', null, {path: '/'});
+ jq.cookie('bp-activity-oldestpage', null, {path: '/'});
var objects = [ 'members', 'groups', 'blogs', 'forums' ];
- j(objects).each( function(i) {
- j.cookie('bp-' + objects[i] + '-scope', null, {path: '/'} );
- j.cookie('bp-' + objects[i] + '-filter', null, {path: '/'} );
- j.cookie('bp-' + objects[i] + '-extras', null, {path: '/'} );
+ jq(objects).each( function(i) {
+ jq.cookie('bp-' + objects[i] + '-scope', null, {path: '/'} );
+ jq.cookie('bp-' + objects[i] + '-filter', null, {path: '/'} );
+ jq.cookie('bp-' + objects[i] + '-extras', null, {path: '/'} );
});
});
@@ -1044,15 +1044,15 @@
function bp_init_activity() {
/* Reset the page */
- j.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
-
- if ( null != j.cookie('bp-activity-filter') && j('#activity-filter-select').length )
- j('#activity-filter-select select option[value=' + j.cookie('bp-activity-filter') + ']').attr( 'selected', 'selected' );
+ jq.cookie( 'bp-activity-oldestpage', 1, {path: '/'} );
+
+ if ( null != jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length )
+ jq('#activity-filter-select select option[value=' + jq.cookie('bp-activity-filter') + ']').attr( 'selected', 'selected' );
/* Activity Tab Set */
- if ( null != j.cookie('bp-activity-scope') && j('div.activity-type-tabs').length ) {
- j('div.activity-type-tabs li').each( function() {
- j(this).removeClass('selected');
- });
- j('li#activity-' + j.cookie('bp-activity-scope') + ', div.item-list-tabs li.current').addClass('selected');
+ if ( null != jq.cookie('bp-activity-scope') && jq('div.activity-type-tabs').length ) {
+ jq('div.activity-type-tabs li').each( function() {
+ jq(this).removeClass('selected');
+ });
+ jq('li#activity-' + jq.cookie('bp-activity-scope') + ', div.item-list-tabs li.current').addClass('selected');
}
}
@@ -1060,13 +1060,13 @@
/* Setup object scope and filter based on the current cookie settings for the object. */
function bp_init_objects(objects) {
- j(objects).each( function(i) {
- if ( null != j.cookie('bp-' + objects[i] + '-filter') && j('li#' + objects[i] + '-order-select select').length )
- j('li#' + objects[i] + '-order-select select option[value=' + j.cookie('bp-' + objects[i] + '-filter') + ']').attr( 'selected', 'selected' );
-
- if ( null != j.cookie('bp-' + objects[i] + '-scope') && j('div.' + objects[i]).length ) {
- j('div.item-list-tabs li').each( function() {
- j(this).removeClass('selected');
+ jq(objects).each( function(i) {
+ if ( null != jq.cookie('bp-' + objects[i] + '-filter') && jq('li#' + objects[i] + '-order-select select').length )
+ jq('li#' + objects[i] + '-order-select select option[value=' + jq.cookie('bp-' + objects[i] + '-filter') + ']').attr( 'selected', 'selected' );
+
+ if ( null != jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
+ jq('div.item-list-tabs li').each( function() {
+ jq(this).removeClass('selected');
});
- j('div.item-list-tabs li#' + objects[i] + '-' + j.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected');
+ jq('div.item-list-tabs li#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected');
}
});
@@ -1078,6 +1078,6 @@
return false;
- if ( j.query.get('s') )
- search_terms = j.query.get('s');
+ if ( jq.query.get('s') )
+ search_terms = jq.query.get('s');
if ( null == scope )
@@ -1085,15 +1085,15 @@
/* Save the settings we want to remain persistent to a cookie */
- j.cookie( 'bp-' + object + '-scope', scope, {path: '/'} );
- j.cookie( 'bp-' + object + '-filter', filter, {path: '/'} );
- j.cookie( 'bp-' + object + '-extras', extras, {path: '/'} );
+ jq.cookie( 'bp-' + object + '-scope', scope, {path: '/'} );
+ jq.cookie( 'bp-' + object + '-filter', filter, {path: '/'} );
+ jq.cookie( 'bp-' + object + '-extras', extras, {path: '/'} );
/* Set the correct selected nav and filter */
- j('div.item-list-tabs li').each( function() {
- j(this).removeClass('selected');
- });
- j('div.item-list-tabs li#' + object + '-' + scope + ', div.item-list-tabs#object-nav li.current').addClass('selected');
- j('div.item-list-tabs li.selected').addClass('loading');
- j('div.item-list-tabs select option[value=' + filter + ']').attr( 'selected', 'selected' );
+ jq('div.item-list-tabs li').each( function() {
+ jq(this).removeClass('selected');
+ });
+ jq('div.item-list-tabs li#' + object + '-' + scope + ', div.item-list-tabs#object-nav li.current').addClass('selected');
+ jq('div.item-list-tabs li.selected').addClass('loading');
+ jq('div.item-list-tabs select option[value=' + filter + ']').attr( 'selected', 'selected' );
if ( 'friends' == object )
@@ -1103,5 +1103,5 @@
bp_ajax_request.abort();
- bp_ajax_request = j.post( ajaxurl, {
+ bp_ajax_request = jq.post( ajaxurl, {
action: object + '_filter',
'cookie': encodeURIComponent(document.cookie),
@@ -1115,9 +1115,9 @@
function(response)
{
- j(target).fadeOut( 100, function() {
- j(this).html(response);
- j(this).fadeIn(100);
+ jq(target).fadeOut( 100, function() {
+ jq(this).html(response);
+ jq(this).fadeIn(100);
});
- j('div.item-list-tabs li.selected').removeClass('loading');
+ jq('div.item-list-tabs li.selected').removeClass('loading');
});
}
@@ -1126,27 +1126,27 @@
function bp_activity_request(scope, filter) {
/* Save the type and filter to a session cookie */
- j.cookie( 'bp-activity-scope', scope, {path: '/'} );
- j.cookie( 'bp-activity-filter', filter, {path: '/'} );
- j.cookie( 'bp-activity-oldestpage', 1 );
+ jq.cookie( 'bp-activity-scope', scope, {path: '/'} );
+ jq.cookie( 'bp-activity-filter', filter, {path: '/'} );
+ jq.cookie( 'bp-activity-oldestpage', 1 );
/* Remove selected and loading classes from tabs */
- j('div.item-list-tabs li').each( function() {
- j(this).removeClass('selected loading');
+ jq('div.item-list-tabs li').each( function() {
+ jq(this).removeClass('selected loading');
});
/* Set the correct selected nav and filter */
- j('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected');
- j('div#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading');
- j('#activity-filter-select select option[value=' + filter + ']').attr( 'selected', 'selected' );
+ jq('li#activity-' + scope + ', div.item-list-tabs li.current').addClass('selected');
+ jq('div#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading');
+ jq('#activity-filter-select select option[value=' + filter + ']').attr( 'selected', 'selected' );
/* Reload the activity stream based on the selection */
- j('.widget_bp_activity_widget h2 span.ajax-loader').show();
+ jq('.widget_bp_activity_widget h2 span.ajax-loader').show();
if ( bp_ajax_request )
bp_ajax_request.abort();
- bp_ajax_request = j.post( ajaxurl, {
+ bp_ajax_request = jq.post( ajaxurl, {
action: 'activity_widget_filter',
'cookie': encodeURIComponent(document.cookie),
- '_wpnonce_activity_filter': j("input#_wpnonce_activity_filter").val(),
+ '_wpnonce_activity_filter': jq("input#_wpnonce_activity_filter").val(),
'scope': scope,
'filter': filter
@@ -1154,16 +1154,16 @@
function(response)
{
- j('.widget_bp_activity_widget h2 span.ajax-loader').hide();
-
- j('div.activity').fadeOut( 100, function() {
- j(this).html(response.contents);
- j(this).fadeIn(100);
+ jq('.widget_bp_activity_widget h2 span.ajax-loader').hide();
+
+ jq('div.activity').fadeOut( 100, function() {
+ jq(this).html(response.contents);
+ jq(this).fadeIn(100);
});
/* Update the feed link */
if ( null != response.feed_url )
- j('.directory div#subnav li.feed a, .home-page div#subnav li.feed a').attr('href', response.feed_url);
-
- j('div.item-list-tabs li.selected').removeClass('loading');
+ jq('.directory div#subnav li.feed a, .home-page div#subnav li.feed a').attr('href', response.feed_url);
+
+ jq('div.item-list-tabs li.selected').removeClass('loading');
/* Selectively hide comments */
@@ -1175,5 +1175,5 @@
/* Hide long lists of activity comments, only show the latest five root comments. */
function bp_dtheme_hide_comments() {
- var comments_divs = j('div.activity-comments');
+ var comments_divs = jq('div.activity-comments');
if ( !comments_divs.length )
@@ -1181,22 +1181,22 @@
comments_divs.each( function() {
- if ( j(this).children('ul').children('li').length < 5 ) return;
-
- var comments_div = j(this);
+ if ( jq(this).children('ul').children('li').length < 5 ) return;
+
+ var comments_div = jq(this);
var parent_li = comments_div.parents('ul#activity-stream > li');
- var comment_lis = j(this).children('ul').children('li');
+ var comment_lis = jq(this).children('ul').children('li');
var comment_count = ' ';
- if ( j('li#' + parent_li.attr('id') + ' a.acomment-reply span').length )
- var comment_count = j('li#' + parent_li.attr('id') + ' a.acomment-reply span').html();
+ if ( jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').length )
+ var comment_count = jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html();
comment_lis.each( function(i) {
/* Show the latest 5 root comments */
if ( i < comment_lis.length - 5 ) {
- j(this).addClass('hidden');
- j(this).toggle();
+ jq(this).addClass('hidden');
+ jq(this).toggle();
if ( !i )
- j(this).before( '- ' + bp_terms_show_all + ' ' + comment_count + ' ' + bp_terms_comments + '
' );
+ jq(this).before( '- ' + bp_terms_show_all + ' ' + comment_count + ' ' + bp_terms_comments + '
' );
}
});
Index: /trunk/bp-themes/bp-default/blogs/create.php
===================================================================
--- /trunk/bp-themes/bp-default/blogs/create.php (revision 2924)
+++ /trunk/bp-themes/bp-default/blogs/create.php (revision 2925)
@@ -1,5 +1,5 @@
-
+
@@ -31,5 +31,5 @@
-
+
Index: /trunk/bp-themes/bp-default/forums/forums-loop.php
===================================================================
--- /trunk/bp-themes/bp-default/forums/forums-loop.php (revision 2924)
+++ /trunk/bp-themes/bp-default/forums/forums-loop.php (revision 2925)
@@ -31,4 +31,7 @@
|
|
+
+
+
Index: /trunk/bp-themes/bp-default/forums/index.php
===================================================================
--- /trunk/bp-themes/bp-default/forums/index.php (revision 2924)
+++ /trunk/bp-themes/bp-default/forums/index.php (revision 2925)
@@ -1,5 +1,3 @@
-
-