diff --git a/wp-content/plugins/buddypress/bp-activity/admin/css/admin.css b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.css index 8b5ac3dc2606713df4aafdd2316b6300cfce3fa4..bf770824eeff1dc5f7ee44b6eff46e53c15e723d 100644 --- a/wp-content/plugins/buddypress/bp-activity/admin/css/admin.css +++ b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.css @@ -1 +1,77 @@ -.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:white}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em} \ No newline at end of file +.akismet-status { + float: right; +} +.akismet-status a { + color: #AAA; + font-style: italic; +} +.akismet-history { + margin: 13px; +} +.akismet-history div { + margin-bottom: 13px; +} +.akismet-history span { + color: #999; +} + +#wp-bp-activities-wrap { + padding: 5px 0; +} +#bp-activities { + height: 120px; +} +#bp-replyhead { + font-size: 1em; + line-height: 1.4em; + margin: 0; +} +#bp-replysubmit { + margin: 0; + padding: 0 0 3px; + text-align: center; +} +#bp-replysubmit .error { + color: red; + line-height: 21px; + text-align: center; + vertical-align: center; +} +#bp-replysubmit img.waiting { + float: right; + padding: 4px 10px 0; + vertical-align: top; +} +#bp-activities-form .column-response img { + float: left; + margin-right: 10px; + margin-top: 1px; +} +.activity-errors { + list-style-type: disc; + margin-left: 2em; +} + +#bp_activity_action div.inside, +#bp_activity_content div.inside { + line-height: 0; +} +#bp_activity_action h3, +#bp_activity_content h3 { + cursor: auto; +} +#bp_activity_action td.mceIframeContainer, +#bp_activity_content td.mceIframeContainer { + background-color: white; +} +#post-body #bp-activities-action_resize, +#post-body #bp-activities-content_resize { + position: inherit; + margin-top: -2px; +} +#bp_activity_link input { + width: 99%; +} +#bp-activities-primaryid { + margin-bottom: 1em; +} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-activity/admin/css/admin.min.css b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.min.css new file mode 100644 index 0000000000000000000000000000000000000000..8b5ac3dc2606713df4aafdd2316b6300cfce3fa4 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-activity/admin/css/admin.min.css @@ -0,0 +1 @@ +.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:white}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js index 53c59ef39adf411fe34a9ec8646974d73fe78c98..4f4d4794cdb3e8d66b904429b9f329305da55e17 100644 --- a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js +++ b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.js @@ -1 +1,167 @@ -(function(b){var a={init:function(){b(document).on("click",".row-actions a.reply",a.open);b(document).on("click","#bp-activities-container a.cancel",a.close);b(document).on("click","#bp-activities-container a.save",a.send);b(document).on("keyup","#bp-activities:visible",function(c){if(27==c.which){a.close()}})},open:function(d){var c=b("#bp-activities-container").hide();b(this).parents("tr").after(c);c.fadeIn("300");b("#bp-activities").focus();return false},close:function(c){b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide()});return false},send:function(d){b("#bp-replysubmit .error").hide();b("#bp-replysubmit .waiting").show();var c={};c["_ajax_nonce-bp-activity-admin-reply"]=b('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();c.action="bp-activity-admin-reply";c.content=b("#bp-activities").val();c.parent_id=b("#bp-activities-container").prev().data("parent_id");c.root_id=b("#bp-activities-container").prev().data("root_id");b.ajax({data:c,type:"POST",url:ajaxurl,error:function(e){a.error(e)},success:function(e){a.show(e)}});return false},error:function(c){var d=c.statusText;b("#bp-replysubmit .waiting").hide();if(c.responseText){d=c.responseText.replace(/<.[^<>]*?>/g,"")}if(d){b("#bp-replysubmit .error").html(d).show()}},show:function(d){var e,f,c;if(typeof(d)=="string"){a.error({responseText:d});return false}c=wpAjax.parseAjaxResponse(d);if(c.errors){a.error({responseText:wpAjax.broken});return false}c=c.responses[0];b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide();b("#bp-activities-container").before(c.data);f=b("#activity-"+c.id);e=f.closest(".widefat").css("backgroundColor");f.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:e},300)})}};b(document).ready(function(){a.init();b("#bp_activity_action h3, #bp_activity_content h3").unbind("click")})})(jQuery); \ No newline at end of file +(function( $ ) { + +/** + * Activity reply object for the activity index screen + * + * @since BuddyPress (1.6) + */ +var activityReply = { + + /** + * Attach event handler functions to the relevant elements. + * + * @since BuddyPress (1.6) + */ + init : function() { + $(document).on( 'click', '.row-actions a.reply', activityReply.open ); + $(document).on( 'click', '#bp-activities-container a.cancel', activityReply.close ); + $(document).on( 'click', '#bp-activities-container a.save', activityReply.send ); + + // Close textarea on escape + $(document).on( 'keyup', '#bp-activities:visible', function( e ) { + if ( 27 == e.which ) { + activityReply.close(); + } + }); + }, + + /** + * Reveals the entire row when "reply" is pressed. + * + * @since BuddyPress (1.6) + */ + open : function( e ) { + // Hide the container row, and move it to the new location + var box = $( '#bp-activities-container' ).hide(); + $( this ).parents( 'tr' ).after( box ); + + // Fade the whole row in, and set focus on the text area. + box.fadeIn( '300' ); + $( '#bp-activities' ).focus(); + + return false; + }, + + /** + * Hide and reset the entire row when "cancel", or escape, are pressed. + * + * @since BuddyPress (1.6) + */ + close : function( e ) { + // Hide the container row + $('#bp-activities-container').fadeOut( '200', function () { + + // Empty and unfocus the text area + $( '#bp-activities' ).val( '' ).blur(); + + // Remove any error message and disable the spinner + $( '#bp-replysubmit .error' ).html( '' ).hide(); + $( '#bp-replysubmit .waiting' ).hide(); + }); + + return false; + }, + + /** + * Submits "form" via AJAX back to WordPress. + * + * @since BuddyPress (1.6) + */ + send : function( e ) { + // Hide any existing error message, and show the loading spinner + $( '#bp-replysubmit .error' ).hide(); + $( '#bp-replysubmit .waiting' ).show(); + + // Grab the nonce + var reply = {}; + reply['_ajax_nonce-bp-activity-admin-reply'] = $( '#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]' ).val(); + + // Get the rest of the data + reply.action = 'bp-activity-admin-reply'; + reply.content = $( '#bp-activities' ).val(); + reply.parent_id = $( '#bp-activities-container' ).prev().data( 'parent_id' ); + reply.root_id = $( '#bp-activities-container' ).prev().data( 'root_id' ); + + // Make the AJAX call + $.ajax({ + data : reply, + type : 'POST', + url : ajaxurl, + + // Callbacks + error : function( r ) { activityReply.error( r ); }, + success : function( r ) { activityReply.show( r ); } + }); + + return false; + }, + + /** + * send() error message handler + * + * @since BuddyPress (1.6) + */ + error : function( r ) { + var er = r.statusText; + $('#bp-replysubmit .waiting').hide(); + + if ( r.responseText ) { + er = r.responseText.replace( /<.[^<>]*?>/g, '' ); + } + + if ( er ) { + $('#bp-replysubmit .error').html( er ).show(); + } + }, + + /** + * send() success handler + * + * @since BuddyPress (1.6) + */ + show : function ( xml ) { + var bg, id, response; + + // Handle any errors in the response + if ( typeof( xml ) == 'string' ) { + activityReply.error( { 'responseText': xml } ); + return false; + } + + response = wpAjax.parseAjaxResponse( xml ); + if ( response.errors ) { + activityReply.error( { 'responseText': wpAjax.broken } ); + return false; + } + response = response.responses[0]; + + // Close and reset the reply row, and add the new Activity item into the list. + $('#bp-activities-container').fadeOut( '200', function () { + + // Empty and unfocus the text area + $( '#bp-activities' ).val( '' ).blur(); + + // Remove any error message and disable the spinner + $( '#bp-replysubmit .error' ).html( '' ).hide(); + $( '#bp-replysubmit .waiting' ).hide(); + + // Insert new activity item + $( '#bp-activities-container' ).before( response.data ); + + // Get background colour and animate the flash + id = $( '#activity-' + response.id ); + bg = id.closest( '.widefat' ).css( 'backgroundColor' ); + id.animate( { 'backgroundColor': '#CEB' }, 300 ).animate( { 'backgroundColor': bg }, 300 ); + }); + } +}; + +$(document).ready( function () { + // Create the Activity reply object after domready event + activityReply.init(); + + // On the edit screen, unload the close/open toggle js for the action & content metaboxes + $( '#bp_activity_action h3, #bp_activity_content h3' ).unbind( 'click' ); +}); + +})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-activity/admin/js/admin.min.js b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.min.js new file mode 100644 index 0000000000000000000000000000000000000000..53c59ef39adf411fe34a9ec8646974d73fe78c98 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-activity/admin/js/admin.min.js @@ -0,0 +1 @@ +(function(b){var a={init:function(){b(document).on("click",".row-actions a.reply",a.open);b(document).on("click","#bp-activities-container a.cancel",a.close);b(document).on("click","#bp-activities-container a.save",a.send);b(document).on("keyup","#bp-activities:visible",function(c){if(27==c.which){a.close()}})},open:function(d){var c=b("#bp-activities-container").hide();b(this).parents("tr").after(c);c.fadeIn("300");b("#bp-activities").focus();return false},close:function(c){b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide()});return false},send:function(d){b("#bp-replysubmit .error").hide();b("#bp-replysubmit .waiting").show();var c={};c["_ajax_nonce-bp-activity-admin-reply"]=b('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val();c.action="bp-activity-admin-reply";c.content=b("#bp-activities").val();c.parent_id=b("#bp-activities-container").prev().data("parent_id");c.root_id=b("#bp-activities-container").prev().data("root_id");b.ajax({data:c,type:"POST",url:ajaxurl,error:function(e){a.error(e)},success:function(e){a.show(e)}});return false},error:function(c){var d=c.statusText;b("#bp-replysubmit .waiting").hide();if(c.responseText){d=c.responseText.replace(/<.[^<>]*?>/g,"")}if(d){b("#bp-replysubmit .error").html(d).show()}},show:function(d){var e,f,c;if(typeof(d)=="string"){a.error({responseText:d});return false}c=wpAjax.parseAjaxResponse(d);if(c.errors){a.error({responseText:wpAjax.broken});return false}c=c.responses[0];b("#bp-activities-container").fadeOut("200",function(){b("#bp-activities").val("").blur();b("#bp-replysubmit .error").html("").hide();b("#bp-replysubmit .waiting").hide();b("#bp-activities-container").before(c.data);f=b("#activity-"+c.id);e=f.closest(".widefat").css("backgroundColor");f.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:e},300)})}};b(document).ready(function(){a.init();b("#bp_activity_action h3, #bp_activity_content h3").unbind("click")})})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php index 23b09f6b78dab09185af796742247969c467a77d..21651a6b540931ebcd71aec30cc18a405ddee915 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-actions.php @@ -147,7 +147,7 @@ function bp_activity_action_delete_activity( $activity_id = 0 ) { $activity = new BP_Activity_Activity( $activity_id ); // Check access - if ( empty( $activity->user_id ) || !bp_activity_user_can_delete( $activity ) ) + if ( ! bp_activity_user_can_delete( $activity ) ) return false; // Call the action before the delete so plugins can still fetch information about it @@ -175,7 +175,7 @@ add_action( 'bp_actions', 'bp_activity_action_delete_activity' ); * @global object $bp BuddyPress global settings * @param int $activity_id Activity id to be deleted. Defaults to 0. * @return bool False on failure - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_action_spam_activity( $activity_id = 0 ) { global $bp; @@ -325,9 +325,9 @@ function bp_activity_action_post_comment() { } $comment_id = bp_activity_new_comment( array( - 'content' => $content, + 'content' => $content, 'activity_id' => $activity_id, - 'parent_id' => $parent_id + 'parent_id' => false )); if ( !empty( $comment_id ) ) @@ -577,7 +577,7 @@ add_action( 'bp_actions', 'bp_activity_action_favorites_feed' ); * Loads Akismet * * @global object $bp BuddyPress global settings - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_setup_akismet() { global $bp; @@ -591,11 +591,9 @@ function bp_activity_setup_akismet() { return; // Bail if BuddyPress Activity Akismet support has been disabled by another plugin - if ( ! apply_filters( 'bp_activity_use_akismet', true ) ) + if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) return; // Instantiate Akismet for BuddyPress $bp->activity->akismet = new BP_Akismet(); } - -?> diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php index 47e9ca32b7ef172824f2241c25140c5e3525bb4d..ab88d81363f5dce08d970d406e62857d41e8ed2e 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-admin.php @@ -6,7 +6,7 @@ * on which this implementation is heavily based. * * @package BuddyPress - * @since 1.6 + * @since BuddyPress (1.6) * @subpackage Activity */ @@ -23,7 +23,7 @@ if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-activity' == $_REQUEST['p /** * Registers the Activity component admin screen * - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_add_admin_menu() { @@ -31,18 +31,39 @@ function bp_activity_add_admin_menu() { return; // Add our screen - $hook = add_menu_page( __( 'Activity', 'buddypress' ), __( 'Activity', 'buddypress' ), 'manage_options', 'bp-activity', 'bp_activity_admin' ); + $hook = add_menu_page( + __( 'Activity', 'buddypress' ), + __( 'Activity', 'buddypress' ), + 'manage_options', + 'bp-activity', + 'bp_activity_admin', + 'div' + ); // Hook into early actions to load custom CSS and our init handler. add_action( "load-$hook", 'bp_activity_admin_load' ); } add_action( bp_core_admin_hook(), 'bp_activity_add_admin_menu' ); +/** + * Add activity component to custom menus array + * + * @since BuddyPress (1.7) + * + * @param array $custom_menus + * @return array + */ +function bp_activity_admin_menu_order( $custom_menus = array() ) { + array_push( $custom_menus, 'bp-activity' ); + return $custom_menus; +} +add_filter( 'bp_admin_menu_order', 'bp_activity_admin_menu_order' ); + /** * AJAX receiver for Activity replies via the admin screen. Adds a new activity * comment, and returns HTML for a new table row. * - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_reply() { // Check nonce @@ -116,7 +137,7 @@ add_action( 'wp_ajax_bp-activity-admin-reply', 'bp_activity_admin_reply' ); * @param string $option Screen option name * @param string $new_value Screen option form value * @return string Option value. False to abandon update. - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_screen_options( $value, $option, $new_value ) { if ( 'toplevel_page_bp_activity_per_page' != $option && 'toplevel_page_bp_activity_network_per_page' != $option ) @@ -135,7 +156,7 @@ function bp_activity_admin_screen_options( $value, $option, $new_value ) { * * @param WP_Screen $screen Screen identifier * @return array Hidden Meta Boxes - * @since 1.0 + * @since BuddyPress (1.0) */ function bp_activity_admin_edit_hidden_metaboxes( $hidden, $screen ) { if ( empty( $screen->id ) || 'toplevel_page_bp-activity' != $screen->id && 'toplevel_page_bp-activity_network' != $screen->id ) @@ -153,16 +174,15 @@ add_filter( 'default_hidden_meta_boxes', 'bp_activity_admin_edit_hidden_metaboxe * * @global object $bp BuddyPress global settings * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_load() { global $bp, $bp_activity_list_table; // Decide whether to load the dev version of the CSS and JavaScript - $dev = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? 'dev.' : ''; + $min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : 'min.'; - // Decide whether to load the index or edit screen - $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : ''; + $doaction = bp_admin_list_table_current_bulk_action(); // Call an action for plugins to hook in early do_action( 'bp_activity_admin_load', $doaction ); @@ -244,8 +264,8 @@ function bp_activity_admin_load() { } // Enqueue CSS and JavaScript - wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . "bp-activity/admin/js/admin.{$dev}js", array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true ); - wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$dev}css", array(), bp_get_version() ); + wp_enqueue_script( 'bp_activity_admin_js', BP_PLUGIN_URL . "bp-activity/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response' ), bp_get_version(), true ); + wp_enqueue_style( 'bp_activity_admin_css', BP_PLUGIN_URL . "bp-activity/admin/css/admin.{$min}css", array(), bp_get_version() ); // Handle spam/un-spam/delete of activities if ( !empty( $doaction ) && ! in_array( $doaction, array( '-1', 'edit', 'save', ) ) ) { @@ -503,7 +523,7 @@ function bp_activity_admin_load() { /** * Outputs the Activity component admin screens * - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin() { // Decide whether to load the index or edit screen @@ -522,10 +542,9 @@ function bp_activity_admin() { * Display the single activity edit screen * * @global int $screen_layout_columns Number of columns shown on this admin page - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_edit() { - global $screen_layout_columns; // @todo: Check if user is allowed to edit activity items // if ( ! current_user_can( 'bp_edit_activity' ) ) @@ -556,8 +575,7 @@ function bp_activity_admin_edit() { $form_url = add_query_arg( 'action', 'save', $form_url ); // Call an action for plugins to modify the activity before we display the edit form - do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); -?> + do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?> <div class="wrap"> <?php screen_icon( 'buddypress-activity' ); ?> @@ -568,7 +586,7 @@ function bp_activity_admin_edit() { <form action="<?php echo esc_attr( $form_url ); ?>" id="bp-activities-edit-form" method="post"> <div id="poststuff"> - <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> + <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> <div id="post-body-content"> <div id="postdiv" class="postarea"> <div id="bp_activity_action" class="postbox"> @@ -604,7 +622,7 @@ function bp_activity_admin_edit() { </form> <?php else : ?> - <p><?php printf( __( 'No activity found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), network_admin_url( 'admin.php?page=bp-activity' ) ); ?></p> + <p><?php printf( __( 'No activity found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), esc_url( bp_get_admin_url( 'admin.php?page=bp-activity' ) ) ); ?></p> <?php endif; ?> </div><!-- .wrap --> @@ -616,7 +634,7 @@ function bp_activity_admin_edit() { * Status metabox for the Activity admin edit screen * * @param object $item Activity item - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_edit_metabox_status( $item ) { ?> @@ -671,7 +689,7 @@ function bp_activity_admin_edit_metabox_status( $item ) { * Primary link metabox for the Activity admin edit screen * * @param object $item Activity item - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_edit_metabox_link( $item ) { ?> @@ -687,7 +705,7 @@ function bp_activity_admin_edit_metabox_link( $item ) { * User ID metabox for the Activity admin edit screen * * @param object $item Activity item - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_edit_metabox_userid( $item ) { ?> @@ -703,7 +721,7 @@ function bp_activity_admin_edit_metabox_userid( $item ) { * * @global object $bp BuddyPress global settings * @param object $item Activity item - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_edit_metabox_type( $item ) { global $bp; @@ -723,8 +741,7 @@ function bp_activity_admin_edit_metabox_type( $item ) { unset( $actions['friends_register_activity_action'] ); // Sort array by the human-readable value - natsort( $actions ); -?> + natsort( $actions ); ?> <select name="bp-activities-type"> <?php foreach ( $actions as $k => $v ) : ?> @@ -739,7 +756,7 @@ function bp_activity_admin_edit_metabox_type( $item ) { * Primary item ID/Secondary item ID metabox for the Activity admin edit screen * * @param object $item Activity item - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_edit_metabox_itemids( $item ) { ?> @@ -761,7 +778,7 @@ function bp_activity_admin_edit_metabox_itemids( $item ) { * * @global BP_Activity_List_Table $bp_activity_list_table Activity screen list table * @global string $plugin_page - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_admin_index() { global $bp_activity_list_table, $plugin_page; @@ -780,15 +797,16 @@ function bp_activity_admin_index() { // Make sure we don't get any empty values in $errors for ( $i = 0, $errors_count = count( $errors ); $i < $errors_count; $i++ ) { - if ( 0 === $errors[$i] ) + if ( 0 === $errors[$i] ) { unset( $errors[$i] ); + } } // Reindex array $errors = array_values( $errors ); if ( $deleted > 0 ) - $messages[] = sprintf( _n( '%s activity has been permanently deleted.', '%s activity items have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) ); + $messages[] = sprintf( _n( '%s activity item has been permanently deleted.', '%s activity items have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) ); if ( ! empty( $errors ) ) { if ( 1 == count( $errors ) ) { @@ -810,21 +828,20 @@ function bp_activity_admin_index() { } if ( $spammed > 0 ) - $messages[] = sprintf( _n( '%s activity has been successfully spammed.', '%s activity items have been successfully spammed.', $spammed, 'buddypress' ), number_format_i18n( $spammed ) ); + $messages[] = sprintf( _n( '%s activity item has been successfully spammed.', '%s activity items have been successfully spammed.', $spammed, 'buddypress' ), number_format_i18n( $spammed ) ); if ( $unspammed > 0 ) - $messages[] = sprintf( _n( '%s activity has been successfully unspammed.', '%s activity items have been successfully unspammed.', $unspammed, 'buddypress' ), number_format_i18n( $unspammed ) ); + $messages[] = sprintf( _n( '%s activity item has been successfully unspammed.', '%s activity items have been successfully unspammed.', $unspammed, 'buddypress' ), number_format_i18n( $unspammed ) ); if ( $updated > 0 ) - $messages[] = __( 'The activity has been updated succesfully.', 'buddypress' ); + $messages[] = __( 'The activity item has been updated succesfully.', 'buddypress' ); } // Prepare the activity items for display $bp_activity_list_table->prepare_items(); // Call an action for plugins to modify the activity before we display the edit form - do_action( 'bp_activity_admin_index', $messages ); -?> + do_action( 'bp_activity_admin_index', $messages ); ?> <div class="wrap"> <?php screen_icon( 'buddypress-activity' ); ?> @@ -867,7 +884,7 @@ function bp_activity_admin_index() { <a href="#" class="cancel button-secondary alignleft"><?php _e( 'Cancel', 'buddypress' ); ?></a> <a href="#" class="save button-primary alignright"><?php _e( 'Reply', 'buddypress' ); ?></a> - <img class="waiting" style="display:none;" src="<?php echo esc_url( network_admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> + <img class="waiting" style="display:none;" src="<?php echo esc_url( bp_get_admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" /> <span class="error" style="display:none;"></span> <br class="clear" /> </p> @@ -886,34 +903,35 @@ function bp_activity_admin_index() { /** * List table class for the Activity component admin page. * - * @since 1.6 + * @since BuddyPress (1.6) */ class BP_Activity_List_Table extends WP_List_Table { + /** * What type of view is being displayed? e.g. "All", "Pending", "Approved", "Spam"... * - * @since 1.6 + * @since BuddyPress (1.6) */ public $view = 'all'; /** * How many activity items have been marked as spam. * - * @since 1.6 + * @since BuddyPress (1.6) */ public $spam_count = 0; /** * Store activity-to-user-ID mappings for use in the In Response To column. * - * @since 1.6 + * @since BuddyPress (1.6) */ protected $activity_user_id = array(); /** * Constructor * - * @since 1.6 + * @since BuddyPress (1.6) */ public function __construct() { @@ -928,7 +946,7 @@ class BP_Activity_List_Table extends WP_List_Table { /** * Handle filtering of data, sorting, pagination, and any other data-manipulation required prior to rendering. * - * @since 1.6 + * @since BuddyPress (1.6) */ function prepare_items() { $screen = get_current_screen(); @@ -1030,7 +1048,7 @@ class BP_Activity_List_Table extends WP_List_Table { * Get an array of all the columns on the page * * @return array - * @since 1.6 + * @since BuddyPress (1.6) */ function get_column_info() { $this->_column_headers = array( @@ -1045,7 +1063,7 @@ class BP_Activity_List_Table extends WP_List_Table { /** * Displays a message on screen when no items are found (e.g. no search matches) * - * @since 1.6 + * @since BuddyPress (1.6) */ function no_items() { _e( 'No activities found.', 'buddypress' ); @@ -1054,13 +1072,12 @@ class BP_Activity_List_Table extends WP_List_Table { /** * Outputs the Activity data table * - * @since 1.6 + * @since BuddyPress (1.6) */ function display() { extract( $this->_args ); - $this->display_tablenav( 'top' ); - ?> + $this->display_tablenav( 'top' ); ?> <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0"> <thead> @@ -1088,11 +1105,16 @@ class BP_Activity_List_Table extends WP_List_Table { * Generates content for a single row of the table * * @param object $item The current item - * @since 1.6 + * @since BuddyPress (1.6) */ function single_row( $item ) { static $row_class = ''; - $row_class = ( $row_class == '' ? ' class="alternate"' : '' ); + + if ( empty( $row_class ) ) { + $row_class = ' class="alternate"'; + } else { + $row_class = ''; + } echo '<tr' . $row_class . ' id="activity-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['item_id'] ) . '">'; echo $this->single_row_columns( $item ); @@ -1102,7 +1124,7 @@ class BP_Activity_List_Table extends WP_List_Table { /** * Get the list of views available on this table (e.g. "all", "spam"). * - * @since 1.6 + * @since BuddyPress (1.6) */ function get_views() { $redirect_to = remove_query_arg( array( 'activity_status', 'aid', 'deleted', 'error', 'spammed', 'unspammed', 'updated', ), $_SERVER['REQUEST_URI'] ); @@ -1120,7 +1142,7 @@ class BP_Activity_List_Table extends WP_List_Table { * Get bulk actions * * @return array Key/value pairs for the bulk actions dropdown - * @since 1.6 + * @since BuddyPress (1.6) */ function get_bulk_actions() { $actions = array(); @@ -1136,7 +1158,7 @@ class BP_Activity_List_Table extends WP_List_Table { * * @see WP_List_Table::single_row_columns() * @return array - * @since 1.6 + * @since BuddyPress (1.6) */ function get_columns() { return array( @@ -1151,7 +1173,7 @@ class BP_Activity_List_Table extends WP_List_Table { * Get the column names for sortable columns * * @return array - * @since 1.6 + * @since BuddyPress (1.6) * @todo For this to work, BP_Activity_Activity::get() needs updating to supporting ordering by specific fields */ function get_sortable_columns() { @@ -1165,34 +1187,17 @@ class BP_Activity_List_Table extends WP_List_Table { /** * Markup for the "filter" part of the form (i.e. which activity type to display) * - * @global object $bp BuddyPress global settings * @param string $which 'top' or 'bottom' - * @since 1.6 + * @since BuddyPress (1.6) */ function extra_tablenav( $which ) { - global $bp; - if ( 'bottom' == $which ) return; - $actions = array(); $selected = !empty( $_REQUEST['activity_type'] ) ? $_REQUEST['activity_type'] : ''; - // Walk through the registered actions, and build an array of actions/values. - foreach ( $bp->activity->actions as $action ) { - $action = array_values( (array) $action ); - - for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) - $actions[ $action[$i]['key'] ] = $action[$i]['value']; - } - - // This was a mis-named activity type from before BP 1.6 - unset( $actions['friends_register_activity_action'] ); - - // This type has not been used since BP 1.0.3. It will be re-instated in a future version. - unset( $actions['updated_profile'] ); - - // Sort array by the human-readable value + // Get all types of activities, and sort alphabetically. + $actions = bp_activity_get_types(); natsort( $actions ); ?> @@ -1216,7 +1221,7 @@ class BP_Activity_List_Table extends WP_List_Table { * * @param array $item A singular item (one full row) * @see WP_List_Table::single_row_columns() - * @since 1.6 + * @since BuddyPress (1.6) */ function column_cb( $item ) { printf( '<input type="checkbox" name="aid[]" value="%d" />', (int) $item['id'] ); @@ -1227,7 +1232,7 @@ class BP_Activity_List_Table extends WP_List_Table { * * @param array $item A singular item (one full row) * @see WP_List_Table::single_row_columns() - * @since 1.6 + * @since BuddyPress (1.6) */ function column_author( $item ) { echo '<strong>' . get_avatar( $item['user_id'], '32' ) . ' ' . bp_core_get_userlink( $item['user_id'] ) . '</strong>'; @@ -1240,7 +1245,7 @@ class BP_Activity_List_Table extends WP_List_Table { * * @param array $item A singular item (one full row) * @see WP_List_Table::single_row_columns() - * @since 1.6 + * @since BuddyPress (1.6) */ function column_comment( $item ) { // Determine what type of item (row) we're dealing with @@ -1258,7 +1263,7 @@ class BP_Activity_List_Table extends WP_List_Table { ); // Build actions URLs - $base_url = network_admin_url( 'admin.php?page=bp-activity&aid=' . $item['id'] ); + $base_url = bp_get_admin_url( 'admin.php?page=bp-activity&aid=' . $item['id'] ); $spam_nonce = esc_html( '_wpnonce=' . wp_create_nonce( 'spam-activity_' . $item['id'] ) ); $delete_url = $base_url . "&action=delete&$spam_nonce"; @@ -1298,10 +1303,11 @@ class BP_Activity_List_Table extends WP_List_Table { echo '</div>'; // Get activity content - if not set, use the action - if ( ! empty( $item['content'] ) ) + if ( ! empty( $item['content'] ) ) { $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) ); - else + } else { $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) ); + } echo $content . ' ' . $this->row_actions( $actions ); } @@ -1311,18 +1317,18 @@ class BP_Activity_List_Table extends WP_List_Table { * * @param array $item A singular item (one full row) * @see WP_List_Table::single_row_columns() - * @since 1.6 + * @since BuddyPress (1.6) */ function column_response( $item ) { // Is $item is a root activity? if ( empty( $item['item_id'] ) || ! in_array( $item['type'], apply_filters( 'bp_activity_admin_root_activity_types', array( 'activity_comment' ), $item ) ) ) { $comment_count = !empty( $item['children'] ) ? bp_activity_recurse_comment_count( (object) $item ) : 0; - $root_activity_url = network_admin_url( 'admin.php?page=bp-activity&aid=' . $item['id'] ); + $root_activity_url = bp_get_admin_url( 'admin.php?page=bp-activity&aid=' . $item['id'] ); // If the activity has comments, display a link to the activity's permalink, with its comment count in a speech bubble if ( $comment_count ) { $title_attr = sprintf( _n( '%s related activity', '%s related activities', $comment_count, 'buddypress' ), number_format_i18n( $comment_count ) ); - printf( '<a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', esc_attr( $root_activity_url ), esc_attr( $title_attr ), number_format_i18n( $comment_count ) ); + printf( '<a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', esc_url( $root_activity_url ), esc_attr( $title_attr ), number_format_i18n( $comment_count ) ); } // For non-root activities, display a link to the replied-to activity's author's profile @@ -1339,7 +1345,7 @@ class BP_Activity_List_Table extends WP_List_Table { * A wrapper function for the BP_Activity_List_Table to get the specified activity's user ID. * * @param int $activity_id Activity ID to retrieve User ID for - * @since 1.6 + * @since BuddyPress (1.6) */ protected function get_activity_user_id( $activity_id ) { // If there is an existing activity/user ID mapping, just return the user ID. @@ -1373,7 +1379,7 @@ class BP_Activity_List_Table extends WP_List_Table { * * @param array $tree Source array * @return array Flattened array - * @since 1.6 + * @since BuddyPress (1.6) */ public static function flatten_activity_array( $tree ){ foreach ( (array) $tree as $node ) { @@ -1390,4 +1396,3 @@ class BP_Activity_List_Table extends WP_List_Table { return $tree; } } -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php index c78ffe41dd77896f0a221cc6f5060111a7598acf..61d2e3c4aef78a4187c8a73500d2fb38fcb0d3d1 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-akismet.php @@ -3,7 +3,7 @@ * Akismet support for BuddyPress' Activity Stream * * @package BuddyPress - * @since 1.6 + * @since BuddyPress (1.6) * @subpackage Activity */ @@ -16,14 +16,14 @@ class BP_Akismet { * * @access protected * @var BP_Activity_Activity - * @since 1.6 + * @since BuddyPress (1.6) */ protected $last_activity = null; /** * Constructor * - * @since 1.6 + * @since BuddyPress (1.6) */ public function __construct() { $this->setup_actions(); @@ -32,7 +32,7 @@ class BP_Akismet { /** * Hook Akismet into the activity stream * - * @since 1.6 + * @since BuddyPress (1.6) */ protected function setup_actions() { // Add nonces to activity stream lists @@ -67,7 +67,7 @@ class BP_Akismet { * @param array $actions The hover links * @param array $activity The activity for the current row being processed * @return array The hover links - * @since 1.6 + * @since BuddyPress (1.6) */ function comment_row_action( $actions, $activity ) { $akismet_result = bp_activity_get_meta( $activity['id'], '_bp_akismet_result' ); @@ -97,14 +97,14 @@ class BP_Akismet { foreach ( $actions as $k => $item ) { $b[ $k ] = $item; if ( $k == 'edit' ) - $b['history'] = '<a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>'; + $b['history'] = '<a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history"> '. __( 'History', 'buddypress' ) . '</a>'; } $actions = $b; } if ( $desc ) - echo '<span class="akismet-status"><a href="' . network_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>'; + echo '<span class="akismet-status"><a href="' . esc_url( bp_get_admin_url( 'admin.php?page=bp-activity&action=edit&aid=' . $activity['id'] ) ) . '#bp_activity_history">' . htmlspecialchars( $desc ) . '</a></span>'; return apply_filters( 'bp_akismet_comment_row_action', $actions ); } @@ -114,10 +114,10 @@ class BP_Akismet { * This is used by Akismet to help detect spam activity. * * @see http://plugins.trac.wordpress.org/ticket/1232 - * @since 1.6 + * @since BuddyPress (1.6) */ public function add_activity_stream_nonce() { - $form_id = '_bp_as_nonce'; + $form_id = '_bp_as_nonce'; $value = '_bp_as_nonce_' . bp_loggedin_user_id(); // If we're in the activity stream loop, we can use the current item's ID to make the nonce unique @@ -138,7 +138,7 @@ class BP_Akismet { * @param int $user_id User ID * @param int $activity_id Activity ID * @see bp_dtheme_post_update() - * @since 1.6 + * @since BuddyPress (1.6) */ public function check_member_activity_update( $content, $user_id, $activity_id ) { // By default, only handle activity updates and activity comments. @@ -158,7 +158,7 @@ class BP_Akismet { * * This function is intended to be used inside the activity stream loop. * - * @since 1.6 + * @since BuddyPress (1.6) */ public function add_activity_spam_button() { if ( !bp_activity_user_can_mark_spam() ) @@ -186,7 +186,7 @@ class BP_Akismet { * * This function is intended to be used inside the activity stream loop. * - * @since 1.6 + * @since BuddyPress (1.6) */ public function add_activity_comment_spam_button() { if ( !bp_activity_user_can_mark_spam() ) @@ -214,7 +214,7 @@ class BP_Akismet { * Get a list of filterable types of activity item that we want Akismet to automatically check for spam. * * @return array List of activity types - * @since 1.6 + * @since BuddyPress (1.6) * @static */ public static function get_activity_types() { @@ -226,7 +226,7 @@ class BP_Akismet { * * @param BP_Activity_Activity $activity * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as spam) or "by_akismet" (automatically spammed). - * @since 1.6 + * @since BuddyPress (1.6) */ public function mark_as_spam( $activity, $source ) { // Record this item so we can do some tidyup in BP_Akismet::check_member_activity_update() @@ -240,7 +240,7 @@ class BP_Akismet { * * @param BP_Activity_Activity $activity * @param string $source Either "by_a_person" (e.g. a person has manually marked the activity as ham) or "by_akismet" (automatically hammed). - * @since 1.6 + * @since BuddyPress (1.6) */ public function mark_as_ham( $activity, $source ) { // If the activity was, originally, automatically marked as spam by Akismet, run the @mentions filter as it would have been skipped. @@ -248,14 +248,14 @@ class BP_Akismet { $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id ); do_action( 'bp_activity_akismet_mark_as_ham', $activity, $source ); - } + } /** * Build a data package for the Akismet service to inspect * * @param BP_Activity_Activity $activity * @see http://akismet.com/development/api/#comment-check - * @since 1.6 + * @since BuddyPress (1.6) * @static */ public static function build_akismet_data_package( $activity ) { @@ -294,7 +294,7 @@ class BP_Akismet { * * @param BP_Activity_Activity $activity The activity item to check * @see http://akismet.com/development/api/ - * @since 1.6 + * @since BuddyPress (1.6) * @todo Spam counter? * @todo Auto-delete old spam? */ @@ -335,7 +335,7 @@ class BP_Akismet { * Update activity meta after a manual spam change (user initiated) * * @param BP_Activity_Activity $activity The activity to check - * @since 1.6 + * @since BuddyPress (1.6) */ public function update_activity_spam_meta( $activity ) { // By default, only handle activity updates and activity comments. @@ -351,7 +351,7 @@ class BP_Akismet { * Update activity meta after a manual ham change (user initiated) * * @param BP_Activity_Activity $activity The activity to check - * @since 1.6 + * @since BuddyPress (1.6) */ public function update_activity_ham_meta( $activity ) { // By default, only handle activity updates and activity comments. @@ -367,7 +367,7 @@ class BP_Akismet { * Update activity meta after an automatic spam check (not user initiated) * * @param BP_Activity_Activity $activity The activity to check - * @since 1.6 + * @since BuddyPress (1.6) */ public function update_activity_akismet_meta( $activity ) { // Check we're dealing with what was last updated by Akismet @@ -408,7 +408,7 @@ class BP_Akismet { * @param array $activity_data Packet of information to submit to Akismet * @param string $check "check" or "submit" * @param string $spam "spam" or "ham" - * @since 1.6 + * @since BuddyPress (1.6) */ public function send_akismet_request( $activity_data, $check = 'check', $spam = 'spam' ) { global $akismet_api_host, $akismet_api_port; @@ -480,7 +480,7 @@ class BP_Akismet { * Filters user agent when sending to Akismet. * * @param string $user_agent - * @since 1.6 + * @since BuddyPress (1.6) */ public function buddypress_ua( $user_agent ) { $user_agent = 'BuddyPress/' . bp_get_version() . ' | Akismet/'. constant( 'AKISMET_VERSION' ); @@ -491,7 +491,7 @@ class BP_Akismet { * Adds a "History" meta box to the activity edit screen. * * @param string $screen_action The type of screen that has been requested - * @since 1.6 + * @since BuddyPress (1.6) */ function add_history_metabox( $screen_action ) { // Only proceed if we're on the edit screen @@ -506,7 +506,7 @@ class BP_Akismet { * History meta box for the Activity admin edit screen * * @param object $item Activity item - * @since 1.6 + * @since BuddyPress (1.6) * @todo Update activity meta to allow >1 record with the same key (iterate through $history). * @see http://buddypress.trac.wordpress.org/ticket/3907 */ @@ -527,7 +527,7 @@ class BP_Akismet { * @param int $activity_id Activity item ID * @param string $message Human-readable description of what's changed * @param string $event The type of check we were carrying out - * @since 1.6 + * @since BuddyPress (1.6) */ public function update_activity_history( $activity_id = 0, $message = '', $event = '' ) { $event = array( @@ -546,7 +546,7 @@ class BP_Akismet { * * @param int $activity_id Activity item ID * @return array The activity item's Akismet history - * @since 1.6 + * @since BuddyPress (1.6) */ public function get_activity_history( $activity_id = 0 ) { $history = bp_activity_get_meta( $activity_id, '_bp_akismet_history' ); @@ -565,7 +565,7 @@ class BP_Akismet { * * @global object $bp BuddyPress global settings * @global wpdb $wpdb WordPress database object - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_akismet_delete_old_metadata() { global $bp, $wpdb; @@ -575,7 +575,7 @@ function bp_activity_akismet_delete_old_metadata() { // Enforce a minimum of 1 day $interval = max( 1, absint( $interval ) ); - // _bp_akismet_submission meta values are large, so expire them after $interval days regardless of the activity status + // _bp_akismet_submission meta values are large, so expire them after $interval days regardless of the activity status $sql = $wpdb->prepare( "SELECT a.id FROM {$bp->activity->table_name} a LEFT JOIN {$bp->activity->table_name_meta} m ON a.id = m.activity_id WHERE m.meta_key = %s AND DATE_SUB(%s, INTERVAL {$interval} DAY) > a.date_recorded LIMIT 10000", '_bp_akismet_submission', current_time( 'mysql', 1 ) ); $activity_ids = $wpdb->get_col( $sql ); @@ -584,4 +584,4 @@ function bp_activity_akismet_delete_old_metadata() { bp_activity_delete_meta( $activity_id, '_bp_akismet_submission' ); } } -?> \ No newline at end of file +add_action( 'bp_activity_akismet_delete_old_metadata', 'bp_activity_akismet_delete_old_metadata' ); diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php index 6c7f43d90a88b8e758ab851d45e936d5c08828d8..a79b3dd9437e9325467b1fc3f1bac666b31a2431 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-cache.php @@ -3,7 +3,7 @@ /** * Functions related to the BuddyPress Activity component and the WP Cache * - * @since 1.6 + * @since BuddyPress (1.6) */ // Exit if accessed directly @@ -35,5 +35,3 @@ function bp_activity_update_meta_cache( $activity_ids = false ) { bp_update_meta_cache( $cache_args ); } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php index 63645cf08f98accc4cf675fea457e2d4d75e56bd..8c9f66b74dae6a6c4f03f8b8ff3704b6ef9102d7 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-classes.php @@ -50,13 +50,13 @@ class BP_Activity_Activity { $this->mptt_left = $row->mptt_left; $this->mptt_right = $row->mptt_right; $this->is_spam = $row->is_spam; - + bp_activity_update_meta_cache( $this->id ); } } function save() { - global $wpdb, $bp; + global $wpdb, $bp, $current_user; $this->id = apply_filters_ref_array( 'bp_activity_id_before_save', array( $this->id, &$this ) ); $this->item_id = apply_filters_ref_array( 'bp_activity_item_id_before_save', array( $this->item_id, &$this ) ); @@ -83,23 +83,21 @@ class BP_Activity_Activity { $this->primary_link = bp_loggedin_user_domain(); // If we have an existing ID, update the activity item, otherwise insert it. - if ( $this->id ) { + if ( $this->id ) $q = $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET user_id = %d, component = %s, type = %s, action = %s, content = %s, primary_link = %s, date_recorded = %s, item_id = %d, secondary_item_id = %d, hide_sitewide = %d, is_spam = %d WHERE id = %d", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam, $this->id ); - } else { + else $q = $wpdb->prepare( "INSERT INTO {$bp->activity->table_name} ( user_id, component, type, action, content, primary_link, date_recorded, item_id, secondary_item_id, hide_sitewide, is_spam ) VALUES ( %d, %s, %s, %s, %s, %s, %s, %d, %d, %d, %d )", $this->user_id, $this->component, $this->type, $this->action, $this->content, $this->primary_link, $this->date_recorded, $this->item_id, $this->secondary_item_id, $this->hide_sitewide, $this->is_spam ); - } if ( false === $wpdb->query( $q ) ) return false; // If this is a new activity item, set the $id property - if ( empty( $this->id ) ) { + if ( empty( $this->id ) ) $this->id = $wpdb->insert_id; // If an existing activity item, prevent any changes to the content generating new @mention notifications. - } else { + else add_filter( 'bp_activity_at_name_do_notifications', '__return_false' ); - } do_action_ref_array( 'bp_activity_after_save', array( &$this ) ); @@ -209,7 +207,7 @@ class BP_Activity_Activity { // Define the preferred order for indexes $indexes = apply_filters( 'bp_activity_preferred_index_order', array( 'user_id', 'item_id', 'secondary_item_id', 'date_recorded', 'component', 'type', 'hide_sitewide', 'is_spam' ) ); - + foreach( $indexes as $key => $index ) { if ( false !== strpos( $where_sql, $index ) ) { $the_index = $index; @@ -263,13 +261,13 @@ class BP_Activity_Activity { } } } - + // Get activity meta $activity_ids = array(); foreach ( (array) $activities as $activity ) { $activity_ids[] = $activity->id; } - + if ( !empty( $activity_ids ) ) { bp_activity_update_meta_cache( $activity_ids ); } @@ -299,7 +297,7 @@ class BP_Activity_Activity { * @param string MySQL column sort; ASC or DESC. (Optional; default is DESC) * @param bool $display_comments Retrieve an activity item's associated comments or not. (Optional; default is false) * @return array - * @since 1.2 + * @since BuddyPress (1.2) */ function get_specific( $activity_ids, $max = false, $page = 1, $per_page = 25, $sort = 'DESC', $display_comments = false ) { _deprecated_function( __FUNCTION__, '1.5', 'Use BP_Activity_Activity::get() with the "in" parameter instead.' ); @@ -447,20 +445,20 @@ class BP_Activity_Activity { * @param array $activities * @param bool $spam Optional; 'ham_only' (default), 'spam_only' or 'all'. * @return array The updated activities with nested comments - * @since 1.2 + * @since BuddyPress (1.2) */ function append_comments( $activities, $spam = 'ham_only' ) { global $wpdb; $activity_comments = array(); - /* Now fetch the activity comments and parse them into the correct position in the activities array. */ + // Now fetch the activity comments and parse them into the correct position in the activities array. foreach( (array) $activities as $activity ) { - if ( 'activity_comment' != $activity->type && $activity->mptt_left && $activity->mptt_right ) - $activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right, $spam ); + $top_level_parent_id = 'activity_comment' == $activity->type ? $activity->item_id : 0; + $activity_comments[$activity->id] = BP_Activity_Activity::get_activity_comments( $activity->id, $activity->mptt_left, $activity->mptt_right, $spam, $top_level_parent_id ); } - /* Merge the comments with the activity items */ + // Merge the comments with the activity items foreach( (array) $activities as $key => $activity ) if ( isset( $activity_comments[$activity->id] ) ) $activities[$key]->children = $activity_comments[$activity->id]; @@ -477,13 +475,19 @@ class BP_Activity_Activity { * @param int $left Left-most node boundary * @param into $right Right-most node boundary * @param bool $spam Optional; 'ham_only' (default), 'spam_only' or 'all'. + * @param int $top_level_parent_id The id of the root-level parent activity item * @return array The updated activities with nested comments - * @since 1.2 + * @since BuddyPress (1.2) */ - function get_activity_comments( $activity_id, $left, $right, $spam = 'ham_only' ) { + function get_activity_comments( $activity_id, $left, $right, $spam = 'ham_only', $top_level_parent_id = 0 ) { global $wpdb, $bp; + if ( empty( $top_level_parent_id ) ) { + $top_level_parent_id = $activity_id; + } + if ( !$comments = wp_cache_get( 'bp_activity_comments_' . $activity_id ) ) { + // Select the user's fullname with the query if ( bp_is_active( 'xprofile' ) ) { $fullname_select = ", pd.value as user_fullname"; @@ -496,17 +500,20 @@ class BP_Activity_Activity { } // Don't retrieve activity comments marked as spam - if ( 'ham_only' == $spam ) + if ( 'ham_only' == $spam ) { $spam_sql = 'AND a.is_spam = 0'; - elseif ( 'spam_only' == $spam ) + } elseif ( 'spam_only' == $spam ) { $spam_sql = 'AND a.is_spam = 1'; - else + } else { $spam_sql = ''; + } - $sql = apply_filters( 'bp_activity_comments_user_join_filter', $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' ${spam_sql} AND a.item_id = %d AND a.mptt_left BETWEEN %d AND %d ORDER BY a.date_recorded ASC", $activity_id, $left, $right ), $activity_id, $left, $right, $spam_sql ); + // The mptt BETWEEN clause allows us to limit returned descendants to the right part of the tree + $sql = apply_filters( 'bp_activity_comments_user_join_filter', $wpdb->prepare( "SELECT a.*, u.user_email, u.user_nicename, u.user_login, u.display_name{$fullname_select} FROM {$bp->activity->table_name} a, {$wpdb->users} u{$fullname_from} WHERE u.ID = a.user_id {$fullname_where} AND a.type = 'activity_comment' {$spam_sql} AND a.item_id = %d AND a.mptt_left > %d AND a.mptt_left < %d ORDER BY a.date_recorded ASC", $top_level_parent_id, $left, $right ), $activity_id, $left, $right, $spam_sql ); // Retrieve all descendants of the $root node $descendants = $wpdb->get_results( $sql ); + $ref = array(); // Loop descendants and build an assoc array foreach ( (array) $descendants as $d ) { @@ -562,7 +569,7 @@ class BP_Activity_Activity { function get_recorded_components() { global $wpdb, $bp; - return $wpdb->get_col( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ); + return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT component FROM {$bp->activity->table_name} ORDER BY component ASC" ) ); } function get_sitewide_items_for_feed( $limit = 35 ) { @@ -671,5 +678,3 @@ class BP_Activity_Activity { return $wpdb->get_var( $wpdb->prepare( "UPDATE {$bp->activity->table_name} SET hide_sitewide = 1 WHERE user_id = %d", $user_id ) ); } } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php index 3bf5ba5ce5ddeb812f4b4efd2445697719c54424..a3f1f81436f9c65ea2a7440725e46d4cf6118fcd 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-filters.php @@ -89,7 +89,7 @@ add_filter( 'bp_get_activity_feed_item_description', 'bp_activity_make_nofollow_ add_filter( 'pre_comment_content', 'bp_activity_at_name_filter' ); add_filter( 'group_forum_topic_text_before_save', 'bp_activity_at_name_filter' ); add_filter( 'group_forum_post_text_before_save', 'bp_activity_at_name_filter' ); -add_filter( 'the_content', 'bp_activity_at_name_filter' ); +add_filter( 'the_content', 'bp_activity_at_name_filter' ); add_filter( 'bp_get_activity_parent_content', 'bp_create_excerpt' ); @@ -99,7 +99,7 @@ add_filter( 'bp_get_activity_content', 'bp_activity_truncate_entry', 5 ); /** Actions *******************************************************************/ // At-name filter -add_action( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' ); +add_action( 'bp_activity_before_save', 'bp_activity_at_name_filter_updates' ); // Activity stream moderation add_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 ); @@ -194,76 +194,103 @@ function bp_activity_filter_kses( $content ) { } /** - * Finds and links @-mentioned users in the contents of activity items + * Finds and links @-mentioned users in the contents of a given item. * * @since BuddyPress (1.2) * - * @param string $content The activity content - * @param int $activity_id The activity id + * @param string $content The contents of a given item. + * @param int $activity_id The activity id. Deprecated. * * @uses bp_activity_find_mentions() - * @uses bp_is_username_compatibility_mode() - * @uses bp_core_get_userid_from_nicename() - * @uses bp_activity_at_message_notification() * @uses bp_core_get_user_domain() - * @uses bp_activity_adjust_mention_count() * * @return string $content Content filtered for mentions */ function bp_activity_at_name_filter( $content, $activity_id = 0 ) { - if ( $activity_id & bp_is_active( 'activity' ) ) { - $activity = new BP_Activity_Activity( $activity_id ); - - // If this activity has been marked as spam, don't do anything. This prevents @notifications being sent. - if ( !empty( $activity ) && $activity->is_spam ) - return $content; - } + // Try to find mentions $usernames = bp_activity_find_mentions( $content ); - foreach( (array) $usernames as $username ) { - if ( bp_is_username_compatibility_mode() ) - $user_id = username_exists( $username ); - else - $user_id = bp_core_get_userid_from_nicename( $username ); - - if ( empty( $user_id ) ) - continue; - - // If an activity_id is provided, we can send email and BP notifications - if ( $activity_id && apply_filters( 'bp_activity_at_name_do_notifications', true ) ) { - bp_activity_at_message_notification( $activity_id, $user_id ); - } + // No mentions? Stop now! + if ( empty( $usernames ) ) + return $content; + + // Linkify the mentions with the username + foreach( (array) $usernames as $user_id => $username ) { $content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $content ); } - // Adjust the activity count for this item - if ( $activity_id ) - bp_activity_adjust_mention_count( $activity_id, 'add' ); - + // Return the content return $content; } /** - * Catch mentions in saved activity items + * Catch mentions in activity items before they are saved into the database. + * + * If mentions are found, replace @mention text with user links and add our + * hook to send mentions after the activity item is saved. * * @since BuddyPress (1.5) * * @param obj $activity * - * @uses remove_filter() To remove the 'bp_activity_at_name_filter_updates' hook. - * @uses bp_activity_at_name_filter() - * @uses BP_Activity_Activity::save() {@link BP_Activity_Activity} + * @uses bp_activity_find_mentions() */ function bp_activity_at_name_filter_updates( $activity ) { - // Only run this function once for a given activity item - remove_filter( 'bp_activity_after_save', 'bp_activity_at_name_filter_updates' ); + // If activity was marked as spam, stop the rest of this function. + if ( ! empty( $activity->is_spam ) ) + return; + + // Try to find mentions + $usernames = bp_activity_find_mentions( $activity->content ); + + // We have mentions! + if ( ! empty( $usernames ) ) { + // Replace @mention text with userlinks + foreach( (array) $usernames as $user_id => $username ) { + $activity->content = preg_replace( '/(@' . $username . '\b)/', "<a href='" . bp_core_get_user_domain( $user_id ) . "' rel='nofollow'>@$username</a>", $activity->content ); + } - // Run the content through the linking filter, making sure to increment mention count - $activity->content = bp_activity_at_name_filter( $activity->content, $activity->id ); + // Add our hook to send @mention emails after the activity item is saved + add_action( 'bp_activity_after_save', 'bp_activity_at_name_send_emails' ); - // Resave the activity with the new content - $activity->save(); + // temporary variable to avoid having to run bp_activity_find_mentions() again + buddypress()->activity->mentioned_users = $usernames; + } +} + +/** + * Sends emails and BP notifications for @-mentioned users in the contents of + * an activity item. + * + * @since BuddyPress (1.7) + * + * @param obj $activity The BP_Activity_Activity object + * + * @uses bp_activity_at_message_notification() + * @uses bp_activity_update_mention_count_for_user() + */ +function bp_activity_at_name_send_emails( $activity ) { + // If our temporary variable doesn't exist, stop now. + if ( empty( buddypress()->activity->mentioned_users ) ) + return; + + // Grab our temporary variable from bp_activity_at_name_filter_updates() + $usernames = buddypress()->activity->mentioned_users; + + // Get rid of temporary variable + unset( buddypress()->activity->mentioned_users ); + + // Send @mentions and setup BP notifications + foreach( (array) $usernames as $user_id => $username ) { + // If you want to disable notifications, you can use this filter to stop email sending + if ( apply_filters( 'bp_activity_at_name_do_notifications', true, $usernames ) ) { + bp_activity_at_message_notification( $activity->id, $user_id ); + } + + // Updates mention count for the user + bp_activity_update_mention_count_for_user( $user_id, $activity->id ); + } } /** @@ -336,5 +363,3 @@ function bp_activity_truncate_entry( $text ) { return apply_filters( 'bp_activity_truncate_entry', $excerpt, $text, $append_text ); } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php index 172b106e10ba3d48399d69dff3c27ed55e853af9..851a447c4785c74178a5dda960fbb4bdbbe111a9 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-functions.php @@ -28,13 +28,13 @@ function bp_activity_has_directory() { } /** - * Searches through the content of an activity item to locate usernames, designated by an @ sign + * Searches through the content of an activity item to locate usernames, + * designated by an @ sign. * * @since BuddyPress (1.5) * - * @param string $content The content of the activity, usually found in $activity->content - * - * @return bool|array $usernames Array of the found usernames that match existing users. False if no matches + * @param string $content The content of the activity, usually found in $activity->content. + * @return mixed Associative array with user ID as key and username as value. Boolean false if no mentions found. */ function bp_activity_find_mentions( $content ) { $pattern = '/[@]+([A-Za-z0-9-_\.@]+)\b/'; @@ -44,7 +44,26 @@ function bp_activity_find_mentions( $content ) { if ( !$usernames = array_unique( $usernames[1] ) ) return false; - return $usernames; + $mentioned_users = array(); + + // We've found some mentions! Check to see if users exist + foreach( (array) $usernames as $key => $username ) { + if ( bp_is_username_compatibility_mode() ) { + $user_id = username_exists( $username ); + } else { + $user_id = bp_core_get_userid_from_nicename( $username ); + } + + // user ID exists, so let's add it to our array + if ( ! empty( $user_id ) ) { + $mentioned_users[$user_id] = $username; + } + } + + if ( empty( $mentioned_users ) ) + return false; + + return $mentioned_users; } /** @@ -61,62 +80,93 @@ function bp_activity_clear_new_mentions( $user_id ) { } /** - * Adjusts new mention count for mentioned users when activity items are deleted or created + * Adjusts mention count for mentioned users in activity items. + * + * This function is useful if you only have the activity ID handy and you + * haven't parsed an activity item for @mentions yet. + * + * Currently, only used in {@link bp_activity_delete()}. * * @since BuddyPress (1.5) * * @param int $activity_id The unique id for the activity item - * @param string $action Can be 'delete' or 'add'. Defaults to 'add' + * @param string $action Can be 'delete' or 'add'. Defaults to 'add'. * - * @uses BP_Activity_Activity() {@link BP_Activity_Activity} * @uses bp_activity_find_mentions() - * @uses bp_is_username_compatibility_mode() - * @uses bp_core_get_userid_from_nicename() + * @uses bp_activity_update_mention_count_for_user() + */ +function bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) { + if ( empty( $activity_id ) ) + return false; + + // Get activity object + $activity = new BP_Activity_Activity( (int) $activity_id ); + + // Try to find mentions + $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ); + + // Still empty? Stop now + if ( empty( $usernames ) ) + return false; + + // Increment mention count foreach mentioned user + foreach( (array) $usernames as $user_id => $username ) { + bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action ); + } +} + +/** + * Updates the mention count for the user in question. + * + * This function should be used when you've already parsed your activity item + * for @mentions. + * + * @since BuddyPress (1.7) + * + * @param int $user_id The user ID + * @param int $activity_id The unique id for the activity item + * @param string $action Can be 'delete' or 'add'. Defaults to 'add' + * * @uses bp_get_user_meta() * @uses bp_update_user_meta() + * @return bool */ -function bp_activity_adjust_mention_count( $activity_id, $action = 'add' ) { - $activity = new BP_Activity_Activity( $activity_id ); +function bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action = 'add' ) { + if ( empty( $user_id ) || empty( $activity_id ) ) + return false; + + // Adjust the mention list and count for the member + $new_mention_count = (int) bp_get_user_meta( $user_id, 'bp_new_mention_count', true ); + if ( !$new_mentions = bp_get_user_meta( $user_id, 'bp_new_mentions', true ) ) + $new_mentions = array(); + + switch ( $action ) { + case 'delete' : + $key = array_search( $activity_id, $new_mentions ); - if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) { - foreach( (array) $usernames as $username ) { - if ( bp_is_username_compatibility_mode() ) - $user_id = username_exists( $username ); - else - $user_id = bp_core_get_userid_from_nicename( $username ); - - if ( empty( $user_id ) ) - continue; - - // Adjust the mention list and count for the member - $new_mention_count = (int)bp_get_user_meta( $user_id, 'bp_new_mention_count', true ); - if ( !$new_mentions = bp_get_user_meta( $user_id, 'bp_new_mentions', true ) ) - $new_mentions = array(); - - switch ( $action ) { - case 'delete' : - $key = array_search( $activity_id, $new_mentions ); - if ( $key !== false ) { - unset( $new_mentions[$key] ); - } - break; - - case 'add' : - default : - if ( !in_array( $activity_id, $new_mentions ) ) { - $new_mentions[] = (int) $activity_id; - } - break; + if ( $key !== false ) { + unset( $new_mentions[$key] ); } - // Get an updated mention count - $new_mention_count = count( $new_mentions ); + break; - // Resave the user_meta - bp_update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count ); - bp_update_user_meta( $user_id, 'bp_new_mentions', $new_mentions ); - } + case 'add' : + default : + if ( !in_array( $activity_id, $new_mentions ) ) { + $new_mentions[] = (int) $activity_id; + } + + break; } + + // Get an updated mention count + $new_mention_count = count( $new_mentions ); + + // Resave the user_meta + bp_update_user_meta( $user_id, 'bp_new_mention_count', $new_mention_count ); + bp_update_user_meta( $user_id, 'bp_new_mentions', $new_mentions ); + + return true; } /** @@ -236,6 +286,32 @@ function bp_activity_get_action( $component_id, $key ) { return apply_filters( 'bp_activity_get_action', $bp->activity->actions->{$component_id}->{$key}, $component_id, $key ); } +/** + * Fetch details of all registered activity types + * + * @return array array( type => description ), ... + * @since BuddyPress (1.7) + */ +function bp_activity_get_types() { + $actions = array(); + + // Walk through the registered actions, and build an array of actions/values. + foreach ( buddypress()->activity->actions as $action ) { + $action = array_values( (array) $action ); + + for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) + $actions[ $action[$i]['key'] ] = $action[$i]['value']; + } + + // This was a mis-named activity type from before BP 1.6 + unset( $actions['friends_register_activity_action'] ); + + // This type has not been used since BP 1.0.3. It will be re-instated in a future version. + unset( $actions['updated_profile'] ); + + return apply_filters( 'bp_activity_get_types', $actions ); +} + /** Favorites ****************************************************************/ /** @@ -532,16 +608,16 @@ function bp_activity_get_meta( $activity_id = 0, $meta_key = '' ) { // No key so get all for activity_id } else { $metas = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM {$bp->activity->table_name_meta} WHERE activity_id = %d", $activity_id ) ); - + if ( !empty( $metas ) ) { $metas = array_map( 'maybe_unserialize', (array) $metas ); - + foreach( $metas as $mkey => $mvalue ) { wp_cache_set( 'bp_activity_meta_' . $activity_id . '_' . $mkey, $mvalue, 'bp' ); } } } - + // No result so return false if ( empty( $metas ) ) return false; @@ -659,7 +735,7 @@ add_action( 'delete_user', 'bp_activity_remove_all_user_data' ); * @global object $wpdb * @global object $bp BuddyPress global settings * @param int $user_id - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_spam_all_user_data( $user_id = 0 ) { global $bp, $wpdb; @@ -710,7 +786,7 @@ add_action( 'bp_make_spam_user', 'bp_activity_spam_all_user_data' ); * @global object $wpdb * @global object $bp BuddyPress global settings * @param int $user_id - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_ham_all_user_data( $user_id = 0 ) { global $bp, $wpdb; @@ -730,7 +806,7 @@ function bp_activity_ham_all_user_data( $user_id = 0 ) { foreach ( $activity as $k => $v ) $activity_obj->$k = $v; - // Mark as not spam + // Mark as not spam bp_activity_mark_as_ham( $activity_obj ); /* @@ -759,7 +835,7 @@ add_action( 'bp_make_ham_user', 'bp_activity_ham_all_user_data' ); * Register the activity stream actions for updates * * @global object $bp BuddyPress global settings - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_register_activity_actions() { global $bp; @@ -1027,7 +1103,7 @@ function bp_activity_post_update( $args = '' ) { 'type' => 'activity_update' ) ); - $activity_content = apply_filters( 'bp_activity_latest_update_content', $content ); + $activity_content = apply_filters( 'bp_activity_latest_update_content', $content ); // Add this update to the "latest update" usermeta so it can be fetched anywhere. bp_update_user_meta( bp_loggedin_user_id(), 'bp_latest_update', array( 'id' => $activity_id, 'content' => $content ) ); @@ -1431,8 +1507,10 @@ function bp_activity_hide_user_activity( $user_id ) { function bp_activity_thumbnail_content_images( $content, $link = false ) { preg_match_all( '/<img[^>]*>/Ui', $content, $matches ); - $content = preg_replace('|(\[caption(.*?)\])?<img[^>]*>(\[/caption\])?|', '', $content ); - + + // Remove <img> tags. Also remove caption shortcodes and caption text if present + $content = preg_replace('|(\[caption(.*?)\])?<img[^>]*>([^\[\[]*\[\/caption\])?|', '', $content ); + if ( !empty( $matches ) && !empty( $matches[0] ) ) { // Get the SRC value preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src ); @@ -1472,7 +1550,7 @@ function bp_activity_thumbnail_content_images( $content, $link = false ) { * Convenience function to control whether the current user is allowed to mark activity items as spam * * @return bool True if user is allowed to mark activity items as spam - * @since 1.6 + * @since BuddyPress (1.6) * @static */ function bp_activity_user_can_mark_spam() { @@ -1485,7 +1563,7 @@ function bp_activity_user_can_mark_spam() { * @global object $bp BuddyPress global settings * @param BP_Activity_Activity $activity * @param string $source Optional; default is "by_a_person" (e.g. a person has manually marked the activity as spam). - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) { global $bp; @@ -1521,7 +1599,7 @@ function bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) { * @global object $bp BuddyPress global settings * @param BP_Activity_Activity $activity * @param string $source Optional; default is "by_a_person" (e.g. a person has manually marked the activity as spam). - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) { global $bp; @@ -1549,7 +1627,7 @@ function bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) { } do_action( 'bp_activity_mark_as_ham', $activity, $source ); -} +} /** Embeds *******************************************************************/ @@ -1666,5 +1744,3 @@ function bp_embed_activity_cache( $cache, $id, $cachekey ) { function bp_embed_activity_save_cache( $cache, $cachekey, $id ) { bp_activity_update_meta( $id, $cachekey, $cache ); } - -?> diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php index 90e0940ccf90afda9bf55daee0eedf63d0df4de3..30eb057707743620eb7b4d36d5071cfff87ad7a9 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-loader.php @@ -52,7 +52,7 @@ class BP_Activity_Component extends BP_Component { // Load Akismet support if Akismet is configured $akismet_key = bp_get_option( 'wordpress_api_key' ); - if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', true ) ) + if ( defined( 'AKISMET_VERSION' ) && ( !empty( $akismet_key ) || defined( 'WPCOM_API_KEY' ) ) && apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) $includes[] = 'akismet'; if ( is_admin() ) @@ -128,12 +128,13 @@ class BP_Activity_Component extends BP_Component { return; // Determine user to use - if ( bp_displayed_user_domain() ) + if ( bp_displayed_user_domain() ) { $user_domain = bp_displayed_user_domain(); - elseif ( bp_loggedin_user_domain() ) + } elseif ( bp_loggedin_user_domain() ) { $user_domain = bp_loggedin_user_domain(); - else + } else { return; + } // User link $activity_link = trailingslashit( $user_domain . $this->slug ); @@ -323,7 +324,7 @@ class BP_Activity_Component extends BP_Component { /** * Setup the actions * - * @since 1.6 + * @since BuddyPress (1.6) */ function setup_actions() { // Spam prevention @@ -339,5 +340,3 @@ function bp_setup_activity() { $bp->activity = new BP_Activity_Component(); } add_action( 'bp_setup_components', 'bp_setup_activity', 6 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php index faa3b0f7f96b21ba3051a95cea5d9a0efb6a658e..fd437a764d9e8a40623cf81dc7ef54b670f0ef0c 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-notifications.php @@ -38,10 +38,10 @@ if ( !defined( 'ABSPATH' ) ) exit; * @uses do_action() To call the 'bp_activity_sent_mention_email' hook */ function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) { - + // Don't leave multiple notifications for the same activity item $notifications = BP_Core_Notification::get_all_for_user( $receiver_user_id, 'all' ); - + foreach( $notifications as $notification ) { if ( $activity_id == $notification->item_id ) { return; @@ -52,6 +52,7 @@ function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) $subject = ''; $message = ''; + $content = ''; // Add the BP notification bp_core_add_notification( $activity_id, $receiver_user_id, 'activity', 'new_at_mention', $activity->user_id ); @@ -70,8 +71,7 @@ function bp_activity_at_message_notification( $activity_id, $receiver_user_id ) // Set up and send the message $ud = bp_core_get_core_userdata( $receiver_user_id ); $to = $ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name ); + $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s mentioned you in an update', 'buddypress' ), $poster_name ) ) ); if ( bp_is_active( 'groups' ) && bp_is_group() ) { $message = sprintf( __( @@ -95,7 +95,10 @@ To view and respond to the message, log in and visit: %3$s ', 'buddypress' ), $poster_name, $content, $message_link ); } - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } /* Send the message */ $to = apply_filters( 'bp_activity_at_message_notification_to', $to ); @@ -157,12 +160,10 @@ function bp_activity_new_comment_notification( $comment_id, $commenter_id, $para $content = bp_activity_filter_kses( stripslashes($content) ); // Set up and send the message - $ud = bp_core_get_core_userdata( $original_activity->user_id ); - $to = $ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name ); - -$message = sprintf( __( + $ud = bp_core_get_core_userdata( $original_activity->user_id ); + $to = $ud->user_email; + $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your updates', 'buddypress' ), $poster_name ) ) ); + $message = sprintf( __( '%1$s replied to one of your updates: "%2$s" @@ -172,7 +173,10 @@ To view your original update and all comments, log in and visit: %3$s --------------------- ', 'buddypress' ), $poster_name, $content, $thread_link ); - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } /* Send the message */ $to = apply_filters( 'bp_activity_new_comment_notification_to', $to ); @@ -188,7 +192,7 @@ To view your original update and all comments, log in and visit: %3$s * If this is a reply to another comment, send an email notification to the * author of the immediate parent comment. */ - if ( $activity_id == $parent_id ) + if ( empty( $parent_id ) || ( $activity_id == $parent_id ) ) return false; $parent_comment = new BP_Activity_Activity( $parent_id ); @@ -202,8 +206,7 @@ To view your original update and all comments, log in and visit: %3$s // Set up and send the message $ud = bp_core_get_core_userdata( $parent_comment->user_id ); $to = $ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name ); + $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s replied to one of your comments', 'buddypress' ), $poster_name ) ) ); $poster_name = stripslashes( $poster_name ); $content = bp_activity_filter_kses( stripslashes( $content ) ); @@ -218,7 +221,10 @@ To view the original activity, your comment and all replies, log in and visit: % --------------------- ', 'buddypress' ), $poster_name, $content, $thread_link ); - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } /* Send the message */ $to = apply_filters( 'bp_activity_new_comment_notification_comment_author_to', $to ); @@ -230,5 +236,3 @@ To view the original activity, your comment and all replies, log in and visit: % do_action( 'bp_activity_sent_reply_to_reply_email', $original_activity->user_id, $subject, $message, $comment_id, $commenter_id, $params ); } } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php index 69687aa9f7558f907761085fdba699451745342f..c03fed41a23d587671c7c1190c1dec88e58c9477 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-screens.php @@ -303,4 +303,112 @@ function bp_activity_screen_notification_settings() { } add_action( 'bp_notification_settings', 'bp_activity_screen_notification_settings', 1 ); -?> +/** Theme Compatability *******************************************************/ + +/** + * The main theme compat class for BuddyPress Activity + * + * This class sets up the necessary theme compatability actions to safely output + * group template parts to the_title and the_content areas of a theme. + * + * @since BuddyPress (1.7) + */ +class BP_Activity_Theme_Compat { + + /** + * Setup the activity component theme compatibility + * + * @since BuddyPress (1.7) + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_activity' ) ); + } + + /** + * Are we looking at something that needs activity theme compatability? + * + * @since BuddyPress (1.7) + */ + public function is_activity() { + + // Bail if not looking at a group + if ( ! bp_is_activity_component() ) + return; + + // Activity Directory + if ( ! bp_displayed_user_id() && ! bp_current_action() ) { + bp_update_is_directory( true, 'activity' ); + + do_action( 'bp_activity_screen_index' ); + + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); + + // Single activity + } elseif ( bp_is_single_activity() ) { + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) ); + } + } + + /** Directory *************************************************************/ + + /** + * Update the global $post with directory data + * + * @since BuddyPress (1.7) + */ + public function directory_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => __( 'Sitewide Activity', 'buddypress' ), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_activity', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the groups index template part + * + * @since BuddyPress (1.7) + */ + public function directory_content() { + bp_buffer_template_part( 'activity/index' ); + } + + /** Single ****************************************************************/ + + /** + * Update the global $post with the displayed user's data + * + * @since BuddyPress (1.7) + */ + public function single_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => __( 'Activity', 'buddypress' ), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_activity', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the members' activity permalink template part + * + * @since BuddyPress (1.7) + */ + public function single_dummy_content() { + bp_buffer_template_part( 'activity/single/home' ); + } +} +new BP_Activity_Theme_Compat(); diff --git a/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php b/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php index 129a7b0f05d64e395392f181a9cf29cd0a879011..736f126a5af734f88ba77e16e26aa1742fd8016a 100644 --- a/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php +++ b/wp-content/plugins/buddypress/bp-activity/bp-activity-template.php @@ -107,7 +107,7 @@ class BP_Activity_Template { /** * Constructor method * - * See definition of $defaults below, as well as $defaults in bp_has_activities(), for + * See definition of $defaults below, as well as $defaults in bp_has_activities(), for * description of $args array * * @param array $args @@ -138,7 +138,7 @@ class BP_Activity_Template { $func_args = func_get_args(); $args = bp_core_parse_args_array( $old_args_keys, $func_args ); } - + $defaults = array( 'page' => 1, 'per_page' => 20, @@ -156,7 +156,7 @@ class BP_Activity_Template { ); $r = wp_parse_args( $args, $defaults ); extract( $r ); - + $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page; $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; @@ -368,6 +368,9 @@ function bp_has_activities( $args = '' ) { $r = wp_parse_args( $args, $defaults ); extract( $r ); + if ( empty( $search_terms ) && ! empty( $_REQUEST['s'] ) ) + $search_terms = $_REQUEST['s']; + // If you have passed a "scope" then this will override any filters you have passed. if ( 'just-me' == $scope || 'friends' == $scope || 'groups' == $scope || 'favorites' == $scope || 'mentions' == $scope ) { if ( 'just-me' == $scope ) @@ -954,18 +957,22 @@ function bp_activity_avatar( $args = '' ) { * @return string User avatar */ function bp_get_activity_avatar( $args = '' ) { - global $activities_template, $bp; + global $activities_template; + + $bp = buddypress(); // On activity permalink pages, default to the full-size avatar $type_default = bp_is_single_activity() ? 'full' : 'thumb'; - if ( !empty( $activities_template->activity->display_name ) ) { - $dn_default = $activities_template->activity->display_name; - } else if ( !empty( $activities_template->current_comment->display_name ) ) { - $dn_default = $activities_template->current_comment->display_name; - } + // Within the activity comment loop, the current activity should be set + // to current_comment. Otherwise, just use activity. + $current_activity_item = isset( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : $activities_template->activity; - $alt_default = isset( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ) : __( 'Profile picture', 'buddypress' ); + // Activity user display name + $dn_default = isset( $current_activity_item->display_name ) ? $current_activity_item->display_name : ''; + + // Prepend some descriptive text to alt + $alt_default = !empty( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $dn_default ) : __( 'Profile picture', 'buddypress' ); $defaults = array( 'alt' => $alt_default, @@ -979,6 +986,7 @@ function bp_activity_avatar( $args = '' ) { extract( $r, EXTR_SKIP ); if ( !isset( $height ) && !isset( $width ) ) { + // Backpat if ( isset( $bp->avatar->full->height ) || isset( $bp->avatar->thumb->height ) ) { $height = ( 'full' == $type ) ? $bp->avatar->full->height : $bp->avatar->thumb->height; @@ -992,23 +1000,27 @@ function bp_activity_avatar( $args = '' ) { } else { $width = 20; } - } - // Within the loop, we the current activity should be set first to the - // current_comment, if available - $current_activity_item = isset( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : $activities_template->activity; - // Primary activity avatar is always a user, but can be modified via a filter $object = apply_filters( 'bp_get_activity_avatar_object_' . $current_activity_item->component, 'user' ); - $item_id = $user_id ? $user_id : $current_activity_item->user_id; + $item_id = !empty( $user_id ) ? $user_id : $current_activity_item->user_id; $item_id = apply_filters( 'bp_get_activity_avatar_item_id', $item_id ); // If this is a user object pass the users' email address for Gravatar so we don't have to refetch it. - if ( 'user' == $object && empty( $user_id ) && empty( $email ) && isset( $activities_template->activity->user_email ) ) + if ( 'user' == $object && empty( $user_id ) && empty( $email ) && isset( $current_activity_item->user_email ) ) $email = $current_activity_item->user_email; - return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, 'type' => $type, 'alt' => $alt, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $email ) ) ); + return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array( + 'item_id' => $item_id, + 'object' => $object, + 'type' => $type, + 'alt' => $alt, + 'class' => $class, + 'width' => $width, + 'height' => $height, + 'email' => $email + ) ) ); } /** @@ -1044,15 +1056,16 @@ function bp_activity_secondary_avatar( $args = '' ) { function bp_get_activity_secondary_avatar( $args = '' ) { global $activities_template; - $defaults = array( - 'type' => 'thumb', - 'width' => 20, - 'height' => 20, - 'class' => 'avatar', - 'email' => false - ); - - $r = wp_parse_args( $args, $defaults ); + $r = wp_parse_args( $args, array( + 'alt' => '', + 'type' => 'thumb', + 'width' => 20, + 'height' => 20, + 'class' => 'avatar', + 'link_class' => '', + 'linked' => true, + 'email' => false + ) ); extract( $r, EXTR_SKIP ); // Set item_id and object (default to user) @@ -1061,13 +1074,20 @@ function bp_activity_secondary_avatar( $args = '' ) { $object = 'group'; $item_id = $activities_template->activity->item_id; + // Only if groups is active + if ( bp_is_active( 'groups' ) ) { + $group = groups_get_group( array( 'group_id' => $item_id ) ); + $link = bp_get_group_permalink( $group ); + $name = $group->name; + } else { + $name = ''; + } + if ( empty( $alt ) ) { $alt = __( 'Group logo', 'buddypress' ); - if ( bp_is_active( 'groups' ) ) { - $group = groups_get_group( $item_id ); - if ( isset( $group->name ) ) - $alt = sprintf( __( 'Group logo of %s', 'buddypress' ), $group->name ); + if ( ! empty( $name ) ) { + $alt = sprintf( __( 'Group logo of %s', 'buddypress' ), $name ); } } @@ -1075,8 +1095,9 @@ function bp_activity_secondary_avatar( $args = '' ) { case 'blogs' : $object = 'blog'; $item_id = $activities_template->activity->item_id; + $link = home_url(); - if ( !$alt ) { + if ( empty( $alt ) ) { $alt = sprintf( __( 'Profile picture of the author of the site %s', 'buddypress' ), get_blog_option( $item_id, 'blogname' ) ); } @@ -1084,6 +1105,7 @@ function bp_activity_secondary_avatar( $args = '' ) { case 'friends' : $object = 'user'; $item_id = $activities_template->activity->secondary_item_id; + $link = bp_core_get_userlink( $item_id, false, true ); if ( empty( $alt ) ) { $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $activities_template->activity->secondary_item_id ) ); @@ -1094,23 +1116,48 @@ function bp_activity_secondary_avatar( $args = '' ) { $object = 'user'; $item_id = $activities_template->activity->user_id; $email = $activities_template->activity->user_email; + $link = bp_core_get_userlink( $item_id, false, true ); - if ( !$alt ) { + if ( empty( $alt ) ) { $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ); } break; } - // Allow object and item_id to be filtered + // Allow object, item_id, and link to be filtered $object = apply_filters( 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component, $object ); $item_id = apply_filters( 'bp_get_activity_secondary_avatar_item_id', $item_id ); // If we have no item_id or object, there is no avatar to display - if ( empty( $item_id ) || empty( $object ) ) + if ( empty( $item_id ) || empty( $object ) ) { return false; + } + + // Get the avatar + $avatar = bp_core_fetch_avatar( array( + 'item_id' => $item_id, + 'object' => $object, + 'type' => $type, + 'alt' => $alt, + 'class' => $class, + 'width' => $width, + 'height' => $height, + 'email' => $email + ) ); + + if ( !empty( $linked ) ) { + $link = apply_filters( 'bp_get_activity_secondary_avatar_link', $link, $activities_template->activity->component ); + + return sprintf( '<a href="%s" class="%s">%s</a>', + $link, + $link_class, + apply_filters( 'bp_get_activity_secondary_avatar', $avatar ) + ); + } - return apply_filters( 'bp_get_activity_secondary_avatar', bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, 'type' => $type, 'alt' => $alt, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $email ) ) ); + // else + return apply_filters( 'bp_get_activity_secondary_avatar', $avatar ); } /** @@ -1118,10 +1165,11 @@ function bp_activity_secondary_avatar( $args = '' ) { * * @since BuddyPress (1.2) * + * @param array $args See bp_get_activity_action() * @uses bp_get_activity_action() */ -function bp_activity_action() { - echo bp_get_activity_action(); +function bp_activity_action( $args = array() ) { + echo bp_get_activity_action( $args ); } /** @@ -1130,22 +1178,30 @@ function bp_activity_action() { * @since BuddyPress (1.2) * * @global object $activities_template {@link BP_Activity_Template} + * @param array $args Only parameter is "no_timestamp". If true, timestamp is shown in output. * @uses apply_filters_ref_array() To call the 'bp_get_activity_action_pre_meta' hook * @uses bp_insert_activity_meta() * @uses apply_filters_ref_array() To call the 'bp_get_activity_action' hook * * @return string The activity action */ - function bp_get_activity_action() { + function bp_get_activity_action( $args = array() ) { global $activities_template; + $defaults = array( + 'no_timestamp' => false, + ); + + $args = wp_parse_args( $args, $defaults ); + extract( $args, EXTR_SKIP ); + $action = $activities_template->activity->action; - $action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity ) ); + $action = apply_filters_ref_array( 'bp_get_activity_action_pre_meta', array( $action, &$activities_template->activity, $args ) ); - if ( !empty( $action ) ) + if ( ! empty( $action ) && ! $no_timestamp ) $action = bp_insert_activity_meta( $action ); - return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity ) ); + return apply_filters_ref_array( 'bp_get_activity_action', array( $action, &$activities_template->activity, $args ) ); } /** @@ -1300,7 +1356,7 @@ function bp_activity_user_can_delete( $activity = false ) { if ( bp_current_user_can( 'bp_moderate' ) ) $can_delete = true; - if ( $activity->user_id == bp_loggedin_user_id() ) + if ( is_user_logged_in() && $activity->user_id == bp_loggedin_user_id() ) $can_delete = true; if ( bp_is_item_admin() && bp_is_single_item() ) @@ -1349,14 +1405,20 @@ function bp_activity_parent_content( $args = '' ) { if ( !$parent_id = $activities_template->activity->item_id ) return false; - // Get the content of the parent + // Bail if no parent content if ( empty( $activities_template->activity_parents[$parent_id] ) ) return false; - if ( empty( $activities_template->activity_parents[$parent_id]->content ) ) - $content = $activities_template->activity_parents[$parent_id]->action; - else - $content = $activities_template->activity_parents[$parent_id]->action . ' ' . $activities_template->activity_parents[$parent_id]->content; + // Bail if no action + if ( empty( $activities_template->activity_parents[$parent_id]->action ) ) + return false; + + // Content always includes action + $content = $activities_template->activity_parents[$parent_id]->action; + + // Maybe append activity content, if it exists + if ( ! empty( $activities_template->activity_parents[$parent_id]->content ) ) + $content .= ' ' . $activities_template->activity_parents[$parent_id]->content; // Remove the time since content for backwards compatibility $content = str_replace( '<span class="time-since">%s</span>', '', $content ); @@ -1367,6 +1429,46 @@ function bp_activity_parent_content( $args = '' ) { return apply_filters( 'bp_get_activity_parent_content', $content ); } +/** + * Output the parent activity's user ID + * + * @since BuddyPress (1.7) + */ +function bp_activity_parent_user_id() { + echo bp_get_activity_parent_user_id(); +} + + /** + * Return the parent activity's user ID + * + * @global BP_Activity_Template $activities_template + * @return bool|int False if parent activity can't be found, otherwise returns the parent activity's user ID + * @since BuddyPress (1.7) + */ + function bp_get_activity_parent_user_id() { + global $activities_template; + + // Bail if no activity on no item ID + if ( empty( $activities_template->activity ) || empty( $activities_template->activity->item_id ) ) + return false; + + // Get the ID of the parent activity content + if ( !$parent_id = $activities_template->activity->item_id ) + return false; + + // Bail if no parent item + if ( empty( $activities_template->activity_parents[$parent_id] ) ) + return false; + + // Bail if no parent user ID + if ( empty( $activities_template->activity_parents[$parent_id]->user_id ) ) + return false; + + $retval = $activities_template->activity_parents[$parent_id]->user_id; + + return (int) apply_filters( 'bp_get_activity_parent_user_id', $retval ); + } + /** * Output whether or not the current activity is in a current user's favorites * @@ -1460,7 +1562,7 @@ function bp_activity_comments( $args = '' ) { // Put the comment into the global so it's available to filters $activities_template->activity->current_comment = $comment_child; - $template = locate_template( 'activity/comment.php', false, false ); + $template = bp_locate_template( 'activity/comment.php', false, false ); // Backward compatibility. In older versions of BP, the markup was // generated in the PHP instead of a template. This ensures that @@ -2463,6 +2565,121 @@ function bp_activity_post_form_action() { return apply_filters( 'bp_get_activity_post_form_action', home_url( bp_get_activity_root_slug() . '/post/' ) ); } +/** + * Looks at all the activity comments on the current activity item, and prints the comments' authors's avatar wrapped in <LI> tags. + * + * Use this function to easily output activity comment authors' avatars. + * + * @param array $args See {@link bp_core_fetch_avatar} for accepted values + * @since BuddyPress (1.7) + */ +function bp_activity_comments_user_avatars( $args = array() ) { + $defaults = array( + 'height' => false, + 'html' => true, + 'type' => 'thumb', + 'width' => false, + ); + + $args = wp_parse_args( $args, $defaults ); + extract( $args, EXTR_SKIP ); + + // Get the user IDs of everyone who has left a comment to the current activity item + $user_ids = bp_activity_get_comments_user_ids(); + + $output = array(); + foreach ( (array) $user_ids as $user_id ) { + $profile_link = bp_core_get_user_domain( $user_id ); + $image_html = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'height' => $height, 'html' => $html, 'type' => $type, 'width' => $width, ) ); + + $output[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $profile_link ), $image_html ); + } + + echo apply_filters( 'bp_activity_comments_user_avatars', '<li>' . implode( '</li><li>', $output ) . '</li>', $args, $output ); +} + +/** + * Returns the user IDs of everyone who's written an activity comment on the current activity item. + * + * @return bool|array Returns false if there is no current activity items + * @since BuddyPress (1.7) + */ +function bp_activity_get_comments_user_ids() { + if ( empty( $GLOBALS['activities_template']->activity ) || empty( $GLOBALS['activities_template']->activity->children ) ) + return false; + + $user_ids = (array) bp_activity_recurse_comments_user_ids( $GLOBALS['activities_template']->activity->children ); + return apply_filters( 'bp_activity_get_comments_user_ids', array_unique( $user_ids ) ); +} + + /** + * Recurse through all activity comments and collect the IDs of the users who wrote them. + * + * @param array $comments Array of {@link BP_Activity_Activity} items + * @return array Array of user IDs + * @since BuddyPress (1.7) + */ + function bp_activity_recurse_comments_user_ids( array $comments ) { + $user_ids = array(); + + foreach ( $comments as $comment ) { + // If a user is a spammer, their activity items will have been automatically marked as spam. Skip these. + if ( $comment->is_spam ) + continue; + + $user_ids[] = $comment->user_id; + + // Check for commentception + if ( ! empty( $comment->children ) ) + $user_ids = array_merge( $user_ids, bp_activity_recurse_comments_user_ids( $comment->children ) ); + } + + return $user_ids; + } + + +/** + * Renders a list of all the registered activity types for use in a <select> element, or as <input type="checkbox">. + * + * @param string $output Optional. Either 'select' or 'checkbox'. Defaults to select. + * @param string|array $args Optional extra arguments: + * checkbox_name - Used when type=checkbox. Sets the item's name property. + * selected - Array of strings of activity types to mark as selected/checked. + * @since BuddyPress (1.7) + */ +function bp_activity_types_list( $output = 'select', $args = '' ) { + $defaults = array( + 'checkbox_name' => 'bp_activity_types', + 'selected' => array(), + ); + $args = wp_parse_args( $args, $defaults ); + + $activities = bp_activity_get_types(); + natsort( $activities ); + + // Loop through the activity types and output markup + foreach ( $activities as $type => $description ) { + + // See if we need to preselect the current type + $checked = checked( true, in_array( $type, (array) $args['selected'] ), false ); + $selected = selected( true, in_array( $type, (array) $args['selected'] ), false ); + + if ( 'select' == $output ) + printf( '<option value="%1$s" %2$s>%3$s</option>', esc_attr( $type ), $selected, esc_html( $description ) ); + + elseif ( 'checkbox' == $output ) + printf( '<label style="">%1$s<input type="checkbox" name="%2$s[]" value="%3$s" %4$s/></label>', esc_html( $description ), esc_attr( $args['checkbox_name'] ), esc_attr( $type ), $checked ); + + // Allow custom markup + do_action( 'bp_activity_types_list_' . $output, $args, $type, $description ); + } + + // Backpat with BP-Default for dropdown boxes only + if ( 'select' == $output ) + do_action( 'bp_activity_filter_options' ); +} + + /* RSS Feed Template Tags ****************************************************/ /** @@ -2739,5 +2956,3 @@ function bp_activity_sitewide_feed() { <?php } add_action( 'bp_head', 'bp_activity_sitewide_feed' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-favorites-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-favorites-feed.php index 8c90c5834823d9472aa42e9ef33e2af12394d543..321b8622b4a5a1cae84ad3c6b9b901435b6ab13e 100644 --- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-favorites-feed.php +++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-favorites-feed.php @@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit; header('Content-Type: text/xml; charset=' . get_option( 'blog_charset' ), true ); header('Status: 200 OK'); -?> -<?php echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>'; ?> +echo '<?xml version="1.0" encoding="' . get_option( 'blog_charset' ) . '"?'.'>'; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" @@ -31,7 +30,7 @@ header('Status: 200 OK'); <description><?php printf( __( '%s - Favorite Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description> <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate> <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator> - <language><?php echo get_option('rss_language'); ?></language> + <language><?php bloginfo_rss( 'language' ); ?></language> <?php do_action('bp_activity_favorites_feed_head'); ?> diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-friends-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-friends-feed.php index c24a3c7a6d52f556d7db22f2f2ab983a3e942a4a..3b2906d6e0460b38efc6c9281b6470e2e37d9d1b 100644 --- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-friends-feed.php +++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-friends-feed.php @@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit; header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); header('Status: 200 OK'); -?> -<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> +echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" @@ -31,7 +30,7 @@ header('Status: 200 OK'); <description><?php printf( __( '%s - Friends Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ); ?></description> <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate> <generator>http://buddypress.org/?v=<?php echo BP_VERSION; ?></generator> - <language><?php echo get_option('rss_language'); ?></language> + <language><?php bloginfo_rss( 'language' ); ?></language> <?php do_action('bp_activity_friends_feed_head'); ?> <?php if ( bp_has_activities( 'scope=friends&max=50&display_comments=stream' ) ) : ?> diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-group-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-group-feed.php index 846108b4dbd0a9633ce77b44542ca4a27d9d5f79..22e219187bfc763aa88600037d7d40f41b5015a2 100644 --- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-group-feed.php +++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-group-feed.php @@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit; header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); header('Status: 200 OK'); -?> -<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> +echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" @@ -31,7 +30,7 @@ header('Status: 200 OK'); <description><?php printf( __( '%s - Group Activity Feed', 'buddypress' ), $bp->groups->current_group->name ) ?></description> <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate> <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator> - <language><?php echo get_option('rss_language'); ?></language> + <language><?php bloginfo_rss( 'language' ); ?></language> <?php do_action('bp_activity_group_feed_head'); ?> <?php if ( bp_has_activities( 'object=' . $bp->groups->id . '&primary_id=' . $bp->groups->current_group->id . '&max=50&display_comments=threaded' ) ) : ?> diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mentions-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mentions-feed.php index b329096fe0549542286003d4e33192824f61f0da..897224b333ed513daa42dbeb5939625ccadbc806 100644 --- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mentions-feed.php +++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mentions-feed.php @@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit; header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); header('Status: 200 OK'); -?> -<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> +echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" @@ -32,7 +31,7 @@ header('Status: 200 OK'); <description><?php printf( __( '%s - Mentions', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description> <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate> <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator> - <language><?php echo get_option('rss_language'); ?></language> + <language><?php bloginfo_rss( 'language' ); ?></language> <?php do_action('bp_activity_mentions_feed_head'); ?> <?php if ( bp_has_activities( 'max=50&display_comments=stream&search_terms=@' . bp_core_get_username( bp_displayed_user_id() ) ) ) : ?> diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mygroups-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mygroups-feed.php index da15c36777792eadf552551dee83ac41192f909f..6703daf7fc71c9495234a83b1646359b8431ee75 100644 --- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mygroups-feed.php +++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-mygroups-feed.php @@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit; header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); header('Status: 200 OK'); -?> -<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> +echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" @@ -32,7 +31,7 @@ header('Status: 200 OK'); <description><?php printf( __( '%1$s - My Groups - Public Activity', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description> <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate> <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator> - <language><?php echo get_option('rss_language'); ?></language> + <language><?php bloginfo_rss( 'language' ); ?></language> <?php do_action('bp_activity_mygroups_feed_head'); ?> <?php diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-personal-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-personal-feed.php index f438bc7f675f58f8cc2ddaa3dd68657d93b22427..455369bacc5548e44c8926941b78a3615f11cb7d 100644 --- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-personal-feed.php +++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-personal-feed.php @@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit; header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); header('Status: 200 OK'); -?> -<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> +echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" @@ -31,7 +30,7 @@ header('Status: 200 OK'); <description><?php printf( __( '%s - Activity Feed', 'buddypress' ), bp_get_displayed_user_fullname() ) ?></description> <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate> <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator> - <language><?php echo get_option('rss_language'); ?></language> + <language><?php bloginfo_rss( 'language' ); ?></language> <?php do_action('bp_activity_personal_feed_head'); ?> <?php if ( bp_has_activities( 'user_id=' . bp_displayed_user_id() . '&max=50&display_comments=stream' ) ) : ?> diff --git a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-sitewide-feed.php b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-sitewide-feed.php index 37a62c6d4382d66363994cfb1eb13de66ed34b9d..236fdd4e594396b46ac420d0079fdfb436b977ac 100644 --- a/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-sitewide-feed.php +++ b/wp-content/plugins/buddypress/bp-activity/feeds/bp-activity-sitewide-feed.php @@ -12,8 +12,7 @@ if ( !defined( 'ABSPATH' ) ) exit; header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); header('Status: 200 OK'); -?> -<?php echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> +echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>'; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" @@ -31,7 +30,7 @@ header('Status: 200 OK'); <description><?php _e( 'Site Wide Activity Feed', 'buddypress' ) ?></description> <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate> <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator> - <language><?php echo get_option('rss_language'); ?></language> + <language><?php bloginfo_rss( 'language' ); ?></language> <?php do_action('bp_activity_sitewide_feed_head'); ?> <?php if ( bp_has_activities( 'type=sitewide&max=50&display_comments=threaded' ) ) : ?> diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php index 4300683016aac0702b7936738030b75da4df0612..1f6bb7e1ae7bc434cbb32f5f8fdaf5bef02125e1 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-actions.php @@ -34,5 +34,3 @@ function bp_blogs_redirect_to_random_blog() { } } add_action( 'bp_actions', 'bp_blogs_redirect_to_random_blog' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php index 1fe80dfd38e7e0fd78be860efbcbf4d37f1c8616..b418840d8004bcc262f270d69fd59f0e81ed995a 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-activity.php @@ -17,7 +17,7 @@ if ( !defined( 'ABSPATH' ) ) exit; * @package BuddyPress * @subpackage BlogsActivity * @global type $bp - * @return boolean + * @return boolean */ function bp_blogs_register_activity_actions() { global $bp; @@ -42,7 +42,7 @@ add_action( 'bp_register_activity_actions', 'bp_blogs_register_activity_actions' * @subpackage BlogsActivity * @global BuddyPress $bp * @param array $args - * @return boolean + * @return boolean */ function bp_blogs_record_activity( $args = '' ) { global $bp; @@ -125,5 +125,3 @@ function bp_blogs_delete_activity( $args = true ) { 'secondary_item_id' => $secondary_item_id ) ); } - -?> diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-buddybar.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-buddybar.php index a254d05ef8f3a6889283a0c5db622837554774fb..5090ecc8c8bbc4391fd3f8ac2ee84264de1e20dd 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-buddybar.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-buddybar.php @@ -17,9 +17,9 @@ if ( !defined( 'ABSPATH' ) ) exit; * @package BuddyPress * @subpackage BlogsBuddyBar * @global BuddyPress $bp - * @return boolean + * @return boolean */ - + function bp_adminbar_blogs_menu() { global $bp; @@ -77,5 +77,3 @@ function bp_adminbar_blogs_menu() { } } add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php index 3fc55bc0a028414920e54319a7a6959f544e92f3..8f4b444491ac945db87f9df4ef7a743ddcb09f17 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-cache.php @@ -7,7 +7,7 @@ * actions throughout BuddyPress. * * @package BuddyPress - * @subpackage BlogsBuddyBar + * @subpackage BlogsCache */ // Exit if accessed directly @@ -18,9 +18,9 @@ if ( !defined( 'ABSPATH' ) ) exit; * * @since BuddyPress (1.0) * @package BuddyPress - * @subpackage BlogsBuddyBar + * @subpackage BlogsCache * @param int $blog_id - * @param int $user_id + * @param int $user_id */ function bp_blogs_clear_blog_object_cache( $blog_id, $user_id ) { wp_cache_delete( 'bp_blogs_of_user_' . $user_id, 'bp' ); @@ -32,8 +32,8 @@ function bp_blogs_clear_blog_object_cache( $blog_id, $user_id ) { * * @since BuddyPress (1.0) * @package BuddyPress - * @subpackage BlogsBuddyBar - * @param Blog $recorded_blog_obj + * @subpackage BlogsCache + * @param Blog $recorded_blog_obj */ function bp_blogs_format_clear_blog_cache( $recorded_blog_obj ) { bp_blogs_clear_blog_object_cache( false, $recorded_blog_obj->user_id ); @@ -54,5 +54,3 @@ add_action( 'bp_blogs_new_blog_comment', 'bp_core_clear_cache' ); add_action( 'bp_blogs_new_blog_post', 'bp_core_clear_cache' ); add_action( 'bp_blogs_new_blog', 'bp_core_clear_cache' ); add_action( 'bp_blogs_remove_data', 'bp_core_clear_cache' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php index 87d6f19feca1f388a149f4bd5129830a4170010f..5c3bd2f483432af6be7b64228914e938db1d1e45 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-classes.php @@ -201,10 +201,11 @@ class BP_Blogs_Blog { $user_id = bp_displayed_user_id(); // If the user is logged in return the blog count including their hidden blogs. - if ( ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) || bp_current_user_can( 'bp_moderate' ) ) - return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) ); - else - return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id) ); + if ( ( is_user_logged_in() && $user_id == bp_loggedin_user_id() ) || bp_current_user_can( 'bp_moderate' ) ) { + return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id ) ); + } else { + return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(DISTINCT b.blog_id) FROM {$bp->blogs->table_name} b LEFT JOIN {$wpdb->base_prefix}blogs wb ON b.blog_id = wb.blog_id WHERE wb.public = 1 AND wb.deleted = 0 AND wb.spam = 0 AND wb.mature = 0 AND wb.archived = '0' AND user_id = %d", $user_id ) ); + } } function search_blogs( $filter, $limit = null, $page = null ) { @@ -215,8 +216,9 @@ class BP_Blogs_Blog { if ( !bp_current_user_can( 'bp_moderate' ) ) $hidden_sql = "AND wb.public = 1"; - if ( $limit && $page ) + if ( $limit && $page ) { $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); + } $paged_blogs = $wpdb->get_results( "SELECT DISTINCT bm.blog_id FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND bm.meta_value LIKE '%%$filter%%' ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC{$pag_sql}" ); $total_blogs = $wpdb->get_var( "SELECT COUNT(DISTINCT bm.blog_id) FROM {$bp->blogs->table_name_blogmeta} bm LEFT JOIN {$wpdb->base_prefix}blogs wb ON bm.blog_id = wb.blog_id WHERE ( ( bm.meta_key = 'name' OR bm.meta_key = 'description' ) AND bm.meta_value LIKE '%%$filter%%' ) {$hidden_sql} AND wb.mature = 0 AND wb.spam = 0 AND wb.archived = '0' AND wb.deleted = 0 ORDER BY meta_value ASC" ); @@ -261,7 +263,35 @@ class BP_Blogs_Blog { for ( $i = 0, $count = count( $paged_blogs ); $i < $count; ++$i ) { $blog_prefix = $wpdb->get_blog_prefix( $paged_blogs[$i]->blog_id ); - $paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT post_title, guid FROM {$blog_prefix}posts WHERE post_status = 'publish' AND post_type = 'post' AND id != 1 ORDER BY id DESC LIMIT 1" ); + $paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT ID, post_content, post_title, post_excerpt, guid FROM {$blog_prefix}posts WHERE post_status = 'publish' AND post_type = 'post' AND id != 1 ORDER BY id DESC LIMIT 1" ); + $images = array(); + + // Add URLs to any Featured Image this post might have + if ( ! empty( $paged_blogs[$i]->latest_post ) && has_post_thumbnail( $paged_blogs[$i]->latest_post->ID ) ) { + + // Grab 4 sizes of the image. Thumbnail. + $image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'thumbnail', false ); + if ( ! empty( $image ) ) + $images['thumbnail'] = $image[0]; + + // Medium + $image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'medium', false ); + if ( ! empty( $image ) ) + $images['medium'] = $image[0]; + + // Large + $image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'large', false ); + if ( ! empty( $image ) ) + $images['large'] = $image[0]; + + // Post thumbnail + $image = wp_get_attachment_image_src( get_post_thumbnail_id( $paged_blogs[$i]->latest_post->ID ), 'post-thumbnail', false ); + if ( ! empty( $image ) ) + $images['post-thumbnail'] = $image[0]; + + // Add the images to the latest_post object + $paged_blogs[$i]->latest_post->images = $images; + } } /* Fetch the blog description for each blog (as it may be empty we can't fetch it in the main query). */ @@ -286,5 +316,3 @@ class BP_Blogs_Blog { return false; } } - -?> diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php index 1da1c54d86bce613528ca9a11f7d93d822f8313c..99b6ba11378acaf9175d7a141c8fd6fb3050a484 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-filters.php @@ -5,22 +5,32 @@ * * @package BuddyPress * @subpackage Blogs - * @since 1.6 + * @since BuddyPress (1.6) */ +// Display filters + +add_filter( 'bp_get_blog_latest_post_title', 'wptexturize' ); +add_filter( 'bp_get_blog_latest_post_title', 'convert_chars' ); +add_filter( 'bp_get_blog_latest_post_title', 'trim' ); + +add_filter( 'bp_blog_latest_post_content', 'wptexturize' ); +add_filter( 'bp_blog_latest_post_content', 'convert_smilies' ); +add_filter( 'bp_blog_latest_post_content', 'convert_chars' ); +add_filter( 'bp_blog_latest_post_content', 'wpautop' ); +add_filter( 'bp_blog_latest_post_content', 'shortcode_unautop' ); +add_filter( 'bp_blog_latest_post_content', 'prepend_attachment' ); + /** * Ensures that the 'Create a new site' link at wp-admin/my-sites.php points to the BP blog signup * - * @since 1.6 + * @since BuddyPress (1.6) * @uses apply_filters() Filter bp_blogs_creation_location to alter the returned value * * @param string $url The original URL (points to wp-signup.php by default) * @return string The new URL */ function bp_blogs_creation_location( $url ) { - return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_slug() . '/create', $url ) ); + return apply_filters( 'bp_blogs_creation_location', trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create', $url ) ); } add_filter( 'wp_signup_location', 'bp_blogs_creation_location' ); - - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php index 82b5b00e361cbe43f21801bc8f148c49b140d74d..f0410fcd3d30be6f159ace644b13c1db6206826f 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-functions.php @@ -48,27 +48,87 @@ function bp_blogs_record_existing_blogs() { // Truncate user blogs table and re-record. $wpdb->query( "TRUNCATE TABLE {$bp->blogs->table_name}" ); - if ( is_multisite() ) - $blog_ids = $wpdb->get_col( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" ); - else + if ( is_multisite() ) { + $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0 AND site_id = %d" ), $wpdb->siteid ); + } else { $blog_ids = 1; + } - if ( $blog_ids ) { + if ( !empty( $blog_ids ) ) { foreach( (array) $blog_ids as $blog_id ) { - $users = get_users( array( 'blog_id' => $blog_id ) ); - $subscribers = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) ); + $users = get_users( array( 'blog_id' => $blog_id ) ); + $subscribers = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) ); if ( !empty( $users ) ) { foreach ( (array) $users as $user ) { // Don't record blogs for subscribers - if ( !in_array( $user, $subscribers ) ) + if ( !in_array( $user, $subscribers ) ) { bp_blogs_record_blog( $blog_id, $user->ID, true ); + } } } } } } +/** + * Makes BuddyPress aware of sites that shouldn't be recorded to activity streams. + * + * If $user_id is provided, you can restrict site from being recordable + * only to particular users. + * + * @since BuddyPress (1.7) + * @param int $blog_id + * @param int|null $user_id + * @uses apply_filters() + * @return bool True if blog is recordable, false elsewhere + */ +function bp_blogs_is_blog_recordable( $blog_id, $user_id = 0 ) { + + $recordable_globally = apply_filters( 'bp_blogs_is_blog_recordable', true, $blog_id ); + + if ( !empty( $user_id ) ) { + $recordable_for_user = apply_filters( 'bp_blogs_is_blog_recordable_for_user', $recordable_globally, $blog_id, $user_id ); + } else { + $recordable_for_user = $recordable_globally; + } + + if ( !empty( $recordable_for_user ) ) { + return true; + } + + return $recordable_globally; +} + +/** + * Makes BuddyPress aware of sites that activities shouldn't be trackable. + * If $user_id is provided, the developer can restrict site from + * being trackable only to particular users. + * + * @since BuddyPress (1.7) + * @param int $blog_id + * @param int|null $user_id + * @uses bp_blogs_is_blog_recordable + * @uses apply_filters() + * @return bool True if blog is trackable, false elsewhere + */ +function bp_blogs_is_blog_trackable( $blog_id, $user_id = 0 ) { + + $trackable_globally = apply_filters( 'bp_blogs_is_blog_trackable', bp_blogs_is_blog_recordable( $blog_id, $user_id ), $blog_id ); + + if ( !empty( $user_id ) ) { + $trackable_for_user = apply_filters( 'bp_blogs_is_blog_trackable_for_user', $trackable_globally, $blog_id, $user_id ); + } else { + $trackable_for_user = $trackable_globally; + } + + if ( !empty( $trackable_for_user ) ) { + return $trackable_for_user; + } + + return $trackable_globally; +} + /** * Makes BuddyPress aware of a new site so that it can track its activity. * @@ -83,7 +143,11 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) { if ( empty( $user_id ) ) $user_id = bp_loggedin_user_id(); - $name = get_blog_option( $blog_id, 'blogname' ); + // If blog is not recordable, do not record the activity. + if ( !bp_blogs_is_blog_recordable( $blog_id, $user_id ) ) + return false; + + $name = get_blog_option( $blog_id, 'blogname' ); $description = get_blog_option( $blog_id, 'blogdescription' ); if ( empty( $name ) ) @@ -103,7 +167,8 @@ function bp_blogs_record_blog( $blog_id, $user_id, $no_activity = false ) { $is_private = !apply_filters( 'bp_is_new_blog_public', !$is_private ); // Only record this activity if the blog is public - if ( !$is_private && !$no_activity ) { + if ( !$is_private && !$no_activity && bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) { + // Record this in activity streams bp_blogs_record_activity( array( 'user_id' => $recorded_blog->user_id, @@ -152,6 +217,10 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) { $post_id = (int) $post_id; $blog_id = (int) $wpdb->blogid; + // If blog is not trackable, do not record the activity. + if ( ! bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) + return false; + if ( !$user_id ) $user_id = (int) $post->post_author; @@ -175,7 +244,7 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) { if ( 'publish' == $post->post_status && empty( $post->post_password ) ) { if ( $is_blog_public || !is_multisite() ) { - + // Record this in activity streams $post_permalink = get_permalink( $post_id ); @@ -194,7 +263,7 @@ function bp_blogs_record_post( $post_id, $post, $user_id = 0 ) { 'secondary_id' => $post_id, ) ) ); - + if ( !empty( $existing['activities'] ) ) { return; } @@ -259,7 +328,12 @@ function bp_blogs_record_comment( $comment_id, $is_approved = true ) { $user_id = (int) $user->ID; // Get blog and post data - $blog_id = get_current_blog_id(); + $blog_id = get_current_blog_id(); + + // If blog is not trackable, do not record the activity. + if ( ! bp_blogs_is_blog_trackable( $blog_id, $user_id ) ) + return false; + $recorded_comment->post = get_post( $recorded_comment->comment_post_ID ); if ( empty( $recorded_comment->post ) || is_wp_error( $recorded_comment->post ) ) @@ -313,7 +387,7 @@ add_action( 'edit_comment', 'bp_blogs_record_comment', 10 ); function bp_blogs_add_user_to_blog( $user_id, $role = false, $blog_id = 0 ) { global $wpdb; - + if ( empty( $blog_id ) ) { $blog_id = isset( $wpdb->blogid ) ? $wpdb->blogid : bp_get_root_blog_id(); } @@ -353,7 +427,7 @@ add_action( 'remove_user_from_blog', 'bp_blogs_remove_user_from_blog', 10, 2 ); * Blogs component. This function bumps the priority of the core function, so that we can be sure * that the Blogs component is loaded first. See http://buddypress.trac.wordpress.org/ticket/3916 * - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_blogs_maybe_add_user_to_blog() { if ( ! is_multisite() ) @@ -440,7 +514,7 @@ add_action( 'delete_comment', 'bp_blogs_remove_comment' ); * @param string $new_status New comment status. * @param string $old_status Previous comment status. * @param object $comment Comment data. - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) { global $bp; @@ -608,7 +682,7 @@ function bp_blogs_get_blogmeta( $blog_id, $meta_key = '') { wp_cache_set( 'bp_blogs_blogmeta_' . $blog_id . '_' . $meta_key, $metas, 'bp' ); } } else { - $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d", $blog_id) ); + $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->blogs->table_name_blogmeta} WHERE blog_id = %d", $blog_id ) ); } if ( empty($metas) ) { @@ -670,5 +744,3 @@ function bp_blogs_remove_data( $user_id ) { add_action( 'wpmu_delete_user', 'bp_blogs_remove_data' ); add_action( 'delete_user', 'bp_blogs_remove_data' ); add_action( 'bp_make_spam_user', 'bp_blogs_remove_data' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php index 76e4815e457bd949f46cfc0dc5a8b6c951a10c0a..6eaa1111f80625e75bb3e13548fa8ef2526f3618 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-loader.php @@ -115,9 +115,18 @@ class BP_Blogs_Component extends BP_Component { 'default_subnav_slug' => 'my-sites', 'item_css_id' => $this->id ); - - $parent_url = trailingslashit( bp_displayed_user_domain() . bp_get_blogs_slug() ); - + + // Determine user to use + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $parent_url = trailingslashit( $user_domain . bp_get_blogs_slug() ); + $sub_nav[] = array( 'name' => __( 'My Sites', 'buddypress' ), 'slug' => 'my-sites', @@ -212,5 +221,3 @@ function bp_setup_blogs() { $bp->blogs = new BP_Blogs_Component(); } add_action( 'bp_setup_components', 'bp_setup_blogs', 6 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php index b96cf8ed66d3c0ffbdbf13db45a90971e1fadbfa..6ffd8278650d9aaf8f053a0a024ac04f60485c25 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-screens.php @@ -20,6 +20,7 @@ function bp_blogs_screen_my_blogs() { } function bp_blogs_screen_create_a_blog() { + if ( !is_multisite() || !bp_is_blogs_component() || !bp_is_current_action( 'create' ) ) return false; @@ -43,4 +44,132 @@ function bp_blogs_screen_index() { } add_action( 'bp_screens', 'bp_blogs_screen_index', 2 ); -?> +/** Theme Compatability *******************************************************/ + +/** + * The main theme compat class for BuddyPress Activity + * + * This class sets up the necessary theme compatability actions to safely output + * group template parts to the_title and the_content areas of a theme. + * + * @since BuddyPress (1.7) + */ +class BP_Blogs_Theme_Compat { + + /** + * Setup the groups component theme compatibility + * + * @since BuddyPress (1.7) + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_blogs' ) ); + } + + /** + * Are we looking at something that needs group theme compatability? + * + * @since BuddyPress (1.7) + */ + public function is_blogs() { + + // Bail if not looking at a group + if ( ! bp_is_blogs_component() ) + return; + + // Bail if looking at a users sites + if ( bp_is_user() ) + return; + + // Blog Directory + if ( is_multisite() && ! bp_current_action() ) { + bp_update_is_directory( true, 'blogs' ); + + do_action( 'bp_blogs_screen_index' ); + + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); + + // Create blog + } elseif ( is_user_logged_in() && bp_blog_signup_enabled() ) { + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'create_content' ) ); + } + } + + /** Directory *************************************************************/ + + /** + * Update the global $post with directory data + * + * @since BuddyPress (1.7) + */ + public function directory_dummy_post() { + + // Title based on ability to create blogs + if ( is_user_logged_in() && bp_blog_signup_enabled() ) { + $title = __( 'Blogs', 'buddypress' ) . ' <a class="button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create' ) . '">' . __( 'Create a Blog', 'buddypress' ) . '</a>'; + } else { + $title = __( 'Blogs', 'buddypress' ); + } + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => $title, + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_blogs', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the groups index template part + * + * @since BuddyPress (1.7) + */ + public function directory_content() { + bp_buffer_template_part( 'blogs/index' ); + } + + /** Create ****************************************************************/ + + /** + * Update the global $post with create screen data + * + * @since BuddyPress (1.7) + */ + public function create_dummy_post() { + + // Title based on ability to create blogs + if ( is_user_logged_in() && bp_blog_signup_enabled() ) { + $title = '<a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '">' . __( 'Blogs', 'buddypress' ) . '</a> ' . __( 'Create a Blog', 'buddypress' ); + } else { + $title = __( 'Blogs', 'buddypress' ); + } + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => $title, + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_group', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the create screen template part + * + * @since BuddyPress (1.7) + */ + public function create_content() { + bp_buffer_template_part( 'blogs/create' ); + } +} +new BP_Blogs_Theme_Compat(); diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php index 3bca221a9f4415d8c408719c4d4912543cd2a19d..c1545647835c80c8557b0bba04010683dd2d9996 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-template.php @@ -30,8 +30,7 @@ function bp_blogs_slug() { * @since BuddyPress (1.5) */ function bp_get_blogs_slug() { - global $bp; - return apply_filters( 'bp_get_blogs_slug', $bp->blogs->slug ); + return apply_filters( 'bp_get_blogs_slug', buddypress()->blogs->slug ); } /** @@ -54,8 +53,7 @@ function bp_blogs_root_slug() { * @since BuddyPress (1.5) */ function bp_get_blogs_root_slug() { - global $bp; - return apply_filters( 'bp_get_blogs_root_slug', $bp->blogs->root_slug ); + return apply_filters( 'bp_get_blogs_root_slug', buddypress()->blogs->root_slug ); } /** @@ -332,6 +330,26 @@ function bp_blog_name() { return apply_filters( 'bp_get_blog_name', $blogs_template->blog->name ); } +/** + * Outputs the blog ID + * + * @since BuddyPress (1.7) + */ +function bp_blog_id() { + echo bp_get_blog_id(); +} + /** + * Returns the blog ID + * + * @return int + * @since BuddyPress (1.7) + */ + function bp_get_blog_id() { + global $blogs_template; + + return apply_filters( 'bp_get_blog_id', $blogs_template->blog->blog_id ); + } + function bp_blog_description() { echo apply_filters( 'bp_blog_description', bp_get_blog_description() ); } @@ -341,6 +359,41 @@ function bp_blog_description() { return apply_filters( 'bp_get_blog_description', $blogs_template->blog->description ); } + +/** + * Output the row class of a site + * + * @since BuddyPress (1.7) + */ +function bp_blog_class() { + echo bp_get_blog_class(); +} + /** + * Return the row class of a site + * + * @global BP_Blogs_Template $blogs_template + * @return string Row class of the site + * @since BuddyPress (1.7) + */ + function bp_get_blog_class() { + global $blogs_template; + + $classes = array(); + $pos_in_loop = (int) $blogs_template->current_blog; + + // If we've only one site in the loop, don't bother with odd and even. + if ( $blogs_template->blog_count > 1 ) + $classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd'; + else + $classes[] = 'bp-single-blog'; + + $classes = apply_filters( 'bp_get_blog_class', $classes ); + $classes = array_merge( $classes, array() ); + + $retval = 'class="' . join( ' ', $classes ) . '"'; + return $retval; + } + function bp_blog_last_active() { echo bp_get_blog_last_active(); } @@ -356,12 +409,143 @@ function bp_blog_latest_post() { function bp_get_blog_latest_post() { global $blogs_template; - if ( null == $blogs_template->blog->latest_post ) - return false; + $retval = bp_get_blog_latest_post_title(); + + if ( ! empty( $retval ) ) + $retval = sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $retval ) . '</a>' ); + + return apply_filters( 'bp_get_blog_latest_post', $retval ); + } + +/** + * Prints this site's latest article's title + * + * @since BuddyPress (1.7) + * + * @see bp_get_blog_latest_post_title() + */ +function bp_blog_latest_post_title() { + echo bp_get_blog_latest_post_title(); +} + /** + * Returns this site's latest article's title + * + * @since BuddyPress (1.7) + * + * @global BP_Blogs_Template + * @return string + */ + function bp_get_blog_latest_post_title() { + global $blogs_template; + + $retval = ''; + + if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->post_title ) ) + $retval = $blogs_template->blog->latest_post->post_title; + + return apply_filters( 'bp_get_blog_latest_post_title', $retval ); + } + +/** + * Prints this site's latest article's permalink + * + * @see bp_get_blog_latest_post_title() + * @since BuddyPress (1.7) + */ +function bp_blog_latest_post_permalink() { + echo bp_get_blog_latest_post_permalink(); +} + /** + * Returns this site's latest article's permalink + * + * @global BP_Blogs_Template + * @return string + * @since BuddyPress (1.7) + */ + function bp_get_blog_latest_post_permalink() { + global $blogs_template; + + $retval = ''; + + if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->ID ) ) + $retval = add_query_arg( 'p', $blogs_template->blog->latest_post->ID, bp_get_blog_permalink() ); + + return apply_filters( 'bp_get_blog_latest_post_permalink', $retval ); + } + +/** + * Prints this site's latest article's content + * + * @since BuddyPress (1.7) + * + * @uses bp_get_blog_latest_post_content() + */ +function bp_blog_latest_post_content() { + echo bp_get_blog_latest_post_content(); +} + /** + * Returns this site's latest article's content + * + * @since BuddyPress (1.7) + * + * @global BP_Blogs_Template + * @return string + */ + function bp_get_blog_latest_post_content() { + global $blogs_template; + + $retval = ''; + + if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->post_content ) ) + $retval = $blogs_template->blog->latest_post->post_content; - return apply_filters( 'bp_get_blog_latest_post', sprintf( __( 'Latest Post: %s', 'buddypress' ), '<a href="' . $blogs_template->blog->latest_post->guid . '">' . apply_filters( 'the_title', $blogs_template->blog->latest_post->post_title ) . '</a>' ) ); + return apply_filters( 'bp_get_blog_latest_post_content', $retval ); } +/** + * Prints this site's latest article's featured image + * + * @since BuddyPress (1.7) + * + * @param string $size Image version to return. Either "thumbnail", "medium", "large", "post-thumbnail". + * @see bp_get_blog_latest_post_content() + */ +function bp_blog_latest_post_featured_image( $size = 'thumbnail' ) { + echo bp_get_blog_latest_post_featured_image( $size ); +} + /** + * Returns this site's latest article's featured image + * + * @since BuddyPress (1.7) + * + * @global BP_Blogs_Template + * @param string $size Image version to return. Either "thumbnail", "medium", "large", "post-thumbnail". + * @return string + */ + function bp_get_blog_latest_post_featured_image( $size = 'thumbnail' ) { + global $blogs_template; + + $retval = ''; + + if ( ! empty( $blogs_template->blog->latest_post ) && ! empty( $blogs_template->blog->latest_post->images[$size] ) ) + $retval = $blogs_template->blog->latest_post->images[$size]; + + return apply_filters( 'bp_get_blog_latest_post_featured_image', $retval ); + } + +/** + * Does the latest blog post have a featured image? + * + * @param string $size Image version to check for. Either "thumbnail", "medium", "large", "post-thumbnail". + * @return bool + * @since BuddyPress (1.7) + */ +function bp_blog_latest_post_has_featured_image( $thumbnail = 'thumbnail' ) { + $image = bp_get_blog_latest_post_featured_image( $thumbnail ); + + return apply_filters( 'bp_blog_latest_post_has_featured_image', ! empty( $image ), $thumbnail, $image ); +} + function bp_blog_hidden_fields() { if ( isset( $_REQUEST['s'] ) ) echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ). '" name="search_terms" />'; @@ -461,9 +645,9 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) <?php } if ( !is_subdomain_install() ) - echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />'; + echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /><br />'; else - echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />'; + echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />'; if ( !is_user_logged_in() ) { print '(<strong>' . __( 'Your address will be ' , 'buddypress'); @@ -511,7 +695,7 @@ function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) /** * Echo the value of bp_blogs_get_subdomain_base() * - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_blogs_subdomain_base() { echo bp_blogs_get_subdomain_base(); @@ -520,7 +704,7 @@ function bp_blogs_subdomain_base() { * Return the base URL to be displayed when a user chooses an address for a new blog, on * a subdomain installation of WordPress MS * - * @since 1.6 + * @since BuddyPress (1.6) * @return str The base URL - eg, 'example.com' for site_url() example.com or www.example.com */ function bp_blogs_get_subdomain_base() { @@ -604,6 +788,8 @@ function bp_blogs_blog_tabs() { </ul> <?php + + // @todo where does $current_tab come from? do_action( 'bp_blogs_blog_tabs', $current_tab ); } @@ -656,5 +842,3 @@ function bp_blogs_visit_blog_button( $args = '' ) { // Filter and return the HTML button return bp_get_button( apply_filters( 'bp_get_blogs_visit_blog_button', $button ) ); } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php index 6298d89cbdfac699dad111f03a3823dc47de7785..506d788ac4e5d508a2d4c62024c1e75197acac2a 100644 --- a/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php +++ b/wp-content/plugins/buddypress/bp-blogs/bp-blogs-widgets.php @@ -15,14 +15,14 @@ function bp_blogs_register_widgets() { global $wpdb; if ( bp_is_active( 'activity' ) && (int) $wpdb->blogid == bp_get_root_blog_id() ) - add_action('widgets_init', create_function('', 'return register_widget("BP_Blogs_Recent_Posts_Widget");') ); + add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Blogs_Recent_Posts_Widget");' ) ); } add_action( 'bp_register_widgets', 'bp_blogs_register_widgets' ); class BP_Blogs_Recent_Posts_Widget extends WP_Widget { function __construct() { - parent::__construct( false, $name = __( 'Recent Networkwide Posts', 'buddypress' ) ); + parent::__construct( false, $name = _x( '(BuddyPress) Recent Networkwide Posts', 'widget name', 'buddypress' ) ); } function widget($args, $instance) { @@ -35,7 +35,7 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget { if ( empty( $instance['max_posts'] ) || !$instance['max_posts'] ) $instance['max_posts'] = 10; ?> - <?php /* Override some of the contextually set parameters for bp_has_activities() */ ?> + <?php // Override some of the contextually set parameters for bp_has_activities() ?> <?php if ( bp_has_activities( array( 'action' => 'new_blog_post', 'max' => $instance['max_posts'], 'per_page' => $instance['max_posts'], 'user_id' => 0, 'scope' => false, 'object' => false, 'primary_id' => false ) ) ) : ?> <ul id="blog-post-list" class="activity-list item-list"> @@ -88,4 +88,3 @@ class BP_Blogs_Recent_Posts_Widget extends WP_Widget { <?php } } -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-actions.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-actions.php new file mode 100644 index 0000000000000000000000000000000000000000..acbac049fa392e3fd4046f0798c01e14648a36bd --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-actions.php @@ -0,0 +1,171 @@ +<?php + +/** + * BuddyPress Admin Actions + * + * @package BuddyPress + * @subpackage Admin + * + * This file contains the actions that are used through-out BuddyPress Admin. They + * are consolidated here to make searching for them easier, and to help developers + * understand at a glance the order in which things occur. + * + * There are a few common places that additional actions can currently be found + * + * - BuddyPress: In {@link BuddyPress::setup_actions()} in BuddyPress.php + * - Admin: More in {@link bp_Admin::setup_actions()} in admin.php + * + * @see bp-core-actions.php + * @see bp-core-filters.php + */ + +// Exit if accessed directly +if ( !defined( 'ABSPATH' ) ) exit; + +/** + * Attach BuddyPress to WordPress + * + * BuddyPress uses its own internal actions to help aid in third-party plugin + * development, and to limit the amount of potential future code changes when + * updates to WordPress core occur. + * + * These actions exist to create the concept of 'plugin dependencies'. They + * provide a safe way for plugins to execute code *only* when BuddyPress is + * installed and activated, without needing to do complicated guesswork. + * + * For more information on how this works, see the 'Plugin Dependency' section + * near the bottom of this file. + * + * v--WordPress Actions v--BuddyPress Sub-actions + */ +add_action( 'admin_menu', 'bp_admin_menu' ); +add_action( 'admin_init', 'bp_admin_init' ); +add_action( 'admin_head', 'bp_admin_head' ); +add_action( 'admin_notices', 'bp_admin_notices' ); +add_action( 'admin_enqueue_scripts', 'bp_admin_enqueue_scripts' ); +add_action( 'network_admin_menu', 'bp_admin_menu' ); +add_action( 'custom_menu_order', 'bp_admin_custom_menu_order' ); +add_action( 'menu_order', 'bp_admin_menu_order' ); +add_action( 'wpmu_new_blog', 'bp_new_site', 10, 6 ); + +// Hook on to admin_init +add_action( 'bp_admin_init', 'bp_setup_updater', 1000 ); +add_action( 'bp_admin_init', 'bp_core_activation_notice', 1010 ); +add_action( 'bp_admin_init', 'bp_register_importers' ); +add_action( 'bp_admin_init', 'bp_register_admin_style' ); +add_action( 'bp_admin_init', 'bp_register_admin_settings' ); +add_action( 'bp_admin_init', 'bp_do_activation_redirect', 1 ); + +// Add a new separator +add_action( 'bp_admin_menu', 'bp_admin_separator' ); + +/** + * When a new site is created in a multisite installation, run the activation + * routine on that site + * + * @since BuddyPress (1.7) + * + * @param int $blog_id + * @param int $user_id + * @param string $domain + * @param string $path + * @param int $site_id + * @param array() $meta + */ +function bp_new_site( $blog_id, $user_id, $domain, $path, $site_id, $meta ) { + + // Bail if plugin is not network activated + if ( ! is_plugin_active_for_network( buddypress()->basename ) ) + return; + + // Switch to the new blog + switch_to_blog( $blog_id ); + + // Do the BuddyPress activation routine + do_action( 'bp_new_site', $blog_id, $user_id, $domain, $path, $site_id, $meta ); + + // restore original blog + restore_current_blog(); +} + +/** Sub-Actions ***************************************************************/ + +/** + * Piggy back admin_init action + * + * @since BuddyPress (1.7) + * @uses do_action() Calls 'bp_admin_init' + */ +function bp_admin_init() { + do_action( 'bp_admin_init' ); +} + +/** + * Piggy back admin_menu action + * + * @since BuddyPress (1.7) + * @uses do_action() Calls 'bp_admin_menu' + */ +function bp_admin_menu() { + do_action( 'bp_admin_menu' ); +} + +/** + * Piggy back admin_head action + * + * @since BuddyPress (1.7) + * @uses do_action() Calls 'bp_admin_head' + */ +function bp_admin_head() { + do_action( 'bp_admin_head' ); +} + +/** + * Piggy back admin_notices action + * + * @since BuddyPress (1.7) + * @uses do_action() Calls 'bp_admin_notices' + */ +function bp_admin_notices() { + do_action( 'bp_admin_notices' ); +} + +/** + * Piggy back admin_notices action + * + * @since BuddyPress (1.7) + * @uses do_action() Calls 'bp_admin_notices' + */ +function bp_admin_enqueue_scripts() { + do_action( 'bp_admin_enqueue_scripts' ); +} + +/** + * Dedicated action to register BuddyPress importers + * + * @since BuddyPress (1.7) + * @uses do_action() Calls 'bp_admin_notices' + */ +function bp_register_importers() { + do_action( 'bp_register_importers' ); +} + +/** + * Dedicated action to register admin styles + * + * @since BuddyPress (1.7) + * @uses do_action() Calls 'bp_admin_notices' + */ +function bp_register_admin_style() { + do_action( 'bp_register_admin_style' ); +} + +/** + * Dedicated action to register admin settings + * + * @since BuddyPress (1.7) + * @uses do_action() Calls 'bp_register_admin_settings' + */ +function bp_register_admin_settings() { + do_action( 'bp_register_admin_settings' ); +} diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-components.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-components.php index 0bdfa82459b6d73d98cc98eeb0bb85660bdbaba8..544c86bfb2cbeb6bf43c7c497ed6bb2eb44a7665 100644 --- a/wp-content/plugins/buddypress/bp-core/admin/bp-core-components.php +++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-components.php @@ -43,76 +43,32 @@ function bp_core_admin_components_settings() { /** * Creates reusable markup for component setup on the Components and Pages dashboard panel. * - * This markup has been abstracted so that it can be used both during the setup wizard as well as - * when BP has been fully installed. - * * @package BuddyPress * @since BuddyPress (1.6) * @todo Use settings API */ function bp_core_admin_components_options() { - // Load core functions, if needed - if ( !function_exists( 'bp_get_option' ) ) - require( BP_PLUGIN_DIR . '/bp-core/bp-core-functions.php' ); - // Declare local variables $deactivated_components = array(); - $required_components = array(); $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) ); - // Optional core components - $optional_components = array( + // The default components (if none are previously selected) + $default_components = array( 'xprofile' => array( 'title' => __( 'Extended Profiles', 'buddypress' ), 'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' ) - ), - 'settings' => array( - 'title' => __( 'Account Settings', 'buddypress' ), - 'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' ) - ), - 'friends' => array( - 'title' => __( 'Friend Connections', 'buddypress' ), - 'description' => __( 'Let your users make connections so they can track the activity of others and focus on the people they care about the most.', 'buddypress' ) - ), - 'messages' => array( - 'title' => __( 'Private Messaging', 'buddypress' ), - 'description' => __( 'Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.', 'buddypress' ) - ), - 'activity' => array( - 'title' => __( 'Activity Streams', 'buddypress' ), - 'description' => __( 'Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support.', 'buddypress' ) - ), - 'groups' => array( - 'title' => __( 'User Groups', 'buddypress' ), - 'description' => __( 'Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.', 'buddypress' ) - ), - 'forums' => array( - 'title' => __( 'Discussion Forums', 'buddypress' ), - 'description' => __( 'Site-wide and Group forums allow for focused, bulletin-board style conversations. Powered by bbPress.', 'buddypress' ) - ), - 'blogs' => array( - 'title' => __( 'Site Tracking', 'buddypress' ), - 'description' => __( 'Record activity for new posts and comments from your site.', 'buddypress' ) ) ); - // Add blogs tracking if multisite - if ( is_multisite() ) { - $optional_components['blogs']['description'] = __( 'Record activity for new sites, posts, and comments across your network.', 'buddypress' ); - } + $optional_components = bp_core_admin_get_components( 'optional' ); + $required_components = bp_core_admin_get_components( 'required' ); + $retired_components = bp_core_admin_get_components( 'retired' ); - // Required components - $required_components = array( - 'core' => array( - 'title' => __( 'BuddyPress Core', 'buddypress' ), - 'description' => __( 'It‘s what makes <del>time travel</del> BuddyPress possible!', 'buddypress' ) - ), - 'members' => array( - 'title' => __( 'Community Members', 'buddypress' ), - 'description' => __( 'Everything in a BuddyPress community revolves around its members.', 'buddypress' ) - ), - ); + // Don't show Forums component in optional components if it's disabled + if ( ! bp_is_active( 'forums' ) ) { + unset( $optional_components['forums'] ); + } // Merge optional and required together $all_components = $optional_components + $required_components; @@ -125,12 +81,12 @@ function bp_core_admin_components_options() { // Trim off namespace and filename $trimmed = array(); - foreach ( (array) $deactivated_components as $component => $value ) { + foreach ( array_keys( (array) $deactivated_components ) as $component ) { $trimmed[] = str_replace( '.php', '', str_replace( 'bp-', '', $component ) ); } // Loop through the optional components to create an active component array - foreach ( (array) $optional_components as $ocomponent => $ovalue ) { + foreach ( array_keys( (array) $optional_components ) as $ocomponent ) { if ( !in_array( $ocomponent, $trimmed ) ) { $active_components[$ocomponent] = 1; } @@ -138,9 +94,9 @@ function bp_core_admin_components_options() { } } - // On new install, set all components to be active by default - if ( empty( $active_components ) && ( bp_get_maintenance_mode() == 'install' ) ) { - $active_components = $optional_components; + // On new install, set active components to default + if ( empty( $active_components ) ) { + $active_components = $default_components; } // Core component is always active @@ -153,7 +109,7 @@ function bp_core_admin_components_options() { $all_count = count( $all_components ); $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; $action = !empty( $_GET['action'] ) ? $_GET['action'] : 'all'; - + switch( $action ) { case 'all' : $current_components = $all_components; @@ -171,94 +127,89 @@ function bp_core_admin_components_options() { case 'mustuse' : $current_components = $required_components; break; - } - - // The setup wizard uses different, more descriptive text - if ( bp_get_maintenance_mode() ) : ?> - - <h3><?php _e( 'Available Components', 'buddypress' ); ?></h3> - - <p><?php _e( 'Each component has a unique purpose, and your community may not need each one.', 'buddypress' ); ?></p> - - <?php endif ?> - - <ul class="subsubsub"> - <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'all' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'all' ) : ?>class="current"<?php endif; ?>><?php printf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $all_count, 'plugins', 'buddypress' ), number_format_i18n( $all_count ) ); ?></a> | </li> - <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'active' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'active' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', count( $active_components ), 'buddypress' ), number_format_i18n( count( $active_components ) ) ); ?></a> | </li> - <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'inactive' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'inactive' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', count( $inactive_components ), 'buddypress' ), number_format_i18n( count( $inactive_components ) ) ); ?></a> | </li> - <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'mustuse' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'mustuse' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', count( $required_components ), 'buddypress' ), number_format_i18n( count( $required_components ) ) ); ?></a></li> - </ul> - - <table class="widefat fixed plugins" cellspacing="0"> - <thead> - <tr> - <th scope="col" id="cb" class="manage-column column-cb check-column"> </th> - <th scope="col" id="name" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th> - <th scope="col" id="description" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th> - </tr> - </thead> + case 'retired' : + $current_components = $retired_components; + break; + } ?> + + <ul class="subsubsub"> + <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'all' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'all' ) : ?>class="current"<?php endif; ?>><?php printf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $all_count, 'plugins', 'buddypress' ), number_format_i18n( $all_count ) ); ?></a> | </li> + <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'active' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'active' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Active <span class="count">(%s)</span>', 'Active <span class="count">(%s)</span>', count( $active_components ), 'buddypress' ), number_format_i18n( count( $active_components ) ) ); ?></a> | </li> + <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'inactive' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'inactive' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Inactive <span class="count">(%s)</span>', 'Inactive <span class="count">(%s)</span>', count( $inactive_components ), 'buddypress' ), number_format_i18n( count( $inactive_components ) ) ); ?></a> | </li> + <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'mustuse' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'mustuse' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Must-Use <span class="count">(%s)</span>', 'Must-Use <span class="count">(%s)</span>', count( $required_components ), 'buddypress' ), number_format_i18n( count( $required_components ) ) ); ?></a> | </li> + <li><a href="<?php echo add_query_arg( array( 'page' => 'bp-components', 'action' => 'retired' ), bp_get_admin_url( $page ) ); ?>" <?php if ( $action === 'retired' ) : ?>class="current"<?php endif; ?>><?php printf( _n( 'Retired <span class="count">(%s)</span>', 'Retired <span class="count">(%s)</span>', count( $retired_components ), 'buddypress' ), number_format_i18n( count( $retired_components ) ) ); ?></a></li> + </ul> + + <table class="widefat fixed plugins" cellspacing="0"> + <thead> + <tr> + <th scope="col" id="cb" class="manage-column column-cb check-column"> </th> + <th scope="col" id="name" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th> + <th scope="col" id="description" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th> + </tr> + </thead> + + <tfoot> + <tr> + <th scope="col" class="manage-column column-cb check-column"> </th> + <th scope="col" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th> + <th scope="col" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th> + </tr> + </tfoot> + + <tbody id="the-list"> + + <?php if ( !empty( $current_components ) ) : ?> + + <?php foreach ( $current_components as $name => $labels ) : ?> + + <?php if ( !in_array( $name, array( 'core', 'members' ) ) ) : + $class = isset( $active_components[esc_attr( $name )] ) ? 'active' : 'inactive'; + else : + $class = 'active'; + endif; ?> + + <tr id="<?php echo esc_attr( $name ); ?>" class="<?php echo esc_attr( $name ) . ' ' . esc_attr( $class ); ?>"> + <th scope="row"> + + <?php if ( !in_array( $name, array( 'core', 'members' ) ) ) : ?> + + <input type="checkbox" id="bp_components[<?php echo esc_attr( $name ); ?>]" name="bp_components[<?php echo esc_attr( $name ); ?>]" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> /> + + <?php endif; ?> + + <label class="screen-reader-text" for="bp_components[<?php echo esc_attr( $name ); ?>]"><?php sprintf( __( 'Select %s', 'buddypress' ), esc_html( $labels['title'] ) ); ?></label> + </th> + <td class="plugin-title" style="width: 190px;"> + <span></span> + <strong><?php echo esc_html( $labels['title'] ); ?></strong> + <div class="row-actions-visible"> + + </div> + </td> + + <td class="column-description desc"> + <div class="plugin-description"> + <p><?php echo $labels['description']; ?></p> + </div> + <div class="active second plugin-version-author-uri"> + + </div> + </td> + </tr> + + <?php endforeach ?> + + <?php else : ?> - <tfoot> - <tr> - <th scope="col" class="manage-column column-cb check-column"> </th> - <th scope="col" class="manage-column column-name" style="width: 190px;"><?php _e( 'Component', 'buddypress' ); ?></th> - <th scope="col" class="manage-column column-description"><?php _e( 'Description', 'buddypress' ); ?></th> + <tr class="no-items"> + <td class="colspanchange" colspan="3"><?php _e( 'No components found.', 'buddypress' ); ?></td> </tr> - </tfoot> - - <tbody id="the-list"> - - <?php if ( !empty( $current_components ) ) : ?> - - <?php foreach ( $current_components as $name => $labels ) : ?> - - <?php if ( !in_array( $name, array( 'core', 'members' ) ) ) : - $class = isset( $active_components[esc_attr( $name )] ) ? 'active' : 'inactive'; - else : - $class = 'active'; - endif; ?> - - <tr id="<?php echo $name; ?>" class="<?php echo $name . ' ' . $class; ?>"> - <th scope="row"> - - <?php if ( !in_array( $name, array( 'core', 'members' ) ) ) : ?> - - <input type="checkbox" id="bp_components[<?php echo esc_attr( $name ); ?>]" name="bp_components[<?php echo esc_attr( $name ); ?>]" value="1"<?php checked( isset( $active_components[esc_attr( $name )] ) ); ?> /> - - <?php endif; ?> - - <label class="screen-reader-text" for="bp_components[<?php echo esc_attr( $name ); ?>]"><?php sprintf( __( 'Select %s', 'buddypress' ), esc_html( $labels['title'] ) ); ?></label> - </th> - <td class="plugin-title" style="width: 190px;"> - <span></span> - <strong><?php echo esc_html( $labels['title'] ); ?></strong> - <div class="row-actions-visible"> - - </div> - </td> - - <td class="column-description desc"> - <div class="plugin-description"> - <p><?php echo $labels['description']; ?></p> - </div> - <div class="active second plugin-version-author-uri"> - - </div> - </td> - </tr> - - <?php endforeach ?> - - <?php else : ?> - - <tr class="no-items"> - <td class="colspanchange" colspan="3"><?php _e( 'No components found.', 'buddypress' ); ?></td> - </tr> - <?php endif; ?> + <?php endif; ?> - </tbody> - </table> + </tbody> + </table> <input type="hidden" name="bp_components[members]" value="1" /> @@ -269,32 +220,194 @@ function bp_core_admin_components_options() { * Handle saving the Component settings * * @since BuddyPress (1.6) - * @todo Use settings API - * @global BuddyPress $bp - * @return false On failure + * @todo Use settings API when it supports saving network settings + * @return If not time to save settings */ function bp_core_admin_components_settings_handler() { - global $bp; - if ( isset( $_POST['bp-admin-component-submit'] ) ) { - if ( !check_admin_referer('bp-admin-component-setup') ) - return false; + // Bail if not saving settings + if ( ! isset( $_POST['bp-admin-component-submit'] ) ) + return; - // Settings form submitted, now save the settings. First, set active components - if ( isset( $_POST['bp_components'] ) ) { - // Save settings and upgrade schema - require_once( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-schema.php' ); - $bp->active_components = stripslashes_deep( $_POST['bp_components'] ); - bp_core_install( $bp->active_components ); + // Bail if nonce fails + if ( ! check_admin_referer( 'bp-admin-component-setup' ) ) + return; - bp_update_option( 'bp-active-components', $bp->active_components ); - } + // Settings form submitted, now save the settings. First, set active components + if ( isset( $_POST['bp_components'] ) ) { + + // Load up BuddyPress + $bp = buddypress(); - $base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components', 'updated' => 'true' ), 'admin.php' ) ); + // Save settings and upgrade schema + require_once( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-schema.php' ); - wp_redirect( $base_url ); + $submitted = stripslashes_deep( $_POST['bp_components'] ); + $bp->active_components = bp_core_admin_get_active_components_from_submitted_settings( $submitted ); + + bp_core_install( $bp->active_components ); + bp_core_add_page_mappings( $bp->active_components ); + bp_update_option( 'bp-active-components', $bp->active_components ); } + + // Where are we redirecting to? + $base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components', 'updated' => 'true' ), 'admin.php' ) ); + + // Redirect + wp_redirect( $base_url ); } -add_action( 'admin_init', 'bp_core_admin_components_settings_handler' ); +add_action( 'bp_admin_init', 'bp_core_admin_components_settings_handler' ); -?> +/** + * Calculates the components that should be active after save, based on submitted settings + * + * The way that active components must be set after saving your settings must + * be calculated differently depending on which of the Components subtabs you + * are coming from: + * - When coming from All or Active, the submitted checkboxes accurately + * reflect the desired active components, so we simply pass them through + * - When coming from Inactive, components can only be activated - already + * active components will not be passed in the $_POST global. Thus, we must + * parse the newly activated components with the already active components + * saved in the $bp global + * - When activating a Retired component, the situation is similar to Inactive. + * - When deactivating a Retired component, no value is passed in the $_POST + * global (because the component settings are checkboxes). So, in order to + * determine whether a retired component is being deactivated, we retrieve a + * list of retired components, and check each one to ensure that its checkbox + * is not present, before merging the submitted components with the active + * ones. + * + * @since (BuddyPress) 1.7 + * + * @param array This is the array of component settings coming from the POST + * global. You should stripslashes_deep() before passing to this function + * @return array The calculated list of component settings + */ +function bp_core_admin_get_active_components_from_submitted_settings( $submitted ) { + $current_action = 'all'; + + if ( isset( $_GET['action'] ) && in_array( $_GET['action'], array( 'active', 'inactive', 'retired' ) ) ) { + $current_action = $_GET['action']; + } + + $current_components = buddypress()->active_components; + + switch ( $current_action ) { + case 'retired' : + $retired_components = bp_core_admin_get_components( 'retired' ); + foreach ( array_keys( $retired_components ) as $retired_component ) { + if ( ! isset( $submitted[ $retired_component ] ) ) { + unset( $current_components[ $retired_component ] ); + } + } + // fall through + + case 'inactive' : + $components = array_merge( $submitted, $current_components ); + break; + + case 'all' : + case 'active' : + default : + $components = $submitted; + break; + } + + return $components; +} + +/** + * Return a list of component information, optionally filtered by type + * + * We use this information both to build the markup for the admin screens, as + * well as to do some processing on settings data submitted from those screens. + * + * @since (BuddyPress) 1.7 + * + * @param string $type 'all', 'optional', 'retired', 'required' + * @return array An array of requested component data + */ +function bp_core_admin_get_components( $type = 'all' ) { + + // Required components + $required_components = array( + 'core' => array( + 'title' => __( 'BuddyPress Core', 'buddypress' ), + 'description' => __( 'It‘s what makes <del>time travel</del> BuddyPress possible!', 'buddypress' ) + ), + 'members' => array( + 'title' => __( 'Community Members', 'buddypress' ), + 'description' => __( 'Everything in a BuddyPress community revolves around its members.', 'buddypress' ) + ), + ); + + // Retired components + $retired_components = array( + 'forums' => array( + 'title' => __( 'Group Forums', 'buddypress' ), + 'description' => sprintf( __( 'BuddyPress Forums are retired. Use %s.', 'buddypress' ), '<a href="http://bbpress.org">bbPress</a>' ) + ), + ); + + // Optional core components + $optional_components = array( + 'xprofile' => array( + 'title' => __( 'Extended Profiles', 'buddypress' ), + 'description' => __( 'Customize your community with fully editable profile fields that allow your users to describe themselves.', 'buddypress' ) + ), + 'settings' => array( + 'title' => __( 'Account Settings', 'buddypress' ), + 'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' ) + ), + 'friends' => array( + 'title' => __( 'Friend Connections', 'buddypress' ), + 'description' => __( 'Let your users make connections so they can track the activity of others and focus on the people they care about the most.', 'buddypress' ) + ), + 'messages' => array( + 'title' => __( 'Private Messaging', 'buddypress' ), + 'description' => __( 'Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members.', 'buddypress' ) + ), + 'activity' => array( + 'title' => __( 'Activity Streams', 'buddypress' ), + 'description' => __( 'Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support.', 'buddypress' ) + ), + 'groups' => array( + 'title' => __( 'User Groups', 'buddypress' ), + 'description' => __( 'Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.', 'buddypress' ) + ), + 'forums' => array( + 'title' => __( 'Group Forums (Legacy)', 'buddypress' ), + 'description' => __( 'Group forums allow for focused, bulletin-board style conversations.', 'buddypress' ) + ), + 'blogs' => array( + 'title' => __( 'Site Tracking', 'buddypress' ), + 'description' => __( 'Record activity for new posts and comments from your site.', 'buddypress' ) + ) + ); + + + // Add blogs tracking if multisite + if ( is_multisite() ) { + $optional_components['blogs']['description'] = __( 'Record activity for new sites, posts, and comments across your network.', 'buddypress' ); + } + + switch ( $type ) { + case 'required' : + $components = $required_components; + break; + case 'optional' : + $components = $optional_components; + break; + case 'retired' : + $components = $retired_components; + break; + case 'all' : + default : + $components = array_merge( $required_components, $optional_components, $retired_components ); + break; + + } + + return $components; +} diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-functions.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-functions.php index d910050d9c0d8af263c3177c26cb64fdc59c281b..a727417649e36b473af920b3e1dbb4dec5031c95 100644 --- a/wp-content/plugins/buddypress/bp-core/admin/bp-core-functions.php +++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-functions.php @@ -32,49 +32,35 @@ function bp_core_admin_menu_init() { * @global array $_parent_pages * @global array $_registered_pages * @global array $submenu - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_core_admin_backpat_menu() { global $_parent_pages, $_registered_pages, $submenu; - if ( ! is_super_admin() ) - return; - - // Don't do anything if a BP upgrade is in progress, or if the bp-wizard is in progress. - if ( defined( 'BP_IS_UPGRADE' ) && BP_IS_UPGRADE || empty( $submenu['bp-general-settings'] ) ) + // If there's no bp-general-settings menu (perhaps because the current + // user is not an Administrator), there's nothing to do here + if ( ! isset( $submenu['bp-general-settings'] ) ) { return; + } /** * By default, only the core "Help" submenu is added under the top-level BuddyPress menu. * This means that if no third-party plugins have registered their admin pages into the * 'bp-general-settings' menu, it will only contain one item. Kill it. */ - if ( 1 == count( $submenu['bp-general-settings'] ) ) { - - // This removes the top-level menu - remove_submenu_page( 'bp-general-settings', 'bp-general-settings' ); - remove_menu_page( 'bp-general-settings' ); - - // These stop people accessing the URL directly - unset( $_parent_pages['bp-general-settings'] ); - unset( $_registered_pages['toplevel_page_bp-general-settings'] ); + if ( 1 != count( $submenu['bp-general-settings'] ) ) { + return; } -} -add_action( bp_core_admin_hook(), 'bp_core_admin_backpat_menu', 999 ); -/** - * Tweak the Settings subnav menu to show only one BuddyPress menu item (Settings > BuddyPress). - * - * @since 1.6 - */ -function bp_core_modify_admin_menu() { - $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; + // This removes the top-level menu + remove_submenu_page( 'bp-general-settings', 'bp-general-settings' ); + remove_menu_page( 'bp-general-settings' ); - remove_submenu_page( $page, 'bb-forums-setup' ); - remove_submenu_page( $page, 'bp-page-settings' ); - remove_submenu_page( $page, 'bp-settings' ); + // These stop people accessing the URL directly + unset( $_parent_pages['bp-general-settings'] ); + unset( $_registered_pages['toplevel_page_bp-general-settings'] ); } -add_action( 'admin_head', 'bp_core_modify_admin_menu', 999 ); +add_action( bp_core_admin_hook(), 'bp_core_admin_backpat_menu', 999 ); /** * This tells WP to highlight the Settings > BuddyPress menu item, @@ -85,7 +71,7 @@ add_action( 'admin_head', 'bp_core_modify_admin_menu', 999 ); * * @global string $plugin_page * @global array $submenu - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_core_modify_admin_menu_highlight() { global $plugin_page, $submenu_file; @@ -101,7 +87,7 @@ function bp_core_modify_admin_menu_highlight() { * will never appear. * * @see bp_core_admin_backpat_menu() - * @since 1.6 + * @since BuddyPress (1.6) * @todo Add convenience links into the markup once new positions are finalised. */ function bp_core_admin_backpat_page() { @@ -109,14 +95,14 @@ function bp_core_admin_backpat_page() { $settings_url = add_query_arg( 'page', 'bp-components', $url ); ?> <div class="wrap"> - <?php screen_icon( 'buddypress'); ?> + <?php screen_icon( 'buddypress' ); ?> <h2><?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h2> <p><?php _e( "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated.", 'buddypress' ); ?></p> - <p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%s">Settings > BuddyPress</a>. Profile Fields has been moved into the <a href="%s">Users</a> menu.', 'buddypress' ), $settings_url, network_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p> + <p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%s">Settings > BuddyPress</a>. Profile Fields has been moved into the <a href="%s">Users</a> menu.', 'buddypress' ), esc_url( $settings_url ), bp_get_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p> </div> -<?php + <?php } /** Notices *******************************************************************/ @@ -130,12 +116,11 @@ function bp_core_admin_backpat_page() { * @package BuddyPress Core * @since BuddyPress (1.5) * - * @global BuddyPress $bp The one true BuddyPress instance * @uses bp_current_user_can() to check current user permissions before showing the notices * @uses bp_is_root_blog() */ function bp_core_print_admin_notices() { - global $bp; + $bp = buddypress(); // Only the super admin should see messages if ( !bp_current_user_can( 'bp_moderate' ) ) @@ -148,13 +133,13 @@ function bp_core_print_admin_notices() { // Show the messages if ( !empty( $bp->admin->notices ) ) { - ?> + ?> <div id="message" class="updated fade"> - <?php foreach( $bp->admin->notices as $notice ) : ?> + <?php foreach ( $bp->admin->notices as $notice ) : ?> <p><?php echo $notice ?></p> - <?php endforeach ?> + <?php endforeach ?> </div> - <?php + <?php } } add_action( 'admin_notices', 'bp_core_print_admin_notices' ); @@ -170,11 +155,10 @@ add_action( 'network_admin_notices', 'bp_core_print_admin_notices' ); * @package BuddyPress Core * @since BuddyPress (1.5) * - * @global BuddyPress $bp The one true BuddyPress instance * @param string $notice The notice you are adding to the queue */ function bp_core_add_admin_notice( $notice ) { - global $bp; + $bp = buddypress(); if ( empty( $bp->admin->notices ) ) { $bp->admin->notices = array(); @@ -188,29 +172,27 @@ function bp_core_add_admin_notice( $notice ) { * * On every Dashboard page, this function checks the following: * - that pretty permalinks are enabled - * - that a BP-compatible theme is activated * - that every BP component that needs a WP page for a directory has one * - that no WP page has multiple BP components associated with it * The administrator will be shown a notice for each check that fails. * - * @package BuddyPress Core + * @global WPDB $wpdb WordPress DB object + * @global WP_Rewrite $wp_rewrite + * @since BuddyPress (1.2) */ function bp_core_activation_notice() { - global $wp_rewrite, $wpdb, $bp; + global $wpdb, $wp_rewrite; + + $bp = buddypress(); // Only the super admin gets warnings if ( !bp_current_user_can( 'bp_moderate' ) ) return; - // On multisite installs, don't load on a non-root blog, unless do_network_admin is - // overridden + // On multisite installs, don't load on a non-root blog, unless do_network_admin is overridden if ( is_multisite() && bp_core_do_network_admin() && !bp_is_root_blog() ) return; - // Don't show these messages during setup or upgrade - if ( !empty( $bp->maintenance_mode ) ) - return; - /** * Check to make sure that the blog setup routine has run. This can't happen during the * wizard because of the order which the components are loaded. We check for multisite here @@ -228,40 +210,20 @@ function bp_core_activation_notice() { * Are pretty permalinks enabled? */ if ( isset( $_POST['permalink_structure'] ) ) - return false; + return; if ( empty( $wp_rewrite->permalink_structure ) ) { bp_core_add_admin_notice( sprintf( __( '<strong>BuddyPress is almost ready</strong>. You must <a href="%s">update your permalink structure</a> to something other than the default for it to work.', 'buddypress' ), admin_url( 'options-permalink.php' ) ) ); } - /** - * Are you using a BP-compatible theme? - */ - - // Get current theme info - $ct = wp_get_theme(); - - // Make sure tags is an array to suppress notices - if ( ! isset( $ct->tags ) ) - $ct->tags = array(); - else - $ct->tags = (array) $ct->tags; - - // The best way to remove this notice is to add a "buddypress" tag to - // your active theme's CSS header. - if ( !defined( 'BP_SILENCE_THEME_NOTICE' ) && !in_array( 'buddypress', $ct->tags ) ) { - bp_core_add_admin_notice( sprintf( __( "You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>.", 'buddypress' ), admin_url( 'themes.php' ), network_admin_url( 'theme-install.php?type=tag&s=buddypress&tab=search' ), network_admin_url( 'plugin-install.php?type=term&tab=search&s=%22bp-template-pack%22' ) ) ); - } - /** * Check for orphaned BP components (BP component is enabled, no WP page exists) */ - $orphaned_components = array(); $wp_page_components = array(); // Only components with 'has_directory' require a WP page to function - foreach( $bp->loaded_components as $component_id => $is_active ) { + foreach( array_keys( $bp->loaded_components ) as $component_id ) { if ( !empty( $bp->{$component_id}->has_directory ) ) { $wp_page_components[] = array( 'id' => $component_id, @@ -284,6 +246,10 @@ function bp_core_activation_notice() { ); } + // On the first admin screen after a new installation, this isn't set, so grab it to supress a misleading error message. + if ( empty( $bp->pages->members ) ) + $bp->pages = bp_core_get_directory_pages(); + foreach( $wp_page_components as $component ) { if ( !isset( $bp->pages->{$component['id']} ) ) { $orphaned_components[] = $component['name']; @@ -306,16 +272,13 @@ function bp_core_activation_notice() { bp_core_add_admin_notice( $notice ); } - /** - * BP components cannot share a single WP page. Check for duplicate assignments, and post - * a message if found. - */ + // BP components cannot share a single WP page. Check for duplicate assignments, and post a message if found. $dupe_names = array(); $page_ids = (array)bp_core_get_directory_page_ids(); $dupes = array_diff_assoc( $page_ids, array_unique( $page_ids ) ); if ( !empty( $dupes ) ) { - foreach( $dupes as $dupe_component => $dupe_id ) { + foreach( array_keys( $dupes ) as $dupe_component ) { $dupe_names[] = $bp->pages->{$dupe_component}->title; } @@ -331,17 +294,45 @@ function bp_core_activation_notice() { bp_core_add_admin_notice( $notice ); } } -add_action( 'admin_init', 'bp_core_activation_notice' ); /** - * Add an extra update message to the update plugin notification. + * Redirect user to BuddyPress's What's New page on activation * - * @package BuddyPress Core + * @since BuddyPress (1.7) + * + * @internal Used internally to redirect BuddyPress to the about page on activation + * + * @uses get_transient() To see if transient to redirect exists + * @uses delete_transient() To delete the transient if it exists + * @uses is_network_admin() To bail if being network activated + * @uses wp_safe_redirect() To redirect + * @uses add_query_arg() To help build the URL to redirect to + * @uses admin_url() To get the admin URL to index.php + * + * @return If no transient, or is bulk activation */ -function bp_core_update_message() { - echo '<p style="color: red; margin: 3px 0 0 0; border-top: 1px solid #ddd; padding-top: 3px">' . __( 'IMPORTANT: <a href="http://codex.buddypress.org/buddypress-site-administration/upgrading-buddypress/">Read this before attempting to update BuddyPress</a>', 'buddypress' ) . '</p>'; +function bp_do_activation_redirect() { + + // Bail if no activation redirect + if ( ! get_transient( '_bp_activation_redirect' ) ) + return; + + // Delete the redirect transient + delete_transient( '_bp_activation_redirect' ); + + // Bail if activating from network, or bulk + if ( isset( $_GET['activate-multi'] ) ) + return; + + $query_args = array( 'page' => 'bp-about' ); + if ( get_transient( '_bp_is_new_install' ) ) { + $query_args['is_new_install'] = '1'; + delete_transient( '_bp_is_new_install' ); + } + + // Redirect to BuddyPress about page + wp_safe_redirect( add_query_arg( $query_args, bp_get_admin_url( 'index.php' ) ) ); } -add_action( 'in_plugin_update_message-buddypress/bp-loader.php', 'bp_core_update_message' ); /** UI/Styling ****************************************************************/ @@ -361,7 +352,7 @@ function bp_core_admin_tabs( $active_tab = '' ) { // Setup core admin tabs $tabs = array( '0' => array( - 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ), + 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ), 'name' => __( 'Components', 'buddypress' ) ), '1' => array( @@ -369,21 +360,13 @@ function bp_core_admin_tabs( $active_tab = '' ) { 'name' => __( 'Pages', 'buddypress' ) ), '2' => array( - 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ), - 'name' => __( 'Settings', 'buddypress' ) + 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ), + 'name' => __( 'Settings', 'buddypress' ) ) ); - // If forums component is active, add additional tab - if ( bp_is_active( 'forums' ) ) { - $tabs['3'] = array( - 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bb-forums-setup' ), 'admin.php' ) ), - 'name' => __( 'Forums', 'buddypress' ) - ); - } - // Loop through tabs and build navigation - foreach( $tabs as $tab_id => $tab_data ) { + foreach ( array_values( $tabs ) as $tab_data ) { $is_current = (bool) ( $tab_data['name'] == $active_tab ); $tab_class = $is_current ? $active_class : $idle_class; $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>'; @@ -396,4 +379,256 @@ function bp_core_admin_tabs( $active_tab = '' ) { do_action( 'bp_admin_tabs' ); } -?> +/** Help **********************************************************************/ + +/** + * adds contextual help to BuddyPress admin pages + * + * @since BuddyPress (1.7) + * @todo Make this part of the BP_Component class and split into each component + */ +function bp_core_add_contextual_help( $screen = '' ) { + + $screen = get_current_screen(); + + switch ( $screen->id ) { + + // Compontent page + case 'settings_page_bp-components' : + + // help tabs + $screen->add_help_tab( array( + 'id' => 'bp-comp-overview', + 'title' => __( 'Overview' ), + 'content' => bp_core_add_contextual_help_content( 'bp-comp-overview' ), + ) ); + + // help panel - sidebar links + $screen->set_help_sidebar( + '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . + '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-components">Managing Components</a>', 'buddypress' ) . '</p>' . + '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' + ); + break; + + // Pages page + case 'settings_page_bp-page-settings' : + + // Help tabs + $screen->add_help_tab( array( + 'id' => 'bp-page-overview', + 'title' => __( 'Overview' ), + 'content' => bp_core_add_contextual_help_content( 'bp-page-overview' ), + ) ); + + // Help panel - sidebar links + $screen->set_help_sidebar( + '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . + '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-pages">Managing Pages</a>', 'buddypress' ) . '</p>' . + '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' + ); + + break; + + // Settings page + case 'settings_page_bp-settings' : + + // Help tabs + $screen->add_help_tab( array( + 'id' => 'bp-settings-overview', + 'title' => __( 'Overview' ), + 'content' => bp_core_add_contextual_help_content( 'bp-settings-overview' ), + ) ); + + // Help panel - sidebar links + $screen->set_help_sidebar( + '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . + '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-settings">Managing Settings</a>', 'buddypress' ) . '</p>' . + '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' + ); + + break; + + // Profile fields page + case 'users_page_bp-profile-overview' : + + // Help tabs + $screen->add_help_tab( array( + 'id' => 'bp-profile-overview', + 'title' => __( 'Overview' ), + 'content' => bp_core_add_contextual_help_content( 'bp-profile-overview' ), + ) ); + + // Help panel - sidebar links + $screen->set_help_sidebar( + '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . + '<p>' . __( '<a href="http://codex.buddypress.org/getting-started/configure-buddypress-components/#users-profile-fields">Managing Profile Fields</a>', 'buddypress' ) . '</p>' . + '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' + ); + + break; + } +} +add_action( 'contextual_help', 'bp_core_add_contextual_help' ); + +/** + * renders contextual help content to contextual help tabs + * + * @since BuddyPress (1.7) + */ +function bp_core_add_contextual_help_content( $tab = '' ) { + + switch ( $tab ) { + case 'bp-comp-overview' : + return '<p>' . __( 'By default, all BuddyPress components are enabled. You can selectively disable any of the components by using the form. Your BuddyPress installation will continue to function. However, the features of the disabled components will no longer be accessible to anyone using the site.', 'buddypress' ) . '</p>'; + break; + + case'bp-page-overview' : + return '<p>' . __( 'BuddyPress Components use WordPress Pages for their root directory/archive pages. Here you can change the page associations for each active component.', 'buddypress' ) . '</p>'; + break; + + case 'bp-settings-overview' : + return '<p>' . __( 'Extra configuration settings.', 'buddypress' ) . '</p>'; + break; + + case 'bp-profile-overview' : + return '<p>' . __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.</br></br>Note: Any fields in the first group will appear on the signup page.', 'buddypress' ) . '</p>'; + break; + + default: + return false; + break; + } +} + +/** Separator *****************************************************************/ + +/** + * Add a separator to the WordPress admin menus + * + * @since BuddyPress (1.7) + * + * @uses bp_current_user_can() To check users capability on root blog + */ +function bp_admin_separator() { + + // Bail if BuddyPress is not network activated and viewing network admin + if ( is_network_admin() && ! bp_is_network_activated() ) + return; + + // Bail if BuddyPress is network activated and viewing site admin + if ( ! is_network_admin() && bp_is_network_activated() ) + return; + + // Prevent duplicate separators when no core menu items exist + if ( ! bp_current_user_can( 'bp_moderate' ) ) + return; + + // Bail if there are no components with admin UI's. Hardcoded for now, until + // there's a real API for determining this later. + if ( ! bp_is_active( 'activity' ) && ! bp_is_active( 'groups' ) ) + return; + + global $menu; + + $menu[] = array( '', 'read', 'separator-buddypress', '', 'wp-menu-separator buddypress' ); +} + +/** + * Tell WordPress we have a custom menu order + * + * @since BuddyPress (1.7) + * + * @param bool $menu_order Menu order + * @uses bp_current_user_can() To check users capability on root blog + * @return bool Always true + */ +function bp_admin_custom_menu_order( $menu_order = false ) { + + // Bail if user cannot see admin pages + if ( ! bp_current_user_can( 'bp_moderate' ) ) + return $menu_order; + + return true; +} + +/** + * Move our custom separator above our custom post types + * + * @since BuddyPress (1.7) + * + * @param array $menu_order Menu Order + * @uses bp_current_user_can() To check users capability on root blog + * @return array Modified menu order + */ +function bp_admin_menu_order( $menu_order = array() ) { + + // Bail if user cannot see admin pages + if ( empty( $menu_order ) || ! bp_current_user_can( 'bp_moderate' ) ) + return $menu_order; + + // Initialize our custom order array + $bp_menu_order = array(); + + // Menu values + $last_sep = is_network_admin() ? 'separator1' : 'separator2'; + + // Filter the custom admin menus + $custom_menus = (array) apply_filters( 'bp_admin_menu_order', array() ); + + // Bail if no components have top level admin pages + if ( empty( $custom_menus ) ) + return $menu_order; + + // Add our separator to beginning of array + array_unshift( $custom_menus, 'separator-buddypress' ); + + // Loop through menu order and do some rearranging + foreach ( (array) $menu_order as $item ) { + + // Position BuddyPress menus above appearance + if ( $last_sep == $item ) { + + // Add our custom menus + foreach( (array) $custom_menus as $custom_menu ) { + if ( array_search( $custom_menu, $menu_order ) ) { + $bp_menu_order[] = $custom_menu; + } + } + + // Add the appearance separator + $bp_menu_order[] = $last_sep; + + // Skip our menu items + } elseif ( ! in_array( $item, $custom_menus ) ) { + $bp_menu_order[] = $item; + } + } + + // Return our custom order + return $bp_menu_order; +} + +/** Utility *****************************************************************/ + +/** + * When using a WP_List_Table, get the currently selected bulk action + * + * WP_List_Tables have bulk actions at the top and at the bottom of the tables, + * and the inputs have different keys in the $_REQUEST array. This function + * reconciles the two values and returns a single action being performed. + * + * @since BuddyPress (1.7) + * @return string + */ +function bp_admin_list_table_current_bulk_action() { + + $action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : ''; + + // If the bottom is set, let it override the action + if ( ! empty( $_REQUEST['action2'] ) && $_REQUEST['action2'] != "-1" ) { + $action = $_REQUEST['action2']; + } + + return $action; +} diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-schema.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-schema.php index 341c1a7fb300713b373b7db74276a83a1ec921c7..64fd1f68e00c2c07dead517a7e6a6d07f8235333 100644 --- a/wp-content/plugins/buddypress/bp-core/admin/bp-core-schema.php +++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-schema.php @@ -8,11 +8,8 @@ function bp_core_set_charset() { require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); - /* BuddyPress component DB schema */ - if ( !empty($wpdb->charset) ) - return "DEFAULT CHARACTER SET $wpdb->charset"; - - return ''; + // BuddyPress component DB schema + return !empty( $wpdb->charset ) ? "DEFAULT CHARACTER SET {$wpdb->charset}" : ''; } function bp_core_install( $active_components = false ) { @@ -242,14 +239,14 @@ function bp_core_install_extended_profiles() { $charset_collate = bp_core_set_charset(); $bp_prefix = bp_core_get_table_prefix(); - // These values should only be updated if they are not already present - if ( !$base_group_name = bp_get_option( 'bp-xprofile-base-group-name' ) ) { - bp_update_option( 'bp-xprofile-base-group-name', _x( 'Base', 'First XProfile group name', 'buddypress' ) ); - } + // These values should only be updated if they are not already present + if ( ! bp_get_option( 'bp-xprofile-base-group-name' ) ) { + bp_update_option( 'bp-xprofile-base-group-name', _x( 'General', 'First field-group name', 'buddypress' ) ); + } - if ( !$fullname_field_name = bp_get_option( 'bp-xprofile-fullname-field-name' ) ) { - bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Name', 'XProfile fullname field name', 'buddypress' ) ); - } + if ( ! bp_get_option( 'bp-xprofile-fullname-field-name' ) ) { + bp_update_option( 'bp-xprofile-fullname-field-name', _x( 'Display Name', 'Display name field', 'buddypress' ) ); + } $sql[] = "CREATE TABLE {$bp_prefix}bp_xprofile_groups ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -339,52 +336,3 @@ function bp_core_install_blog_tracking() { dbDelta( $sql ); } - -/** - * I don't appear to be used anymore, but I'm here anyways. I was originally - * used in olden days to update pre-1.1 schemas, but that was before we had - * a legitimate update process. Keep me around just incase. - * - * @global WPDB $wpdb - * @global BuddyPress $bp - */ -function bp_update_db_stuff() { - global $wpdb, $bp; - - $bp_prefix = bp_core_get_table_prefix(); - - // Rename the old user activity cached table if needed. - if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) ) - $wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" ); - - // Rename fields from pre BP 1.2 - if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) { - if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) { - $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" ); - } - - if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) { - $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" ); - } - } - - // On first installation - record all existing blogs in the system. - if ( !(int) $bp->site_options['bp-blogs-first-install'] ) { - bp_blogs_record_existing_blogs(); - bp_update_option( 'bp-blogs-first-install', 1 ); - } - - if ( is_multisite() ) { - bp_core_add_illegal_names(); - } - - // Update and remove the message threads table if it exists - if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) { - if ( BP_Messages_Thread::update_tables() ) { - $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" ); - } - } - -} - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-settings.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-settings.php index c1c81ad80af8cfdeef28448c9db40962cc11b3f9..01ed8c5d2498f2511cc9d5a831b71c90f7bd230c 100644 --- a/wp-content/plugins/buddypress/bp-core/admin/bp-core-settings.php +++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-settings.php @@ -247,7 +247,7 @@ function bp_admin_setting_callback_bbpress_configuration() { function bp_core_admin_settings() { // We're saving our own options, until the WP Settings API is updated to work with Multisite - $form_action = add_query_arg( 'page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ); + $form_action = add_query_arg( 'page', 'bp-settings', bp_get_admin_url( 'admin.php' ) ); ?> @@ -264,7 +264,7 @@ function bp_core_admin_settings() { <?php do_settings_sections( 'buddypress' ); ?> <p class="submit"> - <input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /> + <input type="submit" name="submit" class="button-primary" value="<?php _e( 'Save Settings', 'buddypress' ); ?>" /> </p> </form> </div> @@ -313,7 +313,7 @@ function bp_core_admin_settings_save() { bp_update_option( $legacy_option, $value ); } - bp_core_redirect( add_query_arg( 'page', 'bp-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) ) ); + bp_core_redirect( add_query_arg( array( 'page' => 'bp-settings', 'updated' => 'true' ), bp_get_admin_url( 'admin.php' ) ) ); } } add_action( 'bp_admin_init', 'bp_core_admin_settings_save', 100 ); @@ -365,4 +365,3 @@ function bp_form_option( $option, $default = '' , $slug = false ) { // Allow plugins to further filter the output return apply_filters( 'bp_get_form_option', $value, $option ); } -?> diff --git a/wp-content/plugins/buddypress/bp-core/admin/bp-core-slugs.php b/wp-content/plugins/buddypress/bp-core/admin/bp-core-slugs.php index 27e9b42c7d3bdecc07bbb7d1d76e2cbf6927c929..3f3d10ee4f9a9ce0caa27f5da47d85351637041c 100644 --- a/wp-content/plugins/buddypress/bp-core/admin/bp-core-slugs.php +++ b/wp-content/plugins/buddypress/bp-core/admin/bp-core-slugs.php @@ -29,7 +29,7 @@ function bp_core_admin_slugs_settings() { <?php bp_core_admin_slugs_options(); ?> <p class="submit clear"> - <input class="button-primary" type="submit" name="bp-admin-pages-submit" id="bp-admin-pages-submit" value="<?php _e( 'Save All', 'buddypress' ) ?>"/> + <input class="button-primary" type="submit" name="bp-admin-pages-submit" id="bp-admin-pages-submit" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/> </p> <?php wp_nonce_field( 'bp-admin-pages-setup' ); ?> @@ -43,9 +43,6 @@ function bp_core_admin_slugs_settings() { /** * Creates reusable markup for page setup on the Components and Pages dashboard panel. * - * This markup has been abstracted so that it can be used both during the setup wizard as well as - * when BP has been fully installed. - * * @package BuddyPress * @since BuddyPress (1.6) * @todo Use settings API @@ -94,8 +91,8 @@ function bp_core_admin_slugs_options() { </th> <td> - <?php if ( !bp_is_root_blog() ) - switch_to_blog( bp_get_root_blog_id() ) ?> + + <?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?> <?php echo wp_dropdown_pages( array( 'name' => 'bp_pages[' . esc_attr( $name ) . ']', @@ -113,8 +110,7 @@ function bp_core_admin_slugs_options() { <?php endif; ?> - <?php if ( !bp_is_root_blog() ) - restore_current_blog() ?> + <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?> </td> </tr> @@ -138,9 +134,9 @@ function bp_core_admin_slugs_options() { 'register' => __( 'Register', 'buddypress' ), 'activate' => __( 'Activate', 'buddypress' ), ); - + $static_pages = apply_filters( 'bp_static_pages', $static_pages ); - + if ( !empty( $static_pages ) ) : ?> <h3><?php _e( 'Registration', 'buddypress' ); ?></h3> @@ -158,6 +154,9 @@ function bp_core_admin_slugs_options() { </th> <td> + + <?php if ( ! bp_is_root_blog() ) switch_to_blog( bp_get_root_blog_id() ); ?> + <?php echo wp_dropdown_pages( array( 'name' => 'bp_pages[' . esc_attr( $name ) . ']', 'echo' => false, @@ -174,6 +173,8 @@ function bp_core_admin_slugs_options() { <?php endif; ?> + <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?> + </td> </tr> @@ -219,6 +220,4 @@ function bp_core_admin_slugs_setup_handler() { wp_redirect( $base_url ); } } -add_action( 'admin_init', 'bp_core_admin_slugs_setup_handler' ); - -?> +add_action( 'bp_admin_init', 'bp_core_admin_slugs_setup_handler' ); diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/common.css b/wp-content/plugins/buddypress/bp-core/admin/css/common.css index 523df84eeca12395c0e65e5e79fb32b90ca731e1..dbf312f7ed933bfcb36132be4f732bf6fac973bf 100644 --- a/wp-content/plugins/buddypress/bp-core/admin/css/common.css +++ b/wp-content/plugins/buddypress/bp-core/admin/css/common.css @@ -1 +1,220 @@ -div#icon-buddypress{background:url(../images/icons32.png) no-repeat -370px -6px}div#icon-buddypress-activity{background:url(../images/icons32.png) no-repeat -10px -6px}ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a img{display:none}ul#adminmenu li.toplevel_page_bp-wizard .wp-menu-image a{background-image:url(../images/menu.png)!important;background-position:-178pxpx -34px}ul#adminmenu li.toplevel_page_bp-wizard:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-wizard.wp-has-current-submenu .wp-menu-image a{background-position:-178px -2px}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a img,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img{display:none}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a{background-image:url(../images/menu.png)!important;background-position:-178px -34px}ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a{background-position:-178px -2px}ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a img,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a img{display:none}ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image a{background-image:url(../images/menu.png)!important;background-position:0 -34px}ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image a,ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image a{background-position:0 -2px}.dashboard_page_bp-wizard td.plugin-title span,.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;background-image:url(../images/menu.png);background-position:-4px -40px;background-repeat:no-repeat;margin-right:5px}.dashboard_page_bp-wizard tr.active td.plugin-title span,.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}.dashboard_page_bp-wizard tr.activity td.plugin-title span,.settings_page_bp-components tr.activity td.plugin-title span{background-position-x:-4px}.dashboard_page_bp-wizard tr.xprofile td.plugin-title span,.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url(../images/menu-wp.png);background-position-x:-305px}.dashboard_page_bp-wizard tr.settings td.plugin-title span,.settings_page_bp-components tr.settings td.plugin-title span{background-image:url(../images/menu-wp.png);background-position-x:-334px}.dashboard_page_bp-wizard tr.groups td.plugin-title span,.settings_page_bp-components tr.groups td.plugin-title span{background-position-x:-66px}.dashboard_page_bp-wizard tr.messages td.plugin-title span,.settings_page_bp-components tr.messages td.plugin-title span{background-position-x:-154px}.dashboard_page_bp-wizard tr.forums td.plugin-title span,.settings_page_bp-components tr.forums td.plugin-title span{background-image:url(../images/menu-wp.png);background-position-x:-36px}.dashboard_page_bp-wizard tr.blogs td.plugin-title span,.settings_page_bp-components tr.blogs td.plugin-title span{background-position-x:-125px}.dashboard_page_bp-wizard tr.friends td.plugin-title span,.settings_page_bp-components tr.friends td.plugin-title span{background-position-x:-95px}.dashboard_page_bp-wizard tr.core td.plugin-title span,.settings_page_bp-components tr.core td.plugin-title span{background-position-x:-184px}.dashboard_page_bp-wizard tr.members td.plugin-title span,.settings_page_bp-components tr.members td.plugin-title span{background-position-x:-36px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top} \ No newline at end of file +/** + * CSS that is always loaded when in wp-admin + * + * @since BuddyPress (1.6) + */ + +/* Icon 32's +------------------------------------------------------------------------------*/ + +div#icon-buddypress { + background: url('../images/icons32.png') no-repeat -370px -6px; +} + +div#icon-buddypress-activity { + background: url('../images/icons32.png') no-repeat -10px -6px; +} + +div#icon-buddypress-groups { + background: url('../images/icons32.png') no-repeat -250px -6px; +} + +/* Menu Icons +------------------------------------------------------------------------------*/ + +/* Backpat */ +ul#adminmenu li.toplevel_page_bp-components .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image { + background-image: url('../images/menu.png') !important; + background-position: -178px -34px; +} + +ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image { + background-position: -178px -2px; +} + +/* Activity */ +ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image { + background-image: url('../images/menu.png'); + background-position: 0 -34px; +} +ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image { + background-position: 0 -2px; +} + +/* Groups */ +ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image { + background-image: url('../images/menu.png'); + background-position: -61px -34px; +} +ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image, +ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image { + background-position: -61px -2px; +} +th.column-gid { + width: 60px; +} +td.column-gid { + vertical-align: middle; +} +table.bp-group-members th, +table.bp-group-members td { + padding: 5px 0; +} +table.bp-group-members .uid-column { + padding-left: 20px; + padding-right: 20px; +} +table.bp-group-members .uname-column { + width: 70%; +} +table.bp-group-members .urole-column { + padding-left: 20px; + padding-right: 20px; +} + +/* Components +------------------------------------------------------------------------------*/ + +.dashboard_page_bp-wizard td.plugin-title span, +.settings_page_bp-components td.plugin-title span { + float: left; + width: 18px; + height: 18px; + background-image: url('../images/menu.png'); + background-position: -4px -40px; + background-repeat: no-repeat; + margin-right: 5px; +} + +.dashboard_page_bp-wizard tr.active td.plugin-title span, +.settings_page_bp-components tr.active td.plugin-title span { + background-position-y: -7px; +} + +.dashboard_page_bp-wizard tr.activity td.plugin-title span, +.settings_page_bp-components tr.activity td.plugin-title span { + background-position-x: -4px; +} + +.dashboard_page_bp-wizard tr.xprofile td.plugin-title span, +.settings_page_bp-components tr.xprofile td.plugin-title span { + background-image: url('../images/menu-wp.png'); + background-position-x: -305px; +} + +.dashboard_page_bp-wizard tr.settings td.plugin-title span, +.settings_page_bp-components tr.settings td.plugin-title span { + background-image: url('../images/menu-wp.png'); + background-position-x: -334px; +} + +.dashboard_page_bp-wizard tr.groups td.plugin-title span, +.settings_page_bp-components tr.groups td.plugin-title span { + background-position-x: -66px; +} + +.dashboard_page_bp-wizard tr.messages td.plugin-title span, +.settings_page_bp-components tr.messages td.plugin-title span { + background-position-x: -154px; +} + +.dashboard_page_bp-wizard tr.forums td.plugin-title span, +.settings_page_bp-components tr.forums td.plugin-title span { + background-image: url('../images/menu-wp.png'); + background-position-x: -36px; +} + +.dashboard_page_bp-wizard tr.blogs td.plugin-title span, +.settings_page_bp-components tr.blogs td.plugin-title span { + background-position-x: -125px; +} + +.dashboard_page_bp-wizard tr.friends td.plugin-title span, +.settings_page_bp-components tr.friends td.plugin-title span { + background-position-x: -95px; +} + +.dashboard_page_bp-wizard tr.core td.plugin-title span, +.settings_page_bp-components tr.core td.plugin-title span { + background-position-x: -184px; +} + +.dashboard_page_bp-wizard tr.members td.plugin-title span, +.settings_page_bp-components tr.members td.plugin-title span { + background-position-x: -36px; +} + +#bp-admin-component-form .widefat th { + display: table-cell; + vertical-align: top; +} + +/* Version Badge */ + +.bp-badge { + padding-top: 142px; + height: 50px; + width: 173px; + color: #fafafa; + font-weight: bold; + font-size: 14px; + text-align: center; + margin: 0 -5px; + background: url('../images/badge.png') no-repeat; +} + +.about-wrap .bp-badge { + position: absolute; + top: 0; + right: 0; +} + body.rtl .about-wrap .bp-badge { + right: auto; + left: 0; + } + +/* HiDPI +------------------------------------------------------------------------------*/ + +@media only screen and (-webkit-min-device-pixel-ratio: 1.5) { + + /* Icon 32 */ + div#icon-buddypress, + div#icon-buddypress-activity, + div#icon-buddypress-groups { + background-image: url('../images/icons64.png'); + background-size: 419px 45px; + } + + /* Backpat */ + ul#adminmenu li.toplevel_page_bp-components .wp-menu-image, + ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image, + ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image, + ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image, + ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image, + ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image { + background-image: url('../images/menu-2x.png') !important; + background-size: 209px 64px; + } + + /* Badge */ + .bp-badge { + background-image: url('../images/badge-2x.png'); + background-size: 173px 194px; + } +} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/admin/css/common.min.css b/wp-content/plugins/buddypress/bp-core/admin/css/common.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c9a2542cda3baa1e78edbb00907a1d8d130b6eeb --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/admin/css/common.min.css @@ -0,0 +1 @@ +div#icon-buddypress{background:url('../images/icons32.png') no-repeat -370px -6px}div#icon-buddypress-activity{background:url('../images/icons32.png') no-repeat -10px -6px}div#icon-buddypress-groups{background:url('../images/icons32.png') no-repeat -250px -6px}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image{background-image:url('../images/menu.png')!important;background-position:-178px -34px}ul#adminmenu li.toplevel_page_bp-components:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-components.wp-has-current-submenu .wp-menu-image,ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image{background-position:-178px -2px}ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image{background-image:url('../images/menu.png');background-position:0 -34px}ul#adminmenu li.toplevel_page_bp-activity:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity.current .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity.wp-has-current-submenu .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network.current .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network.wp-has-current-submenu .wp-menu-image{background-position:0 -2px}ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url('../images/menu.png');background-position:-61px -34px}ul#adminmenu li.toplevel_page_bp-groups:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups.current .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups.wp-has-current-submenu .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network:hover .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network.current .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network.wp-has-current-submenu .wp-menu-image{background-position:-61px -2px}th.column-gid{width:60px}td.column-gid{vertical-align:middle}table.bp-group-members th,table.bp-group-members td{padding:5px 0}table.bp-group-members .uid-column{padding-left:20px;padding-right:20px}table.bp-group-members .uname-column{width:70%}table.bp-group-members .urole-column{padding-left:20px;padding-right:20px}.dashboard_page_bp-wizard td.plugin-title span,.settings_page_bp-components td.plugin-title span{float:left;width:18px;height:18px;background-image:url('../images/menu.png');background-position:-4px -40px;background-repeat:no-repeat;margin-right:5px}.dashboard_page_bp-wizard tr.active td.plugin-title span,.settings_page_bp-components tr.active td.plugin-title span{background-position-y:-7px}.dashboard_page_bp-wizard tr.activity td.plugin-title span,.settings_page_bp-components tr.activity td.plugin-title span{background-position-x:-4px}.dashboard_page_bp-wizard tr.xprofile td.plugin-title span,.settings_page_bp-components tr.xprofile td.plugin-title span{background-image:url('../images/menu-wp.png');background-position-x:-305px}.dashboard_page_bp-wizard tr.settings td.plugin-title span,.settings_page_bp-components tr.settings td.plugin-title span{background-image:url('../images/menu-wp.png');background-position-x:-334px}.dashboard_page_bp-wizard tr.groups td.plugin-title span,.settings_page_bp-components tr.groups td.plugin-title span{background-position-x:-66px}.dashboard_page_bp-wizard tr.messages td.plugin-title span,.settings_page_bp-components tr.messages td.plugin-title span{background-position-x:-154px}.dashboard_page_bp-wizard tr.forums td.plugin-title span,.settings_page_bp-components tr.forums td.plugin-title span{background-image:url('../images/menu-wp.png');background-position-x:-36px}.dashboard_page_bp-wizard tr.blogs td.plugin-title span,.settings_page_bp-components tr.blogs td.plugin-title span{background-position-x:-125px}.dashboard_page_bp-wizard tr.friends td.plugin-title span,.settings_page_bp-components tr.friends td.plugin-title span{background-position-x:-95px}.dashboard_page_bp-wizard tr.core td.plugin-title span,.settings_page_bp-components tr.core td.plugin-title span{background-position-x:-184px}.dashboard_page_bp-wizard tr.members td.plugin-title span,.settings_page_bp-components tr.members td.plugin-title span{background-position-x:-36px}#bp-admin-component-form .widefat th{display:table-cell;vertical-align:top}.bp-badge{padding-top:142px;height:50px;width:173px;color:#fafafa;font-weight:bold;font-size:14px;text-align:center;margin:0 -5px;background:url('../images/badge.png') no-repeat}.about-wrap .bp-badge{position:absolute;top:0;right:0}body.rtl .about-wrap .bp-badge{right:auto;left:0}@media only screen and (-webkit-min-device-pixel-ratio:1.5){div#icon-buddypress,div#icon-buddypress-activity,div#icon-buddypress-groups{background-image:url('../images/icons64.png');background-size:419px 45px}ul#adminmenu li.toplevel_page_bp-components .wp-menu-image,ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity .wp-menu-image,ul#adminmenu li.toplevel_page_bp-activity_network .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups .wp-menu-image,ul#adminmenu li.toplevel_page_bp-groups_network .wp-menu-image{background-image:url('../images/menu-2x.png')!important;background-size:209px 64px}.bp-badge{background-image:url('../images/badge-2x.png');background-size:173px 194px}} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/badge-2x.png b/wp-content/plugins/buddypress/bp-core/admin/images/badge-2x.png new file mode 100644 index 0000000000000000000000000000000000000000..762ed993cbb2232b3207b06891f3d399712c5709 Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/badge-2x.png differ diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/badge.png b/wp-content/plugins/buddypress/bp-core/admin/images/badge.png new file mode 100644 index 0000000000000000000000000000000000000000..7cf0f7998e7e3fc0ac05165d60ea832c244418c6 Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/badge.png differ diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/icons64.png b/wp-content/plugins/buddypress/bp-core/admin/images/icons64.png new file mode 100644 index 0000000000000000000000000000000000000000..511c7f55606f1a941e18bd148a4fde938dd03062 Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/icons64.png differ diff --git a/wp-content/plugins/buddypress/bp-core/admin/images/menu-2x.png b/wp-content/plugins/buddypress/bp-core/admin/images/menu-2x.png new file mode 100644 index 0000000000000000000000000000000000000000..97f773620c292d0d7b6e7be2d0618a139e63fcc1 Binary files /dev/null and b/wp-content/plugins/buddypress/bp-core/admin/images/menu-2x.png differ diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-actions.php b/wp-content/plugins/buddypress/bp-core/bp-core-actions.php index 523d7bb1b6e34ca89be1251a0fb1a53696fc9fb9..9c2c3b816393e278e5337f977958775d2ff4f496 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-actions.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-actions.php @@ -34,38 +34,39 @@ if ( !defined( 'ABSPATH' ) ) exit; add_action( 'plugins_loaded', 'bp_loaded', 10 ); add_action( 'init', 'bp_init', 10 ); add_action( 'wp', 'bp_ready', 10 ); +add_action( 'set_current_user', 'bp_setup_current_user', 10 ); add_action( 'setup_theme', 'bp_setup_theme', 10 ); -add_action( 'after_theme_setup', 'bp_after_theme_setup', 10 ); +add_action( 'after_setup_theme', 'bp_after_setup_theme', 100 ); // After WP themes add_action( 'wp_enqueue_scripts', 'bp_enqueue_scripts', 10 ); add_action( 'admin_bar_menu', 'bp_setup_admin_bar', 20 ); // After WP core add_action( 'template_redirect', 'bp_template_redirect', 10 ); add_action( 'widgets_init', 'bp_widgets_init', 10 ); -add_filter( 'template_include', 'bp_template_include', 10 ); -add_filter( 'map_meta_cap', 'bp_map_meta_caps', 10, 4 ); /** * bp_loaded - Attached to 'plugins_loaded' above * * Attach various loader actions to the bp_loaded action. * The load order helps to execute code at the correct time. - * v---Load order + * v---Load order */ -add_action( 'bp_loaded', 'bp_setup_components', 2 ); -add_action( 'bp_loaded', 'bp_include', 4 ); -add_action( 'bp_loaded', 'bp_setup_widgets', 6 ); -add_action( 'bp_loaded', 'bp_core_load_admin_bar', 10 ); +add_action( 'bp_loaded', 'bp_setup_components', 2 ); +add_action( 'bp_loaded', 'bp_include', 4 ); +add_action( 'bp_loaded', 'bp_setup_widgets', 6 ); +add_action( 'bp_loaded', 'bp_register_theme_packages', 12 ); +add_action( 'bp_loaded', 'bp_register_theme_directory', 14 ); /** * bp_init - Attached to 'init' above * * Attach various initialization actions to the bp_init action. * The load order helps to execute code at the correct time. - * v---Load order + * v---Load order */ -add_action( 'bp_init', 'bp_core_set_uri_globals', 2 ); -add_action( 'bp_init', 'bp_setup_globals', 4 ); -add_action( 'bp_init', 'bp_setup_nav', 6 ); -add_action( 'bp_init', 'bp_setup_title', 8 ); +add_action( 'bp_init', 'bp_core_set_uri_globals', 2 ); +add_action( 'bp_init', 'bp_setup_globals', 4 ); +add_action( 'bp_init', 'bp_setup_nav', 6 ); +add_action( 'bp_init', 'bp_setup_title', 8 ); +add_action( 'bp_init', 'bp_core_load_admin_bar_css', 12 ); /** * bp_template_redirect - Attached to 'template_redirect' above @@ -76,192 +77,20 @@ add_action( 'bp_init', 'bp_setup_title', 8 ); * Note that we currently use template_redirect versus template include because * BuddyPress is a bully and overrides the existing themes output in many * places. This won't always be this way, we promise. - * v---Load order + * v---Load order */ -add_action( 'bp_template_redirect', 'bp_redirect_canonical', 2 ); -add_action( 'bp_template_redirect', 'bp_actions', 4 ); -add_action( 'bp_template_redirect', 'bp_screens', 6 ); - -// Load the admin -if ( is_admin() ) { - add_action( 'bp_loaded', 'bp_admin' ); -} - -/** - * Plugin Dependency - * - * The purpose of the following actions is to mimic the behavior of something - * called 'plugin dependency' which enables a plugin to have plugins of their - * own in a safe and reliable way. - * - * We do this in BuddyPress by mirroring existing WordPress actions in many places - * allowing dependant plugins to hook into the BuddyPress specific ones, thus - * guaranteeing proper code execution only whenBuddyPresss is active. - * - * The following functions are wrappers for their actions, allowing them to be - * manually called and/or piggy-backed on top of other actions if needed. - */ - -/** Sub-actions ***************************************************************/ - -/** - * Include files on this action - */ -function bp_include() { - do_action( 'bp_include' ); -} - -/** - * Include files on this action - */ -function bp_setup_components() { - do_action( 'bp_setup_components' ); -} - -/** - * Setup global variables and objects - */ -function bp_setup_globals() { - do_action( 'bp_setup_globals' ); -} - -/** - * Set navigation elements - */ -function bp_setup_nav() { - do_action( 'bp_setup_nav' ); -} - -/** - * Set up BuddyPress implementation of the WP Toolbar - */ -function bp_setup_admin_bar() { - if ( bp_use_wp_admin_bar() ) - do_action( 'bp_setup_admin_bar' ); -} - -/** - * Set the page title - */ -function bp_setup_title() { - do_action( 'bp_setup_title' ); -} - -/** - * Register widgets - */ -function bp_setup_widgets() { - do_action( 'bp_register_widgets' ); -} - -/** - * Initlialize code - */ -function bp_init() { - do_action( 'bp_init' ); -} - -/** - * Attached to plugins_loaded - */ -function bp_loaded() { - do_action( 'bp_loaded' ); -} +add_action( 'bp_template_redirect', 'bp_actions', 4 ); +add_action( 'bp_template_redirect', 'bp_screens', 6 ); /** - * Attached to wp + * Add the BuddyPress functions file */ -function bp_ready() { - do_action( 'bp_ready' ); -} - -/** - * Attach potential template actions - */ -function bp_actions() { - do_action( 'bp_actions' ); -} - -/** - * Attach potential template screens - */ -function bp_screens() { - do_action( 'bp_screens' ); -} - -/** - * Initialize widgets - */ -function bp_widgets_init() { - do_action ( 'bp_widgets_init' ); -} - -/** Theme *********************************************************************/ - -/** - * Enqueue BuddyPress specific CSS and JS - * - * @since BuddyPress (1.6) - * - * @uses do_action() Calls 'bp_enqueue_scripts' - */ -function bp_enqueue_scripts() { - do_action ( 'bp_enqueue_scripts' ); -} - -/** - * Piggy back action for BuddyPress sepecific theme actions before the theme has - * been setup and the theme's functions.php has loaded. - * - * @since BuddyPress (1.6) - * - * @uses do_action() Calls 'bp_setup_theme' - */ -function bp_setup_theme() { - do_action ( 'bp_setup_theme' ); -} - -/** - * Piggy back action for BuddyPress sepecific theme actions once the theme has - * been setup and the theme's functions.php has loaded. - * - * @since BuddyPress (1.6) - * - * @uses do_action() Calls 'bp_after_theme_setup' - */ -function bp_after_theme_setup() { - do_action ( 'bp_after_theme_setup' ); -} - -/** Theme Compatibility Filter ************************************************/ - -/** - * The main filter used for theme compatibility and displaying custom BuddyPress - * theme files. - * - * @since BuddyPress (1.6) - * - * @uses apply_filters() - * - * @param string $template - * @return string Template file to use - */ -function bp_template_include( $template = '' ) { - return apply_filters( 'bp_template_include', $template ); -} - -/** Theme Permissions *********************************************************/ +add_action( 'bp_after_setup_theme', 'bp_load_theme_functions', 1 ); -/** - * The main action used for redirecting BuddyPress theme actions that are not - * permitted by the current_user - * - * @since BuddyPress (1.6) - * - * @uses do_action() - */ -function bp_template_redirect() { - do_action( 'bp_template_redirect' ); +// Load the admin +if ( is_admin() ) { + add_action( 'bp_loaded', 'bp_admin' ); } -?> +// Activation redirect +add_action( 'bp_activation', 'bp_add_activation_redirect' ); diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-admin.php b/wp-content/plugins/buddypress/bp-core/bp-core-admin.php index 2db359bd526f4f3daeb7874108175b3331fec827..a6fb61b7b03aabc766861f4913d9affec3373847 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-admin.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-admin.php @@ -20,14 +20,6 @@ if ( !class_exists( 'BP_Admin' ) ) : */ class BP_Admin { - /** - * Instance of the setup wizard - * - * @since BuddyPress (1.6) - * @var BP_Core_Setup_Wizard - */ - public $wizard; - /** Directory *************************************************************/ /** @@ -57,7 +49,6 @@ class BP_Admin { */ public $js_url = ''; - /** Methods ***************************************************************/ /** @@ -65,9 +56,9 @@ class BP_Admin { * * @since BuddyPress (1.6) * - * @uses BBP_Admin::setup_globals() Setup the globals needed - * @uses BBP_Admin::includes() Include the required files - * @uses BBP_Admin::setup_actions() Setup the hooks and actions + * @uses BP_Admin::setup_globals() Setup the globals needed + * @uses BP_Admin::includes() Include the required files + * @uses BP_Admin::setup_actions() Setup the hooks and actions */ public function __construct() { $this->setup_globals(); @@ -82,22 +73,17 @@ class BP_Admin { * @access private */ private function setup_globals() { - global $bp; - - // Admin url - $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-core/admin' ); - - // Admin url - $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-core/admin' ); + $bp = buddypress(); - // Admin images URL - $this->images_url = trailingslashit( $this->admin_url . 'images' ); + // Paths and URLs + $this->admin_dir = trailingslashit( $bp->plugin_dir . 'bp-core/admin' ); // Admin path + $this->admin_url = trailingslashit( $bp->plugin_url . 'bp-core/admin' ); // Admin url + $this->images_url = trailingslashit( $this->admin_url . 'images' ); // Admin images URL + $this->css_url = trailingslashit( $this->admin_url . 'css' ); // Admin css URL + $this->js_url = trailingslashit( $this->admin_url . 'js' ); // Admin css URL - // Admin css URL - $this->css_url = trailingslashit( $this->admin_url . 'css' ); - - // Admin css URL - $this->js_url = trailingslashit( $this->admin_url . 'js' ); + // Main settings page + $this->settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; } /** @@ -107,19 +93,11 @@ class BP_Admin { * @access private */ private function includes() { - - // If in maintenance mode, only include updater and schema - if ( bp_get_maintenance_mode() ) { - require( $this->admin_dir . 'bp-core-schema.php' ); - require( $this->admin_dir . 'bp-core-update.php' ); - - // No update needed so proceed with loading everything - } else { - require( $this->admin_dir . 'bp-core-settings.php' ); - require( $this->admin_dir . 'bp-core-functions.php' ); - require( $this->admin_dir . 'bp-core-components.php' ); - require( $this->admin_dir . 'bp-core-slugs.php' ); - } + require( $this->admin_dir . 'bp-core-actions.php' ); + require( $this->admin_dir . 'bp-core-settings.php' ); + require( $this->admin_dir . 'bp-core-functions.php' ); + require( $this->admin_dir . 'bp-core-components.php' ); + require( $this->admin_dir . 'bp-core-slugs.php' ); } /** @@ -133,42 +111,27 @@ class BP_Admin { */ private function setup_actions() { - // Start the wizard if in maintenance mode - if ( bp_get_maintenance_mode() ) { - add_action( bp_core_admin_hook(), array( $this, 'start_wizard' ), 2 ); - } - /** General Actions ***************************************************/ - // Attach the BuddyPress admin_init action to the WordPress admin_init action. - add_action( 'admin_init', array( $this, 'admin_init' ) ); - // Add some page specific output to the <head> - add_action( 'admin_head', array( $this, 'admin_head' ) ); + add_action( 'bp_admin_head', array( $this, 'admin_head' ), 999 ); // Add menu item to settings menu - add_action( bp_core_admin_hook(), array( $this, 'admin_menus' ), 5 ); - - // Add notice if not using a BuddyPress theme - add_action( 'admin_notices', array( $this, 'admin_notices' ) ); - add_action( 'network_admin_notices', array( $this, 'admin_notices' ) ); + add_action( bp_core_admin_hook(), array( $this, 'admin_menus' ), 5 ); // Enqueue all admin JS and CSS - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); + add_action( 'bp_admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); /** BuddyPress Actions ************************************************/ // Add settings - add_action( 'bp_admin_init', array( $this, 'register_admin_settings' ) ); + add_action( 'bp_register_admin_settings', array( $this, 'register_admin_settings' ) ); /** Filters ***********************************************************/ // Add link to settings page - add_filter( 'plugin_action_links', array( $this, 'add_settings_link' ), 10, 2 ); - } - - public function start_wizard() { - $this->wizard = new BP_Core_Setup_Wizard; + add_filter( 'plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 ); + add_filter( 'network_admin_plugin_action_links', array( $this, 'modify_plugin_action_links' ), 10, 2 ); } /** @@ -182,86 +145,80 @@ class BP_Admin { */ public function admin_menus() { - // In maintenance mode - if ( bp_get_maintenance_mode() ) { - - if ( !current_user_can( 'manage_options' ) ) - return; - - if ( bp_get_maintenance_mode() == 'install' ) - $status = __( 'BuddyPress Setup', 'buddypress' ); - else - $status = __( 'Update BuddyPress', 'buddypress' ); - - if ( bp_get_wizard() ) { - if ( ! is_multisite() || bp_is_multiblog_mode() ) { - $hook = add_dashboard_page( $status, $status, 'manage_options', 'bp-wizard', array( bp_get_wizard(), 'html' ) ); - } else { - $hook = add_submenu_page( 'update-core.php', $status, $status, 'manage_options', 'bp-wizard', array( bp_get_wizard(), 'html' ) ); - } - } + // Bail if user cannot moderate + if ( ! bp_current_user_can( 'manage_options' ) ) + return; - // Not in maintenance mode - } else { - - // Bail if user cannot moderate - if ( ! bp_current_user_can( 'manage_options' ) ) - return; - - $hooks = array(); - $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; - - // Changed in BP 1.6 . See bp_core_admin_backpat_menu() - $hooks[] = add_menu_page( - __( 'BuddyPress', 'buddypress' ), - __( 'BuddyPress', 'buddypress' ), - 'manage_options', - 'bp-general-settings', - 'bp_core_admin_backpat_menu', - '' - ); - - $hooks[] = add_submenu_page( - 'bp-general-settings', - __( 'BuddyPress Help', 'buddypress' ), - __( 'Help', 'buddypress' ), - 'manage_options', - 'bp-general-settings', - 'bp_core_admin_backpat_page' - ); - - // Add the option pages - $hooks[] = add_submenu_page( - $page, - __( 'BuddyPress Components', 'buddypress' ), - __( 'BuddyPress', 'buddypress' ), - 'manage_options', - 'bp-components', - 'bp_core_admin_components_settings' - ); - - $hooks[] = add_submenu_page( - $page, - __( 'BuddyPress Pages', 'buddypress' ), - __( 'BuddyPress Pages', 'buddypress' ), - 'manage_options', - 'bp-page-settings', - 'bp_core_admin_slugs_settings' - ); - - $hooks[] = add_submenu_page( - $page, - __( 'BuddyPress Settings', 'buddypress' ), - __( 'BuddyPress Settings', 'buddypress' ), - 'manage_options', - 'bp-settings', - 'bp_core_admin_settings' - ); - - // Fudge the highlighted subnav item when on a BuddyPress admin page - foreach( $hooks as $hook ) { - add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); - } + // About + add_dashboard_page( + __( 'Welcome to BuddyPress', 'buddypress' ), + __( 'Welcome to BuddyPress', 'buddypress' ), + 'manage_options', + 'bp-about', + array( $this, 'about_screen' ) + ); + + // Credits + add_dashboard_page( + __( 'Welcome to BuddyPress', 'buddypress' ), + __( 'Welcome to BuddyPress', 'buddypress' ), + 'manage_options', + 'bp-credits', + array( $this, 'credits_screen' ) + ); + + $hooks = array(); + + // Changed in BP 1.6 . See bp_core_admin_backpat_menu() + $hooks[] = add_menu_page( + __( 'BuddyPress', 'buddypress' ), + __( 'BuddyPress', 'buddypress' ), + 'manage_options', + 'bp-general-settings', + 'bp_core_admin_backpat_menu', + 'div' + ); + + $hooks[] = add_submenu_page( + 'bp-general-settings', + __( 'BuddyPress Help', 'buddypress' ), + __( 'Help', 'buddypress' ), + 'manage_options', + 'bp-general-settings', + 'bp_core_admin_backpat_page' + ); + + // Add the option pages + $hooks[] = add_submenu_page( + $this->settings_page, + __( 'BuddyPress Components', 'buddypress' ), + __( 'BuddyPress', 'buddypress' ), + 'manage_options', + 'bp-components', + 'bp_core_admin_components_settings' + ); + + $hooks[] = add_submenu_page( + $this->settings_page, + __( 'BuddyPress Pages', 'buddypress' ), + __( 'BuddyPress Pages', 'buddypress' ), + 'manage_options', + 'bp-page-settings', + 'bp_core_admin_slugs_settings' + ); + + $hooks[] = add_submenu_page( + $this->settings_page, + __( 'BuddyPress Settings', 'buddypress' ), + __( 'BuddyPress Settings', 'buddypress' ), + 'manage_options', + 'bp-settings', + 'bp_core_admin_settings' + ); + + // Fudge the highlighted subnav item when on a BuddyPress admin page + foreach( $hooks as $hook ) { + add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); } } @@ -273,7 +230,6 @@ class BP_Admin { * @uses add_settings_section() To add our own settings section * @uses add_settings_field() To add various settings fields * @uses register_setting() To register various settings - * @uses do_action() Calls 'bp_register_admin_settings' */ public function register_admin_settings() { @@ -326,10 +282,10 @@ class BP_Admin { /** Forums ************************************************************/ - if ( bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) { + if ( bp_is_active( 'forums' ) ) { // Add the main section - add_settings_section( 'bp_forums', __( 'Forums Settings', 'buddypress' ), 'bp_admin_setting_callback_bbpress_section', 'buddypress' ); + add_settings_section( 'bp_forums', __( 'Legacy Group Forums', 'buddypress' ), 'bp_admin_setting_callback_bbpress_section', 'buddypress' ); // Allow subscriptions setting add_settings_field( 'bb-config-location', __( 'bbPress Configuration', 'buddypress' ), 'bp_admin_setting_callback_bbpress_configuration', 'buddypress', 'bp_forums' ); @@ -353,8 +309,6 @@ class BP_Admin { register_setting ( 'buddypress', '_bp_enable_akismet', 'intval' ); } } - - do_action( 'bp_register_admin_settings' ); } /** @@ -366,27 +320,17 @@ class BP_Admin { * @param string $file Current plugin basename * @return array Processed links */ - public function add_settings_link( $links, $file ) { - global $bp; + public function modify_plugin_action_links( $links, $file ) { - if ( plugin_basename( $bp->file ) == $file ) { - $url = bp_core_do_network_admin() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' ); - $settings_link = '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), $url ) . '">' . __( 'Settings', 'buddypress' ) . '</a>'; - array_unshift( $links, $settings_link ); - } - - return $links; - } + // Return normal links if not BuddyPress + if ( plugin_basename( buddypress()->file ) != $file ) + return $links; - /** - * BuddyPress's dedicated admin init action - * - * @since BuddyPress (1.6) - * - * @uses do_action() Calls 'bp_admin_init' - */ - public function admin_init() { - do_action( 'bp_admin_init' ); + // Add a few links to the existing links array + return array_merge( $links, array( + 'settings' => '<a href="' . add_query_arg( array( 'page' => 'bp-components' ), bp_get_admin_url( $this->settings_page ) ) . '">' . esc_html__( 'Settings', 'buddypress' ) . '</a>', + 'about' => '<a href="' . add_query_arg( array( 'page' => 'bp-about' ), bp_get_admin_url( 'index.php' ) ) . '">' . esc_html__( 'About', 'buddypress' ) . '</a>' + ) ); } /** @@ -394,7 +338,16 @@ class BP_Admin { * * @since BuddyPress (1.6) */ - public function admin_head() { } + public function admin_head() { + + // Settings pages + remove_submenu_page( $this->settings_page, 'bp-page-settings' ); + remove_submenu_page( $this->settings_page, 'bp-settings' ); + + // About and Credits pages + remove_submenu_page( 'index.php', 'bp-about' ); + remove_submenu_page( 'index.php', 'bp-credits' ); + } /** * Add some general styling to the admin area @@ -403,92 +356,249 @@ class BP_Admin { */ public function enqueue_scripts() { - $maybe_dev = ''; - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) - $maybe_dev = '.dev'; + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; - $file = $this->css_url . "common{$maybe_dev}.css"; + $file = $this->css_url . "common{$min}.css"; $file = apply_filters( 'bp_core_admin_common_css', $file ); wp_enqueue_style( 'bp-admin-common-css', $file, array(), bp_get_version() ); + } - // Extra bits for the installation wizard - if ( bp_get_maintenance_mode() ) { - - // Styling - $file = $this->css_url . "wizard{$maybe_dev}.css"; - $file = apply_filters( 'bp_core_admin_wizard_css', $file ); - wp_enqueue_style( 'bp-admin-wizard-css', $file, array(), bp_get_version() ); - - // JS - $file = $this->js_url . "wizard{$maybe_dev}.js"; - $file = apply_filters( 'bp_core_admin_wizard_js', $file ); - wp_enqueue_script( 'bp-admin-wizard-js', $file, array(), bp_get_version() ); + /** About *****************************************************************/ - // We'll need the thickbox too - wp_enqueue_script( 'thickbox' ); - wp_enqueue_style( 'thickbox' ); - } + /** + * Output the about screen + * + * @since BuddyPress (1.7) + */ + public function about_screen() { + global $wp_rewrite; + + $is_new_install = ! empty( $_GET['is_new_install'] ); + + $pretty_permalinks_enabled = ! empty( $wp_rewrite->permalink_structure ); + + list( $display_version ) = explode( '-', bp_get_version() ); ?> + + <div class="wrap about-wrap"> + <h1><?php printf( __( 'Welcome to BuddyPress %s' ), $display_version ); ?></h1> + <div class="about-text"> + <?php if ( $is_new_install ) : ?> + <?php printf( __( 'BuddyPress %s is our safest, fastest, most flexible version ever.' ), $display_version ); ?> + <?php else : ?> + <?php printf( __( 'Thank you for updating! BuddyPress %s is our safest, fastest, most flexible version ever.' ), $display_version ); ?> + <?php endif; ?> + </div> + <div class="bp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div> + + <h2 class="nav-tab-wrapper"> + <a class="nav-tab nav-tab-active" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>"> + <?php _e( 'What’s New', 'buddypress' ); ?> + </a><a class="nav-tab" href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>"> + <?php _e( 'Credits', 'buddypress' ); ?> + </a> + </h2> + + <?php if ( $is_new_install ) : ?> + <h3><?php _e( 'Getting Started', 'buddypress' ); ?></h3> + + <div class="feature-section"> + <h4><?php _e( 'Your Default Setup', 'buddypress' ); ?></h4> + <p><?php printf( + __( 'BuddyPress’s powerful features help your users connect and collaborate. To help get your community started, we’ve activated two of the most commonly used tools in BP: <strong>Extended Profiles</strong> and <strong>Activity Streams</strong>. See these components in action at the %1$s and %2$s directories, and be sure to spend a few minutes <a href="%3$s">configuring user profiles</a>. Want to explore more of BP’s features? Visit the <a href="%4$s">Components panel</a>.', 'buddypress' ), + $pretty_permalinks_enabled ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ) . '">' . __( 'Members', 'buddypress' ) . '</a>' : __( 'Members', 'buddypress' ), + $pretty_permalinks_enabled ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_activity_root_slug() ) . '">' . __( 'Activity', 'buddypress' ) . '</a>' : __( 'Activity', 'buddypress' ), + bp_get_admin_url( add_query_arg( array( 'page' => 'bp-profile-setup' ), 'users.php' ) ), + bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) + ); ?></p> + + <h4><?php _e( 'Community and Support', 'buddypress' ); ?></h4> + <p><?php _e( 'Looking for help? The <a href="http://codex.buddypress.org/">BuddyPress Codex</a> has you covered, with dozens of user-contributed guides on how to configure and use your BP site. Can’t find what you need? Stop by <a href="http://buddypress.org/support/">our support forums</a>, where a vibrant community of BuddyPress users and developers is waiting to share tips, show off their sites, talk about the future of BuddyPress, and much more.', 'buddypress' ) ?></p> + </div> + + <?php endif; ?> + + <div class="changelog"> + <h3><?php _e( 'A Declaration of (Theme) Independence', 'buddypress' ); ?></h3> + + <div class="feature-section"> + <h4><?php _e( 'It Just Works', 'buddypress' ); ?></h4> + <p><?php _e( 'BuddyPress is now compatible with <strong>any WordPress theme</strong>. If your theme has BuddyPress-specific templates and styling, we’ll use them. If not, we provide what you need to make your BuddyPress content look great. Still want to customize? No problem - you can override our templates just like you would in a WordPress child theme. <a href="http://codex.buddypress.org/theme-compatibility/">Learn more about theme compatibility</a>.', 'buddypress' ); ?></p> + </div> + </div> + + <div class="changelog"> + <h3><?php _e( 'Group Management', 'buddypress' ); ?></h3> + + <div class="feature-section"> + <h4><?php _e( 'Get More Done Quickly', 'buddypress' ); ?></h4> + + <?php + $group_admin_text = __( 'Groups administration panel', 'buddypress' ); + if ( bp_is_active( 'groups' ) ) { + $group_admin_text = '<a href="' . bp_get_admin_url( add_query_arg( array( 'page' => 'bp-groups' ), 'admin.php' ) ) . '">' . $group_admin_text . '</a>'; + } + ?> + + <p><?php printf( + __( 'The new %s makes it easy to handle large numbers of groups on your BuddyPress installation. Delete groups, edit group details, modify memberships, and more, with just a few clicks.', 'buddypress' ), + $group_admin_text + ); ?></p> + </div> + </div> + + <div class="changelog"> + <h3><?php _e( 'Under the Hood', 'buddypress' ); ?></h3> + + <div class="feature-section three-col"> + <div> + <h4><?php _e( 'Faster Member Queries', 'buddypress' ); ?></h4> + <p><?php _e( 'The new <code>BP_User_Query</code> makes member queries (like in the Members directory) up to 4x faster than before.', 'buddypress' ); ?></p> + + <h4><?php _e( 'Sortable Profile Options', 'buddypress' ); ?></h4> + <p><?php _e( 'Profile field types with multiple options - like radio buttons and checkboxes - now support drag-and-drop reordering.', 'buddypress' ); ?></p> + </div> + + <div> + <h4><?php _e( 'New Visibility Level', 'buddypress' ); ?></h4> + <p><?php _e( 'By popular demand, the "Admins Only" visibility setting is now available for profile fields.', 'buddypress' ); ?></p> + + <h4><?php _e( 'Better bbPress Integration', 'buddypress' ); ?></h4> + <p><?php _e( 'Support for group and sitewide forums, using the latest version of the bbPress plugin, is better than ever. Still using bbPress 1.x? Our new migration tools are field-tested.', 'buddypress' ); ?></p> + </div> + </div> + + <div class="return-to-dashboard"> + <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ); ?>"><?php _e( 'Go to the BuddyPress Settings page', 'buddypress' ); ?></a> + </div> + + </div> - do_action( 'bp_admin_head' ); + <?php } /** - * Add any admin notices we might need, mostly for update or new installs + * Output the credits screen * - * @since BuddyPress (1.6) + * Hardcoding this in here is pretty janky. It's fine for 2.2, but we'll + * want to leverage api.wordpress.org eventually. * - * @global string $pagenow - * @return If no notice is needed + * @since BuddyPress (1.7) */ - public function admin_notices() { - global $pagenow; - - // Bail if not in maintenance mode - if ( ! bp_get_maintenance_mode() ) - return; - - // Bail if user cannot manage options - if ( ! current_user_can( 'manage_options' ) ) - return; - - // Are we looking at a network? - if ( bp_core_do_network_admin() ) { - - // Bail if looking at wizard page - if ( ( 'admin.php' == $pagenow ) && ( !empty( $_GET['page'] ) && ( 'bp-wizard' == $_GET['page'] ) ) ) { - return; - } - - // Set the url for the nag - $url = network_admin_url( 'admin.php?page=bp-wizard' ); - - // Single site - } else { - - // Bail if looking at wizard page - if ( ( 'index.php' == $pagenow ) && ( !empty( $_GET['page'] ) && ( 'bp-wizard' == $_GET['page'] ) ) ) { - return; - } - - // Set the url for the nag - $url = admin_url( 'index.php?page=bp-wizard' ); - } - - // What does the nag say? - switch ( bp_get_maintenance_mode() ) { - - // Update text - case 'update' : - $msg = sprintf( __( 'BuddyPress has been updated! Please run the <a href="%s">update wizard</a>.', 'buddypress' ), $url ); - break; - - // First install text - case 'install' : default : - $msg = sprintf( __( 'BuddyPress was successfully activated! Please run the <a href="%s">installation wizard</a>.', 'buddypress' ), $url ); - break; - } ?> - - <div class="update-nag"><?php echo $msg; ?></div> + public function credits_screen() { + + list( $display_version ) = explode( '-', bp_get_version() ); ?> + + <div class="wrap about-wrap"> + <h1><?php printf( __( 'Welcome to BuddyPress %s' ), $display_version ); ?></h1> + <div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! BuddyPress %s is ready to make your community a safer, faster, and better looking place to hang out!' ), $display_version ); ?></div> + <div class="bp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div> + + <h2 class="nav-tab-wrapper"> + <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-about' ), 'index.php' ) ) ); ?>" class="nav-tab"> + <?php _e( 'What’s New', 'buddypress' ); ?> + </a><a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'index.php' ) ) ); ?>" class="nav-tab nav-tab-active"> + <?php _e( 'Credits', 'buddypress' ); ?> + </a> + </h2> + + <p class="about-description"><?php _e( 'BuddyPress is created by a worldwide network of friendly folks.', 'buddypress' ); ?></p> + + <h4 class="wp-people-group"><?php _e( 'Project Leaders', 'buddypress' ); ?></h4> + <ul class="wp-people-group " id="wp-people-group-project-leaders"> + <li class="wp-person" id="wp-person-apeatling"> + <a href="http://profiles.wordpress.org/apeatling"><img src="http://0.gravatar.com/avatar/bb29d699b5cba218c313b61aa82249da?s=60" class="gravatar" alt="Andy Peatling" /></a> + <a class="web" href="http://profiles.wordpress.org/apeatling">Andy Peatling</a> + <span class="title"><?php _e( 'Founding Developer', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-johnjamesjacoby"> + <a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a> + <a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a> + <span class="title"><?php _e( 'Project Lead', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-boonebgorges"> + <a href="http://profiles.wordpress.org/boonebgorges"><img src="http://0.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=60" class="gravatar" alt="Boone B. Gorges" /></a> + <a class="web" href="http://profiles.wordpress.org/boonebgorges">Boone B. Gorges</a> + <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-djpaul"> + <a href="http://profiles.wordpress.org/djpaul"><img src="http://0.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=60" class="gravatar" alt="Paul Gibbs" /></a> + <a class="web" href="http://profiles.wordpress.org/djpaul">Paul Gibbs</a> + <span class="title"><?php _e( 'Lead Developer', 'buddypress' ); ?></span> + </li> + </ul> + + <h4 class="wp-people-group"><?php _e( 'Core Developers', 'buddypress' ); ?></h4> + <ul class="wp-people-group " id="wp-people-group-core-developers"> + <li class="wp-person" id="wp-person-r-a-y"> + <a href="http://profiles.wordpress.org/r-a-y"><img src="http://0.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=60" class="gravatar" alt="Ray" /></a> + <a class="web" href="http://profiles.wordpress.org/r-a-y">Ray</a> + </li> + </ul> + + <h4 class="wp-people-group"><?php _e( 'Recent Rockstars', 'buddypress' ); ?></h4> + <ul class="wp-people-group " id="wp-people-group-rockstars"> + <li class="wp-person" id="wp-person-karmatosed"> + <a href="http://profiles.wordpress.org/karmatosed"><img src="http://0.gravatar.com/avatar/d36d2c1821af9249b69ff7f5ed60529b?s=60" class="gravatar" alt="Tammie Lister" /></a> + <a class="web" href="http://profiles.wordpress.org/karmatosed">Tammie Lister</a> + <span class="title"><?php _e( 'Design Officer', 'buddypress' ); ?></span> + </li> + <li class="wp-person" id="wp-person-mercime"> + <a href="http://profiles.wordpress.org/mercime"><img src="http://0.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=60" class="gravatar" alt="Mercime" /></a> + <a class="web" href="http://profiles.wordpress.org/mercime">Mercime</a> + <span class="title"><?php _e( 'Support Officer', 'buddypress' ); ?></span> + </li> + </ul> + + <h4 class="wp-people-group"><?php _e( 'Core Contributors to BuddyPress 1.7', 'buddypress' ); ?></h4> + <p class="wp-credits-list"> + <a href="http://profiles.wordpress.org/aesqe">aesqe</a>, + <a href="http://profiles.wordpress.org/apeatling">apeatling</a>, + <a href="http://profiles.wordpress.org/borkweb">borkweb</a>, + <a href="http://profiles.wordpress.org/calin">calin</a>, + <a href="http://profiles.wordpress.org/chouf1">chouf1</a>, + <a href="http://profiles.wordpress.org/chrisclayton">chrisclayton</a>, + <a href="http://profiles.wordpress.org/cnorris23">cnorris23</a>, + <a href="http://profiles.wordpress.org/ddean">ddean</a>, + <a href="http://profiles.wordpress.org/DennisSmolek">DennisSmolek</a>, + <a href="http://profiles.wordpress.org/Dianakc">Dianakc</a>, + <a href="http://profiles.wordpress.org/dontdream">dontdream</a>, + <a href="http://profiles.wordpress.org/empireoflight">empireoflight</a>, + <a href="http://profiles.wordpress.org/enej">enej</a>, + <a href="http://profiles.wordpress.org/ethitter">ethitter</a>, + <a href="http://profiles.wordpress.org/fanquake">fanquake</a>, + <a href="http://profiles.wordpress.org/gmax21">gmax21</a>, + <a href="http://profiles.wordpress.org/hnla">hnla</a>, + <a href="http://profiles.wordpress.org/humanshell">humanshell</a>, + <a href="http://profiles.wordpress.org/imath">imath</a>, + <a href="http://profiles.wordpress.org/Jacek">Jacek</a>, + <a href="http://profiles.wordpress.org/jag1989">jag1989</a>, + <a href="http://profiles.wordpress.org/jbobich">jbobich</a>, + <a href="http://profiles.wordpress.org/jkudish">jkudish</a>, + <a href="http://profiles.wordpress.org/jpsb">jpsb</a>, + <a href="http://profiles.wordpress.org/MacPresss">MacPresss</a>, + <a href="http://profiles.wordpress.org/magnus78">magnus78</a>, + <a href="http://profiles.wordpress.org/markjaquith">markjaquith</a>, + <a href="http://profiles.wordpress.org/Maty">Maty</a>, + <a href="http://profiles.wordpress.org/michael.ecklund">michael.ecklund</a>, + <a href="http://profiles.wordpress.org/modemlooper">modemlooper</a>, + <a href="http://profiles.wordpress.org/nacin">nacin</a>, + <a href="http://profiles.wordpress.org/netweb">netweb</a>, + <a href="http://profiles.wordpress.org/rogercoathup">rogercoathup</a>, + <a href="http://profiles.wordpress.org/sboisvert">sboisvert</a>, + <a href="http://profiles.wordpress.org/sbrajesh">sbrajesh</a>, + <a href="http://profiles.wordpress.org/slaFFik">slaFFik</a>, + <a href="http://profiles.wordpress.org/steve7777">steve7777</a>, + <a href="http://profiles.wordpress.org/tiraeth">tiraeth</a>, + <a href="http://profiles.wordpress.org/will_c">will_c</a>, + <a href="http://profiles.wordpress.org/wpdennis">wpdennis</a>, + <a href="http://profiles.wordpress.org/xt4v">xt4v</a>. + </p> + + <div class="return-to-dashboard"> + <a href="<?php echo esc_url( bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), $this->settings_page ) ) ); ?>"><?php _e( 'Go to the BuddyPress Settings page', 'buddypress' ); ?></a> + </div> + + </div> <?php } @@ -503,9 +613,5 @@ endif; // class_exists check * @uses BP_Admin */ function bp_admin() { - global $bp; - - $bp->admin = new BP_Admin(); + buddypress()->admin = new BP_Admin(); } - -?> diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php b/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php index d7208f1457749cd9192b3303851f8d55494abeee..e674ba9278e0e64b18c2a9c2f59c96364c2f392d 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-adminbar.php @@ -43,34 +43,68 @@ function bp_admin_bar_my_account_root() { } add_action( 'admin_bar_menu', 'bp_admin_bar_my_account_root', 100 ); +/** + * Handle the Toolbar/BuddyBar business + * + * @since BuddyPress (1.2) + * + * @global string $wp_version + * @uses bp_get_option() + * @uses is_user_logged_in() + * @uses bp_use_wp_admin_bar() + * @uses show_admin_bar() + * @uses add_action() To hook 'bp_adminbar_logo' to 'bp_adminbar_logo' + * @uses add_action() To hook 'bp_adminbar_login_menu' to 'bp_adminbar_menus' + * @uses add_action() To hook 'bp_adminbar_account_menu' to 'bp_adminbar_menus' + * @uses add_action() To hook 'bp_adminbar_thisblog_menu' to 'bp_adminbar_menus' + * @uses add_action() To hook 'bp_adminbar_random_menu' to 'bp_adminbar_menus' + * @uses add_action() To hook 'bp_core_admin_bar' to 'wp_footer' + * @uses add_action() To hook 'bp_core_admin_bar' to 'admin_footer' + */ +function bp_core_load_admin_bar() { + // Show the Toolbar for logged out users + if ( ! is_user_logged_in() && (int) bp_get_option( 'hide-loggedout-adminbar' ) != 1 ) { + show_admin_bar( true ); + } + + // Hide the WordPress Toolbar and show the BuddyBar + if ( ! bp_use_wp_admin_bar() ) { + + // Keep the WP Toolbar from loading + show_admin_bar( false ); + + // Actions used to build the BP Toolbar + add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' ); + add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 ); + add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 ); + add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 ); + add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 ); + + // Actions used to append BP Toolbar to footer + add_action( 'wp_footer', 'bp_core_admin_bar', 8 ); + add_action( 'admin_footer', 'bp_core_admin_bar' ); + } +} +add_action( 'init', 'bp_core_load_admin_bar', 9 ); + /** * Handle the Toolbar CSS * * @since BuddyPress 1.5 */ function bp_core_load_admin_bar_css() { + global $wp_styles; if ( ! bp_use_wp_admin_bar() || ! is_admin_bar_showing() ) return; + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + // Toolbar styles - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) - $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar.dev.css'; - else - $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar.css'; + $stylesheet = BP_PLUGIN_URL . "bp-core/css/admin-bar{$min}.css"; wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array( 'admin-bar' ), bp_get_version() ); - - if ( !is_rtl() ) - return; - - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) - $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar-rtl.dev.css'; - else - $stylesheet = BP_PLUGIN_URL . 'bp-core/css/admin-bar-rtl.css'; - - wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_admin_bar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), bp_get_version() ); + $wp_styles->add_data( 'bp-admin-bar', 'rtl', true ); + if ( $min ) + $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min ); } -add_action( 'bp_init', 'bp_core_load_admin_bar_css' ); - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php b/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php index 3a5c025c4905fdd34c94e9194cc790f1e408f945..c4f61698d69fa97d8f17daa2974b9983bf67685f 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-avatars.php @@ -11,7 +11,6 @@ if ( !defined( 'ABSPATH' ) ) exit; * Set up the constants we need for avatar support */ function bp_core_set_avatar_constants() { - global $bp; if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) ) define( 'BP_AVATAR_THUMB_WIDTH', 50 ); @@ -29,6 +28,9 @@ function bp_core_set_avatar_constants() { define( 'BP_AVATAR_ORIGINAL_MAX_WIDTH', 450 ); if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) { + + $bp = buddypress(); + if ( !isset( $bp->site_options['fileupload_maxk'] ) ) { define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); // 5mb } else { @@ -41,21 +43,25 @@ function bp_core_set_avatar_constants() { if ( !defined( 'BP_AVATAR_DEFAULT_THUMB' ) ) define( 'BP_AVATAR_DEFAULT_THUMB', BP_PLUGIN_URL . 'bp-core/images/mystery-man-50.jpg' ); + + if ( ! defined( 'BP_SHOW_AVATARS' ) ) { + define( 'BP_SHOW_AVATARS', bp_get_option( 'show_avatars' ) ); + } } add_action( 'bp_init', 'bp_core_set_avatar_constants', 3 ); function bp_core_set_avatar_globals() { - global $bp; + $bp = buddypress(); $bp->avatar = new stdClass; $bp->avatar->thumb = new stdClass; $bp->avatar->full = new stdClass; // Dimensions - $bp->avatar->thumb->width = BP_AVATAR_THUMB_WIDTH; - $bp->avatar->thumb->height = BP_AVATAR_THUMB_HEIGHT; - $bp->avatar->full->width = BP_AVATAR_FULL_WIDTH; - $bp->avatar->full->height = BP_AVATAR_FULL_HEIGHT; + $bp->avatar->thumb->width = BP_AVATAR_THUMB_WIDTH; + $bp->avatar->thumb->height = BP_AVATAR_THUMB_HEIGHT; + $bp->avatar->full->width = BP_AVATAR_FULL_WIDTH; + $bp->avatar->full->height = BP_AVATAR_FULL_HEIGHT; // Upload maximums $bp->avatar->original_max_width = BP_AVATAR_ORIGINAL_MAX_WIDTH; @@ -63,11 +69,15 @@ function bp_core_set_avatar_globals() { // Defaults $bp->avatar->thumb->default = BP_AVATAR_DEFAULT_THUMB; - $bp->avatar->full->default = BP_AVATAR_DEFAULT; + $bp->avatar->full->default = BP_AVATAR_DEFAULT; // These have to be set on page load in order to avoid infinite filter loops at runtime $bp->avatar->upload_path = bp_core_avatar_upload_path(); - $bp->avatar->url = bp_core_avatar_url(); + $bp->avatar->url = bp_core_avatar_url(); + + // Cache the root blog's show_avatars setting, to avoid unnecessary + // calls to switch_to_blog() + $bp->avatar->show_avatars = (bool) BP_SHOW_AVATARS; // Backpat for pre-1.5 if ( ! defined( 'BP_AVATAR_UPLOAD_PATH' ) ) @@ -87,13 +97,19 @@ add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' ); * Fetches an avatar from a BuddyPress object. Supports user/group/blog as * default, but can be extended to include your own custom components too. * - * @global BuddyPress $bp The one true BuddyPress instance * @global $current_blog WordPress global containing information and settings for the current blog being viewed. * @param array $args Determine the output of this function * @return string Formatted HTML <img> element, or raw avatar URL based on $html arg */ function bp_core_fetch_avatar( $args = '' ) { - global $bp, $current_blog; + + // If avatars are disabled for the root site, obey that request and bail + if ( ! buddypress()->avatar->show_avatars ) + return; + + global $current_blog; + + $bp = buddypress(); // Set a few default variables $def_object = 'user'; @@ -101,7 +117,7 @@ function bp_core_fetch_avatar( $args = '' ) { $def_class = 'avatar'; // Set the default variables array - $defaults = array( + $params = wp_parse_args( $args, array( 'item_id' => false, 'object' => $def_object, // user/group/blog/custom type (if you use filters) 'type' => $def_type, // thumb or full @@ -115,10 +131,7 @@ function bp_core_fetch_avatar( $args = '' ) { 'no_grav' => false, // If there is no avatar found, return false instead of a grav? 'html' => true, // Wrap the return img URL in <img /> 'title' => '' // Custom <img> title (string) - ); - - // Compare defaults to passed and extract - $params = wp_parse_args( $args, $defaults ); + ) ); extract( $params, EXTR_SKIP ); /** Set item_id ***********************************************************/ @@ -191,9 +204,6 @@ function bp_core_fetch_avatar( $args = '' ) { if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) { - // Get item name for alt/title tags - $item_name = ''; - switch ( $object ) { case 'blog' : @@ -220,25 +230,35 @@ function bp_core_fetch_avatar( $args = '' ) { if ( empty( $alt ) ) $alt = __( 'Avatar Image', 'buddypress' ); + $html_alt = ' alt="' . esc_attr( $alt ) . '"'; + // Set title tag, if it's been provided - if ( !empty( $title ) ) + if ( !empty( $title ) ) { $title = " title='" . esc_attr( apply_filters( 'bp_core_avatar_title', $title, $item_id, $object, $params ) ) . "'"; + } // Set CSS ID if passed - if ( !empty( $css_id ) ) - $css_id = ' id="' . $css_id . '"'; + if ( !empty( $css_id ) ) { + $css_id = ' id="' . esc_attr( $css_id ) . '"'; + } // Set image width - if ( false !== $width ) + if ( false !== $width ) { $html_width = ' width="' . $width . '"'; - else - $html_width = ( 'thumb' == $type ) ? ' width="' . bp_core_avatar_thumb_width() . '"' : ' width="' . bp_core_avatar_full_width() . '"'; + } elseif ( 'thumb' == $type ) { + $html_width = ' width="' . bp_core_avatar_thumb_width() . '"'; + } else { + $html_width = ' width="' . bp_core_avatar_full_width() . '"'; + } // Set image height - if ( false !== $height ) + if ( false !== $height ) { $html_height = ' height="' . $height . '"'; - else - $html_height = ( 'thumb' == $type ) ? ' height="' . bp_core_avatar_thumb_height() . '"' : ' height="' . bp_core_avatar_full_height() . '"'; + } elseif ( 'thumb' == $type ) { + $html_height = ' height="' . bp_core_avatar_thumb_height() . '"'; + } else { + $html_height = ' height="' . bp_core_avatar_full_height() . '"'; + } // Set img URL and DIR based on prepopulated constants $avatar_loc = new stdClass(); @@ -250,9 +270,9 @@ function bp_core_fetch_avatar( $args = '' ) { $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', ( $avatar_loc->path . $avatar_loc->dir . $item_id ), $item_id, $object, $avatar_dir ); // Add an identifying class - $class .= ' ' . $object . '-' . $item_id . '-avatar'; + $class .= ' ' . $object . '-' . $item_id . '-avatar ' . sanitize_html_class( "avatar-$width" ) . ' photo'; - /**** + /** * Look for uploaded avatar first. Use it if it exists. * Set the file names to search for, to select the full size * or thumbnail image. @@ -314,7 +334,7 @@ function bp_core_fetch_avatar( $args = '' ) { // Return it wrapped in an <img> element if ( true === $html ) { - return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '" alt="' . esc_attr( $alt ) . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); + return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $html_alt . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); // ...or only the URL } else { @@ -356,7 +376,7 @@ function bp_core_fetch_avatar( $args = '' ) { } // Set host based on if using ssl - $host = 'http://www.gravatar.com/avatar/'; + $host = 'http://gravatar.com/avatar/'; if ( is_ssl() ) { $host = 'https://secure.gravatar.com/avatar/'; } @@ -367,18 +387,20 @@ function bp_core_fetch_avatar( $args = '' ) { // Gravatar rating; http://bit.ly/89QxZA $rating = get_option( 'avatar_rating' ); - if ( ! empty( $rating ) ) + if ( ! empty( $rating ) ) { $gravatar .= "&r={$rating}"; + } // No avatar was found, and we've been told not to use a gravatar. } else { $gravatar = apply_filters( "bp_core_default_avatar_$object", BP_PLUGIN_URL . 'bp-core/images/mystery-man.jpg', $params ); } - if ( true === $html ) - return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '" alt="' . esc_attr( $alt ) . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); - else + if ( true === $html ) { + return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $gravatar . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $html_alt . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); + } else { return apply_filters( 'bp_core_fetch_avatar_url', $gravatar ); + } } /** @@ -389,12 +411,10 @@ function bp_core_fetch_avatar( $args = '' ) { * object - the objetc type user, group, blog, etc. * avatar_dir - The directory where the avatars to be uploaded. * - * @global object $bp BuddyPress global settings * @param mixed $args * @return bool Success/failure */ function bp_core_delete_existing_avatar( $args = '' ) { - global $bp; $defaults = array( 'item_id' => false, @@ -409,7 +429,7 @@ function bp_core_delete_existing_avatar( $args = '' ) { if ( 'user' == $object ) $item_id = bp_displayed_user_id(); else if ( 'group' == $object ) - $item_id = $bp->groups->current_group->id; + $item_id = buddypress()->groups->current_group->id; else if ( 'blog' == $object ) $item_id = $current_blog->id; @@ -458,7 +478,6 @@ function bp_core_delete_existing_avatar( $args = '' ) { * It then checks that the file size is within limits, and that it has an accepted file extension (jpg, gif, png). * If everything checks out, crop the image and move it to its real location. * - * @global object $bp BuddyPress global settings * @param array $file The appropriate entry the from $_FILES superglobal. * @param string $upload_dir_filter A filter to be applied to upload_dir * @return bool Success/failure @@ -466,7 +485,6 @@ function bp_core_delete_existing_avatar( $args = '' ) { * @see bp_core_check_avatar_type() */ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { - global $bp; /*** * You may want to hook into this filter if you want to override this function. @@ -478,25 +496,25 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { require_once( ABSPATH . '/wp-admin/includes/file.php' ); $uploadErrors = array( - 0 => __("There is no error, the file uploaded with success", 'buddypress'), - 1 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ), - 2 => __("Your image was bigger than the maximum allowed file size of: ", 'buddypress') . size_format( bp_core_avatar_original_max_filesize() ), - 3 => __("The uploaded file was only partially uploaded", 'buddypress'), - 4 => __("No file was uploaded", 'buddypress'), - 6 => __("Missing a temporary folder", 'buddypress') + 0 => __( 'The image was uploaded successfully', 'buddypress' ), + 1 => __( 'The image exceeds the maximum allowed file size of: ', 'buddypress' ) . size_format( bp_core_avatar_original_max_filesize() ), + 2 => __( 'The image exceeds the maximum allowed file size of: ', 'buddypress' ) . size_format( bp_core_avatar_original_max_filesize() ), + 3 => __( 'The uploaded file was only partially uploaded.', 'buddypress' ), + 4 => __( 'The image was not uploaded.', 'buddypress' ), + 6 => __( 'Missing a temporary folder.', 'buddypress' ) ); - if ( !bp_core_check_avatar_upload( $file ) ) { + if ( ! bp_core_check_avatar_upload( $file ) ) { bp_core_add_message( sprintf( __( 'Your upload failed, please try again. Error was: %s', 'buddypress' ), $uploadErrors[$file['file']['error']] ), 'error' ); return false; } - if ( !bp_core_check_avatar_size( $file ) ) { - bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress'), size_format( bp_core_avatar_original_max_filesize() ) ), 'error' ); + if ( ! bp_core_check_avatar_size( $file ) ) { + bp_core_add_message( sprintf( __( 'The file you uploaded is too big. Please upload a file under %s', 'buddypress' ), size_format( bp_core_avatar_original_max_filesize() ) ), 'error' ); return false; } - if ( !bp_core_check_avatar_type( $file ) ) { + if ( ! bp_core_check_avatar_type( $file ) ) { bp_core_add_message( __( 'Please upload only JPG, GIF or PNG photos.', 'buddypress' ), 'error' ); return false; } @@ -504,8 +522,14 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { // Filter the upload location add_filter( 'upload_dir', $upload_dir_filter, 10, 0 ); + $bp = buddypress(); + $bp->avatar_admin->original = wp_handle_upload( $file['file'], array( 'action'=> 'bp_avatar_upload' ) ); + // Remove the upload_dir filter, so that other upload URLs on the page + // don't break + remove_filter( 'upload_dir', $upload_dir_filter, 10, 0 ); + // Move the file to the correct upload location. if ( !empty( $bp->avatar_admin->original['error'] ) ) { bp_core_add_message( sprintf( __( 'Upload Failed! Error was: %s', 'buddypress' ), $bp->avatar_admin->original['error'] ), 'error' ); @@ -524,17 +548,19 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { $editor->set_quality( 100 ); $resized = $editor->resize( bp_core_avatar_original_max_width(), bp_core_avatar_original_max_width(), false ); - if ( ! is_wp_error( $resized ) ) + if ( ! is_wp_error( $resized ) ) { $thumb = $editor->save( $editor->generate_filename() ); - else + } else { $error = $resized; + } // Check for thumbnail creation errors - if ( false === $error && is_wp_error( $thumb ) ) + if ( false === $error && is_wp_error( $thumb ) ) { $error = $thumb; + } + // Thumbnail is good so proceed if ( false === $error ) { - // Thumbnail is good so proceed $bp->avatar_admin->resized = $thumb; } @@ -548,10 +574,13 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { } } + if ( ! isset( $bp->avatar_admin->image ) ) + $bp->avatar_admin->image = new stdClass(); + // We only want to handle one image after resize. - if ( empty( $bp->avatar_admin->resized ) ) + if ( empty( $bp->avatar_admin->resized ) ) { $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->original['file'] ); - else { + } else { $bp->avatar_admin->image->dir = str_replace( bp_core_avatar_upload_path(), '', $bp->avatar_admin->resized['path'] ); @unlink( $bp->avatar_admin->original['file'] ); } @@ -586,7 +615,7 @@ function bp_core_avatar_handle_upload( $file, $upload_dir_filter ) { */ function bp_core_avatar_handle_crop( $args = '' ) { - $defaults = array( + $r = wp_parse_args( $args, array( 'object' => 'user', 'avatar_dir' => 'avatars', 'item_id' => false, @@ -595,9 +624,7 @@ function bp_core_avatar_handle_crop( $args = '' ) { 'crop_h' => bp_core_avatar_full_height(), 'crop_x' => 0, 'crop_y' => 0 - ); - - $r = wp_parse_args( $args, $defaults ); + ) ); /*** * You may want to hook into this filter if you want to override this function. @@ -608,7 +635,7 @@ function bp_core_avatar_handle_crop( $args = '' ) { extract( $r, EXTR_SKIP ); - if ( !$original_file ) + if ( empty( $original_file ) ) return false; $original_file = bp_core_avatar_upload_path() . $original_file; @@ -616,10 +643,11 @@ function bp_core_avatar_handle_crop( $args = '' ) { if ( !file_exists( $original_file ) ) return false; - if ( !$item_id ) + if ( empty( $item_id ) ) { $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', dirname( $original_file ), $item_id, $object, $avatar_dir ); - else + } else { $avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir ); + } if ( !file_exists( $avatar_folder_dir ) ) return false; @@ -631,22 +659,28 @@ function bp_core_avatar_handle_crop( $args = '' ) { bp_core_delete_existing_avatar( array( 'object' => $object, 'avatar_path' => $avatar_folder_dir ) ); // Make sure we at least have a width and height for cropping - if ( !(int) $crop_w ) + if ( empty( $crop_w ) ) { $crop_w = bp_core_avatar_full_width(); + } - if ( !(int) $crop_h ) + if ( empty( $crop_h ) ) { $crop_h = bp_core_avatar_full_height(); + } + + // Get the file extension + $data = @getimagesize( $original_file ); + $ext = $data['mime'] == 'image/png' ? 'png' : 'jpg'; // Set the full and thumb filenames - $full_filename = wp_hash( $original_file . time() ) . '-bpfull.jpg'; - $thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.jpg'; + $full_filename = wp_hash( $original_file . time() ) . '-bpfull.' . $ext; + $thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.' . $ext; // Crop the image - $full_cropped = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_full_width(), bp_core_avatar_full_height(), false, $avatar_folder_dir . '/' . $full_filename ); + $full_cropped = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_full_width(), bp_core_avatar_full_height(), false, $avatar_folder_dir . '/' . $full_filename ); $thumb_cropped = wp_crop_image( $original_file, (int) $crop_x, (int) $crop_y, (int) $crop_w, (int) $crop_h, bp_core_avatar_thumb_width(), bp_core_avatar_thumb_height(), false, $avatar_folder_dir . '/' . $thumb_filename ); // Check for errors - if ( ! $full_cropped || ! $thumb_cropped || is_wp_error( $full_cropped ) || is_wp_error( $thumb_cropped ) ) + if ( empty( $full_cropped ) || empty( $thumb_cropped ) || is_wp_error( $full_cropped ) || is_wp_error( $thumb_cropped ) ) return false; // Remove the original @@ -677,23 +711,27 @@ function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '' return $avatar; // If passed an object, assume $user->user_id - if ( is_object( $user ) ) + if ( is_object( $user ) ) { $id = $user->user_id; // If passed a number, assume it was a $user_id - else if ( is_numeric( $user ) ) + } else if ( is_numeric( $user ) ) { $id = $user; // If passed a string and that string returns a user, get the $id - else if ( is_string( $user ) && ( $user_by_email = get_user_by( 'email', $user ) ) ) + } elseif ( is_string( $user ) && ( $user_by_email = get_user_by( 'email', $user ) ) ) { $id = $user_by_email->ID; + } // If somehow $id hasn't been assigned, return the result of get_avatar - if ( empty( $id ) ) + if ( empty( $id ) ) { return !empty( $avatar ) ? $avatar : $default; + } - if ( !$alt ) + // Image alt tag + if ( empty( $alt ) ) { $alt = sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $id ) ); + } // Let BuddyPress handle the fetching of the avatar $bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) ); @@ -753,7 +791,7 @@ function bp_core_check_avatar_type($file) { * @return string Absolute path to WP upload directory */ function bp_core_avatar_upload_path() { - global $bp; + $bp = buddypress(); // See if the value has already been calculated and stashed in the $bp global if ( isset( $bp->avatar->upload_path ) ) { @@ -799,7 +837,7 @@ function bp_core_avatar_upload_path() { * @return string Full URL to current upload location */ function bp_core_avatar_url() { - global $bp; + $bp = buddypress(); // See if the value has already been calculated and stashed in the $bp global if ( isset( $bp->avatar->url ) ) { @@ -810,11 +848,16 @@ function bp_core_avatar_url() { if ( defined( 'BP_AVATAR_URL' ) ) { $baseurl = BP_AVATAR_URL; } else { + // If multisite, and we're not on the BP root blog, switch to it + if ( is_multisite() ) { + switch_to_blog( bp_get_root_blog_id() ); + } + // Get upload directory information from current site $upload_dir = wp_upload_dir(); // Directory does not exist and cannot be created - if ( !empty( $upload_dir['error'] ) ) { + if ( ! empty( $upload_dir['error'] ) ) { $baseurl = ''; } else { @@ -824,10 +867,10 @@ function bp_core_avatar_url() { if ( is_ssl() ) $baseurl = str_replace( 'http://', 'https://', $baseurl ); - // If multisite, and current blog does not match root blog, make adjustments - if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() ) - $baseurl = trailingslashit( get_blog_option( bp_get_root_blog_id(), 'home' ) ) . get_blog_option( bp_get_root_blog_id(), 'upload_path' ); } + + // Will bail if not switched + restore_current_blog(); } // Stash in $bp for later use @@ -867,8 +910,7 @@ function bp_get_user_has_avatar( $user_id = 0 ) { * @return int $dim The dimension */ function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) { - global $bp; - + $bp = buddypress(); $dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false; return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w ); @@ -931,9 +973,7 @@ function bp_core_avatar_full_height() { * @return int The width */ function bp_core_avatar_original_max_width() { - global $bp; - - return apply_filters( 'bp_core_avatar_original_max_width', (int) $bp->avatar->original_max_width ); + return apply_filters( 'bp_core_avatar_original_max_width', (int) buddypress()->avatar->original_max_width ); } /** @@ -945,9 +985,7 @@ function bp_core_avatar_original_max_width() { * @return int The filesize */ function bp_core_avatar_original_max_filesize() { - global $bp; - - return apply_filters( 'bp_core_avatar_original_max_filesize', (int) $bp->avatar->original_max_filesize ); + return apply_filters( 'bp_core_avatar_original_max_filesize', (int) buddypress()->avatar->original_max_filesize ); } /** @@ -959,9 +997,7 @@ function bp_core_avatar_original_max_filesize() { * @return int The URL of the default avatar */ function bp_core_avatar_default() { - global $bp; - - return apply_filters( 'bp_core_avatar_default', $bp->avatar->full->default ); + return apply_filters( 'bp_core_avatar_default', buddypress()->avatar->full->default ); } /** @@ -973,10 +1009,5 @@ function bp_core_avatar_default() { * @return int The URL of the default avatar thumb */ function bp_core_avatar_default_thumb() { - global $bp; - - return apply_filters( 'bp_core_avatar_thumb', $bp->avatar->thumb->default ); + return apply_filters( 'bp_core_avatar_thumb', buddypress()->avatar->thumb->default ); } - - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php b/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php index 81adbe09d65296fa698cd6bf68f2e7370f818a16..5e5e26225cf782cc34b89ccc30c4a97195d23fa7 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-buddybar.php @@ -373,8 +373,8 @@ function bp_nav_item_has_subnav( $nav_item = '' ) { * Removes a navigation item from the sub navigation array used in BuddyPress themes. * * @package BuddyPress Core - * @param $parent_id The id of the parent navigation item. - * @param $slug The slug of the sub navigation item. + * @param int $parent_id The id of the parent navigation item. + * @param bool|string false if the parent item doesn't exist or $slug the slug of the sub navigation item. */ function bp_core_remove_nav_item( $parent_id ) { global $bp; @@ -386,6 +386,9 @@ function bp_core_remove_nav_item( $parent_id ) { } } + if ( empty( $bp->bp_nav[ $parent_id ] ) ) + return false; + if ( $function = $bp->bp_nav[$parent_id]['screen_function'] ) { if ( is_object( $function[0] ) ) { remove_action( 'bp_screens', array( &$function[0], $function[1] ), 3 ); @@ -480,7 +483,7 @@ function bp_adminbar_login_menu() { // Show "Sign Up" link if user registrations are allowed if ( bp_get_signup_allowed() ) - echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>'; + echo '<li class="bp-signup no-arrow"><a href="' . bp_get_signup_page() . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>'; } @@ -609,84 +612,25 @@ function bp_get_admin_bar_pref( $context, $user = 0 ) { return 'true' === $pref; } -/** - * Handle the Toolbar/BuddyBar business - * - * @since BuddyPress (1.2) - * - * @global string $wp_version - * @uses bp_get_option() - * @uses is_user_logged_in() - * @uses bp_use_wp_admin_bar() - * @uses show_admin_bar() - * @uses add_action() To hook 'bp_adminbar_logo' to 'bp_adminbar_logo' - * @uses add_action() To hook 'bp_adminbar_login_menu' to 'bp_adminbar_menus' - * @uses add_action() To hook 'bp_adminbar_account_menu' to 'bp_adminbar_menus' - * @uses add_action() To hook 'bp_adminbar_thisblog_menu' to 'bp_adminbar_menus' - * @uses add_action() To hook 'bp_adminbar_random_menu' to 'bp_adminbar_menus' - * @uses add_action() To hook 'bp_core_admin_bar' to 'wp_footer' - * @uses add_action() To hook 'bp_core_admin_bar' to 'admin_footer' - */ -function bp_core_load_admin_bar() { - global $wp_version; - - // Don't show if Toolbar is disabled for non-logged in users - if ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && ! is_user_logged_in() ) - return; - - // Show the WordPress Toolbar - if ( bp_use_wp_admin_bar() && $wp_version >= 3.1 ) { - - // Respect user's Toolbar display preferences - if ( is_user_logged_in() && ( bp_get_admin_bar_pref( 'front', bp_loggedin_user_id() ) || bp_get_admin_bar_pref( 'admin', bp_loggedin_user_id() ) ) ) - return; - - show_admin_bar( true ); - - // Hide the WordPress Toolbar - } elseif ( !bp_use_wp_admin_bar() ) { - // Keep the WP Toolbar from loading - show_admin_bar( false ); - - // Actions used to build the BP Toolbar - add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' ); - add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 ); - add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 ); - add_action( 'bp_adminbar_menus', 'bp_adminbar_thisblog_menu', 6 ); - add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 ); - - // Actions used to append BP Toolbar to footer - add_action( 'wp_footer', 'bp_core_admin_bar', 8 ); - add_action( 'admin_footer', 'bp_core_admin_bar' ); - } -} - /** * Handle the BuddyBar CSS */ function bp_core_load_buddybar_css() { + global $wp_styles; + if ( bp_use_wp_admin_bar() || ( (int) bp_get_option( 'hide-loggedout-adminbar' ) && !is_user_logged_in() ) || ( defined( 'BP_DISABLE_ADMIN_BAR' ) && BP_DISABLE_ADMIN_BAR ) ) return; + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + if ( file_exists( get_stylesheet_directory() . '/_inc/css/adminbar.css' ) ) // Backwards compatibility $stylesheet = get_stylesheet_directory_uri() . '/_inc/css/adminbar.css'; - elseif ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) - $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar.dev.css'; else - $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar.css'; + $stylesheet = BP_PLUGIN_URL . "bp-core/css/buddybar{$min}.css"; - wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_admin_bar_css', $stylesheet ), array(), bp_get_version() ); - - if ( !is_rtl() ) - return; - - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) - $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar-rtl.dev.css'; - else - $stylesheet = BP_PLUGIN_URL . 'bp-core/css/buddybar-rtl.css'; - - wp_enqueue_style( 'bp-admin-bar-rtl', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array( 'bp-admin-bar' ), bp_get_version() ); + wp_enqueue_style( 'bp-admin-bar', apply_filters( 'bp_core_buddybar_rtl_css', $stylesheet ), array(), bp_get_version() ); + $wp_styles->add_data( 'bp-admin-bar', 'rtl', true ); + if ( $min ) + $wp_styles->add_data( 'bp-admin-bar', 'suffix', $min ); } add_action( 'bp_init', 'bp_core_load_buddybar_css' ); - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-cache.php b/wp-content/plugins/buddypress/bp-core/bp-core-cache.php index 8b4d566586c6b181659608973cb822c97df8dee7..1c0ba2d9450cb460f118305cbc909db1f4b1523b 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-cache.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-cache.php @@ -16,7 +16,7 @@ if ( !defined( 'ABSPATH' ) ) exit; * @package BuddyPress Core */ function bp_core_clear_cache() { - global $cache_path, $cache_filename; + global $cache_path; if ( function_exists( 'prune_super_cache' ) ) { do_action( 'bp_core_clear_cache' ); @@ -30,8 +30,9 @@ function bp_core_clear_cache() { * @package BuddyPress Core */ function bp_core_add_global_group() { - wp_cache_init(); - wp_cache_add_global_groups( array( 'bp' ) ); + if ( function_exists( 'wp_cache_add_global_groups' ) ) { + wp_cache_add_global_groups( array( 'bp' ) ); + } } add_action( 'bp_loaded', 'bp_core_add_global_group' ); @@ -60,7 +61,7 @@ add_action( 'deleted_user', 'bp_core_clear_member_count_caches /** * Update the metadata cache for the specified objects. * - * @since 1.6 + * @since BuddyPress (1.6) * @global $wpdb WordPress database object for queries. * @param array $args See $defaults definition for more details * @return mixed Metadata cache for the specified objects, or false on failure. @@ -102,7 +103,7 @@ function bp_update_meta_cache( $args = array() ) { // Get meta info $id_list = join( ',', $object_ids ); - $meta_list = $wpdb->get_results( "SELECT $object_column, meta_key, meta_value FROM $meta_table WHERE $object_column IN ($id_list)", ARRAY_A ); + $meta_list = $wpdb->get_results( $wpdb->prepare( "SELECT {$object_column}, meta_key, meta_value FROM {$meta_table} WHERE {$object_column} IN ($id_list)", $object_type ), ARRAY_A ); if ( !empty( $meta_list ) ) { foreach ( $meta_list as $metarow ) { @@ -132,5 +133,3 @@ function bp_update_meta_cache( $args = array() ) { return $cache; } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-caps.php b/wp-content/plugins/buddypress/bp-core/bp-core-caps.php index bbdbbc1a8f238945e7bf64aaccaa2dc065829d0e..b0f0cc60ca6bf1eea2dc05e0bc63f345e289f9bc 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-caps.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-caps.php @@ -10,41 +10,6 @@ // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; -/** - * Adds BuddyPress-specific user roles. - * - * This is called on plugin activation. - * - * @since BuddyPress (1.6) - * - * @uses get_option() To get the default role - * @uses get_role() To get the default role object - * @uses add_role() To add our own roles - * @uses do_action() Calls 'bp_add_roles' - */ -function bp_add_roles() { - - // Get new role names - $moderator_role = bp_get_moderator_role(); - $participant_role = bp_get_participant_role(); - - // Add the Moderator role and add the default role caps. - // Mod caps are added by the bp_add_caps() function - $default = get_role( get_option( 'default_role' ) ); - - // If role does not exist, default to read cap - if ( empty( $default->capabilities ) ) - $default->capabilities = array( 'read' ); - - // Moderators are default role + community moderating caps in bp_add_caps() - add_role( $moderator_role, 'Community Moderator', $default->capabilities ); - - // Forum Subscribers are auto added to sites with global communities - add_role( $participant_role, 'Community Participant', $default->capabilities ); - - do_action( 'bp_add_roles' ); -} - /** * Adds capabilities to WordPress user roles. * @@ -63,15 +28,10 @@ function bp_add_caps() { if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); - // Loop through available roles - foreach( $wp_roles->roles as $role => $details ) { - - // Load this role - $this_role = get_role( $role ); - - // Loop through caps for this role and remove them - foreach ( bp_get_caps_for_role( $role ) as $cap ) { - $this_role->add_cap( $cap ); + // Loop through available roles and add them + foreach( $wp_roles->role_objects as $role ) { + foreach ( bp_get_caps_for_role( $role->name ) as $cap ) { + $role->add_cap( $cap ); } } @@ -96,46 +56,16 @@ function bp_remove_caps() { if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); - // Loop through available roles - foreach( $wp_roles->roles as $role => $details ) { - - // Load this role - $this_role = get_role( $role ); - - // Loop through caps for this role and remove them - foreach ( bp_get_caps_for_role( $role ) as $cap ) { - $this_role->remove_cap( $cap ); + // Loop through available roles and remove them + foreach( $wp_roles->role_objects as $role ) { + foreach ( bp_get_caps_for_role( $role->name ) as $cap ) { + $role->remove_cap( $cap ); } } do_action( 'bp_remove_caps' ); } -/** - * Removes BuddyPress-specific user roles. - * - * This is called on plugin deactivation. - * - * @since BuddyPress (1.6) - * - * @uses remove_role() To remove our roles - * @uses do_action() Calls 'bp_remove_roles' - */ -function bp_remove_roles() { - - // Get new role names - $moderator_role = bp_get_moderator_role(); - $participant_role = bp_get_participant_role(); - - // Remove the Moderator role - remove_role( $moderator_role ); - - // Remove the Moderator role - remove_role( $participant_role ); - - do_action( 'bp_remove_roles' ); -} - /** * Maps community caps to built in WordPress caps * @@ -183,10 +113,6 @@ function bp_get_community_caps() { */ function bp_get_caps_for_role( $role = '' ) { - // Get new role names - $moderator_role = bp_get_moderator_role(); - $participant_role = bp_get_participant_role(); - // Which role are we looking for? switch ( $role ) { @@ -199,23 +125,10 @@ function bp_get_caps_for_role( $role = '' ) { break; - // Moderator - case $moderator_role : - $caps = array( - // Misc - 'bp_moderate', - ); - - break; - - // WordPress Core Roles case 'editor' : case 'author' : case 'contributor' : case 'subscriber' : - - // BuddyPress Participant Role - case $participant_role : default : $caps = array(); break; @@ -230,7 +143,7 @@ function bp_get_caps_for_role( $role = '' ) { * * @since BuddyPress (1.6) * - * @global BuddyPress $bbp + * @global BuddyPress $bp * * @uses is_multisite() * @uses bp_allow_global_access() @@ -241,130 +154,22 @@ function bp_get_caps_for_role( $role = '' ) { * * @return If user is not spam/deleted or is already capable */ -function bp_global_access_auto_role() { +function bp_set_current_user_default_role() { - // Bail if not multisite or community is not global - if ( !is_multisite() || !bp_allow_global_access() ) + // Bail if not multisite or not root blog + if ( ! is_multisite() || ! bp_is_root_blog() ) return; - // Bail if user is not active - if ( bp_is_user_inactive() ) - return; - - // Bail if user is not logged in - if ( !is_user_logged_in() ) - return; - - // Give the user the 'Forum Participant' role - if ( current_user_can( 'bp_masked' ) ) { - global $bbp; - - // Get the default role - $default_role = bp_get_participant_role(); - - // Set the current users default role - $bbp->current_user->set_role( $default_role ); - } -} - -/** - * The participant role for registered users without roles - * - * This is primarily for multisite compatibility when users without roles on - * sites that have global communities enabled - * - * @since BuddyPress (1.6) - * - * @param string $role - * @uses apply_filters() - * @return string - */ -function bp_get_participant_role() { - - // Hardcoded participant role - $role = 'bp_participant'; - - // Allow override - return apply_filters( 'bp_get_participant_role', $role ); -} - -/** - * The moderator role for BuddyPress users - * - * @since BuddyPress (1.6) - * - * @param string $role - * @uses apply_filters() - * @return string - */ -function bp_get_moderator_role() { - - // Hardcoded moderated user role - $role = 'bp_moderator'; - - // Allow override - return apply_filters( 'bp_get_moderator_role', $role ); -} - -/** - * Add the default role and mapped BuddyPress caps to the current user if needed - * - * This function will bail if the community is not global in a multisite - * installation of WordPress, or if the user is marked as spam or deleted. - * - * @since BuddyPress (1.6) - * - * @uses is_multisite() - * @uses bp_allow_global_access() - * @uses bp_is_user_inactive() - * @uses is_user_logged_in() - * @uses current_user_can() - * @uses get_option() - * @uses bp_get_caps_for_role() - * - * @global BuddyPress $bbp - * @return If not multisite, not global, or user is deleted/spammed - */ -function bp_global_access_role_mask() { - - // Bail if not multisite or community is not global - if ( !is_multisite() || !bp_allow_global_access() ) + // Bail if user is not logged in or already a member + if ( ! is_user_logged_in() || is_user_member_of_blog() ) return; - // Bail if user is marked as spam or is deleted + // Bail if user is not active if ( bp_is_user_inactive() ) return; - // Normal user is logged in but has no caps - if ( is_user_logged_in() && !current_user_can( 'read' ) ) { - - // Define local variable - $mapped_meta_caps = array(); - - // Assign user the minimal participant role to map caps to - $default_role = bp_get_participant_role(); - - // Get BuddyPress caps for the default role - $caps_for_role = bp_get_caps_for_role( $default_role ); - - // Set all caps to true - foreach ( $caps_for_role as $cap ) { - $mapped_meta_caps[$cap] = true; - } - - // Add 'read' cap just in case - $mapped_meta_caps['read'] = true; - $mapped_meta_caps['bp_masked'] = true; - - // Allow global access caps to be manipulated - $mapped_meta_caps = apply_filters( 'bp_global_access_mapped_meta_caps', $mapped_meta_caps ); - - // Assign the role and mapped caps to the current user - global $bp; - $bp->current_user->roles[0] = $default_role; - $bp->current_user->caps = $mapped_meta_caps; - $bp->current_user->allcaps = $mapped_meta_caps; - } + // Set the current users default role + buddypress()->current_user->set_role( bp_get_option( 'default_role', 'subscriber' ) ); } /** @@ -404,23 +209,82 @@ function bp_current_user_can( $capability, $blog_id = 0 ) { * * @since BuddyPress (1.6) * @see WP_User::has_cap() + * @access private * * @param array $allcaps The caps that WP associates with the given role * @param array $caps The caps being tested for in WP_User::has_cap() * @param array $args Miscellaneous arguments passed to the user_has_cap filter * @return array $allcaps The user's cap list, with 'bp_moderate' appended, if relevant */ -function _bp_enforce_bp_moderate_cap_for_admins( $allcaps, $caps, $args ) { - if ( in_array( 'bp_moderate', $caps ) && // We only care if checking for bp_moderate - !in_array( 'do_not_allow', $caps ) && // 'do_not_allow' overrides everything else - !is_multisite() && // Check not necessary on Multisite - isset( $allcaps['delete_users'] ) ) // Mimicking WP's check for Administrator status - { - $allcaps['bp_moderate'] = true; - } +function _bp_enforce_bp_moderate_cap_for_admins( $caps = array(), $cap = '', $user_id = 0, $args = array() ) { + + // Bail if not checking the 'bp_moderate' cap + if ( 'bp_moderate' !== $cap ) + return $caps; + + // Bail if BuddyPress is not network activated + if ( bp_is_network_activated() ) + return $caps; + + // Never trust inactive users + if ( bp_is_user_inactive( $user_id ) ) + return $caps; + + // Only users that can 'manage_options' on this site can 'bp_moderate' + return array( 'manage_options' ); +} +add_filter( 'map_meta_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 4 ); + +/** Deprecated ****************************************************************/ + +/** + * Adds BuddyPress-specific user roles. + * + * This is called on plugin activation. + * + * @since BuddyPress (1.6) + * + * @deprecated since version 1.7 + */ +function bp_add_roles() { + _doing_it_wrong( 'bp_add_roles', __( 'Special community roles no longer exist. Use mapped capabilities instead', 'buddypress' ), '1.7' ); +} + +/** + * Removes BuddyPress-specific user roles. + * + * This is called on plugin deactivation. + * + * @since BuddyPress (1.6) + * + * @deprecated since version 1.7 + */ +function bp_remove_roles() { + _doing_it_wrong( 'bp_remove_roles', __( 'Special community roles no longer exist. Use mapped capabilities instead', 'buddypress' ), '1.7' ); +} - return $allcaps; + +/** + * The participant role for registered users without roles + * + * This is primarily for multisite compatibility when users without roles on + * sites that have global communities enabled + * + * @since BuddyPress (1.6) + * + * @deprecated since version 1.7 + */ +function bp_get_participant_role() { + _doing_it_wrong( 'bp_get_participant_role', __( 'Special community roles no longer exist. Use mapped capabilities instead', 'buddypress' ), '1.7' ); } -add_filter( 'user_has_cap', '_bp_enforce_bp_moderate_cap_for_admins', 10, 3 ); -?> +/** + * The moderator role for BuddyPress users + * + * @since BuddyPress (1.6) + * + * @deprecated since version 1.7 + */ +function bp_get_moderator_role() { + _doing_it_wrong( 'bp_get_moderator_role', __( 'Special community roles no longer exist. Use mapped capabilities instead', 'buddypress' ), '1.7' ); +} diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php b/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php index 973ae4e70869506d008a63283666245deb11ada6..d20ba424398ccb7f2a67abb27d76308c0495e8dc 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-catchuri.php @@ -19,9 +19,6 @@ if ( !defined( 'ABSPATH' ) ) exit; * add new re-write rules. Custom components are able to use their own custom * URI structures with very little work. * - * @package BuddyPress Core - * @since BuddyPress (1.0) - * * The URI's are broken down as follows: * - http:// domain.com / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ... * - OUTSIDE ROOT: http:// domain.com / sites / buddypress / members / andy / [current_component] / [current_action] / [action_variables] / [action_variables] / ... @@ -32,6 +29,8 @@ if ( !defined( 'ABSPATH' ) ) exit; * - $bp->current_action: string 'edit' * - $bp->action_variables: array ['group', 5] * + * @package BuddyPress Core + * @since BuddyPress (1.0) */ function bp_core_set_uri_globals() { global $bp, $current_blog, $wp_rewrite; @@ -333,8 +332,6 @@ function bp_core_enable_root_profiles() { } /** - * bp_core_load_template() - * * Load a specific template file with fallback support. * * Example: @@ -372,13 +369,11 @@ function bp_core_load_template( $templates ) { $post = $wp_query->queried_object; } - // Define local variables - $located_template = false; - $filtered_templates = array(); - // Fetch each template and add the php suffix - foreach ( (array) $templates as $template ) + $filtered_templates = array(); + foreach ( (array) $templates as $template ) { $filtered_templates[] = $template . '.php'; + } // Filter the template locations so that plugins can alter where they are located $located_template = apply_filters( 'bp_located_template', locate_template( (array) $filtered_templates, false ), $filtered_templates ); @@ -386,18 +381,34 @@ function bp_core_load_template( $templates ) { // Template was located, lets set this as a valid page and not a 404. status_header( 200 ); - $wp_query->is_page = $wp_query->is_singular = true; - $wp_query->is_404 = false; + $wp_query->is_page = true; + $wp_query->is_singular = true; + $wp_query->is_404 = false; do_action( 'bp_core_pre_load_template', $located_template ); load_template( apply_filters( 'bp_load_template', $located_template ) ); do_action( 'bp_core_post_load_template', $located_template ); - } - // Kill any other output after this. - die; + // Kill any other output after this. + exit(); + + // No template found, so setup theme compatability + // @todo Some other 404 handling if theme compat doesn't kick in + } else { + + // We know where we are, so reset important $wp_query bits here early. + // The rest will be done by bp_theme_compat_reset_post() later. + if ( is_buddypress() ) { + status_header( 200 ); + $wp_query->is_page = true; + $wp_query->is_singular = true; + $wp_query->is_404 = false; + } + + do_action( 'bp_setup_theme_compat' ); + } } /** @@ -449,7 +460,7 @@ function bp_core_no_access( $args = '' ) { $redirect_url .= $_SERVER['REQUEST_URI']; $defaults = array( - 'mode' => '1', // 1 = $root, 2 = wp-login.php + 'mode' => 2, // 1 = $root, 2 = wp-login.php 'redirect' => $redirect_url, // the URL you get redirected to when a user successfully logs in 'root' => bp_get_root_domain(), // the landing page you get redirected to when a user doesn't have access 'message' => __( 'You must log in to access the page you requested.', 'buddypress' ) @@ -462,11 +473,11 @@ function bp_core_no_access( $args = '' ) { /** * @ignore Ignore these filters and use 'bp_core_no_access' above */ - $mode = apply_filters( 'bp_no_access_mode', $mode, $root, $redirect, $message ); - $redirect = apply_filters( 'bp_no_access_redirect', $redirect, $root, $message, $mode ); - $root = apply_filters( 'bp_no_access_root', $root, $redirect, $message, $mode ); - $message = apply_filters( 'bp_no_access_message', $message, $root, $redirect, $mode ); - $root = trailingslashit( $root ); + $mode = apply_filters( 'bp_no_access_mode', $mode, $root, $redirect, $message ); + $redirect = apply_filters( 'bp_no_access_redirect', $redirect, $root, $message, $mode ); + $root = apply_filters( 'bp_no_access_root', $root, $redirect, $message, $mode ); + $message = apply_filters( 'bp_no_access_message', $message, $root, $redirect, $mode ); + $root = trailingslashit( $root ); switch ( $mode ) { @@ -526,7 +537,7 @@ add_action( 'login_form_bpnoaccess', 'bp_core_no_access_wp_login_error' ); * general possible versions of the URL - eg, example.com/groups/mygroup/ instead of * example.com/groups/mygroup/home/ * - * @since 1.6 + * @since BuddyPress (1.6) * @see BP_Members_Component::setup_globals() where $bp->canonical_stack['base_url'] and * ['component'] may be set * @see bp_core_new_nav_item() where $bp->canonical_stack['action'] may be set @@ -579,7 +590,7 @@ function bp_redirect_canonical() { /** * Output rel=canonical header tag for BuddyPress content * - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_rel_canonical() { $canonical_url = bp_get_canonical_url(); @@ -663,7 +674,7 @@ function bp_get_requested_url() { $bp->canonical_stack['requested_url'] .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; } - return $bp->canonical_stack['requested_url']; + return apply_filters( 'bp_get_requested_url', $bp->canonical_stack['requested_url'] ); } /** @@ -705,7 +716,7 @@ add_action( 'bp_init', '_bp_maybe_remove_redirect_canonical' ); * This function will be removed in a later version of BuddyPress. Plugins * (and plugin authors!) should ignore it. * - * @since 1.6.1 + * @since BuddyPress (1.6.1) * * @link http://buddypress.trac.wordpress.org/ticket/4329 * @link http://buddypress.trac.wordpress.org/ticket/4415 @@ -725,7 +736,7 @@ add_action( 'template_redirect', '_bp_rehook_maybe_redirect_404', 1 ); * This function should be considered temporary, and may be removed without * notice in future versions of BuddyPress. * - * @since 1.6 + * @since BuddyPress (1.6) */ function _bp_maybe_remove_rel_canonical() { if ( ! bp_is_blog_page() && ! is_404() ) { @@ -734,4 +745,3 @@ function _bp_maybe_remove_rel_canonical() { } } add_action( 'wp_head', '_bp_maybe_remove_rel_canonical', 8 ); -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-classes.php b/wp-content/plugins/buddypress/bp-core/bp-core-classes.php index 75e622635faab4ff073bec5282a0a605bbf19334..d2c18bad3bb4c439dff0b97a86b55f6e1e17e485 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-classes.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-classes.php @@ -1,7 +1,548 @@ <?php + // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; +/** + * BuddyPress User Query class + * + * Used for querying users in a BuddyPress context, in situations where + * WP_User_Query won't do the trick: Member directories, the Friends component, + * etc. + * + * Accepted parameters: + * type - Determines sort order. Select from 'newest', 'active', + * 'online', 'random', 'popular', 'alphabetical' + * per_page - Number of results to return + * page - Page offset (together with per_page) + * user_id - Pass a single numeric user id to limit results to + * friends of that user. Requires the Friends component + * search_terms - Terms to search by. Search happens across xprofile + * fields. Requires XProfile component + * include - An array or comma-separated list of user ids. Results + * will be limited to users in this list + * exclude - An array or comma-separated list of user ids. Results + * will not include any users in this list + * user_ids - An array or comma-separated list of user ids. When + * this parameter is passed, it will override all other + * parameters; BP User objects will be constructed using + * these IDs only + * meta_key - Limit results to users that have usermeta associated + * with this meta_key. Usually used with meta_value + * meta_value - When used with meta_key, limits results to users whose + * usermeta value associated with meta_key matches + * meta_value + * populate_extras - Boolean. True if you want to fetch extra metadata about + * returned users, such as total group and friend counts + * count_total - Determines how BP_User_Query will do a count of total + * users matching the other filter criteria. Default value + * is 'count_query', which does a separate SELECT COUNT + * query to determine the total. 'sql_count_found_rows' + * uses SQL_COUNT_FOUND_ROWS and SELECT FOUND_ROWS(). Pass + * an empty string to skip the total user count query. + * + * @since BuddyPress (1.7) + */ +class BP_User_Query { + + /** Variables *************************************************************/ + + /** + * Array of variables to query with + * + * @since BuddyPress (1.7) + * @var array + */ + public $query_vars = array(); + + /** + * List of found users and their respective data + * + * @since BuddyPress (1.7) + * @access public To allow components to manipulate them + * @var array + */ + public $results = array(); + + /** + * Total number of found users for the current query + * + * @since BuddyPress (1.7) + * @access public To allow components to manipulate it + * @var int + */ + public $total_users = 0; + + /** + * List of found user ID's + * + * @since BuddyPress (1.7) + * @access public To allow components to manipulate it + * @var array + */ + public $user_ids = array(); + + /** + * SQL clauses for the user ID query + * + * @since BuddyPress (1.7) + * @access public To allow components to manipulate it + * @var array() + */ + public $uid_clauses = array(); + + /** + * SQL database column name to order by + * + * @since BuddyPress (1.7) + * @var string + */ + public $uid_name = ''; + + /** + * Standard response when the query should not return any rows. + * + * @since BuddyPress (1.7) + * @access protected + * @var string + */ + protected $no_results = array( 'join' => '', 'where' => '0 = 1' ); + + + /** Methods ***************************************************************/ + + /** + * Constructor + * + * @since BuddyPress (1.7) + * + * @param string|array $query The query variables + */ + public function __construct( $query = null ) { + if ( ! empty( $query ) ) { + $this->query_vars = wp_parse_args( $query, array( + 'type' => 'newest', + 'per_page' => 0, + 'page' => 1, + 'user_id' => 0, + 'search_terms' => false, + 'include' => false, + 'exclude' => false, + 'user_ids' => false, + 'meta_key' => false, + 'meta_value' => false, + 'populate_extras' => true, + 'count_total' => 'count_query' + ) ); + + // Plugins can use this filter to modify query args + // before the query is constructed + do_action_ref_array( 'bp_pre_user_query_construct', array( &$this ) ); + + // Get user ids + // If the user_ids param is present, we skip the query + if ( false !== $this->query_vars['user_ids'] ) { + $this->user_ids = wp_parse_id_list( $this->query_vars['user_ids'] ); + } else { + $this->prepare_user_ids_query(); + $this->do_user_ids_query(); + } + } + + // Bail if no user IDs were found + if ( empty( $this->user_ids ) ) { + return; + } + + // Fetch additional data. First, using WP_User_Query + $this->do_wp_user_query(); + + // Get BuddyPress specific user data + $this->populate_extras(); + } + + /** + * Prepare the query for user_ids + * + * @since BuddyPress (1.7) + */ + public function prepare_user_ids_query() { + global $wpdb, $bp; + + // Default query variables used here + $type = ''; + $per_page = 0; + $page = 1; + $user_id = 0; + $include = false; + $search_terms = false; + $exclude = false; + $meta_key = false; + $meta_value = false; + + extract( $this->query_vars ); + + // Setup the main SQL query container + $sql = array( + 'select' => '', + 'where' => array(), + 'orderby' => '', + 'order' => '', + 'limit' => '' + ); + + /** TYPE **************************************************************/ + + // Determines the sort order, which means it also determines where the + // user IDs are drawn from (the SELECT and WHERE statements) + switch ( $type ) { + + // 'online' query happens against the last_activity usermeta key + case 'online' : + $this->uid_name = 'user_id'; + $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->usermeta} u"; + $sql['where'][] = $wpdb->prepare( "u.meta_key = %s", bp_get_user_meta_key( 'last_activity' ) ); + $sql['where'][] = 'u.meta_value >= DATE_SUB( UTC_TIMESTAMP(), INTERVAL 5 MINUTE )'; + $sql['orderby'] = "ORDER BY u.meta_value"; + $sql['order'] = "DESC"; + + break; + + // 'active', 'newest', and 'random' queries + // all happen against the last_activity usermeta key + case 'active' : + case 'newest' : + case 'random' : + $this->uid_name = 'user_id'; + $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->usermeta} u"; + $sql['where'][] = $wpdb->prepare( "u.meta_key = %s", bp_get_user_meta_key( 'last_activity' ) ); + + if ( 'newest' == $type ) { + $sql['orderby'] = "ORDER BY u.user_id"; + $sql['order'] = "DESC"; + } else if ( 'random' == $type ) { + $sql['orderby'] = "ORDER BY rand()"; + } else { + $sql['orderby'] = "ORDER BY u.meta_value"; + $sql['order'] = "DESC"; + } + + break; + + // 'popular' sorts by the 'total_friend_count' usermeta + case 'popular' : + $this->uid_name = 'user_id'; + $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->usermeta} u"; + $sql['where'][] = $wpdb->prepare( "u.meta_key = %s", bp_get_user_meta_key( 'total_friend_count' ) ); + $sql['orderby'] = "ORDER BY u.meta_value"; + $sql['order'] = "DESC"; + + break; + + // 'alphabetical' sorts depend on the xprofile setup + case 'alphabetical' : + + // We prefer to do alphabetical sorts against the display_name field + // of wp_users, because the table is smaller and better indexed. We + // can do so if xprofile sync is enabled, or if xprofile is inactive. + // + // @todo remove need for bp_is_active() check + if ( ! bp_disable_profile_sync() || ! bp_is_active( 'xprofile' ) ) { + $this->uid_name = 'ID'; + $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->users} u"; + $sql['orderby'] = "ORDER BY u.display_name"; + $sql['order'] = "ASC"; + + // When profile sync is disabled, alphabetical sorts must happen against + // the xprofile table + } else { + $fullname_field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", bp_xprofile_fullname_field_name() ) ); + + $this->uid_name = 'user_id'; + $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$bp->profile->table_name_data} u"; + $sql['where'][] = "u.field_id = {$fullname_field_id}"; + $sql['orderby'] = "ORDER BY u.value"; + $sql['order'] = "ASC"; + } + + break; + + // Any other 'type' falls through + default : + $this->uid_name = 'ID'; + $sql['select'] = "SELECT DISTINCT u.{$this->uid_name} as id FROM {$wpdb->users} u"; + + // In this case, we assume that a plugin is + // handling order, so we leave those clauses + // blank + + break; + } + + /** WHERE *************************************************************/ + + // 'include' - User ids to include in the results + if ( false !== $include ) { + $include = wp_parse_id_list( $include ); + $include_ids = $wpdb->escape( implode( ',', (array) $include ) ); + $sql['where'][] = "u.{$this->uid_name} IN ({$include_ids})"; + } + + // 'exclude' - User ids to exclude from the results + if ( false !== $exclude ) { + $exclude = wp_parse_id_list( $exclude ); + $exclude_ids = $wpdb->escape( implode( ',', (array) $exclude ) ); + $sql['where'][] = "u.{$this->uid_name} NOT IN ({$exclude_ids})"; + } + + // 'user_id' - When a user id is passed, limit to the friends of the user + // Only parse this if no 'include' param is passed, to account for + // friend request queries + // @todo remove need for bp_is_active() check + if ( empty( $include ) && ! empty( $user_id ) && bp_is_active( 'friends' ) ) { + $friend_ids = friends_get_friend_user_ids( $user_id ); + $friend_ids = $wpdb->escape( implode( ',', (array) $friend_ids ) ); + + if ( ! empty( $friend_ids ) ) { + $sql['where'][] = "u.{$this->uid_name} IN ({$friend_ids})"; + + // If the user has no friends, and we're not including specific users, make sure the query returns null + } elseif ( empty( $include ) ) { + $sql['where'][] = $this->no_results['where']; + } + } + + /** Search Terms ******************************************************/ + + // 'search_terms' searches the xprofile fields + // To avoid global joins, do a separate query + // @todo remove need for bp_is_active() check + if ( false !== $search_terms && bp_is_active( 'xprofile' ) ) { + $found_user_ids = $wpdb->get_col( $wpdb->prepare( "SELECT user_id FROM {$bp->profile->table_name_data} WHERE value LIKE %s", '%%' . like_escape( $search_terms ) . '%%' ) ); + + if ( ! empty( $found_user_ids ) ) { + $sql['where'][] = "u.{$this->uid_name} IN (" . implode( ',', wp_parse_id_list( $found_user_ids ) ) . ")"; + } else { + $sql['where'][] = $this->no_results['where']; + } + } + + // 'meta_key', 'meta_value' allow usermeta search + // To avoid global joins, do a separate query + if ( false !== $meta_key ) { + $meta_sql = $wpdb->prepare( "SELECT user_id FROM {$wpdb->usermeta} WHERE meta_key = %s", $meta_key ); + + if ( false !== $meta_value ) { + $meta_sql .= $wpdb->prepare( " AND meta_value = %s", $meta_value ); + } + + $found_user_ids = $wpdb->get_col( $meta_sql ); + + if ( ! empty( $found_user_ids ) ) { + $sql['where'][] = "u.{$this->uid_name} IN (" . implode( ',', wp_parse_id_list( $found_user_ids ) ) . ")"; + } + } + + // 'per_page', 'page' - handles LIMIT + if ( !empty( $per_page ) && !empty( $page ) ) { + $sql['limit'] = $wpdb->prepare( "LIMIT %d, %d", intval( ( $page - 1 ) * $per_page ), intval( $per_page ) ); + } else { + $sql['limit'] = ''; + } + + // Assemble the query chunks + $this->uid_clauses['select'] = $sql['select']; + $this->uid_clauses['where'] = ! empty( $sql['where'] ) ? 'WHERE ' . implode( ' AND ', $sql['where'] ) : ''; + $this->uid_clauses['orderby'] = $sql['orderby']; + $this->uid_clauses['order'] = $sql['order']; + $this->uid_clauses['limit'] = $sql['limit']; + + do_action_ref_array( 'bp_pre_user_query', array( &$this ) ); + } + + /** + * Perform a database query to specifically get only user IDs, using + * existing query variables set previously in the constructor. + * + * Also used to quickly perform user total counts. + * + * @since BuddyPress (1.7) + */ + public function do_user_ids_query() { + global $wpdb; + + // If counting using SQL_CALC_FOUND_ROWS, set it up here + if ( 'sql_calc_found_rows' == $this->query_vars['count_total'] ) { + $this->uid_clauses['select'] = str_replace( 'SELECT', 'SELECT SQL_CALC_FOUND_ROWS', $this->uid_clauses['select'] ); + } + + // Get the specific user ids + $this->user_ids = $wpdb->get_col( "{$this->uid_clauses['select']} {$this->uid_clauses['where']} {$this->uid_clauses['orderby']} {$this->uid_clauses['order']} {$this->uid_clauses['limit']}" ); + + // Get the total user count + if ( 'sql_calc_found_rows' == $this->query_vars['count_total'] ) { + $this->total_users = $wpdb->get_var( apply_filters( 'bp_found_user_query', "SELECT FOUND_ROWS()", $this ) ); + } elseif ( 'count_query' == $this->query_vars['count_total'] ) { + $count_select = preg_replace( '/^SELECT.*?FROM (\S+) u/', "SELECT COUNT(DISTINCT u.{$this->uid_name}) FROM $1 u", $this->uid_clauses['select'] ); + $this->total_users = $wpdb->get_var( apply_filters( 'bp_found_user_query', "{$count_select} {$this->uid_clauses['where']}", $this ) ); + } + } + + /** + * Perform a database query using the WP_User_Query() object, using existing + * fields, variables, and user ID's set previously in this class. + * + * @since BuddyPress (1.7) + */ + public function do_wp_user_query() { + $wp_user_query = new WP_User_Query( apply_filters( 'bp_wp_user_query_args', array( + + // Relevant + 'fields' => array( 'ID', 'user_registered', 'user_login', 'user_nicename', 'display_name', 'user_email' ), + 'include' => $this->user_ids, + + // Overrides + 'blog_id' => 0, // BP does not require blog roles + 'count_total' => false // We already have a count + + ), $this ) ); + + // Reindex for easier matching + $r = array(); + foreach ( $wp_user_query->results as $u ) { + $r[ $u->ID ] = $u; + } + + // Match up to the user ids from the main query + foreach ( $this->user_ids as $uid ) { + if ( isset( $r[ $uid ] ) ) { + $this->results[ $uid ] = $r[ $uid ]; + + // The BP template functions expect an 'id' + // (as opposed to 'ID') property + $this->results[ $uid ]->id = $uid; + } + } + } + + /** + * Perform a database query to populate any extra metadata we might need. + * Different components will hook into the 'bp_user_query_populate_extras' + * action to loop in the things they want. + * + * @since BuddyPress (1.7) + * + * @global BuddyPress $bp + * @global WPDB $wpdb + * @return + */ + public function populate_extras() { + global $wpdb; + + // Bail if no users + if ( empty( $this->user_ids ) || empty( $this->results ) ) { + return; + } + + // Bail if the populate_extras flag is set to false + // In the case of the 'popular' sort type, we force + // populate_extras to true, because we need the friend counts + if ( 'popular' == $this->query_vars['type'] ) { + $this->query_vars['populate_extras'] = 1; + } + + if ( ! (bool) $this->query_vars['populate_extras'] ) { + return; + } + + // Turn user ID's into a query-usable, comma separated value + $user_ids_sql = implode( ',', wp_parse_id_list( $this->user_ids ) ); + + /** + * Use this action to independently populate your own custom extras. + * + * Note that anything you add here should query using $user_ids_sql, to + * avoid running multiple queries per user in the loop. + * + * Two BuddyPress components currently do this: + * - XProfile: To override display names + * - Friends: To set whether or not a user is the current users friend + * + * @see bp_xprofile_filter_user_query_populate_extras() + * @see bp_friends_filter_user_query_populate_extras() + */ + do_action_ref_array( 'bp_user_query_populate_extras', array( $this, $user_ids_sql ) ); + + // Fetch usermeta data + // We want the three following pieces of info from usermeta: + // - friend count + // - last activity + // - latest update + $total_friend_count_key = bp_get_user_meta_key( 'total_friend_count' ); + $last_activity_key = bp_get_user_meta_key( 'last_activity' ); + $bp_latest_update_key = bp_get_user_meta_key( 'bp_latest_update' ); + + // total_friend_count must be set for each user, even if its + // value is 0 + foreach ( $this->results as $uindex => $user ) { + $this->results[$uindex]->total_friend_count = 0; + } + + // Create, prepare, and run the seperate usermeta query + $user_metas = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, meta_key, meta_value FROM {$wpdb->usermeta} WHERE meta_key IN (%s,%s,%s) AND user_id IN ({$user_ids_sql})", $total_friend_count_key, $last_activity_key, $bp_latest_update_key ) ); + + // The $members_template global expects the index key to be different + // from the meta_key in some cases, so we rejig things here. + foreach ( $user_metas as $user_meta ) { + switch ( $user_meta->meta_key ) { + case $total_friend_count_key : + $key = 'total_friend_count'; + break; + + case $last_activity_key : + $key = 'last_activity'; + break; + + case $bp_latest_update_key : + $key = 'latest_update'; + break; + } + + if ( isset( $this->results[ $user_meta->user_id ] ) ) { + $this->results[ $user_meta->user_id ]->{$key} = $user_meta->meta_value; + } + } + + // When meta_key or meta_value have been passed to the query, + // fetch the resulting values for use in the template functions + if ( ! empty( $this->query_vars['meta_key'] ) ) { + $meta_sql = array( + 'select' => "SELECT user_id, meta_key, meta_value", + 'from' => "FROM $wpdb->usermeta", + 'where' => $wpdb->prepare( "WHERE meta_key = %s", $this->query_vars['meta_key'] ) + ); + + if ( false !== $this->query_vars['meta_value'] ) { + $meta_sql['where'] .= $wpdb->prepare( " AND meta_value = %s", $this->query_vars['meta_value'] ); + } + + $metas = $wpdb->get_results( "{$meta_sql['select']} {$meta_sql['from']} {$meta_sql['where']}" ); + + if ( ! empty( $metas ) ) { + foreach ( $metas as $meta ) { + if ( isset( $this->results[ $meta->user_id ] ) ) { + $this->results[ $meta->user_id ]->meta_key = $meta->meta_key; + + if ( ! empty( $meta->meta_value ) ) { + $this->results[ $meta->user_id ]->meta_value = $meta->meta_value; + } + } + } + } + } + } +} + /** * BP_Core_User class can be used by any component. It will fetch useful * details for any user when provided with a user_id. @@ -201,6 +742,8 @@ class BP_Core_User { function get_users( $type, $limit = 0, $page = 1, $user_id = 0, $include = false, $search_terms = false, $populate_extras = true, $exclude = false, $meta_key = false, $meta_value = false ) { global $wpdb, $bp; + _deprecated_function( __METHOD__, '1.7', 'BP_User_Query' ); + $sql = array(); $sql['select_main'] = "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.display_name, u.user_email"; @@ -415,8 +958,8 @@ class BP_Core_User { $exclude_sql = ( !empty( $exclude ) ) ? " AND u.ID NOT IN ({$exclude})" : ""; - $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ), $letter ); - $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name() ), $letter, $pag_sql ); + $total_users_sql = apply_filters( 'bp_core_users_by_letter_count_sql', $wpdb->prepare( "SELECT COUNT(DISTINCT u.ID) FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC", bp_xprofile_fullname_field_name() ) ); + $paged_users_sql = apply_filters( 'bp_core_users_by_letter_sql', $wpdb->prepare( "SELECT DISTINCT u.ID as id, u.user_registered, u.user_nicename, u.user_login, u.user_email FROM {$wpdb->users} u LEFT JOIN {$bp->profile->table_name_data} pd ON u.ID = pd.user_id LEFT JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id WHERE {$status_sql} AND pf.name = %s {$exclude_sql} AND pd.value LIKE '{$letter}%%' ORDER BY pd.value ASC{$pag_sql}", bp_xprofile_fullname_field_name() ) ); $total_users = $wpdb->get_var( $total_users_sql ); $paged_users = $wpdb->get_results( $paged_users_sql ); @@ -460,12 +1003,10 @@ class BP_Core_User { if ( $limit && $page ) $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); - // @todo remove? $user_sql is not used here - $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', "SELECT COUNT(DISTINCT ID) FROM {$wpdb->users} 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', "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}", $wpdb->escape( $user_ids ) ); + $total_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT COUNT(DISTINCT ID) FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) " ); + $paged_users_sql = apply_filters( 'bp_core_get_specific_users_count_sql', "SELECT DISTINCT ID as id, user_registered, user_nicename, user_login, user_email FROM {$wpdb->users} WHERE {$status_sql} AND ID IN ( " . $wpdb->escape( $user_ids ) . " ) {$pag_sql}" ); $total_users = $wpdb->get_var( $total_users_sql ); $paged_users = $wpdb->get_results( $paged_users_sql ); @@ -782,7 +1323,7 @@ class BP_Core_Notification { function get_all_for_user( $user_id, $status = 'is_new' ) { global $bp, $wpdb; - $is_new = 'is_new' == $status ? ' AND is_new = 1 ' : ''; + $is_new = ( 'is_new' == $status ) ? ' AND is_new = 1 ' : ''; return $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$bp->core->table_name_notifications} WHERE user_id = %d {$is_new}", $user_id ) ); } @@ -872,42 +1413,57 @@ class BP_Core_Notification { * * API to create BuddyPress buttons * + * component: Which component this button is for + * must_be_logged_in: Button only appears for logged in users + * block_self: Button will not appear when viewing your own profile. + * wrapper: div|span|p|li|false for no wrapper + * wrapper_id: The DOM ID of the button wrapper + * wrapper_class: The DOM class of the button wrapper + * link_href: The destination link of the button + * link_title: Title of the button + * link_id: The DOM ID of the button + * link_class: The DOM class of the button + * link_rel: The DOM rel of the button + * link_text: The text of the button + * contents: The contents of the button + * * @package BuddyPress Core - * @since 1.2.6 + * @since BuddyPress (1.2.6) */ class BP_Button { - // Button properties + + /** Button properties *****************************************************/ /** * The button ID * * @var integer */ - var $id; + public $id = ''; /** * The component name that button belongs to. * * @var string */ - var $component; + public $component = 'core'; /** * Does the user need to be logged in to see this button? * * @var boolean */ - var $must_be_logged_in; + public $must_be_logged_in = true; /** - * True or false if the button should not be displayed while viewing your own profile. + * True or false if the button should not be displayed while viewing your + * own profile. * * @var boolean */ - var $block_self; + public $block_self = true; - - // Wrapper + /** Wrapper ***************************************************************/ /** * What type of DOM element to use for a wrapper. @@ -915,134 +1471,101 @@ class BP_Button { * * @var mixed div|span|p|li, or false for no wrapper */ - var $wrapper; + public $wrapper = 'div'; /** * The DOM class of the button wrapper * * @var string */ - var $wrapper_class; + public $wrapper_class = ''; /** * The DOM ID of the button wrapper * * @var string */ - var $wrapper_id; - + public $wrapper_id = ''; - // Button + /** Button ****************************************************************/ /** * The destination link of the button * * @var string */ - var $link_href; + public $link_href = ''; /** * The DOM class of the button link * * @var string */ - var $link_class; + public $link_class = ''; /** * The DOM ID of the button link * * @var string */ - var $link_id; + public $link_id = ''; /** * The DOM rel value of the button link * * @var string */ - var $link_rel; + public $link_rel = ''; /** * Title of the button link * * @var string */ - var $link_title; + public $link_title = ''; /** * The contents of the button link * * @var string */ - var $link_text; + public $link_text = ''; + /** HTML result ***********************************************************/ - // HTML result + public $contents = ''; - var $contents; + /** Methods ***************************************************************/ /** - * bp_button() + * Builds the button based on class parameters: * - * Builds the button based on passed parameters: - * - * component: Which component this button is for - * must_be_logged_in: Button only appears for logged in users - * block_self: Button will not appear when viewing your own profile. - * wrapper: div|span|p|li|false for no wrapper - * wrapper_id: The DOM ID of the button wrapper - * wrapper_class: The DOM class of the button wrapper - * link_href: The destination link of the button - * link_title: Title of the button - * link_id: The DOM ID of the button - * link_class: The DOM class of the button - * link_rel: The DOM rel of the button - * link_text: The contents of the button + * @since BuddyPress (1.2.6) * * @param array $args * @return bool False if not allowed */ - function __construct( $args = '' ) { - - // Default arguments - $defaults = array( - 'id' => '', - 'component' => 'core', - 'must_be_logged_in' => true, - 'block_self' => true, - - 'wrapper' => 'div', - 'wrapper_id' => '', - 'wrapper_class' => '', - - 'link_href' => '', - 'link_title' => '', - 'link_id' => '', - 'link_class' => '', - 'link_rel' => '', - 'link_text' => '', - ); + public function __construct( $args = '' ) { - $r = wp_parse_args( $args, $defaults ); - extract( $r, EXTR_SKIP ); + $r = wp_parse_args( $args, get_class_vars( __CLASS__ ) ); // Required button properties - $this->id = $id; - $this->component = $component; - $this->must_be_logged_in = (bool)$must_be_logged_in; - $this->block_self = (bool)$block_self; - $this->wrapper = $wrapper; + $this->id = $r['id']; + $this->component = $r['component']; + $this->must_be_logged_in = (bool) $r['must_be_logged_in']; + $this->block_self = (bool) $r['block_self']; + $this->wrapper = $r['wrapper']; // $id and $component are required - if ( empty( $id ) || empty( $component ) ) + if ( empty( $r['id'] ) || empty( $r['component'] ) ) return false; // No button if component is not active - if ( !bp_is_active( $this->component ) ) + if ( ! bp_is_active( $this->component ) ) return false; // No button for guests if must be logged in - if ( true == $this->must_be_logged_in && !is_user_logged_in() ) + if ( true == $this->must_be_logged_in && ! is_user_logged_in() ) return false; // No button if viewing your own profile @@ -1053,20 +1576,20 @@ class BP_Button { if ( false !== $this->wrapper ) { // Wrapper ID - if ( !empty( $wrapper_id ) ) { - $this->wrapper_id = ' id="' . $wrapper_id . '"'; + if ( !empty( $r['wrapper_id'] ) ) { + $this->wrapper_id = ' id="' . $r['wrapper_id'] . '"'; } // Wrapper class - if ( !empty( $wrapper_class ) ) { - $this->wrapper_class = ' class="generic-button ' . $wrapper_class . '"'; + if ( !empty( $r['wrapper_class'] ) ) { + $this->wrapper_class = ' class="generic-button ' . $r['wrapper_class'] . '"'; } else { $this->wrapper_class = ' class="generic-button"'; } // Set before and after - $before = '<' . $wrapper . $this->wrapper_class . $this->wrapper_id . '>'; - $after = '</' . $wrapper . '>'; + $before = '<' . $r['wrapper'] . $this->wrapper_class . $this->wrapper_id . '>'; + $after = '</' . $r['wrapper'] . '>'; // No wrapper } else { @@ -1074,48 +1597,37 @@ class BP_Button { } // Link properties - if ( !empty( $link_id ) ) - $this->link_id = ' id="' . $link_id . '"'; - - if ( !empty( $link_href ) ) - $this->link_href = ' href="' . $link_href . '"'; - - if ( !empty( $link_title ) ) - $this->link_title = ' title="' . $link_title . '"'; - - if ( !empty( $link_rel ) ) - $this->link_rel = ' rel="' . $link_rel . '"'; - - if ( !empty( $link_class ) ) - $this->link_class = ' class="' . $link_class . '"'; - - if ( !empty( $link_text ) ) - $this->link_text = $link_text; + if ( !empty( $r['link_id'] ) ) $this->link_id = ' id="' . $r['link_id'] . '"'; + if ( !empty( $r['link_href'] ) ) $this->link_href = ' href="' . $r['link_href'] . '"'; + if ( !empty( $r['link_title'] ) ) $this->link_title = ' title="' . $r['link_title'] . '"'; + if ( !empty( $r['link_rel'] ) ) $this->link_rel = ' rel="' . $r['link_rel'] . '"'; + if ( !empty( $r['link_class'] ) ) $this->link_class = ' class="' . $r['link_class'] . '"'; + if ( !empty( $r['link_text'] ) ) $this->link_text = $r['link_text']; // Build the button $this->contents = $before . '<a'. $this->link_href . $this->link_title . $this->link_id . $this->link_rel . $this->link_class . '>' . $this->link_text . '</a>' . $after; // Allow button to be manipulated externally - $this->contents = apply_filters( 'bp_button_' . $component . '_' . $id, $this->contents, $this, $before, $after ); + $this->contents = apply_filters( 'bp_button_' . $this->component . '_' . $this->id, $this->contents, $this, $before, $after ); } /** - * contents() - * * Return contents of button * + * @since BuddyPress (1.2.6) + * * @return string */ - function contents() { + public function contents() { return $this->contents; } /** - * display() - * * Output contents of button + * + * @since BuddyPress (1.2.6) */ - function display() { + public function display() { if ( !empty( $this->contents ) ) echo $this->contents; } @@ -1285,4 +1797,154 @@ class BP_Embed extends WP_Embed { } } -?> +/** + * Create HTML list of BP nav items + * + * @since BuddyPress (1.7) + */ +class BP_Walker_Nav_Menu extends Walker_Nav_Menu { + /** + * @since BuddyPress (1.7) + * @var array + */ + var $db_fields = array( 'id' => 'css_id', 'parent' => 'parent' ); + + /** + * @since BuddyPress (1.7) + * @var string + */ + var $tree_type = array(); + + /** + * Display array of elements hierarchically. + * + * This method is almost identical to the version in {@link Walker::walk()}. The only change is on one line + * which has been commented. An IF was comparing 0 to a non-empty string which was preventing child elements + * being grouped under their parent menu element. + * + * This caused a problem for BuddyPress because our primary/secondary navigations doesn't have a unique numerical + * ID that describes a hierarchy (we use a slug). Obviously, WordPress Menus use Posts, and those have ID/post_parent. + * + * @param array $elements + * @param int $max_depth + * @return string + * @see Walker::walk() + * @since BuddyPress (1.7) + */ + function walk( $elements, $max_depth ) { + $args = array_slice( func_get_args(), 2 ); + $output = ''; + + if ( $max_depth < -1 ) // invalid parameter + return $output; + + if ( empty( $elements ) ) // nothing to walk + return $output; + + $id_field = $this->db_fields['id']; + $parent_field = $this->db_fields['parent']; + + // flat display + if ( -1 == $max_depth ) { + + $empty_array = array(); + foreach ( $elements as $e ) + $this->display_element( $e, $empty_array, 1, 0, $args, $output ); + + return $output; + } + + /* + * need to display in hierarchical order + * separate elements into two buckets: top level and children elements + * children_elements is two dimensional array, eg. + * children_elements[10][] contains all sub-elements whose parent is 10. + */ + $top_level_elements = array(); + $children_elements = array(); + + foreach ( $elements as $e ) { + // BuddyPress: changed '==' to '==='. This is the only change from version in Walker::walk(). + if ( 0 === $e->$parent_field ) + $top_level_elements[] = $e; + else + $children_elements[$e->$parent_field][] = $e; + } + + /* + * when none of the elements is top level + * assume the first one must be root of the sub elements + */ + if ( empty( $top_level_elements ) ) { + + $first = array_slice( $elements, 0, 1 ); + $root = $first[0]; + $top_level_elements = array(); + $children_elements = array(); + + foreach ( $elements as $e ) { + if ( $root->$parent_field == $e->$parent_field ) + $top_level_elements[] = $e; + else + $children_elements[$e->$parent_field][] = $e; + } + } + + foreach ( $top_level_elements as $e ) + $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output ); + + /* + * if we are displaying all levels, and remaining children_elements is not empty, + * then we got orphans, which should be displayed regardless + */ + if ( ( $max_depth == 0 ) && count( $children_elements ) > 0 ) { + $empty_array = array(); + + foreach ( $children_elements as $orphans ) + foreach ( $orphans as $op ) + $this->display_element( $op, $empty_array, 1, 0, $args, $output ); + } + + return $output; + } + + /** + * Displays the current <li> that we are on. + * + * @param string $output Passed by reference. Used to append additional content. + * @param object $item Menu item data object. + * @param int $depth Depth of menu item. Used for padding. Optional, defaults to 0. + * @param array $args Optional + * @param int $current_page Menu item ID. Optional. + * @since BuddyPress (1.7) + */ + function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { + // If we're someway down the tree, indent the HTML with the appropriate number of tabs + $indent = $depth ? str_repeat( "\t", $depth ) : ''; + + // Add HTML classes + $class_names = join( ' ', apply_filters( 'bp_nav_menu_css_class', array_filter( $item->class ), $item, $args ) ); + $class_names = ! empty( $class_names ) ? ' class="' . esc_attr( $class_names ) . '"' : ''; + + // Add HTML ID + $id = sanitize_html_class( $item->css_id . '-personal-li' ); // Backpat with BP pre-1.7 + $id = apply_filters( 'bp_nav_menu_item_id', $id, $item, $args ); + $id = ! empty( $id ) ? ' id="' . esc_attr( $id ) . '"' : ''; + + // Opening tag; closing tag is handled in Walker_Nav_Menu::end_el(). + $output .= $indent . '<li' . $id . $class_names . '>'; + + // Add href attribute + $attributes = ! empty( $item->link ) ? ' href="' . esc_attr( esc_url( $item->link ) ) . '"' : ''; + + // Construct the link + $item_output = $args->before; + $item_output .= '<a' . $attributes . '>'; + $item_output .= $args->link_before . apply_filters( 'the_title', $item->name, 0 ) . $args->link_after; + $item_output .= '</a>'; + $item_output .= $args->after; + + // $output is byref + $output .= apply_filters( 'bp_walker_nav_menu_start_el', $item_output, $item, $depth, $args ); + } +} diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-component.php b/wp-content/plugins/buddypress/bp-core/bp-core-component.php index b30e646d1b567bbc0fef71e26216fe0d1b6f26f7..5e9e6a2dfb23e0a4161c2f73438fe1f76f6fd16b 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-component.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-component.php @@ -109,7 +109,6 @@ class BP_Component { * Component global variables * * @since BuddyPress (1.5) - * @access private * * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_id' * @uses apply_filters() Calls 'bp_{@link bp_Component::name}_slug' @@ -187,7 +186,6 @@ class BP_Component { * - ./bp-my_component/bp-my_component-actions.php * * @since BuddyPress (1.5) - * @access private * * @uses do_action() Calls 'bp_{@link bp_Component::name}includes' */ @@ -229,7 +227,6 @@ class BP_Component { * Setup the actions * * @since BuddyPress (1.5) - * @access private * * @uses add_action() To add various actions * @uses do_action() Calls 'bp_{@link BP_Component::name}setup_actions' @@ -385,5 +382,3 @@ class BP_Component { } } endif; // BP_Component - -?> diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php b/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php index 0c6810e9af508f59e7afc3d40daa5846bb548b70..ff9608ac4993247378ef78a41600436c2e31b1d9 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-cssjs.php @@ -1,11 +1,11 @@ <?php + // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; function bp_core_confirmation_js() { - global $wpdb; - if ( is_multisite() && $wpdb->blogid != bp_get_root_blog_id() ) + if ( is_multisite() && ! bp_is_root_blog() ) return false; if ( !wp_script_is( 'jquery' ) ) @@ -14,11 +14,19 @@ function bp_core_confirmation_js() { if ( !wp_script_is( 'jquery', 'done' ) ) wp_print_scripts( 'jquery' ); ?> - <script type="text/javascript"> jQuery(document).ready( function() { jQuery("a.confirm").click( function() { if ( confirm( '<?php _e( 'Are you sure?', 'buddypress' ) ?>' ) ) return true; else return false; }); });</script> + <script type="text/javascript"> + jQuery( document ).ready( function() { + jQuery( 'a.confirm').click( function() { + if ( confirm( '<?php _e( 'Are you sure?', 'buddypress' ) ?>' ) ) + return true; else return false; + }); + }); + </script> <?php } -add_action( 'wp_head', 'bp_core_confirmation_js', 100 ); +add_action( 'wp_head', 'bp_core_confirmation_js', 100 ); +add_action( 'admin_head', 'bp_core_confirmation_js', 100 ); /** * bp_core_add_jquery_cropper() @@ -28,6 +36,7 @@ add_action( 'wp_head', 'bp_core_confirmation_js', 100 ); * @package BuddyPress Core */ function bp_core_add_jquery_cropper() { + wp_enqueue_style( 'jcrop' ); wp_enqueue_script( 'jcrop', array( 'jquery' ) ); add_action( 'wp_head', 'bp_core_add_cropper_inline_js' ); add_action( 'wp_head', 'bp_core_add_cropper_inline_css' ); @@ -41,20 +50,28 @@ function bp_core_add_jquery_cropper() { * @package BuddyPress Core */ function bp_core_add_cropper_inline_js() { - global $bp; - $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . $bp->avatar_admin->image->dir ) ); - $aspect_ratio = 1; + // Bail if no image was uploaded + $image = apply_filters( 'bp_inline_cropper_image', getimagesize( bp_core_avatar_upload_path() . buddypress()->avatar_admin->image->dir ) ); + if ( empty( $image ) ) + return; + // $full_height = bp_core_avatar_full_height(); $full_width = bp_core_avatar_full_width(); // Calculate Aspect Ratio - if ( $full_height && ( $full_width != $full_height ) ) + if ( !empty( $full_height ) && ( $full_width != $full_height ) ) { $aspect_ratio = $full_width / $full_height; + } else { + $aspect_ratio = 1; + } - $width = $image[0] / 2; - $height = $image[1] / 2; ?> + // Default cropper coordinates + $crop_left = $image[0] / 4; + $crop_top = $image[1] / 4; + $crop_right = $image[0] - $crop_left; + $crop_bottom = $image[1] - $crop_top; ?> <script type="text/javascript"> jQuery(window).load( function(){ @@ -62,10 +79,10 @@ function bp_core_add_cropper_inline_js() { onChange: showPreview, onSelect: showPreview, onSelect: updateCoords, - aspectRatio: <?php echo $aspect_ratio ?>, - setSelect: [ 50, 50, <?php echo $width ?>, <?php echo $height ?> ] + aspectRatio: <?php echo $aspect_ratio; ?>, + setSelect: [ <?php echo $crop_left; ?>, <?php echo $crop_top; ?>, <?php echo $crop_right; ?>, <?php echo $crop_bottom; ?> ] }); - updateCoords({x: 50, y: 50, w: <?php echo $width ?>, h: <?php echo $height ?>}); + updateCoords({x: <?php echo $crop_left; ?>, y: <?php echo $crop_top; ?>, w: <?php echo $crop_right; ?>, h: <?php echo $crop_bottom; ?>}); }); function updateCoords(c) { @@ -77,18 +94,14 @@ function bp_core_add_cropper_inline_js() { function showPreview(coords) { if ( parseInt(coords.w) > 0 ) { - var rx = <?php echo $full_width; ?> / coords.w; - var ry = <?php echo $full_height; ?> / coords.h; - <?php if ( $image ) : ?> - var w = <?php echo $image[0]; ?>; - var h = <?php echo $image[1]; ?>; - <?php endif; ?> - - jQuery('#avatar-crop-preview').css({ - <?php if ( $image ) : ?> - width: Math.round(rx * w) + 'px', - height: Math.round(ry * h) + 'px', - <?php endif; ?> + var fw = <?php echo $full_width; ?>; + var fh = <?php echo $full_height; ?>; + var rx = fw / coords.w; + var ry = fh / coords.h; + + jQuery( '#avatar-crop-preview' ).css({ + width: Math.round(rx * <?php echo $image[0]; ?>) + 'px', + height: Math.round(ry * <?php echo $image[1]; ?>) + 'px', marginLeft: '-' + Math.round(rx * coords.x) + 'px', marginTop: '-' + Math.round(ry * coords.y) + 'px' }); @@ -111,35 +124,42 @@ function bp_core_add_cropper_inline_css() { <style type="text/css"> .jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; } - .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url('<?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif'); } - .jcrop-vline { height: 100%; width: 1px !important; } - .jcrop-hline { width: 100%; height: 1px !important; } - .jcrop-handle { font-size: 1px; width: 7px !important; height: 7px !important; border: 1px #eee solid; background-color: #333; *width: 9px; *height: 9px; } - .jcrop-tracker { width: 100%; height: 100%; } - .custom .jcrop-vline, .custom .jcrop-hline { background: yellow; } - .custom .jcrop-handle { border-color: black; background-color: #C7BB00; -moz-border-radius: 3px; -webkit-border-radius: 3px; } #avatar-crop-pane { width: <?php echo bp_core_avatar_full_width() ?>px; height: <?php echo bp_core_avatar_full_height() ?>px; overflow: hidden; } #avatar-crop-submit { margin: 20px 0; } - #avatar-upload-form img, #create-group-form img, #group-settings-form img { border: none !important; } + .jcrop-holder img, + #avatar-crop-pane img, + #avatar-upload-form img, + #create-group-form img, + #group-settings-form img { border: none !important; max-width: none !important; } </style> <?php } /** - * bp_core_add_ajax_url_js() - * * Adds AJAX target URL so themes can access the WordPress AJAX functionality. * - * @since 1.1 + * @since BuddyPress (1.1) */ function bp_core_add_ajax_url_js() { ?> - <script type="text/javascript">var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>';</script> + <script type="text/javascript">var ajaxurl = '<?php echo bp_core_ajax_url(); ?>';</script> <?php } add_action( 'wp_head', 'bp_core_add_ajax_url_js' ); -?> \ No newline at end of file +/** + * Returns the proper value for BP's ajaxurl + * + * Designed to be sensitive to FORCE_SSL_ADMIN and non-standard multisite + * configurations. + * + * @since BuddyPress (1.7) + * + * @return string + */ +function bp_core_ajax_url() { + return apply_filters( 'bp_core_ajax_url', admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ) ); +} diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php b/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php new file mode 100644 index 0000000000000000000000000000000000000000..553d6582954f3c1267fd65628e95c61b56b910c0 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php @@ -0,0 +1,271 @@ +<?php + +/** + * Plugin Dependency + * + * The purpose of the following hooks is to mimic the behavior of something + * called 'plugin dependency' which enables a plugin to have plugins of their + * own in a safe and reliable way. + * + * We do this in BuddyPress by mirroring existing WordPress hookss in many places + * allowing dependant plugins to hook into the BuddyPress specific ones, thus + * guaranteeing proper code execution only when BuddyPress is active. + * + * The following functions are wrappers for hookss, allowing them to be + * manually called and/or piggy-backed on top of other hooks if needed. + * + * @todo use anonymous functions when PHP minimun requirement allows (5.3) + */ + +/** + * Include files on this action + */ +function bp_include() { + do_action( 'bp_include' ); +} + +/** + * Include files on this action + */ +function bp_setup_components() { + do_action( 'bp_setup_components' ); +} + +/** + * Setup global variables and objects + */ +function bp_setup_globals() { + do_action( 'bp_setup_globals' ); +} + +/** + * Set navigation elements + */ +function bp_setup_nav() { + do_action( 'bp_setup_nav' ); +} + +/** + * Set up BuddyPress implementation of the WP Toolbar + */ +function bp_setup_admin_bar() { + if ( bp_use_wp_admin_bar() ) + do_action( 'bp_setup_admin_bar' ); +} + +/** + * Set the page title + */ +function bp_setup_title() { + do_action( 'bp_setup_title' ); +} + +/** + * Register widgets + */ +function bp_setup_widgets() { + do_action( 'bp_register_widgets' ); +} + +/** + * Setup the currently logged-in user + * + * @uses did_action() To make sure the user isn't loaded out of order + * @uses do_action() Calls 'bp_setup_current_user' + */ +function bp_setup_current_user() { + + // If the current user is being setup before the "init" action has fired, + // strange (and difficult to debug) role/capability issues will occur. + if ( ! did_action( 'after_setup_theme' ) ) { + _doing_it_wrong( __FUNCTION__, __( 'The current user is being initialized without using $wp->init().', 'buddypress' ), '1.7' ); + } + + do_action( 'bp_setup_current_user' ); +} + +/** + * Initlialize code + */ +function bp_init() { + do_action( 'bp_init' ); +} + +/** + * Attached to plugins_loaded + */ +function bp_loaded() { + do_action( 'bp_loaded' ); +} + +/** + * Attached to wp + */ +function bp_ready() { + do_action( 'bp_ready' ); +} + +/** + * Attach potential template actions + */ +function bp_actions() { + do_action( 'bp_actions' ); +} + +/** + * Attach potential template screens + */ +function bp_screens() { + do_action( 'bp_screens' ); +} + +/** + * Initialize widgets + */ +function bp_widgets_init() { + do_action ( 'bp_widgets_init' ); +} + +/** + * BuddyPress head scripts + */ +function bp_head() { + do_action ( 'bp_head' ); +} + +/** Theme Permissions *********************************************************/ + +/** + * The main action used for redirecting BuddyPress theme actions that are not + * permitted by the current_user + * + * @since BuddyPress (1.6) + * + * @uses do_action() + */ +function bp_template_redirect() { + do_action( 'bp_template_redirect' ); +} + +/** Theme Helpers *************************************************************/ + +/** + * The main action used registering theme directory + * + * @since BuddyPress (1.5) + * @uses do_action() + */ +function bp_register_theme_directory() { + do_action( 'bp_register_theme_directory' ); +} + +/** + * The main action used registering theme packages + * + * @since BuddyPress (1.7) + * @uses do_action() + */ +function bp_register_theme_packages() { + do_action( 'bp_register_theme_packages' ); +} + +/** + * Enqueue BuddyPress specific CSS and JS + * + * @since BuddyPress (1.6) + * + * @uses do_action() Calls 'bp_enqueue_scripts' + */ +function bp_enqueue_scripts() { + do_action ( 'bp_enqueue_scripts' ); +} + +/** + * Piggy back action for BuddyPress sepecific theme actions before the theme has + * been setup and the theme's functions.php has loaded. + * + * @since BuddyPress (1.6) + * + * @uses do_action() Calls 'bp_setup_theme' + */ +function bp_setup_theme() { + do_action ( 'bp_setup_theme' ); +} + +/** + * Piggy back action for BuddyPress sepecific theme actions once the theme has + * been setup and the theme's functions.php has loaded. + * + * Hooked to 'after_setup_theme' with a priority of 100. This allows plenty of + * time for other themes to load their features, such as BuddyPress support, + * before our theme compatibility layer kicks in. + * + * @since BuddyPress (1.6) + * + * @uses do_action() Calls 'bp_after_setup_theme' + */ +function bp_after_setup_theme() { + do_action ( 'bp_after_setup_theme' ); +} + +/** Theme Compatibility Filter ************************************************/ + +/** + * Piggy back filter for WordPress's 'request' filter + * + * @since BuddyPress (1.7) + * @param array $query_vars + * @return array + */ +function bp_request( $query_vars = array() ) { + return apply_filters( 'bp_request', $query_vars ); +} + +/** + * Piggy back filter to handle login redirects. + * + * @since BuddyPress (1.7) + * + * @param string $redirect_to + * @param string $redirect_to_raw + * @param string $user + */ +function bp_login_redirect( $redirect_to = '', $redirect_to_raw = '', $user = false ) { + return apply_filters( 'bp_login_redirect', $redirect_to, $redirect_to_raw, $user ); +} + +/** + * The main filter used for theme compatibility and displaying custom BuddyPress + * theme files. + * + * @since BuddyPress (1.6) + * + * @uses apply_filters() + * + * @param string $template + * @return string Template file to use + */ +function bp_template_include( $template = '' ) { + return apply_filters( 'bp_template_include', $template ); +} + +/** + * Generate BuddyPress-specific rewrite rules + * + * @since BuddyPress (1.7) + * @param WP_Rewrite $wp_rewrite + * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite} + */ +function bp_generate_rewrite_rules( $wp_rewrite ) { + do_action_ref_array( 'bp_generate_rewrite_rules', array( &$wp_rewrite ) ); +} + +/** + * Filter the allowed themes list for BuddyPress specific themes + * + * @since BuddyPress (1.7) + * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list + */ +function bp_allowed_themes( $themes ) { + return apply_filters( 'bp_allowed_themes', $themes ); +} diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-filters.php b/wp-content/plugins/buddypress/bp-core/bp-core-filters.php index a65b29a4c4f3e80bf634a6bcf531af9bda42154d..d984c247c2ef9dbef994759d0620645fa84f051d 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-filters.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-filters.php @@ -1,8 +1,50 @@ <?php +/** + * BuddyPress Filters + * + * @package BuddyPress + * @subpackage Core + * + * This file contains the filters that are used through-out BuddyPress. They are + * consolidated here to make searching for them easier, and to help developers + * understand at a glance the order in which things occur. + * + * There are a few common places that additional filters can currently be found + * + * - BuddyPress: In {@link BuddyPress::setup_actions()} in buddypress.php + * - Component: In {@link BP_Component::setup_actions()} in + * bp-core/bp-core-component.php + * - Admin: More in {@link BP_Admin::setup_actions()} in + * bp-core/bp-core-admin.php + * + * @see bp-core-actions.php + */ + // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; +/** + * Attach BuddyPress to WordPress + * + * BuddyPress uses its own internal actions to help aid in third-party plugin + * development, and to limit the amount of potential future code changes when + * updates to WordPress core occur. + * + * These actions exist to create the concept of 'plugin dependencies'. They + * provide a safe way for plugins to execute code *only* when BuddyPress is + * installed and activated, without needing to do complicated guesswork. + * + * For more information on how this works, see the 'Plugin Dependency' section + * near the bottom of this file. + * + * v--WordPress Actions v--BuddyPress Sub-actions + */ +add_filter( 'request', 'bp_request', 10 ); +add_filter( 'template_include', 'bp_template_include', 10 ); +add_filter( 'login_redirect', 'bp_login_redirect', 10, 3 ); +add_filter( 'map_meta_cap', 'bp_map_meta_caps', 10, 4 ); + // Add some filters to feedback messages add_filter( 'bp_core_render_message_content', 'wptexturize' ); add_filter( 'bp_core_render_message_content', 'convert_smilies' ); @@ -10,6 +52,22 @@ add_filter( 'bp_core_render_message_content', 'convert_chars' ); add_filter( 'bp_core_render_message_content', 'wpautop' ); add_filter( 'bp_core_render_message_content', 'shortcode_unautop' ); +/** + * Template Compatibility + * + * If you want to completely bypass this and manage your own custom BuddyPress + * template hierarchy, start here by removing this filter, then look at how + * bp_template_include() works and do something similar. :) + */ +add_filter( 'bp_template_include', 'bp_template_include_theme_supports', 2, 1 ); +add_filter( 'bp_template_include', 'bp_template_include_theme_compat', 4, 2 ); + +// Filter BuddyPress template locations +add_filter( 'bp_get_template_stack', 'bp_add_template_stack_locations' ); + +// Turn comments off for BuddyPress pages +add_filter( 'comments_open', 'bp_comments_open', 10, 2 ); + /** * bp_core_exclude_pages() * @@ -19,19 +77,22 @@ add_filter( 'bp_core_render_message_content', 'shortcode_unautop' ); * @uses bp_is_active() checks if a BuddyPress component is active. * @return array The list of page ID's to exclude */ -function bp_core_exclude_pages( $pages ) { - global $bp; +function bp_core_exclude_pages( $pages = array() ) { - if ( bp_is_root_blog() ) { - if ( !empty( $bp->pages->activate ) ) - $pages[] = $bp->pages->activate->id; + // Bail if not the root blog + if ( ! bp_is_root_blog() ) + return $pages; - if ( !empty( $bp->pages->register ) ) - $pages[] = $bp->pages->register->id; + $bp = buddypress(); - if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) ) - $pages[] = $bp->pages->forums->id; - } + if ( !empty( $bp->pages->activate ) ) + $pages[] = $bp->pages->activate->id; + + if ( !empty( $bp->pages->register ) ) + $pages[] = $bp->pages->register->id; + + if ( !empty( $bp->pages->forums ) && ( !bp_is_active( 'forums' ) || ( bp_is_active( 'forums' ) && bp_forums_has_directory() && !bp_forums_is_installed_correctly() ) ) ) + $pages[] = $bp->pages->forums->id; return apply_filters( 'bp_core_exclude_pages', $pages ); } @@ -43,38 +104,14 @@ add_filter( 'wp_list_pages_excludes', 'bp_core_exclude_pages' ); * Sets the "From" name in emails sent to the name of the site and not "WordPress" * * @package BuddyPress Core - * @uses get_blog_option() fetches the value for a meta_key in the wp_X_options table + * @uses bp_get_option() fetches the value for a meta_key in the wp_X_options table * @return The blog name for the root blog */ function bp_core_email_from_name_filter() { - return apply_filters( 'bp_core_email_from_name_filter', wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ) ); + return apply_filters( 'bp_core_email_from_name_filter', bp_get_option( 'blogname', 'WordPress' ) ); } add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' ); -/** - * bp_core_allow_default_theme() - * - * On multiblog installations you must first allow themes to be activated and show - * up on the theme selection screen. This function will let the BuddyPress bundled - * themes show up on the root blog selection screen and bypass this step. It also - * means that the themes won't show for selection on other blogs. - * - * @package BuddyPress Core - */ -function bp_core_allow_default_theme( $themes ) { - global $wpdb; - - if ( !bp_current_user_can( 'bp_moderate' ) ) - return $themes; - - if ( $wpdb->blogid == bp_get_root_blog_id() ) { - $themes['bp-default'] = 1; - } - - return $themes; -} -add_filter( 'allowed_themes', 'bp_core_allow_default_theme' ); - /** * bp_core_filter_comments() * @@ -156,7 +193,7 @@ function bp_core_login_redirect( $redirect_to, $redirect_to_raw, $user ) { return bp_get_root_domain(); } -add_filter( 'login_redirect', 'bp_core_login_redirect', 10, 3 ); +add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 ); /*** * bp_core_filter_user_welcome_email() @@ -171,14 +208,13 @@ add_filter( 'login_redirect', 'bp_core_login_redirect', 10, 3 ); function bp_core_filter_user_welcome_email( $welcome_email ) { // Don't touch the email if we don't have a custom registration template - if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) ) + if ( ! bp_has_custom_signup_page() ) return $welcome_email; // [User Set] Replaces 'PASSWORD' in welcome email; Represents value set by user return str_replace( 'PASSWORD', __( '[User Set]', 'buddypress' ), $welcome_email ); } -if ( !is_admin() && empty( $_GET['e'] ) ) - add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' ); +add_filter( 'update_welcome_user_email', 'bp_core_filter_user_welcome_email' ); /*** * bp_core_filter_blog_welcome_email() @@ -196,14 +232,13 @@ if ( !is_admin() && empty( $_GET['e'] ) ) function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) { // Don't touch the email if we don't have a custom registration template - if ( '' == locate_template( array( 'registration/register.php' ), false ) && '' == locate_template( array( 'register.php' ), false ) ) + if ( ! bp_has_custom_signup_page() ) return $welcome_email; // [User Set] Replaces $password in welcome email; Represents value set by user return str_replace( $password, __( '[User Set]', 'buddypress' ), $welcome_email ); } -if ( !is_admin() && empty( $_GET['e'] ) ) - add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 ); +add_filter( 'update_welcome_email', 'bp_core_filter_blog_welcome_email', 10, 4 ); // Notify user of signup success. function bp_core_activation_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta ) { @@ -217,10 +252,10 @@ function bp_core_activation_signup_blog_notification( $domain, $path, $title, $u if ( empty( $admin_email ) ) $admin_email = 'support@' . $_SERVER['SERVER_NAME']; - $from_name = ( '' == get_site_option( 'site_name' ) ) ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); + $from_name = bp_get_option( 'blogname', 'WordPress' ); $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n"; $message = sprintf( __( "Thanks for registering! To complete the activation of your account and blog, please click the following link:\n\n%1\$s\n\n\n\nAfter you activate, you can visit your blog here:\n\n%2\$s", 'buddypress' ), $activate_url, esc_url( "http://{$domain}{$path}" ) ); - $subject = '[' . $from_name . '] ' . sprintf(__( 'Activate %s', 'buddypress' ), esc_url( 'http://' . $domain . $path ) ); + $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Activate %s', 'buddypress' ), 'http://' . $domain . $path ) ) ); // Send the message $to = apply_filters( 'bp_core_activation_signup_blog_notification_to', $user_email, $domain, $path, $title, $user, $user_email, $key, $meta ); @@ -234,8 +269,7 @@ function bp_core_activation_signup_blog_notification( $domain, $path, $title, $u // Return false to stop the original WPMU function from continuing return false; } -if ( !is_admin() ) - add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 ); +add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 ); function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) { @@ -246,14 +280,10 @@ function bp_core_activation_signup_user_notification( $user, $user_email, $key, if ( empty( $admin_email ) ) $admin_email = 'support@' . $_SERVER['SERVER_NAME']; - // If this is an admin generated activation, add a param to email the - // user login details - $email = is_admin() ? '&e=1' : ''; - - $from_name = ( '' == get_site_option( 'site_name' ) ) ? 'WordPress' : esc_html( get_site_option( 'site_name' ) ); + $from_name = bp_get_option( 'blogname', 'WordPress' ); $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n"; - $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url . $email ); - $subject = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' ); + $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url ); + $subject = bp_get_email_subject( array( 'text' => __( 'Activate Your Account', 'buddypress' ) ) ); // Send the message $to = apply_filters( 'bp_core_activation_signup_user_notification_to', $user_email, $user, $user_email, $key, $meta ); @@ -267,8 +297,7 @@ function bp_core_activation_signup_user_notification( $user, $user_email, $key, // Return false to stop the original WPMU function from continuing return false; } -if ( !is_admin() || ( is_admin() && empty( $_POST['noconfirmation'] ) ) ) - add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 ); +add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 ); /** * Filter the page title for BuddyPress pages @@ -309,8 +338,8 @@ function bp_modify_page_title( $title, $sep, $seplocation ) { $component_name = $bp->{$component_id}->id; } - // translators: "displayed user's name | canonicalised component name" - $title = strip_tags( sprintf( __( '%1$s | %2$s', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( $component_name ) ) ); + // Construct the page title. 1 = user name, 2 = seperator, 3 = component name + $title = strip_tags( sprintf( _x( '%1$s %3$s %2$s', 'Construct the page title. 1 = user name, 2 = component name, 3 = seperator', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( $component_name ), $sep ) ); // A single group } elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) { @@ -357,5 +386,3 @@ add_filter( 'wp_title', 'bp_modify_page_title', 10, 3 ); add_filter( 'bp_modify_page_title', 'wptexturize' ); add_filter( 'bp_modify_page_title', 'convert_chars' ); add_filter( 'bp_modify_page_title', 'esc_html' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-functions.php b/wp-content/plugins/buddypress/bp-core/bp-core-functions.php index e410546129d439322f7090b4f4f1b84b37105b54..96b75646c5e63a6c965028151b5a40b587c5b15c 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-functions.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-functions.php @@ -25,12 +25,10 @@ function bp_version() { * Return the BuddyPress version * * @since BuddyPress (1.6) - * @global BuddyPress $bp * @return string The BuddyPress version */ function bp_get_version() { - global $bp; - return $bp->version; + return buddypress()->version; } /** @@ -46,12 +44,10 @@ function bp_db_version() { * Return the BuddyPress database version * * @since BuddyPress (1.6) - * @global BuddyPress $bp * @return string The BuddyPress version */ function bp_get_db_version() { - global $bp; - return $bp->db_version; + return buddypress()->db_version; } /** @@ -67,38 +63,11 @@ function bp_db_version_raw() { * Return the BuddyPress database version * * @since BuddyPress (1.6) - * @global BuddyPress $bp * @return string The BuddyPress version direct from the database */ function bp_get_db_version_raw() { - global $bp; - - $retval = 0; - if ( !empty( $bp->db_version_raw ) ) - $retval = $bp->db_version_raw; - - return $retval; - } - -/** - * Output the BuddyPress maintenance mode - * - * @since BuddyPress (1.6) - * @uses bp_get_maintenance_mode() To get the BuddyPress maintenance mode - */ -function bp_maintenance_mode() { - echo bp_get_maintenance_mode(); -} - /** - * Return the BuddyPress maintenance mode - * - * @since BuddyPress (1.6) - * @global BuddyPress $bp - * @return string The BuddyPress maintenance mode - */ - function bp_get_maintenance_mode() { - global $bp; - return $bp->maintenance_mode; + $bp = buddypress(); + return !empty( $bp->db_version_raw ) ? $bp->db_version_raw : 0; } /** Functions *****************************************************************/ @@ -205,6 +174,87 @@ function bp_core_get_directory_pages() { return apply_filters( 'bp_core_get_directory_pages', $pages ); } +/** + * Add the pages for the component mapping. These are most often used by components with directories (e.g. groups, members). + * + * @param array $default_components Optional components to create pages for + * @param string $existing 'delete' if you want to delete existing page + * mappings and replace with new ones. Otherwise existing page mappings + * are kept, and the gaps filled in with new pages + * @since BuddyPress (1.7) + */ +function bp_core_add_page_mappings( $components, $existing = 'keep' ) { + + // Make sure that the pages are created on the root blog no matter which Dashboard the setup is being run on + if ( ! bp_is_root_blog() ) + switch_to_blog( bp_get_root_blog_id() ); + + $pages = bp_core_get_directory_page_ids(); + + // Delete any existing pages + if ( 'delete' == $existing ) { + foreach ( (array) $pages as $page_id ) { + wp_delete_post( $page_id, true ); + } + + $pages = array(); + } + + $page_titles = array( + 'activity' => _x( 'Activity', 'Page title for the Activity directory.', 'buddypress' ), + 'groups' => _x( 'Groups', 'Page title for the Groups directory.', 'buddypress' ), + 'sites' => _x( 'Sites', 'Page title for the Sites directory.', 'buddypress' ), + 'activate' => _x( 'Activate', 'Page title for the user account activation screen.', 'buddypress' ), + 'members' => _x( 'Members', 'Page title for the Members directory.', 'buddypress' ), + 'register' => _x( 'Register', 'Page title for the user registration screen.', 'buddypress' ), + ); + + $pages_to_create = array(); + foreach ( array_keys( $components ) as $component_name ) { + if ( ! isset( $pages[ $component_name ] ) && isset( $page_titles[ $component_name ] ) ) { + $pages_to_create[ $component_name ] = $page_titles[ $component_name ]; + } + } + + // Register and Activate are not components, but need pages when + // registration is enabled + if ( bp_get_signup_allowed() ) { + foreach ( array( 'register', 'activate' ) as $slug ) { + if ( ! isset( $pages[ $slug ] ) ) { + $pages_to_create[ $slug ] = $page_titles[ $slug ]; + } + } + } + + // No need for a Sites directory unless we're on multisite + if ( ! is_multisite() && isset( $pages_to_create['sites'] ) ) { + unset( $pages_to_create['sites'] ); + } + + // Members must always have a page, no matter what + if ( ! isset( $pages['members'] ) && ! isset( $pages_to_create['members'] ) ) { + $pages_to_create['members'] = $page_titles['members']; + } + + // Create the pages + foreach ( $pages_to_create as $component_name => $page_name ) { + $pages[ $component_name ] = wp_insert_post( array( + 'comment_status' => 'closed', + 'ping_status' => 'closed', + 'post_status' => 'publish', + 'post_title' => $page_name, + 'post_type' => 'page', + ) ); + } + + // Save the page mapping + bp_update_option( 'bp-pages', $pages ); + + // If we had to switch_to_blog, go back to the original site. + if ( ! bp_is_root_blog() ) + restore_current_blog(); +} + /** * Creates a default component slug from a WP page root_slug * @@ -254,7 +304,7 @@ function bp_core_get_root_domain() { * Get the current GMT time to save into the DB * * @package BuddyPress Core - * @since 1.2.6 + * @since BuddyPress (1.2.6) */ function bp_core_current_time( $gmt = true ) { // Get current time in MYSQL format @@ -335,7 +385,7 @@ function bp_core_render_message() { $type = ( 'success' == $bp->template_message_type ) ? 'updated' : 'error'; $content = apply_filters( 'bp_core_render_message_content', $bp->template_message, $type ); ?> - <div id="message" class="<?php echo $type; ?>"> + <div id="message" class="bp-template-notice <?php echo $type; ?>"> <?php echo $content; ?> @@ -374,12 +424,19 @@ function bp_core_number_format( $number, $decimals = false ) { * eg: 4 weeks and 6 days * * @package BuddyPress Core + * @uses apply_filters() Filter 'bp_core_time_since_pre' to bypass BP's calculations + * @uses apply_filters() Filter 'bp_core_time_since' to modify BP's calculations * @param $older_date int Unix timestamp of date you want to calculate the time since for * @param $newer_date int Unix timestamp of date to compare older date to. Default false (current time). * @return str The time since. */ function bp_core_time_since( $older_date, $newer_date = false ) { + // Use this filter to bypass BuddyPress's time_since calculations + if ( $pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date ) ) { + return $pre_value; + } + // Setup the strings $unknown_text = apply_filters( 'bp_core_time_since_unknown_text', __( 'sometime', 'buddypress' ) ); $right_now_text = apply_filters( 'bp_core_time_since_right_now_text', __( 'right now', 'buddypress' ) ); @@ -468,7 +525,7 @@ function bp_core_time_since( $older_date, $newer_date = false ) { $output = sprintf( $ago_text, $output ); } - return $output; + return apply_filters( 'bp_core_time_since', $output, $older_date, $newer_date ); } /** @@ -565,24 +622,21 @@ function bp_core_get_site_path() { * Performs a status safe wp_redirect() that is compatible with bp_catch_uri() * * @package BuddyPress Core - * @global BuddyPress $bp Makes sure that there are no conflicts with - * status_header() called in bp_core_do_catch_uri() - * @uses wp_redirect() + * @uses wp_safe_redirect() */ function bp_core_redirect( $location, $status = 302 ) { - global $bp; - // On some setups, passing the value of wp_get_referer() may result in an empty value for - // $location, which results in an error. Ensure that we have a valid URL. - if ( empty( $location ) ) { + // On some setups, passing the value of wp_get_referer() may result in an + // empty value for $location, which results in an error. Ensure that we + // have a valid URL. + if ( empty( $location ) ) $location = bp_get_root_domain(); - } - // Make sure we don't call status_header() in bp_core_do_catch_uri() - // as this conflicts with wp_redirect() - $bp->no_status_set = true; + // Make sure we don't call status_header() in bp_core_do_catch_uri() as this + // conflicts with wp_redirect() and wp_safe_redirect(). + buddypress()->no_status_set = true; - wp_redirect( $location, $status ); + wp_safe_redirect( $location, $status ); die; } @@ -910,16 +964,25 @@ function bp_is_username_compatibility_mode() { /** * Are we running multiblog mode? * - * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WP Multisite. "Multiblog" is - * a BP setup that allows BP content to be viewed in the theme, and with the URL, of every blog - * on the network. Thus, instead of having all 'boonebgorges' links go to + * Note that BP_ENABLE_MULTIBLOG is different from (but dependent on) WordPress + * Multisite. "Multiblog" is BuddyPress setup that allows BuddyPress components + * to be viewed on every blog on the network, each with their own settings. + * + * Thus, instead of having all 'boonebgorges' links go to * http://example.com/members/boonebgorges - * on the root blog, each blog will have its own version of the same profile content, eg + * on the root blog, each blog will have its own version of the same content, eg * http://site2.example.com/members/boonebgorges (for subdomains) * http://example.com/site2/members/boonebgorges (for subdirectories) * - * Multiblog mode is disabled by default, meaning that all BP content must be viewed on the root - * blog. + * Multiblog mode is disabled by default, meaning that all BuddyPress content + * must be viewed on the root blog. It's also recommended not to use the + * BP_ENABLE_MULTIBLOG constant beyond 1.7, as BuddyPress can now be activated + * on individual sites. + * + * Why would you want to use this? Originally it was intended to allow + * BuddyPress to live in mu-plugins and be visible on mapped domains. This is + * a very small use-case with large architectural shortcomings, so do not go + * down this road unless you specifically need to. * * @package BuddyPress * @since BuddyPress (1.5) @@ -928,7 +991,23 @@ function bp_is_username_compatibility_mode() { * @return bool False when multiblog mode is disabled (default); true when enabled */ function bp_is_multiblog_mode() { - return apply_filters( 'bp_is_multiblog_mode', is_multisite() && defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG ); + + // Setup some default values + $retval = false; + $is_multisite = is_multisite(); + $network_active = bp_is_network_activated(); + $is_multiblog = defined( 'BP_ENABLE_MULTIBLOG' ) && BP_ENABLE_MULTIBLOG; + + // Multisite, Network Activated, and Specifically Multiblog + if ( $is_multisite && $network_active && $is_multiblog ) { + $retval = true; + + // Multisite, but not network activated + } elseif ( $is_multisite && ! $network_active ) { + $retval = true; + } + + return apply_filters( 'bp_is_multiblog_mode', $retval ); } /** @@ -1076,23 +1155,40 @@ function bp_admin_url( $path = '', $scheme = 'admin' ) { function bp_get_admin_url( $path = '', $scheme = 'admin' ) { // Links belong in network admin - if ( bp_core_do_network_admin() ) + if ( bp_core_do_network_admin() ) { $url = network_admin_url( $path, $scheme ); // Links belong in site admin - else + } else { $url = admin_url( $path, $scheme ); + } return $url; } +/** + * Should BuddyPress appear in network admin, or site admin? + * + * Because BuddyPress can be installed in multiple ways and with multiple + * configurations, we need to check a few things to be confident about where + * to hook into certain areas of WordPress's admin. + * + * This function defaults to BuddyPress being network activated. + * @since BuddyPress (1.5) + * + * @uses bp_is_network_activated() + * @uses bp_is_multiblog_mode() + * @return boolean + */ function bp_core_do_network_admin() { - $do_network_admin = false; - if ( is_multisite() && !bp_is_multiblog_mode() ) - $do_network_admin = true; + // Default + $retval = bp_is_network_activated(); - return apply_filters( 'bp_core_do_network_admin', $do_network_admin ); + if ( bp_is_multiblog_mode() ) + $retval = false; + + return (bool) apply_filters( 'bp_core_do_network_admin', $retval ); } function bp_core_admin_hook() { @@ -1101,6 +1197,32 @@ function bp_core_admin_hook() { return apply_filters( 'bp_core_admin_hook', $hook ); } +/** + * Is BuddyPress active at the network level for this network? + * + * Used to determine admin menu placement, and where settings and options are + * stored. If you're being *really* clever and manually pulling BuddyPress in + * with an mu-plugin or some other method, you'll want to + * + * @since BuddyPress (1.7) + * @return boolean + */ +function bp_is_network_activated() { + + // Default to is_multisite() + $retval = is_multisite(); + + // Check the sitewide plugins array + $base = buddypress()->basename; + $plugins = get_site_option( 'active_sitewide_plugins' ); + + // Override is_multisite() if not network activated + if ( ! is_array( $plugins ) || ! isset( $plugins[$base] ) ) + $retval = false; + + return (bool) apply_filters( 'bp_is_network_activated', $retval ); +} + /** Global Manipulators *******************************************************/ /** @@ -1190,9 +1312,7 @@ function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) { // Get the home URL $home_url = strtolower( home_url() ); - // Build the currently requested URL - $scheme = is_ssl() ? 'https://' : 'http://'; - $requested_url = strtolower( $scheme . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); + $requested_url = bp_get_requested_url(); // Check the nonce $result = isset( $_REQUEST[$query_arg] ) ? wp_verify_nonce( $_REQUEST[$query_arg], $action ) : false; @@ -1206,5 +1326,3 @@ function bp_verify_nonce_request( $action = '', $query_arg = '_wpnonce' ) { return $result; } - -?> diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-loader.php b/wp-content/plugins/buddypress/bp-core/bp-core-loader.php index 635f6b4abde5336a56813c74ee6b9a20bf40b9ab..f7ebe8fe02369364fe0820606885339d0f165860 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-loader.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-loader.php @@ -203,6 +203,9 @@ class BP_Core extends BP_Component { $sub_nav = array(); // Fallback values if xprofile is disabled + if ( ! isset( $bp->core->profile ) ) { + $bp->core->profile = new stdClass; + } $bp->core->profile->slug = 'profile'; $bp->active_components[$bp->core->profile->slug] = $bp->core->profile->slug; @@ -219,7 +222,7 @@ class BP_Core extends BP_Component { // Add the subnav items to the profile $sub_nav[] = array( - 'name' => __( 'Public', 'buddypress' ), + 'name' => __( 'View', 'buddypress' ), 'slug' => 'public', 'parent_url' => $profile_link, 'parent_slug' => $bp->core->profile->slug, @@ -243,5 +246,3 @@ function bp_setup_core() { $bp->core = new BP_Core(); } add_action( 'bp_setup_components', 'bp_setup_core', 2 ); - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php b/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php index b2777047e779a27d2aa91bb4912f2b81a58f7a59..a090e2ff306706f7fdcf1ec199de8de101dad3f7 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-moderation.php @@ -4,7 +4,7 @@ * * @package BuddyPress * @subpackage Core - * @since 1.6 + * @since BuddyPress (1.6) */ // Exit if accessed directly @@ -20,7 +20,7 @@ if ( !defined( 'ABSPATH' ) ) exit; * * @param int $user_id User id to check for flood * @return bool True if there is no flooding, true if there is - * @since 1.6 + * @since BuddyPress (1.6) * @uses current_user_can() To check if the current user can throttle * @uses bp_get_option() To get the throttle time * @uses get_transient() To get the last posted transient of the ip @@ -50,7 +50,7 @@ function bp_core_check_for_flood( $user_id = 0 ) { * @param string $title The title of the content * @param string $content The content being posted * @return bool True if test is passed, false if fail - * @since 1.6 + * @since BuddyPress (1.6) * @uses bp_current_author_ip() To get current user IP address * @uses bp_current_author_ua() To get current user agent * @uses bp_current_user_can() Allow super admins to bypass blacklist @@ -159,7 +159,7 @@ function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '' * @uses bp_current_author_ip() To get current user IP address * @uses bp_current_author_ua() To get current user agent * @uses bp_current_user_can() Allow super admins to bypass blacklist - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) { @@ -241,7 +241,7 @@ function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '' ) * Get the current-user IP address * * @return string - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_core_current_user_ip() { $retval = preg_replace( '/[^0-9a-fA-F:., ]/', '', $_SERVER['REMOTE_ADDR'] ); @@ -253,7 +253,7 @@ function bp_core_current_user_ip() { * Get the current-user user-agent * * @return string - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_core_current_user_ua() { @@ -265,4 +265,3 @@ function bp_core_current_user_ua() { return apply_filters( 'bp_core_current_user_ua', $retval ); } -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-options.php b/wp-content/plugins/buddypress/bp-core/bp-core-options.php index 73cadc9979fbda80f2192d228dccc473fa8b0ffa..0addde0dadcbfa4ad499757a33a17b23f0552c2d 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-options.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-options.php @@ -61,6 +61,9 @@ function bp_get_default_options() { // Allow comments on blog and forum activity items 'bp-disable-blogforum-comments' => true, + // The ID for the current theme package. + '_bp_theme_package_id' => 'legacy', + /** Groups ************************************************************/ // @todo Move this into the groups component @@ -521,4 +524,15 @@ function bp_is_akismet_active( $default = true ) { return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) ); } -?> +/** + * Get the current theme package ID + * + * @since BuddyPress (1.7) + * + * @param $default string Optional. Default value 'default' + * @uses get_option() To get the subtheme option + * @return string ID of the subtheme + */ +function bp_get_theme_package_id( $default = 'legacy' ) { + return apply_filters( 'bp_get_theme_package_id', get_option( '_bp_theme_package_id', $default ) ); +} diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php b/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php new file mode 100644 index 0000000000000000000000000000000000000000..334a4498240f51d7c548d60f56b89b5463899a20 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/bp-core-template-loader.php @@ -0,0 +1,398 @@ +<?php + +/** + * BuddyPress Template Functions + * + * This file contains functions necessary to mirror the WordPress core template + * loading process. Many of those functions are not filterable, and even then + * would not be robust enough to predict where BuddyPress templates might exist. + * + * @package BuddyPress + * @subpackage TemplateFunctions + */ + +// Exit if accessed directly +if ( !defined( 'ABSPATH' ) ) exit; + +/** + * Adds BuddyPress theme support to any active WordPress theme + * + * @since BuddyPress (1.7) + * + * @param string $slug + * @param string $name Optional. Default null + * @uses bp_locate_template() + * @uses load_template() + * @uses get_template_part() + */ +function bp_get_template_part( $slug, $name = null ) { + + // Execute code for this part + do_action( 'get_template_part_' . $slug, $slug, $name ); + + // Setup possible parts + $templates = array(); + if ( isset( $name ) ) + $templates[] = $slug . '-' . $name . '.php'; + $templates[] = $slug . '.php'; + + // Allow template parts to be filtered + $templates = apply_filters( 'bp_get_template_part', $templates, $slug, $name ); + + // Return the part that is found + return bp_locate_template( $templates, true, false ); +} + +/** + * Retrieve the name of the highest priority template file that exists. + * + * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which + * inherit from a parent theme can just overload one file. If the template is + * not found in either of those, it looks in the theme-compat folder last. + * + * @since BuddyPress (1.7) + * + * @param string|array $template_names Template file(s) to search for, in order. + * @param bool $load If true the template file will be loaded if it is found. + * @param bool $require_once Whether to require_once or require. Default true. + * Has no effect if $load is false. + * @return string The template filename if one is located. + */ +function bp_locate_template( $template_names, $load = false, $require_once = true ) { + + // No file found yet + $located = false; + $template_locations = bp_get_template_stack(); + + // Try to find a template file + foreach ( (array) $template_names as $template_name ) { + + // Continue if template is empty + if ( empty( $template_name ) ) + continue; + + // Trim off any slashes from the template name + $template_name = ltrim( $template_name, '/' ); + + // Loop through template stack + foreach ( (array) $template_locations as $template_location ) { + + // Continue if $template_location is empty + if ( empty( $template_location ) ) + continue; + + // Check child theme first + if ( file_exists( trailingslashit( $template_location ) . $template_name ) ) { + $located = trailingslashit( $template_location ) . $template_name; + break 2; + } + } + } + + // Maybe load the template if one was located + if ( ( true == $load ) && !empty( $located ) ) + load_template( $located, $require_once ); + + return $located; +} + +/** + * This is really cool. This function registers a new template stack location, + * using WordPress's built in filters API. + * + * This allows for templates to live in places beyond just the parent/child + * relationship, to allow for custom template locations. Used in conjunction + * with bp_locate_template(), this allows for easy template overrides. + * + * @since BuddyPress (1.7) + * + * @param string $location Callback function that returns the stack location + * @param int $priority + */ +function bp_register_template_stack( $location_callback = '', $priority = 10 ) { + + // Bail if no location, or function does not exist + if ( empty( $location_callback ) || ! function_exists( $location_callback ) ) + return false; + + // Add location callback to template stack + return add_filter( 'bp_template_stack', $location_callback, (int) $priority ); +} + +/** + * Deregisters a previously registered template stack location. + * + * @since BuddyPress (1.7) + * + * @param string $location Callback function that returns the stack location + * @param int $priority + * @see bp_register_template_stack() + */ +function bp_deregister_template_stack( $location_callback = '', $priority = 10 ) { + + // Bail if no location, or function does not exist + if ( empty( $location_callback ) || ! function_exists( $location_callback ) ) + return false; + + // Add location callback to template stack + return remove_filter( 'bp_template_stack', $location_callback, (int) $priority ); +} + +/** + * Call the functions added to the 'bp_template_stack' filter hook, and return + * an array of the template locations. + * + * @see bp_register_template_stack() + * + * @since BuddyPress (1.7) + * + * @global array $wp_filter Stores all of the filters + * @global array $merged_filters Merges the filter hooks using this function. + * @global array $wp_current_filter stores the list of current filters with the current one last + * + * @return array The filtered value after all hooked functions are applied to it. + */ +function bp_get_template_stack() { + global $wp_filter, $merged_filters, $wp_current_filter; + + // Setup some default variables + $tag = 'bp_template_stack'; + $args = $stack = array(); + + // Add 'bp_template_stack' to the current filter array + $wp_current_filter[] = $tag; + + // Sort + if ( ! isset( $merged_filters[ $tag ] ) ) { + ksort( $wp_filter[$tag] ); + $merged_filters[ $tag ] = true; + } + + // Ensure we're always at the beginning of the filter array + reset( $wp_filter[ $tag ] ); + + // Loop through 'bp_template_stack' filters, and call callback functions + do { + foreach( (array) current( $wp_filter[$tag] ) as $the_ ) { + if ( ! is_null( $the_['function'] ) ) { + $args[1] = $stack; + $stack[] = call_user_func_array( $the_['function'], array_slice( $args, 1, (int) $the_['accepted_args'] ) ); + } + } + } while ( next( $wp_filter[$tag] ) !== false ); + + // Remove 'bp_template_stack' from the current filter array + array_pop( $wp_current_filter ); + + // Remove empties and duplicates + $stack = array_unique( array_filter( $stack ) ); + + return (array) apply_filters( 'bp_get_template_stack', $stack ) ; +} + +/** + * Get a template part in an output buffer, and return it + * + * @since BuddyPress (1.7) + * + * @param string $slug + * @param string $name + * @return string + */ +function bp_buffer_template_part( $slug, $name = null, $echo = true ) { + ob_start(); + + // Remove 'bp_replace_the_content' filter to prevent infinite loops + remove_filter( 'the_content', 'bp_replace_the_content' ); + + bp_get_template_part( $slug, $name ); + + // Remove 'bp_replace_the_content' filter to prevent infinite loops + add_filter( 'the_content', 'bp_replace_the_content' ); + + // Get the output buffer contents + $output = ob_get_contents(); + + // Flush the output buffer + ob_end_clean(); + + // Echo or return the output buffer contents + if ( true === $echo ) { + echo $output; + } else { + return $output; + } +} + +/** + * Retrieve path to a template + * + * Used to quickly retrieve the path of a template without including the file + * extension. It will also check the parent theme and theme-compat theme with + * the use of {@link bp_locate_template()}. Allows for more generic template + * locations without the use of the other get_*_template() functions. + * + * @since BuddyPress (1.7) + * + * @param string $type Filename without extension. + * @param array $templates An optional list of template candidates + * @uses bp_set_theme_compat_templates() + * @uses bp_locate_template() + * @uses bp_set_theme_compat_template() + * @return string Full path to file. + */ +function bp_get_query_template( $type, $templates = array() ) { + $type = preg_replace( '|[^a-z0-9-]+|', '', $type ); + + if ( empty( $templates ) ) + $templates = array( "{$type}.php" ); + + // Filter possible templates, try to match one, and set any BuddyPress theme + // compat properties so they can be cross-checked later. + $templates = apply_filters( "bp_get_{$type}_template", $templates ); + $templates = bp_set_theme_compat_templates( $templates ); + $template = bp_locate_template( $templates ); + $template = bp_set_theme_compat_template( $template ); + + return apply_filters( "bp_{$type}_template", $template ); +} + +/** + * Get the possible subdirectories to check for templates in + * + * @since BuddyPress (1.7) + * @param array $templates Templates we are looking for + * @return array Possible subfolders to look in + */ +function bp_get_template_locations( $templates = array() ) { + $locations = array( + 'buddypress', + 'community', + '' + ); + return apply_filters( 'bp_get_template_locations', $locations, $templates ); +} + +/** + * Add template locations to template files being searched for + * + * @since BuddyPress (1.7) + * + * @param array $stacks + * @return array() + */ +function bp_add_template_stack_locations( $stacks = array() ) { + $retval = array(); + + // Get alternate locations + $locations = bp_get_template_locations(); + + // Loop through locations and stacks and combine + foreach ( (array) $stacks as $stack ) + foreach ( (array) $locations as $custom_location ) + $retval[] = untrailingslashit( trailingslashit( $stack ) . $custom_location ); + + return apply_filters( 'bp_add_template_stack_locations', array_unique( $retval ), $stacks ); +} + +/** + * Add checks for BuddyPress conditions to parse_query action + * + * @since BuddyPress (1.7) + * + * @param WP_Query $posts_query + */ +function bp_parse_query( $posts_query ) { + + // Bail if $posts_query is not the main loop + if ( ! $posts_query->is_main_query() ) + return; + + // Bail if filters are suppressed on this query + if ( true == $posts_query->get( 'suppress_filters' ) ) + return; + + // Bail if in admin + if ( is_admin() ) + return; + + // Allow BuddyPress components to parse the main query + do_action_ref_array( 'bp_parse_query', array( &$posts_query ) ); +} + +/** + * Possibly intercept the template being loaded + * + * Listens to the 'template_include' filter and waits for any BuddyPress specific + * template condition to be met. If one is met and the template file exists, + * it will be used; otherwise + * + * Note that the _edit() checks are ahead of their counterparts, to prevent them + * from being stomped on accident. + * + * @since BuddyPress (1.7) + * + * @param string $template + * + * @return string The path to the template file that is being used + */ +function bp_template_include_theme_supports( $template = '' ) { + + // Look for root BuddyPress template files in parent/child themes + $new_template = apply_filters( 'bp_get_root_template', false, $template ); + + // BuddyPress template file exists + if ( !empty( $new_template ) ) { + + // Override the WordPress template with a BuddyPress one + $template = $new_template; + + // @see: bp_template_include_theme_compat() + buddypress()->theme_compat->found_template = true; + } + + return apply_filters( 'bp_template_include_theme_supports', $template ); +} + +/** + * Attempt to load a custom BuddyPress functions file, similar to each themes + * functions.php file. + * + * @since BuddyPress (1.7) + * + * @global string $pagenow + * @uses bp_locate_template() + */ +function bp_load_theme_functions() { + global $pagenow; + + // Do not include on BuddyPress deactivation + if ( bp_is_deactivation() ) + return; + + // Only include if not installing or if activating via wp-activate.php + if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) { + bp_locate_template( 'buddypress-functions.php', true ); + } +} + +/** + * Get the templates to use as the endpoint for BuddyPress template parts + * + * @since BuddyPress (1.7) + * + * @uses apply_filters() + * @return array Of possible root level wrapper template files + */ +function bp_get_theme_compat_templates() { + $templates = array( + 'plugin-buddypress.php', + 'buddypress.php', + 'community.php', + 'generic.php', + 'page.php', + 'single.php', + 'index.php' + ); + return bp_get_query_template( 'buddypress', $templates ); +} diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-template.php b/wp-content/plugins/buddypress/bp-core/bp-core-template.php index 28263753108d533f901748ef57c2081b9ba1015a..4ffa19ca4fac0f83f4c547eddd4ce0ea26c3839b 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-template.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-template.php @@ -161,23 +161,12 @@ function bp_site_name() { /** * Returns the name of the BP site. Used in RSS headers * - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_get_site_name() { return apply_filters( 'bp_site_name', get_bloginfo( 'name', 'display' ) ); } -function bp_get_profile_header() { - locate_template( array( '/profile/profile-header.php' ), true ); -} - -function bp_exists( $component_name ) { - if ( function_exists( $component_name . '_install' ) ) - return true; - - return false; -} - function bp_format_time( $time, $just_date = false, $localize_time = true ) { if ( !isset( $time ) || !is_numeric( $time ) ) return false; @@ -228,9 +217,6 @@ function bp_word_or_name( $youtext, $nametext, $capitalize = true, $echo = true } } -function bp_get_plugin_sidebar() { - locate_template( array( 'plugin-sidebar.php' ), true ); -} function bp_styles() { do_action( 'bp_styles' ); @@ -247,7 +233,7 @@ function bp_search_form_action() { * Generates the basic search form as used in BP-Default's header. * * @return string HTML <select> element - * @since 1.0 + * @since BuddyPress (1.0) */ function bp_search_form_type_select() { @@ -552,6 +538,31 @@ function bp_registration_needs_activation() { return apply_filters( 'bp_registration_needs_activation', true ); } +/** + * Retrieve a client friendly version of the root blog name, plus take care of + * the typical formatting bits and bobs. + * + * The blogname option is escaped with esc_html on the way into the database in + * sanitize_option, we want to reverse this for the plain text arena of emails. + * + * @link http://buddypress.trac.wordpress.org/ticket/4401 + * @since BuddyPress (1.7) + * @return string + */ +function bp_get_email_subject( $args = array() ) { + + $r = wp_parse_args( $args, array( + 'before' => '[', + 'after' => ']', + 'default' => __( 'Community', 'buddypress' ), + 'text' => '' + ) ); + + $subject = $r['before'] . wp_specialchars_decode( bp_get_option( 'blogname', $r['default'] ), ENT_QUOTES ) . $r['after'] . ' ' . $r['text']; + + return apply_filters( 'bp_get_email_subject', $subject, $r ); +} + /** * Allow templates to pass parameters directly into the template loops via AJAX * @@ -715,8 +726,8 @@ function bp_get_name_from_root_slug( $root_slug = '' ) { return false; // Loop through active components and look for a match - foreach ( $bp->active_components as $component => $id ) { - if ( !empty( $bp->{$component}->root_slug ) && ( $bp->{$component}->root_slug == $root_slug ) ) { + foreach ( array_keys( $bp->active_components ) as $component ) { + if ( ( !empty( $bp->{$component}->slug ) && ( $bp->{$component}->slug == $root_slug ) ) || ( !empty( $bp->{$component}->root_slug ) && ( $bp->{$component}->root_slug == $root_slug ) ) ) { return $bp->{$component}->name; } } @@ -758,15 +769,10 @@ function bp_search_slug() { * @return int */ function bp_displayed_user_id() { + $bp = buddypress(); + $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0; - static $id = 0; - - if ( empty( $id ) ) { - global $bp; - $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0; - } - - return apply_filters( 'bp_displayed_user_id', $id ); + return (int) apply_filters( 'bp_displayed_user_id', $id ); } /** @@ -776,15 +782,10 @@ function bp_displayed_user_id() { * @return int */ function bp_loggedin_user_id() { + $bp = buddypress(); + $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0; - static $id = 0; - - if ( empty( $id ) ) { - global $bp; - $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0; - } - - return apply_filters( 'bp_loggedin_user_id', $id ); + return (int) apply_filters( 'bp_loggedin_user_id', $id ); } /** is_() functions to determine the current page *****************************/ @@ -1045,14 +1046,25 @@ function bp_is_blog_page() { return apply_filters( 'bp_is_blog_page', $is_blog_page ); } -function bp_is_page( $page ) { - if ( !bp_is_user() && bp_is_current_component( $page ) ) - return true; - - if ( 'home' == $page ) - return is_front_page(); +/** + * Is this a BuddyPress component? + * + * You can tell if a page is displaying BP content by whether the + * current_component has been defined + * + * Generally, we can just check to see that there's no current component. + * The one exception is single user home tabs, where $bp->current_component + * is unset. Thus the addition of the bp_is_user() check. + * + * @since BuddyPress (1.7) + * + * @package BuddyPress + * @return bool True if it's a BuddyPress page, false otherwise + */ +function is_buddypress() { + $retval = (bool) ( bp_current_component() || bp_is_user() ); - return false; + return apply_filters( 'is_buddypress', $retval ); } /** Components ****************************************************************/ @@ -1129,6 +1141,32 @@ function bp_is_settings_component() { return false; } +/** + * Is the current component an active core component. + * + * Use this function when you need to check if the current component is an + * active core component of BuddyPress. If the current component is inactive, it + * will return false. If the current component is not part of BuddyPress core, + * it will return false. If the current component is active, and is part of + * BuddyPress core, it will return true. + * + * @since BuddyPress (1.7) + * @return boolean + */ +function bp_is_current_component_core() { + $retval = false; + $active_components = apply_filters( 'bp_active_components', bp_get_option( 'bp-active-components' ) ); + + foreach ( array_keys( $active_components ) as $active_component ) { + if ( bp_is_current_component( $active_component ) ) { + $retval = true; + break; + } + } + + return $retval; +} + /** Activity ******************************************************************/ function bp_is_single_activity() { @@ -1150,7 +1188,7 @@ function bp_is_my_profile() { } function bp_is_user() { - if ( bp_displayed_user_id() && !is_404() ) + if ( bp_displayed_user_id() ) return true; return false; @@ -1224,6 +1262,10 @@ function bp_is_user_change_avatar() { * @return bool */ function bp_is_user_forums() { + + if ( ! bp_is_active( 'forums' ) ) + return false; + if ( bp_is_user() && bp_is_forums_component() ) return true; @@ -1395,10 +1437,20 @@ function bp_is_group_admin_page() { } function bp_is_group_forum() { - if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) ) - return true; + $retval = false; - return false; + // At a forum URL + if ( bp_is_single_item() && bp_is_groups_component() && bp_is_current_action( 'forum' ) ) { + $retval = true; + + // If at a forum URL, set back to false if forums are inactive, or not + // installed correctly. + if ( ! bp_is_active( 'forums' ) || ! bp_forums_is_installed_correctly() ) { + $retval = false; + } + } + + return $retval; } function bp_is_group_activity() { @@ -1705,6 +1757,13 @@ function bp_the_body_class() { $bp_classes[] = bp_current_action(); } + /** is_buddypress *****************************************************/ + + // Add BuddyPress class if we are within a BuddyPress page + if ( ! bp_is_blog_page() ) { + $bp_classes[] = 'buddypress'; + } + /** Clean up***********************************************************/ // We don't want WordPress blog classes to appear on non-blog pages. @@ -1722,14 +1781,217 @@ function bp_the_body_class() { } } - // Merge WP classes with BP classes - $classes = array_merge( (array) $bp_classes, (array) $wp_classes ); - - // Remove any duplicates - $classes = array_unique( $classes ); + // Merge WP classes with BP classes and remove any duplicates + $classes = array_unique( array_merge( (array) $bp_classes, (array) $wp_classes ) ); return apply_filters( 'bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes ); } add_filter( 'body_class', 'bp_get_the_body_class', 10, 2 ); -?> \ No newline at end of file +/** + * Sort BuddyPress nav menu items by their position property. + * + * This is an internal convenience function and it will probably be removed in a later release. Do not use. + * + * @access private + * @param array $a First item + * @param array $b Second item + * @return int Returns an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. + * @since BuddyPress (1.7) + */ +function _bp_nav_menu_sort( $a, $b ) { + if ( $a["position"] == $b["position"] ) + return 0; + + else if ( $a["position"] < $b["position"] ) + return -1; + + else + return 1; +} + +/** + * Get an array of all the items registered in the primary and secondary BuddyPress navigation menus + * + * @return array + * @since BuddyPress (1.7) + */ +function bp_get_nav_menu_items() { + $menus = $selected_menus = array(); + + // Get the second level menus + foreach ( (array) buddypress()->bp_options_nav as $parent_menu => $sub_menus ) { + + // The root menu's ID is "xprofile", but the Profile submenus are using "profile". See BP_Core::setup_nav(). + if ( 'profile' == $parent_menu ) + $parent_menu = 'xprofile'; + + // Sort the items in this menu's navigation by their position property + $second_level_menus = (array) $sub_menus; + usort( $second_level_menus, '_bp_nav_menu_sort' ); + + // Iterate through the second level menus + foreach( $second_level_menus as $sub_nav ) { + + // Skip items we don't have access to + if ( ! $sub_nav['user_has_access'] ) + continue; + + // Add this menu + $menu = new stdClass; + $menu->class = array(); + $menu->css_id = $sub_nav['css_id']; + $menu->link = $sub_nav['link']; + $menu->name = $sub_nav['name']; + $menu->parent = $parent_menu; // Associate this sub nav with a top-level menu + + // If we're viewing this item's screen, record that we need to mark its parent menu to be selected + if ( $sub_nav['slug'] == bp_current_action() ) { + $menu->class = array( 'current-menu-item' ); + $selected_menus[] = $parent_menu; + } + + $menus[] = $menu; + } + } + + // Get the top-level menu parts (Friends, Groups, etc) and sort by their position property + $top_level_menus = (array) buddypress()->bp_nav; + usort( $top_level_menus, '_bp_nav_menu_sort' ); + + // Iterate through the top-level menus + foreach ( $top_level_menus as $nav ) { + + // Skip items marked as user-specific if you're not on your own profile + if ( ! $nav['show_for_displayed_user'] && ! bp_core_can_edit_settings() ) + continue; + + // Get the correct menu link. See http://buddypress.trac.wordpress.org/ticket/4624 + $link = bp_loggedin_user_domain() ? str_replace( bp_loggedin_user_domain(), bp_displayed_user_domain(), $nav['link'] ) : trailingslashit( bp_displayed_user_domain() . $nav['link'] ); + + // Add this menu + $menu = new stdClass; + $menu->class = array(); + $menu->css_id = $nav['css_id']; + $menu->link = $link; + $menu->name = $nav['name']; + $menu->parent = 0; + + // Check if we need to mark this menu as selected + if ( in_array( $nav['css_id'], $selected_menus ) ) + $menu->class = array( 'current-menu-parent' ); + + $menus[] = $menu; + } + + return apply_filters( 'bp_get_nav_menu_items', $menus ); +} + +/** + * Displays a navigation menu. + * + * @param string|array $args Optional arguments: + * before - Text before the link text. + * container - Whether to wrap the ul, and what to wrap it with. Defaults to div. + * container_class - The class that is applied to the container. Defaults to 'menu-bp-container'. + * container_id - The ID that is applied to the container. Defaults to blank. + * depth - How many levels of the hierarchy are to be included. 0 means all. Defaults to 0. + * echo - Whether to echo the menu or return it. Defaults to echo. + * fallback_cb - If the menu doesn't exists, a callback function will fire. Defaults to false (no fallback). + * items_wrap - How the list items should be wrapped. Defaults to a ul with an id and class. Uses printf() format with numbered placeholders. + * link_after - Text after the link. + * link_before - Text before the link. + * menu_class - CSS class to use for the ul element which forms the menu. Defaults to 'menu'. + * menu_id - The ID that is applied to the ul element which forms the menu. Defaults to 'menu-bp', incremented. + * walker - Allows a custom walker to be specified. Defaults to 'BP_Walker_Nav_Menu'. + * @since BuddyPress (1.7) + */ +function bp_nav_menu( $args = array() ) { + static $menu_id_slugs = array(); + + $defaults = array( + 'after' => '', + 'before' => '', + 'container' => 'div', + 'container_class' => '', + 'container_id' => '', + 'depth' => 0, + 'echo' => true, + 'fallback_cb' => false, + 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', + 'link_after' => '', + 'link_before' => '', + 'menu_class' => 'menu', + 'menu_id' => '', + 'walker' => '', + ); + $args = wp_parse_args( $args, $defaults ); + $args = apply_filters( 'bp_nav_menu_args', $args ); + $args = (object) $args; + + $items = $nav_menu = ''; + $show_container = false; + + // Create custom walker if one wasn't set + if ( empty( $args->walker ) ) + $args->walker = new BP_Walker_Nav_Menu; + + // Sanitise values for class and ID + $args->container_class = sanitize_html_class( $args->container_class ); + $args->container_id = sanitize_html_class( $args->container_id ); + + // Whether to wrap the ul, and what to wrap it with + if ( $args->container ) { + $allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav', ) ); + + if ( in_array( $args->container, $allowed_tags ) ) { + $show_container = true; + + $class = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-bp-container"'; + $id = $args->container_id ? ' id="' . esc_attr( $args->container_id ) . '"' : ''; + $nav_menu .= '<' . $args->container . $id . $class . '>'; + } + } + + // Get the BuddyPress menu items + $menu_items = apply_filters( 'bp_nav_menu_objects', bp_get_nav_menu_items(), $args ); + $items = walk_nav_menu_tree( $menu_items, $args->depth, $args ); + unset( $menu_items ); + + // Set the ID that is applied to the ul element which forms the menu. + if ( ! empty( $args->menu_id ) ) { + $wrap_id = $args->menu_id; + + } else { + $wrap_id = 'menu-bp'; + + // If a specific ID wasn't requested, and there are multiple menus on the same screen, make sure the autogenerated ID is unique + while ( in_array( $wrap_id, $menu_id_slugs ) ) { + if ( preg_match( '#-(\d+)$#', $wrap_id, $matches ) ) + $wrap_id = preg_replace('#-(\d+)$#', '-' . ++$matches[1], $wrap_id ); + else + $wrap_id = $wrap_id . '-1'; + } + } + $menu_id_slugs[] = $wrap_id; + + // Allow plugins to hook into the menu to add their own <li>'s + $items = apply_filters( 'bp_nav_menu_items', $items, $args ); + + // Build the output + $wrap_class = $args->menu_class ? $args->menu_class : ''; + $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items ); + unset( $items ); + + // If we've wrapped the ul, close it + if ( $show_container ) + $nav_menu .= '</' . $args->container . '>'; + + // Final chance to modify output + $nav_menu = apply_filters( 'bp_nav_menu', $nav_menu, $args ); + + if ( $args->echo ) + echo $nav_menu; + else + return $nav_menu; +} diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php b/wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php new file mode 100644 index 0000000000000000000000000000000000000000..fd62a43cdbce685e0e3a501db82aa3cae236b6b3 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/bp-core-theme-compatibility.php @@ -0,0 +1,697 @@ +<?php + +/** + * BuddyPress Core Theme Compatibility + * + * @package BuddyPress + * @subpackage ThemeCompatibility + */ + +// Exit if accessed directly +if ( !defined( 'ABSPATH' ) ) exit; + +/** Theme Compat **************************************************************/ + +/** + * What follows is an attempt at intercepting the natural page load process + * to replace the_content() with the appropriate BuddyPress content. + * + * To do this, BuddyPress does several direct manipulations of global variables + * and forces them to do what they are not supposed to be doing. + * + * Don't try anything you're about to witness here, at home. Ever. + */ + +/** Base Class ****************************************************************/ + +/** + * Theme Compatibility base class + * + * This is only intended to be extended, and is included here as a basic guide + * for future Theme Packs to use. @link BP_Legacy is a good example of + * extending this class. + * + * @since BuddyPress (1.7) + * @todo We should probably do something similar to BP_Component::start() + */ +class BP_Theme_Compat { + + /** + * Should be like: + * + * array( + * 'id' => ID of the theme (should be unique) + * 'name' => Name of the theme (should match style.css) + * 'version' => Theme version for cache busting scripts and styling + * 'dir' => Path to theme + * 'url' => URL to theme + * ); + * @var array + */ + protected $_data = array(); + + /** + * Pass the $properties to the object on creation. + * + * @since BuddyPress (1.7) + * @param array $properties + */ + public function __construct( Array $properties = array() ) { + $this->_data = $properties; + } + + + /** + * Themes shoud use this method in their constructor. + * + * In this method, we check all types of conditions where theme compatibility + * should *not* run. + * + * If we pass all conditions, then we setup some additional methods to use. + * + * @since BuddyPress (1.7) + */ + protected function start() { + + // If the theme supports 'buddypress', bail. + if ( current_theme_supports( 'buddypress' ) ) { + return; + + // If the theme doesn't support BP, do some additional checks + } else { + // Bail if theme is a derivative of bp-default + if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) ) { + return; + } + + // Bruteforce check for a BP template + // Examples are clones of bp-default + if ( locate_template( 'members/members-loop.php', false, false ) ) { + return; + } + } + + // Setup methods + $this->setup_globals(); + $this->setup_actions(); + } + + /** + * Meant to be extended in your class. + * + * @since BuddyPress (1.7) + */ + protected function setup_globals() {} + + /** + * Meant to be extended in your class. + * + * @since BuddyPress (1.7) + */ + protected function setup_actions() {} + + /** + * Set a theme's property. + * + * @since BuddyPress (1.7) + * @param string $property + * @param mixed $value + * @return mixed + */ + public function __set( $property, $value ) { + return $this->_data[$property] = $value; + } + + /** + * Get a theme's property. + * + * @since BuddyPress (1.7) + * @param string $property + * @param mixed $value + * @return mixed + */ + public function __get( $property ) { + return array_key_exists( $property, $this->_data ) ? $this->_data[$property] : ''; + } +} + +/** Functions *****************************************************************/ + +/** + * Setup the default theme compat theme + * + * @since BuddyPress (1.7) + * @param BP_Theme_Compat $theme + */ +function bp_setup_theme_compat( $theme = '' ) { + $bp = buddypress(); + + // Make sure theme package is available, set to default if not + if ( ! isset( $bp->theme_compat->packages[$theme] ) || ! is_a( $bp->theme_compat->packages[$theme], 'BP_Theme_Compat' ) ) { + $theme = 'legacy'; + } + + // Set the active theme compat theme + $bp->theme_compat->theme = $bp->theme_compat->packages[$theme]; +} + +/** + * Gets the name of the BuddyPress compatable theme used, in the event the + * currently active WordPress theme does not explicitly support BuddyPress. + * This can be filtered or set manually. Tricky theme authors can override the + * default and include their own BuddyPress compatability layers for their themes. + * + * @since BuddyPress (1.7) + * @uses apply_filters() + * @return string + */ +function bp_get_theme_compat_id() { + return apply_filters( 'bp_get_theme_compat_id', buddypress()->theme_compat->theme->id ); +} + +/** + * Gets the name of the BuddyPress compatable theme used, in the event the + * currently active WordPress theme does not explicitly support BuddyPress. + * This can be filtered or set manually. Tricky theme authors can override the + * default and include their own BuddyPress compatability layers for their themes. + * + * @since BuddyPress (1.7) + * @uses apply_filters() + * @return string + */ +function bp_get_theme_compat_name() { + return apply_filters( 'bp_get_theme_compat_name', buddypress()->theme_compat->theme->name ); +} + +/** + * Gets the version of the BuddyPress compatable theme used, in the event the + * currently active WordPress theme does not explicitly support BuddyPress. + * This can be filtered or set manually. Tricky theme authors can override the + * default and include their own BuddyPress compatability layers for their themes. + * + * @since BuddyPress (1.7) + * @uses apply_filters() + * @return string + */ +function bp_get_theme_compat_version() { + return apply_filters( 'bp_get_theme_compat_version', buddypress()->theme_compat->theme->version ); +} + +/** + * Gets the BuddyPress compatable theme used in the event the currently active + * WordPress theme does not explicitly support BuddyPress. This can be filtered, + * or set manually. Tricky theme authors can override the default and include + * their own BuddyPress compatability layers for their themes. + * + * @since BuddyPress (1.7) + * @uses apply_filters() + * @return string + */ +function bp_get_theme_compat_dir() { + return apply_filters( 'bp_get_theme_compat_dir', buddypress()->theme_compat->theme->dir ); +} + +/** + * Gets the BuddyPress compatable theme used in the event the currently active + * WordPress theme does not explicitly support BuddyPress. This can be filtered, + * or set manually. Tricky theme authors can override the default and include + * their own BuddyPress compatability layers for their themes. + * + * @since BuddyPress (1.7) + * @uses apply_filters() + * @return string + */ +function bp_get_theme_compat_url() { + return apply_filters( 'bp_get_theme_compat_url', buddypress()->theme_compat->theme->url ); +} + +/** + * Gets true/false if the current, loaded page uses theme compatibility + * + * @since BuddyPress (1.7) + * @return bool + */ +function bp_is_theme_compat_active() { + $bp = buddypress(); + + if ( empty( $bp->theme_compat->active ) ) + return false; + + return $bp->theme_compat->active; +} + +/** + * Sets true/false if page is currently inside theme compatibility + * + * @since BuddyPress (1.7) + * @param bool $set + * @return bool + */ +function bp_set_theme_compat_active( $set = true ) { + buddypress()->theme_compat->active = $set; + + return (bool) buddypress()->theme_compat->active; +} + +/** + * Set the theme compat templates global + * + * Stash possible template files for the current query. Useful if plugins want + * to override them, or see what files are being scanned for inclusion. + * + * @since BuddyPress (1.7) + */ +function bp_set_theme_compat_templates( $templates = array() ) { + buddypress()->theme_compat->templates = $templates; + + return buddypress()->theme_compat->templates; +} + +/** + * Set the theme compat template global + * + * Stash the template file for the current query. Useful if plugins want + * to override it, or see what file is being included. + * + * @since BuddyPress (1.7) + */ +function bp_set_theme_compat_template( $template = '' ) { + buddypress()->theme_compat->template = $template; + + return buddypress()->theme_compat->template; +} + +/** + * Set the theme compat original_template global + * + * Stash the original template file for the current query. Useful for checking + * if BuddyPress was able to find a more appropriate template. + * + * @since BuddyPress (1.7) + */ +function bp_set_theme_compat_original_template( $template = '' ) { + buddypress()->theme_compat->original_template = $template; + + return buddypress()->theme_compat->original_template; +} + +/** + * Set the theme compat original_template global + * + * Stash the original template file for the current query. Useful for checking + * if BuddyPress was able to find a more appropriate template. + * + * @since BuddyPress (1.7) + */ +function bp_is_theme_compat_original_template( $template = '' ) { + $bp = buddypress(); + + if ( empty( $bp->theme_compat->original_template ) ) + return false; + + return (bool) ( $bp->theme_compat->original_template == $template ); +} + +/** + * Register a new BuddyPress theme package to the active theme packages array + * + * @since BuddyPress (1.7) + * @param array $theme + */ +function bp_register_theme_package( $theme = array(), $override = true ) { + + // Create new BP_Theme_Compat object from the $theme array + if ( is_array( $theme ) ) + $theme = new BP_Theme_Compat( $theme ); + + // Bail if $theme isn't a proper object + if ( ! is_a( $theme, 'BP_Theme_Compat' ) ) + return; + + // Load up BuddyPress + $bp = buddypress(); + + // Only override if the flag is set and not previously registered + if ( empty( $bp->theme_compat->packages[$theme->id] ) || ( true === $override ) ) { + $bp->theme_compat->packages[$theme->id] = $theme; + } +} +/** + * This fun little function fills up some WordPress globals with dummy data to + * stop your average page template from complaining about it missing. + * + * @since BuddyPress (1.7) + * @global WP_Query $wp_query + * @global object $post + * @param array $args + */ +function bp_theme_compat_reset_post( $args = array() ) { + global $wp_query, $post; + + // Default arguments + $defaults = array( + 'ID' => -9999, + 'post_status' => 'publish', + 'post_author' => 0, + 'post_parent' => 0, + 'post_type' => 'page', + 'post_date' => 0, + 'post_date_gmt' => 0, + 'post_modified' => 0, + 'post_modified_gmt' => 0, + 'post_content' => '', + 'post_title' => '', + 'post_category' => 0, + 'post_excerpt' => '', + 'post_content_filtered' => '', + 'post_mime_type' => '', + 'post_password' => '', + 'post_name' => '', + 'guid' => '', + 'menu_order' => 0, + 'pinged' => '', + 'to_ping' => '', + 'ping_status' => '', + 'comment_status' => 'closed', + 'comment_count' => 0, + + 'is_404' => false, + 'is_page' => false, + 'is_single' => false, + 'is_archive' => false, + 'is_tax' => false, + ); + + // Switch defaults if post is set + if ( isset( $wp_query->post ) ) { + $defaults = array( + 'ID' => $wp_query->post->ID, + 'post_status' => $wp_query->post->post_status, + 'post_author' => $wp_query->post->post_author, + 'post_parent' => $wp_query->post->post_parent, + 'post_type' => $wp_query->post->post_type, + 'post_date' => $wp_query->post->post_date, + 'post_date_gmt' => $wp_query->post->post_date_gmt, + 'post_modified' => $wp_query->post->post_modified, + 'post_modified_gmt' => $wp_query->post->post_modified_gmt, + 'post_content' => $wp_query->post->post_content, + 'post_title' => $wp_query->post->post_title, + 'post_excerpt' => $wp_query->post->post_excerpt, + 'post_content_filtered' => $wp_query->post->post_content_filtered, + 'post_mime_type' => $wp_query->post->post_mime_type, + 'post_password' => $wp_query->post->post_password, + 'post_name' => $wp_query->post->post_name, + 'guid' => $wp_query->post->guid, + 'menu_order' => $wp_query->post->menu_order, + 'pinged' => $wp_query->post->pinged, + 'to_ping' => $wp_query->post->to_ping, + 'ping_status' => $wp_query->post->ping_status, + 'comment_status' => $wp_query->post->comment_status, + 'comment_count' => $wp_query->post->comment_count, + + 'is_404' => false, + 'is_page' => false, + 'is_single' => false, + 'is_archive' => false, + 'is_tax' => false, + ); + } + $dummy = wp_parse_args( $args, $defaults ); //, 'theme_compat_reset_post' ); + + // Clear out the post related globals + unset( $wp_query->posts ); + unset( $wp_query->post ); + unset( $post ); + + // Setup the dummy post object + $wp_query->post = new stdClass; + $wp_query->post->ID = $dummy['ID']; + $wp_query->post->post_status = $dummy['post_status']; + $wp_query->post->post_author = $dummy['post_author']; + $wp_query->post->post_parent = $dummy['post_parent']; + $wp_query->post->post_type = $dummy['post_type']; + $wp_query->post->post_date = $dummy['post_date']; + $wp_query->post->post_date_gmt = $dummy['post_date_gmt']; + $wp_query->post->post_modified = $dummy['post_modified']; + $wp_query->post->post_modified_gmt = $dummy['post_modified_gmt']; + $wp_query->post->post_content = $dummy['post_content']; + $wp_query->post->post_title = $dummy['post_title']; + $wp_query->post->post_excerpt = $dummy['post_excerpt']; + $wp_query->post->post_content_filtered = $dummy['post_content_filtered']; + $wp_query->post->post_mime_type = $dummy['post_mime_type']; + $wp_query->post->post_password = $dummy['post_password']; + $wp_query->post->post_name = $dummy['post_name']; + $wp_query->post->guid = $dummy['guid']; + $wp_query->post->menu_order = $dummy['menu_order']; + $wp_query->post->pinged = $dummy['pinged']; + $wp_query->post->to_ping = $dummy['to_ping']; + $wp_query->post->ping_status = $dummy['ping_status']; + $wp_query->post->comment_status = $dummy['comment_status']; + $wp_query->post->comment_count = $dummy['comment_count']; + + // Set the $post global + $post = $wp_query->post; + + // Setup the dummy post loop + $wp_query->posts[0] = $wp_query->post; + + // Prevent comments form from appearing + $wp_query->post_count = 1; + $wp_query->is_404 = $dummy['is_404']; + $wp_query->is_page = $dummy['is_page']; + $wp_query->is_single = $dummy['is_single']; + $wp_query->is_archive = $dummy['is_archive']; + $wp_query->is_tax = $dummy['is_tax']; + + // If we are resetting a post, we are in theme compat + bp_set_theme_compat_active(); +} + +/** + * Reset main query vars and filter 'the_content' to output a BuddyPress + * template part as needed. + * + * @since BuddyPress (1.7) + * + * @param string $template + * @uses bp_is_single_user() To check if page is single user + * @uses bp_get_single_user_template() To get user template + * @uses bp_is_single_user_edit() To check if page is single user edit + * @uses bp_get_single_user_edit_template() To get user edit template + * @uses bp_is_single_view() To check if page is single view + * @uses bp_get_single_view_template() To get view template + * @uses bp_is_forum_edit() To check if page is forum edit + * @uses bp_get_forum_edit_template() To get forum edit template + * @uses bp_is_topic_merge() To check if page is topic merge + * @uses bp_get_topic_merge_template() To get topic merge template + * @uses bp_is_topic_split() To check if page is topic split + * @uses bp_get_topic_split_template() To get topic split template + * @uses bp_is_topic_edit() To check if page is topic edit + * @uses bp_get_topic_edit_template() To get topic edit template + * @uses bp_is_reply_edit() To check if page is reply edit + * @uses bp_get_reply_edit_template() To get reply edit template + * @uses bp_set_theme_compat_template() To set the global theme compat template + */ +function bp_template_include_theme_compat( $template = '' ) { + + /** + * Use this action to execute code that will communicate to BuddyPress's + * theme compatibility layer whether or not we're replacing the_content() + * with some other template part. + */ + do_action( 'bp_template_include_reset_dummy_post_data' ); + + // Bail if the template already matches a BuddyPress template + if ( !empty( buddypress()->theme_compat->found_template ) ) + return $template; + + /** + * If we are relying on BuddyPress's built in theme compatibility to load + * the proper content, we need to intercept the_content, replace the + * output, and display ours instead. + * + * To do this, we first remove all filters from 'the_content' and hook + * our own function into it, which runs a series of checks to determine + * the context, and then uses the built in shortcodes to output the + * correct results from inside an output buffer. + * + * Uses bp_get_theme_compat_templates() to provide fall-backs that + * should be coded without superfluous mark-up and logic (prev/next + * navigation, comments, date/time, etc...) + */ + if ( bp_is_theme_compat_active() ) { + + // Remove all filters from the_content + bp_remove_all_filters( 'the_content' ); + + // Add a filter on the_content late, which we will later remove + if ( ! has_filter( 'the_content', 'bp_replace_the_content' ) ) { + add_filter( 'the_content', 'bp_replace_the_content' ); + } + + // Add BuddyPress's head action to wp_head + if ( ! has_action( 'wp_head', 'bp_head' ) ) { + add_action( 'wp_head', 'bp_head' ); + } + + // Find the appropriate template file + $template = bp_get_theme_compat_templates(); + } + + return apply_filters( 'bp_template_include_theme_compat', $template ); +} + +/** + * Replaces the_content() if the post_type being displayed is one that would + * normally be handled by BuddyPress, but proper single page templates do not + * exist in the currently active theme. + * + * @since BuddyPress (1.7) + * @param string $content + * @return type + */ +function bp_replace_the_content( $content = '' ) { + + if ( ! in_the_loop() ) + return $content; + + $new_content = apply_filters( 'bp_replace_the_content', $content ); + + // Juggle the content around and try to prevent unsightly comments + if ( !empty( $new_content ) && ( $new_content != $content ) ) { + + // Set the content to be the new content + $content = $new_content; + + // Clean up after ourselves + unset( $new_content ); + + // Reset the $post global + wp_reset_postdata(); + } + + // Return possibly hi-jacked content + return $content; +} + +/** Filters *******************************************************************/ + +/** + * Removes all filters from a WordPress filter, and stashes them in the $bp + * global in the event they need to be restored later. + * + * @since BuddyPress (1.7) + * @global WP_filter $wp_filter + * @global array $merged_filters + * @param string $tag + * @param int $priority + * @return bool + */ +function bp_remove_all_filters( $tag, $priority = false ) { + global $wp_filter, $merged_filters; + + $bp = buddypress(); + + // Filters exist + if ( isset( $wp_filter[$tag] ) ) { + + // Filters exist in this priority + if ( !empty( $priority ) && isset( $wp_filter[$tag][$priority] ) ) { + + // Store filters in a backup + $bp->filters->wp_filter[$tag][$priority] = $wp_filter[$tag][$priority]; + + // Unset the filters + unset( $wp_filter[$tag][$priority] ); + + // Priority is empty + } else { + + // Store filters in a backup + $bp->filters->wp_filter[$tag] = $wp_filter[$tag]; + + // Unset the filters + unset( $wp_filter[$tag] ); + } + } + + // Check merged filters + if ( isset( $merged_filters[$tag] ) ) { + + // Store filters in a backup + $bp->filters->merged_filters[$tag] = $merged_filters[$tag]; + + // Unset the filters + unset( $merged_filters[$tag] ); + } + + return true; +} + +/** + * Restores filters from the $bp global that were removed using + * bp_remove_all_filters() + * + * @since BuddyPress (1.7) + * @global WP_filter $wp_filter + * @global array $merged_filters + * @param string $tag + * @param int $priority + * @return bool + */ +function bp_restore_all_filters( $tag, $priority = false ) { + global $wp_filter, $merged_filters; + + $bp = buddypress(); + + // Filters exist + if ( isset( $bp->filters->wp_filter[$tag] ) ) { + + // Filters exist in this priority + if ( !empty( $priority ) && isset( $bp->filters->wp_filter[$tag][$priority] ) ) { + + // Store filters in a backup + $wp_filter[$tag][$priority] = $bp->filters->wp_filter[$tag][$priority]; + + // Unset the filters + unset( $bp->filters->wp_filter[$tag][$priority] ); + + // Priority is empty + } else { + + // Store filters in a backup + $wp_filter[$tag] = $bp->filters->wp_filter[$tag]; + + // Unset the filters + unset( $bp->filters->wp_filter[$tag] ); + } + } + + // Check merged filters + if ( isset( $bp->filters->merged_filters[$tag] ) ) { + + // Store filters in a backup + $merged_filters[$tag] = $bp->filters->merged_filters[$tag]; + + // Unset the filters + unset( $bp->filters->merged_filters[$tag] ); + } + + return true; +} + +/** + * Force comments_status to 'closed' for BuddyPress post types + * + * @since BuddyPress (1.7) + * @param bool $open True if open, false if closed + * @param int $post_id ID of the post to check + * @return bool True if open, false if closed + */ +function bp_comments_open( $open, $post_id = 0 ) { + + $retval = is_buddypress() ? false : $open; + + // Allow override of the override + return apply_filters( 'bp_force_comment_status', $retval, $open, $post_id ); +} diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-update.php b/wp-content/plugins/buddypress/bp-core/bp-core-update.php index f3dea1cd6da0a50a29a67ac8b450b8e7096bd168..1db5dd5a8b5d9d01773015c9414d12e07e70e9fa 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-update.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-update.php @@ -10,6 +10,19 @@ // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; +/** + * If there is no raw DB version, this is the first installation + * + * @since BuddyPress (1.7) + * + * @uses get_option() + * @uses bp_get_db_version() To get BuddyPress's database version + * @return bool True if update, False if not + */ +function bp_is_install() { + return ! bp_get_db_version_raw(); +} + /** * Compare the BuddyPress version to the DB version to determine if updating * @@ -37,36 +50,43 @@ function bp_is_update() { * * @since BuddyPress (1.6) * - * @global BuddyPress $bp + * @uses buddypress() * @return bool True if activating BuddyPress, false if not */ function bp_is_activation( $basename = '' ) { - global $bp; + $bp = buddypress(); + $action = false; - // Baif if action or plugin are empty - if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) ) - return false; + if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) { + $action = $_REQUEST['action']; + } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) { + $action = $_REQUEST['action2']; + } // Bail if not activating - if ( 'activate' !== $_GET['action'] ) + if ( empty( $action ) || !in_array( $action, array( 'activate', 'activate-selected' ) ) ) { return false; + } - // The plugin being activated - $plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : ''; + // The plugin(s) being activated + if ( $action == 'activate' ) { + $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); + } else { + $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); + } // Set basename if empty - if ( empty( $basename ) && !empty( $bp->basename ) ) + if ( empty( $basename ) && !empty( $bp->basename ) ) { $basename = $bp->basename; + } // Bail if no basename - if ( empty( $basename ) ) - return false; - - // Bail if plugin is not BuddyPress - if ( $basename !== $plugin ) + if ( empty( $basename ) ) { return false; + } - return true; + // Is BuddyPress being activated? + return in_array( $basename, $plugins ); } /** @@ -74,36 +94,43 @@ function bp_is_activation( $basename = '' ) { * * @since BuddyPress (1.6) * - * @global BuddyPress $bp + * @uses buddypress() * @return bool True if deactivating BuddyPress, false if not */ function bp_is_deactivation( $basename = '' ) { - global $bp; + $bp = buddypress(); + $action = false; - // Baif if action or plugin are empty - if ( empty( $_GET['action'] ) || empty( $_GET['plugin'] ) ) - return false; + if ( ! empty( $_REQUEST['action'] ) && ( '-1' != $_REQUEST['action'] ) ) { + $action = $_REQUEST['action']; + } elseif ( ! empty( $_REQUEST['action2'] ) && ( '-1' != $_REQUEST['action2'] ) ) { + $action = $_REQUEST['action2']; + } // Bail if not deactivating - if ( 'deactivate' !== $_GET['action'] ) + if ( empty( $action ) || !in_array( $action, array( 'deactivate', 'deactivate-selected' ) ) ) { return false; + } - // The plugin being deactivated - $plugin = isset( $_GET['plugin'] ) ? $_GET['plugin'] : ''; + // The plugin(s) being deactivated + if ( 'deactivate' == $action ) { + $plugins = isset( $_GET['plugin'] ) ? array( $_GET['plugin'] ) : array(); + } else { + $plugins = isset( $_POST['checked'] ) ? (array) $_POST['checked'] : array(); + } // Set basename if empty - if ( empty( $basename ) && !empty( $bp->basename ) ) + if ( empty( $basename ) && !empty( $bp->basename ) ) { $basename = $bp->basename; + } // Bail if no basename - if ( empty( $basename ) ) - return false; - - // Bail if plugin is not BuddyPress - if ( $basename !== $plugin ) + if ( empty( $basename ) ) { return false; + } - return true; + // Is bbPress being deactivated? + return in_array( $basename, $plugins ); } /** @@ -116,31 +143,133 @@ function bp_is_deactivation( $basename = '' ) { * @uses bp_update_option() To update BuddyPress's database version */ function bp_version_bump() { - $db_version = bp_get_db_version(); - bp_update_option( '_bp_db_version', $db_version ); + bp_update_option( '_bp_db_version', bp_get_db_version() ); } /** * Setup the BuddyPress updater * * @since BuddyPress (1.6) - * - * @uses BBP_Updater */ function bp_setup_updater() { // Are we running an outdated version of BuddyPress? - if ( bp_is_update() ) { + if ( ! bp_is_update() ) + return; + + bp_version_updater(); +} + +/** + * BuddyPress's version updater looks at what the current database version is, + * and runs whatever other code is needed. + * + * This is most-often used when the data schema changes, but should also be used + * to correct issues with BuddyPress metadata silently on software update. + * + * @since BuddyPress (r4104) + */ +function bp_version_updater() { - // Bump the version - bp_version_bump(); + // Get the raw database version + $raw_db_version = (int) bp_get_db_version_raw(); - // Run the deactivation function to wipe roles, caps, and rewrite rules - bp_deactivation(); + $default_components = apply_filters( 'bp_new_install_default_components', array( 'activity' => 1, 'members' => 1, 'xprofile' => 1, ) ); + require_once( BP_PLUGIN_DIR . '/bp-core/admin/bp-core-schema.php' ); - // Run the activation function to reset roles, caps, and rewrite rules - bp_activation(); + // Install BP schema and activate only Activity and XProfile + if ( bp_is_install() ) { + + // Apply schema and set Activity and XProfile components as active + bp_core_install( $default_components ); + bp_update_option( 'bp-active-components', $default_components ); + bp_core_add_page_mappings( $default_components, 'delete' ); + + // Upgrades + } else { + + // Run the schema install to update tables + bp_core_install(); + + // 1.5 + if ( $raw_db_version < 1801 ) { + bp_update_to_1_5(); + bp_core_add_page_mappings( $default_components, 'delete' ); + } + + // 1.6 + if ( $raw_db_version < 6067 ) { + bp_update_to_1_6(); + } + } + + /** All done! *************************************************************/ + + // Bump the version + bp_version_bump(); +} + +/** + * Database update methods based on version numbers + * + * @since BuddyPress (1.7) + */ +function bp_update_to_1_5() { + + // Delete old database version options + delete_site_option( 'bp-activity-db-version' ); + delete_site_option( 'bp-blogs-db-version' ); + delete_site_option( 'bp-friends-db-version' ); + delete_site_option( 'bp-groups-db-version' ); + delete_site_option( 'bp-messages-db-version' ); + delete_site_option( 'bp-xprofile-db-version' ); +} + +/** + * Database update methods based on version numbers + * + * @since BuddyPress (1.7) + */ +function bp_update_to_1_6() { + + // Delete possible site options + delete_site_option( 'bp-db-version' ); + delete_site_option( '_bp_db_version' ); + delete_site_option( 'bp-core-db-version' ); + delete_site_option( '_bp-core-db-version' ); + + // Delete possible blog options + delete_blog_option( bp_get_root_blog_id(), 'bp-db-version' ); + delete_blog_option( bp_get_root_blog_id(), 'bp-core-db-version' ); + delete_site_option( bp_get_root_blog_id(), '_bp-core-db-version' ); + delete_site_option( bp_get_root_blog_id(), '_bp_db_version' ); +} + +/** + * Redirect user to BuddyPress's What's New page on activation + * + * @since BuddyPress (1.7) + * + * @internal Used internally to redirect BuddyPress to the about page on activation + * + * @uses set_transient() To drop the activation transient for 30 seconds + * + * @return If bulk activation + */ +function bp_add_activation_redirect() { + + // Bail if activating from network, or bulk + if ( isset( $_GET['activate-multi'] ) ) + return; + + // Record that this is a new installation, so we show the right + // welcome message + if ( bp_is_install() ) { + set_transient( '_bp_is_new_install', true, 30 ); } + + // Add the transient to redirect + set_transient( '_bp_activation_redirect', true, 30 ); } /** Activation Actions ********************************************************/ @@ -176,6 +305,14 @@ function bp_deactivation() { // Force refresh theme roots. delete_site_transient( 'theme_roots' ); + // Switch to WordPress's default theme if current parent or child theme + // depend on bp-default. This is to prevent white screens of doom. + if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) ) { + switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME ); + update_option( 'template_root', get_raw_theme_root( WP_DEFAULT_THEME, true ) ); + update_option( 'stylesheet_root', get_raw_theme_root( WP_DEFAULT_THEME, true ) ); + } + // Use as of (1.6) do_action( 'bp_deactivation' ); @@ -193,5 +330,3 @@ function bp_deactivation() { function bp_uninstall() { do_action( 'bp_uninstall' ); } - -?> diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php b/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php index fae5d686b19dd636e8d37b55fb5628c0b792c922..69c95281c4e9f52fbd8274a4cf59ba436757c404 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-widgets.php @@ -15,15 +15,15 @@ add_action( 'bp_register_widgets', 'bp_core_register_widgets' ); class BP_Core_Members_Widget extends WP_Widget { function __construct() { - $widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest members', 'buddypress' ) ); - parent::__construct( false, $name = __( 'Members', 'buddypress' ), $widget_ops ); + $widget_ops = array( + 'description' => __( 'A dynamic list of recently active, popular, and newest members', 'buddypress' ), + 'classname' => 'widget_bp_core_members_widget buddypress', + ); + parent::__construct( false, $name = _x( '(BuddyPress) Members', 'widget name', 'buddypress' ), $widget_ops ); if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) { - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { - wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.dev.js', array( 'jquery' ), bp_get_version() ); - } else { - wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . 'bp-core/js/widget-members.js', array( 'jquery' ), bp_get_version() ); - } + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + wp_enqueue_script( 'bp_core_widget_members-js', BP_PLUGIN_URL . "bp-core/js/widget-members{$min}.js", array( 'jquery' ), bp_get_version() ); } } @@ -42,7 +42,7 @@ class BP_Core_Members_Widget extends WP_Widget { . $title . $after_title; ?> - <?php if ( bp_has_members( 'user_id=0&type=' . $instance['member_default'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?> + <?php if ( bp_has_members( 'user_id=0&type=' . $instance['member_default'] . '&max=' . $instance['max_members'] . '&populate_extras=1' ) ) : ?> <div class="item-options" id="members-list-options"> <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="newest-members" <?php if ( $instance['member_default'] == 'newest' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Newest', 'buddypress' ) ?></a> | <a href="<?php echo site_url( bp_get_members_root_slug() ); ?>" id="recently-active-members" <?php if ( $instance['member_default'] == 'active' ) : ?>class="selected"<?php endif; ?>><?php _e( 'Active', 'buddypress' ) ?></a> @@ -146,8 +146,11 @@ class BP_Core_Members_Widget extends WP_Widget { class BP_Core_Whos_Online_Widget extends WP_Widget { function __construct() { - $widget_ops = array( 'description' => __( 'Avatars of users who are currently online', 'buddypress' ) ); - parent::__construct( false, $name = __( "Who's Online Avatars", 'buddypress' ), $widget_ops ); + $widget_ops = array( + 'description' => __( 'Avatars of users who are currently online', 'buddypress' ), + 'classname' => 'widget_bp_core_whos_online_widget buddypress', + ); + parent::__construct( false, $name = _x( "(BuddyPress) Who's Online", 'widget name', 'buddypress' ), $widget_ops ); } function widget($args, $instance) { @@ -159,7 +162,7 @@ class BP_Core_Whos_Online_Widget extends WP_Widget { . $instance['title'] . $after_title; ?> - <?php if ( bp_has_members( 'user_id=0&type=online&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?> + <?php if ( bp_has_members( 'user_id=0&type=online&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=1' ) ) : ?> <div class="avatar-block"> <?php while ( bp_members() ) : bp_the_member(); ?> <div class="item-avatar"> @@ -210,8 +213,11 @@ class BP_Core_Whos_Online_Widget extends WP_Widget { class BP_Core_Recently_Active_Widget extends WP_Widget { function __construct() { - $widget_ops = array( 'description' => __( 'Avatars of recently active members', 'buddypress' ) ); - parent::__construct( false, $name = __( 'Recently Active Member Avatars', 'buddypress' ), $widget_ops ); + $widget_ops = array( + 'description' => __( 'Avatars of recently active members', 'buddypress' ), + 'classname' => 'widget_bp_core_recently_active_widget buddypress', + ); + parent::__construct( false, $name = _x( '(BuddyPress) Recently Active Members', 'widget name', 'buddypress' ), $widget_ops ); } function widget( $args, $instance ) { @@ -223,7 +229,7 @@ class BP_Core_Recently_Active_Widget extends WP_Widget { . $instance['title'] . $after_title; ?> - <?php if ( bp_has_members( 'user_id=0&type=active&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=0' ) ) : ?> + <?php if ( bp_has_members( 'user_id=0&type=active&per_page=' . $instance['max_members'] . '&max=' . $instance['max_members'] . '&populate_extras=1' ) ) : ?> <div class="avatar-block"> <?php while ( bp_members() ) : bp_the_member(); ?> <div class="item-avatar"> @@ -293,29 +299,26 @@ function bp_core_ajax_widget_members() { break; } - if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] . '&populate_extras=0' ) ) : ?> + if ( bp_has_members( 'user_id=0&type=' . $type . '&per_page=' . $_POST['max-members'] . '&max=' . $_POST['max-members'] . '&populate_extras=1' ) ) : ?> <?php echo '0[[SPLIT]]'; // return valid result. TODO: remove this. ?> - <div class="avatar-block"> - <?php while ( bp_members() ) : bp_the_member(); ?> - <li class="vcard"> - <div class="item-avatar"> - <a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a> - </div> - - <div class="item"> - <div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div> - <?php if ( 'active' == $type ) : ?> - <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div> - <?php elseif ( 'newest' == $type ) : ?> - <div class="item-meta"><span class="activity"><?php bp_member_registered() ?></span></div> - <?php elseif ( bp_is_active( 'friends' ) ) : ?> - <div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div> - <?php endif; ?> - </div> - </li> - - <?php endwhile; ?> - </div> + <?php while ( bp_members() ) : bp_the_member(); ?> + <li class="vcard"> + <div class="item-avatar"> + <a href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a> + </div> + + <div class="item"> + <div class="item-title fn"><a href="<?php bp_member_permalink() ?>" title="<?php bp_member_name() ?>"><?php bp_member_name() ?></a></div> + <?php if ( 'active' == $type ) : ?> + <div class="item-meta"><span class="activity"><?php bp_member_last_active() ?></span></div> + <?php elseif ( 'newest' == $type ) : ?> + <div class="item-meta"><span class="activity"><?php bp_member_registered() ?></span></div> + <?php elseif ( bp_is_active( 'friends' ) ) : ?> + <div class="item-meta"><span class="activity"><?php bp_member_total_friend_count() ?></span></div> + <?php endif; ?> + </div> + </li> + <?php endwhile; ?> <?php else: ?> <?php echo "-1[[SPLIT]]<li>"; ?> @@ -325,5 +328,3 @@ function bp_core_ajax_widget_members() { } add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' ); add_action( 'wp_ajax_nopriv_widget_members', 'bp_core_ajax_widget_members' ); - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php b/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php index c36dbd2b825dc14f6d35280cf5d1aa675453268e..2d41b293ddca880090be65e3d392d1866f9ac20d 100644 --- a/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php +++ b/wp-content/plugins/buddypress/bp-core/bp-core-wpabstraction.php @@ -170,5 +170,3 @@ if ( !function_exists( 'mb_strrpos' ) ) { } } } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css index d46916c32ed5a07a62a23d5c4b9e68fbaa5f08b5..389638405b578e2f2c1c2acdb3ce274e5ddd9146 100644 --- a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css +++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.css @@ -1 +1,27 @@ -#wpadminbar .quicklinks li#wp-admin-bar-my-account ul,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{margin:-2px -5px 0 23px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:30px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0} \ No newline at end of file +#wpadminbar .quicklinks li#wp-admin-bar-my-account ul, +#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul { + left: auto; + right: 0; +} +#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a img, +#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a img { + margin: -2px -5px 0 23px; +} +#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul, +#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul { + left: auto; + right: 30px; +} +#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul, +#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul { + left: auto; + right: 0; +} +#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul { + left: auto; + right: 0; +} +#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul { + left: auto; + right: 0; +} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.min.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.min.css new file mode 100644 index 0000000000000000000000000000000000000000..d46916c32ed5a07a62a23d5c4b9e68fbaa5f08b5 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar-rtl.min.css @@ -0,0 +1 @@ +#wpadminbar .quicklinks li#wp-admin-bar-my-account ul,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{margin:-2px -5px 0 23px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:30px}#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar ul ul,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:auto;right:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:auto;right:0} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar.css index b20ce7e6cb5fddd6197194fdd69381bcc45f66a3..d3801dc7736d87946fc20c23281c9085bcb5c004 100644 --- a/wp-content/plugins/buddypress/bp-core/css/admin-bar.css +++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar.css @@ -1 +1,58 @@ -#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#1fb3dd;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px} \ No newline at end of file +/* Displayed User */ +#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar > a img, +#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar > a img { + width: 16px; + height: 16px; + display: inline; + border: 1px solid #999; + vertical-align: middle; + margin: -2px 10px 0 -5px; + padding: 0; + background: #eee; + float: none; +} + +/* Displayed Group */ +#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul { + left: 0; +} +#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul { + left: 0; +} + +/* Notifications */ +#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count, +#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count, +#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications { + background: #21759B; + color: #fff; + text-shadow: none; + display: inline; + padding: 2px 5px; + font-size: 10px; + font-weight: bold; + -moz-border-radius: 10px; + -khtml-border-radius: 10px; + -webkit-border-radius: 10px; + border-radius: 10px; +} + +#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications { + background: #ddd; + color: #333; + margin: 0 +} + +#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert { + background-color: #1fb3dd; + color: #fff; +} + +#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications > a { + padding: 0 .5em; +} + +#wp-admin-bar-user-info img.avatar { + height: 64px; + width: 64px; +} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/css/admin-bar.min.css b/wp-content/plugins/buddypress/bp-core/css/admin-bar.min.css new file mode 100644 index 0000000000000000000000000000000000000000..b20ce7e6cb5fddd6197194fdd69381bcc45f66a3 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/css/admin-bar.min.css @@ -0,0 +1 @@ +#wpadminbar .quicklinks li#wp-admin-bar-user-admin-with-avatar>a img,#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar>a img{width:16px;height:16px;display:inline;border:1px solid #999;vertical-align:middle;margin:-2px 10px 0 -5px;padding:0;background:#eee;float:none}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-group-admin-with-avatar ul ul{left:0}#wpadminbar .quicklinks li#wp-admin-bar-my-account a span.count,#wpadminbar .quicklinks li#wp-admin-bar-my-account-with-avatar a span.count,#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#21759b;color:#fff;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-moz-border-radius:10px;-khtml-border-radius:10px;-webkit-border-radius:10px;border-radius:10px}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications{background:#ddd;color:#333;margin:0}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications #ab-pending-notifications.alert{background-color:#1fb3dd;color:#fff}#wpadminbar .quicklinks li#wp-admin-bar-bp-notifications>a{padding:0 .5em}#wp-admin-bar-user-info img.avatar{height:64px;width:64px} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css index a89f116f4a2daf72bb41be3b8531d8e6c3258de8..21552d362d40781a7adc49944efb6c39ba3be240 100644 --- a/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css +++ b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.css @@ -1 +1,77 @@ -#wp-admin-bar{right:0;left:auto}#wp-admin-bar div#admin-bar-logo{right:10px;left:auto}#wp-admin-bar li{text-align:right}#wp-admin-bar li.no-arrow a{padding-left:15px;padding-right:0}#admin-bar-logo{float:right}#wp-admin-bar ul li{float:right;background:url(_inc/images/admin-menu-arrow.gif) 12% 53% no-repeat;padding-left:11px;padding-right:0}#wp-admin-bar ul li.no-arrow{padding-left:0}#wp-admin-bar ul li.align-right{left:0;right:auto}#wp-admin-bar ul li ul{right:-999em;left:auto;margin-right:0}#wp-admin-bar ul li ul li{float:right}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0;right:auto}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{right:-999em;left:auto}#wp-admin-bar img.avatar{float:right;margin-left:8px;margin-right:0}#wp-admin-bar span.activity{margin-right:34px;margin-left:0}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{margin-right:2px;margin-left:0} \ No newline at end of file +#wp-admin-bar { + right: 0; + left: auto; +} +#wp-admin-bar div#admin-bar-logo { + right: 10px; + left: auto; +} +#wp-admin-bar li { + text-align: right; +} +#wp-admin-bar li.no-arrow a { + padding-left: 15px; + padding-right: 0; +} +#admin-bar-logo { + float: right; +} + +#wp-admin-bar ul li {/* all list items */ + float: right; + background: url('../images/admin-menu-arrow.gif') 12% 53% no-repeat; + padding-left: 11px; + padding-right: 0; +} +#wp-admin-bar ul li.no-arrow { + padding-left: 0; +} +#wp-admin-bar ul li.align-right { + left: 0; + right: auto; +} + +/* second-level lists */ +#wp-admin-bar ul li ul { + right: -999em; + left: auto; + margin-right: 0; +} +#wp-admin-bar ul li ul li { + float: right; +} + +/* third-and-above-level lists */ +#wp-admin-bar ul li ul ul { + margin: -25px 184px 0 0; +} +#wp-admin-bar ul li:hover ul, +#wp-admin-bar ul li li:hover ul, +#wp-admin-bar ul li.sfhover ul, +#wp-admin-bar ul li ul li.sfhover ul {/* lists nested under hovered list items */ + right: auto; +} +#wp-admin-bar ul li.align-right:hover ul { + left: 0; + right: auto; +} +#wp-admin-bar ul li:hover ul ul, +#wp-admin-bar li.sfhover ul li ul { + right: -999em; + left: auto; +} + +/* Menu item css */ +#wp-admin-bar img.avatar { + float: right; + margin-left: 8px; + margin-right: 0; +} +#wp-admin-bar span.activity { + margin-right: 34px; + margin-left: 0; +} +#wp-admin-bar ul li#bp-adminbar-notifications-menu a span { + margin-right: 2px; + margin-left: 0; +} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.min.css b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.min.css new file mode 100644 index 0000000000000000000000000000000000000000..c135f4d079a75784e733c03c29f22ba0ac3d8f32 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/css/buddybar-rtl.min.css @@ -0,0 +1 @@ +#wp-admin-bar{right:0;left:auto}#wp-admin-bar div#admin-bar-logo{right:10px;left:auto}#wp-admin-bar li{text-align:right}#wp-admin-bar li.no-arrow a{padding-left:15px;padding-right:0}#admin-bar-logo{float:right}#wp-admin-bar ul li{float:right;background:url('../images/admin-menu-arrow.gif') 12% 53% no-repeat;padding-left:11px;padding-right:0}#wp-admin-bar ul li.no-arrow{padding-left:0}#wp-admin-bar ul li.align-right{left:0;right:auto}#wp-admin-bar ul li ul{right:-999em;left:auto;margin-right:0}#wp-admin-bar ul li ul li{float:right}#wp-admin-bar ul li ul ul{margin:-25px 184px 0 0}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{right:auto}#wp-admin-bar ul li.align-right:hover ul{left:0;right:auto}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{right:-999em;left:auto}#wp-admin-bar img.avatar{float:right;margin-left:8px;margin-right:0}#wp-admin-bar span.activity{margin-right:34px;margin-left:0}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{margin-right:2px;margin-left:0} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar.css b/wp-content/plugins/buddypress/bp-core/css/buddybar.css index f5c4e54147be0fa2ccbd5aabfb727f9d6ca119a0..a53920f126d547d56ad31c9bc6d02128e76806ba 100644 --- a/wp-content/plugins/buddypress/bp-core/css/buddybar.css +++ b/wp-content/plugins/buddypress/bp-core/css/buddybar.css @@ -1 +1,203 @@ -body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url(../images/60pc_black.png);height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img{border:0}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left}#wp-admin-bar li a{padding:7px 15px 7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:0}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li:hover,#wp-admin-bar li.hover{position:static}#admin-bar-logo{float:left;font-weight:bold;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0;float:left;position:relative;background:url(../images/admin-menu-arrow.gif) 88% 53% no-repeat;padding-right:11px}#wp-admin-bar ul li.no-arrow{background:0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li:hover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,0.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,0.1);-moz-border-radius:3px;-webkit-border-radius:3px;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0}#wp-admin-bar ul li>ul{border-top:0}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li:hover,#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px} \ No newline at end of file +body:not(.wp-admin) { + padding-top: 25px !important; +} +#wp-admin-bar { + position: fixed; + top: 0; + left: 0; + height: 25px; + font-size: 11px; + width: 100%; + z-index: 9999; +} +#wp-admin-bar .padder { + position: relative; + padding: 0; + width: 100%; + margin: 0 auto; + background: url('../images/60pc_black.png'); + height: 25px; +} +body#bp-default #wp-admin-bar .padder { + max-width: 1250px; +} +#wp-admin-bar * { + z-index: 999; +} +#wp-admin-bar div#admin-bar-logo { + position: absolute; + top: 5px; + left: 10px; +} +#wp-admin-bar a img { + border: none; +} +#wp-admin-bar li { + list-style: none; + margin: 0; + padding: 0; + line-height: 100%; + text-align: left; +} +#wp-admin-bar li a { + padding: 7px 15px 7px 15px; + color: #eee; + text-decoration: none; + font-size: 11px; +} +#wp-admin-bar li.alt { + border: none; +} +#wp-admin-bar li.no-arrow a { + padding-right: 15px; +} +#wp-admin-bar ul li ul li a span { + display: none; +} +#wp-admin-bar li:hover, +#wp-admin-bar li.hover { + position: static; +} +#admin-bar-logo { + float: left; + font-weight: bold; + font-size: 11px; + padding: 5px 8px; + margin: 0; + text-decoration: none; + color: #fff; +} +body#bp-default #admin-bar-logo { + padding: 2px 8px; +} + +/* all lists */ +#wp-admin-bar ul { + margin: 0; + list-style: none; + line-height: 1; + cursor: pointer; + height: auto; + padding: 0; +} + +/* all list items */ +#wp-admin-bar ul li { + padding: 0; + float: left; + position: relative; + background: url('../images/admin-menu-arrow.gif') 88% 53% no-repeat; + padding-right: 11px; +} +#wp-admin-bar ul li.no-arrow { + background: none; + padding-right: 0; +} +#wp-admin-bar ul li ul li { + background-image: none; +} +#wp-admin-bar ul li.align-right { + position: absolute; + right: 0; +} +#wp-admin-bar ul li a { + display: block; +} +#wp-admin-bar ul.main-nav li:hover, +#wp-admin-bar ul.main-nav li.sfhover, +#wp-admin-bar ul.main-nav li ul li.sfhover { + background-color: #333; +} + +/* second-level lists */ +#wp-admin-bar ul li ul { + position: absolute; + width: 185px; + left: -999em; + margin-left: 0; + background: #333; + border: 1px solid #222; + -moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + -moz-border-radius-topright: 0; + -webkit-border-top-right-radius: 0; +} +#wp-admin-bar ul li > ul { + border-top: none; +} +#wp-admin-bar ul li ul a { + color: #eee; +} +#wp-admin-bar ul li ul li { + float: left; + width: 174px; + margin: 0; +} +#wp-admin-bar ul li ul li:hover a { + color: #fff; +} +#wp-admin-bar ul li div.admin-bar-clear { + clear: both; +} +#wp-admin-bar ul.main-nav li ul li:hover, +#wp-admin-bar ul.main-nav li ul li.sfhover, +#wp-admin-bar ul.main-nav li ul li.sfhover { + background-color: #222; +} + +/* third-and-above-level lists */ +#wp-admin-bar ul li ul ul { + margin: -25px 0 0 184px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} +#wp-admin-bar ul li ul li:hover ul li a { + color: #eee; +} +#wp-admin-bar ul li ul li ul li:hover a { + color: #fff; +} +#wp-admin-bar ul li:hover ul, +#wp-admin-bar ul li ul li:hover ul, +#wp-admin-bar ul li.sfhover ul, +#wp-admin-bar ul li ul li.sfhover ul { + left: auto; +} +#wp-admin-bar ul li.align-right:hover ul { + right: 0; +} +#wp-admin-bar ul li:hover ul ul, +#wp-admin-bar li.sfhover ul li ul { + left: -999em; +} + +/* Menu item css */ +#wp-admin-bar img.avatar { + float: left; + margin-right: 8px; +} +#wp-admin-bar span.activity { + display: block; + margin-left: 34px; + padding: 0; +} +#wp-admin-bar ul.author-list li a { + height: 17px; +} +#wp-admin-bar ul li#bp-adminbar-notifications-menu a span { + padding: 0 6px; + margin-left: 2px; + background: #fff; + color: #000; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; +} +#wp-admin-bar-user-info img.avatar { + height: 64px; + width: 64px; +} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/css/buddybar.min.css b/wp-content/plugins/buddypress/bp-core/css/buddybar.min.css new file mode 100644 index 0000000000000000000000000000000000000000..f84d96300292a6f825d1cbda3255afc59256efc7 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/css/buddybar.min.css @@ -0,0 +1 @@ +body:not(.wp-admin){padding-top:25px!important}#wp-admin-bar{position:fixed;top:0;left:0;height:25px;font-size:11px;width:100%;z-index:9999}#wp-admin-bar .padder{position:relative;padding:0;width:100%;margin:0 auto;background:url('../images/60pc_black.png');height:25px}body#bp-default #wp-admin-bar .padder{max-width:1250px}#wp-admin-bar *{z-index:999}#wp-admin-bar div#admin-bar-logo{position:absolute;top:5px;left:10px}#wp-admin-bar a img{border:0}#wp-admin-bar li{list-style:none;margin:0;padding:0;line-height:100%;text-align:left}#wp-admin-bar li a{padding:7px 15px 7px 15px;color:#eee;text-decoration:none;font-size:11px}#wp-admin-bar li.alt{border:0}#wp-admin-bar li.no-arrow a{padding-right:15px}#wp-admin-bar ul li ul li a span{display:none}#wp-admin-bar li:hover,#wp-admin-bar li.hover{position:static}#admin-bar-logo{float:left;font-weight:bold;font-size:11px;padding:5px 8px;margin:0;text-decoration:none;color:#fff}body#bp-default #admin-bar-logo{padding:2px 8px}#wp-admin-bar ul{margin:0;list-style:none;line-height:1;cursor:pointer;height:auto;padding:0}#wp-admin-bar ul li{padding:0;float:left;position:relative;background:url('../images/admin-menu-arrow.gif') 88% 53% no-repeat;padding-right:11px}#wp-admin-bar ul li.no-arrow{background:0;padding-right:0}#wp-admin-bar ul li ul li{background-image:none}#wp-admin-bar ul li.align-right{position:absolute;right:0}#wp-admin-bar ul li a{display:block}#wp-admin-bar ul.main-nav li:hover,#wp-admin-bar ul.main-nav li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#333}#wp-admin-bar ul li ul{position:absolute;width:185px;left:-999em;margin-left:0;background:#333;border:1px solid #222;-moz-box-shadow:0 4px 8px rgba(0,0,0,0.1);-webkit-box-shadow:0 4px 8px rgba(0,0,0,0.1);-moz-border-radius:3px;-webkit-border-radius:3px;-moz-border-radius-topleft:0;-webkit-border-top-left-radius:0;-moz-border-radius-topright:0;-webkit-border-top-right-radius:0}#wp-admin-bar ul li>ul{border-top:0}#wp-admin-bar ul li ul a{color:#eee}#wp-admin-bar ul li ul li{float:left;width:174px;margin:0}#wp-admin-bar ul li ul li:hover a{color:#fff}#wp-admin-bar ul li div.admin-bar-clear{clear:both}#wp-admin-bar ul.main-nav li ul li:hover,#wp-admin-bar ul.main-nav li ul li.sfhover,#wp-admin-bar ul.main-nav li ul li.sfhover{background-color:#222}#wp-admin-bar ul li ul ul{margin:-25px 0 0 184px;-moz-border-radius:3px;-webkit-border-radius:3px}#wp-admin-bar ul li ul li:hover ul li a{color:#eee}#wp-admin-bar ul li ul li ul li:hover a{color:#fff}#wp-admin-bar ul li:hover ul,#wp-admin-bar ul li ul li:hover ul,#wp-admin-bar ul li.sfhover ul,#wp-admin-bar ul li ul li.sfhover ul{left:auto}#wp-admin-bar ul li.align-right:hover ul{right:0}#wp-admin-bar ul li:hover ul ul,#wp-admin-bar li.sfhover ul li ul{left:-999em}#wp-admin-bar img.avatar{float:left;margin-right:8px}#wp-admin-bar span.activity{display:block;margin-left:34px;padding:0}#wp-admin-bar ul.author-list li a{height:17px}#wp-admin-bar ul li#bp-adminbar-notifications-menu a span{padding:0 6px;margin-left:2px;background:#fff;color:#000;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}#wp-admin-bar-user-info img.avatar{height:64px;width:64px} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php index f56c222ae79809ca20b960ab7dc8748d3224ce64..62a9ba94a1d9cdc2f50e411187d0698f81bd4285 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.5.php @@ -12,6 +12,9 @@ if ( !defined( 'ABSPATH' ) ) exit; /** Loader ********************************************************************/ +/** + * @deprecated BuddyPress (1.5) + */ function bp_setup_root_components() { do_action( 'bp_setup_root_components' ); } @@ -25,7 +28,7 @@ add_action( 'bp_init', 'bp_setup_root_components', 6 ); * This function originally served as a wrapper when WordPress and WordPress MU were separate entities. * Use is_multisite() instead. * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Use is_multisite() */ function bp_core_is_multisite() { @@ -38,12 +41,12 @@ function bp_core_is_multisite() { * * Checks if current blog is root blog of site. Deprecated in 1.5. * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Use is_main_site() * @package BuddyPress * @param int $blog_id optional blog id to test (default current blog) * @return bool True if not multisite or $blog_id is main site - * @since 1.2.6 + * @since BuddyPress (1.2.6) */ function bp_core_is_main_site( $blog_id = '' ) { _deprecated_function( __FUNCTION__, '1.5', 'is_main_site()' ); @@ -53,7 +56,7 @@ function bp_core_is_main_site( $blog_id = '' ) { /** * WPMU version of is_super_admin() * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Use is_super_admin() * @param int $user_id Optional. Defaults to logged-in user * @return bool True if is super admin @@ -71,9 +74,9 @@ if ( !function_exists( 'is_site_admin' ) ) { * In BuddyPress 1.1 - 1.2.x, this function provided a better version of add_menu_page() * that allowed positioning of menus. Deprecated in 1.5 in favour of a WP core function. * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Use add_menu_page(). - * @since 1.1 + * @since BuddyPress (1.1) */ function bp_core_add_admin_menu_page( $args = '' ) { global $_registered_pages, $admin_page_hooks, $menu; @@ -117,6 +120,9 @@ function bp_core_add_admin_menu_page( $args = '' ) { } /** Activity ******************************************************************/ +/** + * @deprecated BuddyPress (1.5) + */ function bp_is_activity_permalink() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_single_activity' ); bp_is_single_activity(); @@ -124,11 +130,12 @@ function bp_is_activity_permalink() { /** Core **********************************************************************/ +/** + * @deprecated BuddyPress (1.5) + */ function bp_core_get_wp_profile() { _deprecated_function( __FUNCTION__, '1.5' ); - global $bp; - $ud = get_userdata( bp_displayed_user_id() ); ?> <div class="bp-widget wp-profile"> @@ -196,6 +203,10 @@ function bp_core_get_wp_profile() { <?php } +/** + * @deprecated BuddyPress (1.5) + * @deprecated Use bp_is_my_profile() + */ function bp_is_home() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_my_profile' ); return bp_is_my_profile(); @@ -204,7 +215,7 @@ function bp_is_home() { /** * Is the user on the front page of the site? * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Use is_front_page() * @return bool */ @@ -216,7 +227,7 @@ function bp_is_front_page() { /** * Is the front page of the site set to the Activity component? * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Use bp_is_component_front_page( 'activity' ) * @return bool */ @@ -225,11 +236,19 @@ function bp_is_activity_front_page() { return bp_is_component_front_page( 'activity' ); } +/** + * @deprecated BuddyPress (1.5) + * @deprecated use bp_is_user() + */ function bp_is_member() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user' ); return bp_is_user(); } +/** + * @deprecated BuddyPress (1.5) + * @deprecated use bp_loggedin_user_link() + */ function bp_loggedinuser_link() { _deprecated_function( __FUNCTION__, '1.5', 'bp_logged_in_user_link' ); bp_loggedin_user_link(); @@ -239,6 +258,7 @@ function bp_loggedinuser_link() { * Only show the search form if there are available objects to search for. * Deprecated in 1.5; not used anymore. * + * @deprecated BuddyPress (1.5) * @return bool */ function bp_search_form_enabled() { @@ -249,9 +269,9 @@ function bp_search_form_enabled() { /** * Template tag version of bp_get_page_title() * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Use wp_title() - * @since 1.0 + * @since BuddyPress (1.0) */ function bp_page_title() { echo bp_get_page_title(); @@ -260,9 +280,9 @@ function bp_page_title() { * Prior to BuddyPress 1.5, this was used to generate the page's <title> text. * Now, just simply use wp_title(). * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Use wp_title() - * @since 1.0 + * @since BuddyPress (1.0) */ function bp_get_page_title() { _deprecated_function( __FUNCTION__, '1.5', 'wp_title()' ); @@ -277,9 +297,9 @@ function bp_page_title() { /** * Generate a link to log out. Last used in BP 1.2-beta. You should be using wp_logout_url(). * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Use wp_logout_url() - * @since 1.0 + * @since BuddyPress (1.0) */ function bp_log_out_link() { _deprecated_function( __FUNCTION__, '1.5', 'wp_logout_url()' ); @@ -291,12 +311,10 @@ function bp_log_out_link() { /** * Send an email and a BP notification on receipt of an @-mention in a group * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Deprecated in favor of the more general bp_activity_at_message_notification() */ function groups_at_message_notification( $content, $poster_user_id, $group_id, $activity_id ) { - global $bp; - _deprecated_function( __FUNCTION__, '1.5', 'bp_activity_at_message_notification()' ); /* Scan for @username strings in an activity update. Notify each user. */ @@ -331,8 +349,7 @@ function groups_at_message_notification( $content, $poster_user_id, $group_id, $ // Set up and send the message $ud = bp_core_get_core_userdata( $receiver_user_id ); $to = $ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . sprintf( __( '%1$s mentioned you in the group "%2$s"', 'buddypress' ), $poster_name, $group->name ); + $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%1$s mentioned you in the group "%2$s"', 'buddypress' ), $poster_name, $group->name ) ) ); $message = sprintf( __( '%1$s mentioned you in the group "%2$s": @@ -360,6 +377,7 @@ To view and respond to the message, log in and visit: %4$s /** * BP 1.5 simplified notification functions a bit + * @deprecated BuddyPress (1.5) */ function bp_core_delete_notifications_for_user_by_type( $user_id, $component_name, $component_action ) { _deprecated_function( __FUNCTION__, '1.5', 'bp_core_delete_notifications_by_type()' ); @@ -373,6 +391,7 @@ function bp_core_delete_notifications_for_user_by_item_id( $user_id, $item_id, $ /** * In BP 1.5, these functions were renamed for greater consistency + * @deprecated BuddyPress (1.5) */ function bp_forum_directory_permalink() { _deprecated_function( __FUNCTION__, '1.5', 'bp_forums_directory_permalink()' ); @@ -385,6 +404,7 @@ function bp_forum_directory_permalink() { /** * Last used by core in BP 1.1. The markup was merged into DTheme's header.php template. + * @deprecated BuddyPress (1.5) */ function bp_search_form() { _deprecated_function( __FUNCTION__, '1.1', 'No longer required.' ); @@ -404,17 +424,24 @@ function bp_search_form() { /** * Some _is_ function had their names normalized + * @deprecated BuddyPress (1.5) */ function bp_is_profile_edit() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_profile_edit()' ); return bp_is_user_profile_edit(); } +/** + * @deprecated BuddyPress (1.5) + */ function bp_is_change_avatar() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_change_avatar()' ); return bp_is_user_change_avatar(); } +/** + * @deprecated BuddyPress (1.5) + */ function bp_is_friend_requests() { _deprecated_function( __FUNCTION__, '1.5', 'bp_is_user_friend_requests()' ); return bp_is_user_friend_requests(); @@ -425,7 +452,7 @@ function bp_is_friend_requests() { * eg: http://domain.com/groups/the-group NOT http://domain.com/members/andy/groups/the-group * You should be using bp_is_root_component(). * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated bp_is_root_component() * @return true if root component, else false. */ @@ -440,6 +467,7 @@ function bp_core_is_root_component( $component_name ) { * Contains functions which were moved out of BP-Default's functions.php * in BuddyPress 1.5. * + * @deprecated BuddyPress (1.5) * @since BuddyPress (1.5) */ function bp_dtheme_deprecated() { @@ -449,12 +477,12 @@ function bp_dtheme_deprecated() { * Settings > Reading screen for selecting the page to show on front to * include "Activity Stream." As of 1.5.x, it is no longer required. * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated No longer required. * @param string $page_html A list of pages as a dropdown (select list) * @return string * @see wp_dropdown_pages() - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_wp_pages_filter( $page_html ) { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -467,12 +495,12 @@ function bp_dtheme_deprecated() { * In BuddyPress 1.2.x, this function hijacked the saving of page on front setting to save the activity stream setting. * As of 1.5.x, it is no longer required. * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated No longer required. * @param $string $oldvalue Previous value of get_option( 'page_on_front' ) * @param $string $oldvalue New value of get_option( 'page_on_front' ) * @return string - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_page_on_front_update( $oldvalue, $newvalue ) { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -488,11 +516,11 @@ function bp_dtheme_deprecated() { * In BuddyPress 1.2.x, this function loaded the activity stream template if the front page display settings allow. * As of 1.5.x, it is no longer required. * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated No longer required. * @param string $template Absolute path to the page template * @return string - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_page_on_front_template( $template ) { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -505,9 +533,9 @@ function bp_dtheme_deprecated() { * In BuddyPress 1.2.x, this forced the page ID as a string to stop the get_posts query from kicking up a fuss. * As of 1.5.x, it is no longer required. * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated No longer required. - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_fix_get_posts_on_activity_front() { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -519,11 +547,11 @@ function bp_dtheme_deprecated() { * In BuddyPress 1.2.x, this was used as part of the code that set the activity stream to be on the front page. * As of 1.5.x, it is no longer required. * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated No longer required. * @param array $posts Posts as retrieved by WP_Query * @return array - * @since 1.2.5 + * @since BuddyPress (1.2.5) */ function bp_dtheme_fix_the_posts_on_activity_front( $posts ) { _deprecated_function( __FUNCTION__, '1.5', "No longer required." ); @@ -536,9 +564,9 @@ function bp_dtheme_deprecated() { * In BuddyPress 1.2.x, this added the javascript needed for blog comment replies. * As of 1.5.x, we recommend that you enqueue the comment-reply javascript in your theme's header.php. * - * @deprecated 1.5 + * @deprecated BuddyPress (1.5) * @deprecated Enqueue the comment-reply script in your theme's header.php. - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_add_blog_comments_js() { _deprecated_function( __FUNCTION__, '1.5', "Enqueue the comment-reply script in your theme's header.php." ); @@ -677,4 +705,3 @@ function bp_core_screen_delete_account_title() { function bp_core_screen_delete_account_content() { _deprecated_function( __FUNCTION__, '1.5', 'Moved into theme template' ); } -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php index a782e7f6d07ab40ae1ef9083fbf5e9822b32988a..e84fb638264a7f3253dd82d8a5e960e0e970ad9d 100644 --- a/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php +++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.6.php @@ -8,41 +8,71 @@ * @deprecated Since 1.6 */ +// Exit if accessed directly +if ( !defined( 'ABSPATH' ) ) exit; + /** Toolbar functions *********************************************************/ +/** + * @deprecated BuddyPress (1.6) + */ function bp_admin_bar_remove_wp_menus() { _deprecated_function( __FUNCTION__, '1.6' ); } +/** + * @deprecated BuddyPress (1.6) + */ function bp_admin_bar_root_site() { _deprecated_function( __FUNCTION__, '1.6' ); } +/** + * @deprecated BuddyPress (1.6) + */ function bp_admin_bar_my_sites_menu() { _deprecated_function( __FUNCTION__, '1.6' ); } -function bp_admin_bar_comments_menu( $wp_admin_bar ) { +/** + * @deprecated BuddyPress (1.6) + */ +function bp_admin_bar_comments_menu( $wp_admin_bar = '' ) { _deprecated_function( __FUNCTION__, '1.6' ); } +/** + * @deprecated BuddyPress (1.6) + */ function bp_admin_bar_appearance_menu() { _deprecated_function( __FUNCTION__, '1.6' ); } +/** + * @deprecated BuddyPress (1.6) + */ function bp_admin_bar_updates_menu() { _deprecated_function( __FUNCTION__, '1.6' ); } +/** + * @deprecated BuddyPress (1.6) + */ function bp_members_admin_bar_my_account_logout() { _deprecated_function( __FUNCTION__, '1.6' ); } +/** + * @deprecated BuddyPress (1.6) + */ function bp_core_is_user_deleted( $user_id = 0 ) { _deprecated_function( __FUNCTION__, '1.6' ); bp_is_user_deleted( $user_id ); } +/** + * @deprecated BuddyPress (1.6) + */ function bp_core_is_user_spammer( $user_id = 0 ) { _deprecated_function( __FUNCTION__, '1.6' ); bp_is_user_spammer( $user_id ); @@ -54,7 +84,7 @@ function bp_core_is_user_spammer( $user_id = 0 ) { */ /** - * @deprecated 1.6 + * @deprecated BuddyPress (1.6) * @deprecated No longer used; see bp_blogs_transition_activity_status() */ function bp_blogs_manage_comment( $comment_id, $comment_status ) { @@ -66,7 +96,7 @@ function bp_blogs_manage_comment( $comment_id, $comment_status ) { */ /** - * @deprecated 1.6 + * @deprecated BuddyPress (1.6) * @deprecated No longer used; see BP_Admin::admin_menus() */ function bp_core_add_admin_menu() { @@ -74,25 +104,13 @@ function bp_core_add_admin_menu() { } /** - * @deprecated 1.6 + * @deprecated BuddyPress (1.6) * @deprecated No longer used. We do ajax properly now. */ function bp_core_add_ajax_hook() { _deprecated_function( __FUNCTION__, '1.6', 'No longer used' ); } -/** - * Members functions - */ - -/** - * @deprecated 1.6 - * @deprecated No longer used. Check for $bp->pages->activate->slug instead. - */ -function bp_has_custom_activation_page() { - _deprecated_function( __FUNCTION__, '1.6' ); -} - /** * Friends functions */ @@ -100,7 +118,7 @@ function bp_has_custom_activation_page() { /** * Displays Friends header tabs * - * @deprecated 1.6 + * @deprecated BuddyPress (1.6) * @deprecated No longer used */ function bp_friends_header_tabs() { @@ -118,7 +136,7 @@ function bp_friends_header_tabs() { /** * Filters the title for the Friends component * - * @deprecated 1.6 + * @deprecated BuddyPress (1.6) * @deprecated No longer used */ function bp_friends_filter_title() { @@ -140,12 +158,10 @@ function bp_friends_filter_title() { } -/** - * Groups functions - */ +/** Groups functions **********************************************************/ /** - * @deprecated 1.6 + * @deprecated BuddyPress (1.6) * @deprecated Renamed to groups_get_id() for greater consistency */ function groups_check_group_exists( $group_slug ) { @@ -153,27 +169,21 @@ function groups_check_group_exists( $group_slug ) { return groups_get_id( $group_slug ); } -/** - * Admin functions - */ +/** Admin functions ***********************************************************/ /** * Loads admin panel styles and scripts. * - * @deprecated 1.6 - * @deprecated No longer used. + * @deprecated BuddyPress (1.6) */ function bp_core_add_admin_menu_styles() { _deprecated_function( __FUNCTION__, '1.6' ); } -/** - * Activity functions - */ +/** Activity functions ********************************************************/ /** - * @deprecated 1.6 - * @deprecated No longer used. Renamed to bp_activity_register_activity_actions(). + * @deprecated BuddyPress (1.6) */ function updates_register_activity_actions() { _deprecated_function( __FUNCTION__, '1.6' ); @@ -182,8 +192,7 @@ function updates_register_activity_actions() { /** * Sets the "From" address in emails sent * - * @deprecated 1.6 - * @deprecated No longer used. + * @deprecated BuddyPress (1.6) * @return noreply@sitedomain email address */ function bp_core_email_from_address_filter() { @@ -209,6 +218,8 @@ function bp_core_email_from_address_filter() { * * Note that this hack only runs if the function bp_dtheme_register_actions() is not found (this * function was introduced in BP 1.6 for related backward compatibility reasons). + * + * @deprecated BuddyPress (1.6) */ if ( !function_exists( 'bp_dtheme_register_actions' ) ) : function bp_die_legacy_ajax_callbacks() { @@ -261,4 +272,3 @@ if ( !function_exists( 'bp_dtheme_register_actions' ) ) : } add_action( 'after_setup_theme', 'bp_die_legacy_ajax_callbacks', 20 ); endif; -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-core/deprecated/1.7.php b/wp-content/plugins/buddypress/bp-core/deprecated/1.7.php new file mode 100644 index 0000000000000000000000000000000000000000..20f12d786fddf6037efbea69eb06812f8c8f37b6 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/deprecated/1.7.php @@ -0,0 +1,163 @@ +<?php +/** + * Deprecated Functions + * + * @package BuddyPress + * @subpackage Core + * @deprecated Since 1.7 + */ + +// Exit if accessed directly +if ( !defined( 'ABSPATH' ) ) exit; + +/** + * Output the BuddyPress maintenance mode + * + * @since BuddyPress (1.6) + * @deprecated BuddyPress (1.7) + * @uses bp_get_maintenance_mode() To get the BuddyPress maintenance mode + */ +function bp_maintenance_mode() { + echo bp_get_maintenance_mode(); +} + /** + * Return the BuddyPress maintenance mode + * + * @since BuddyPress (1.6) + * @deprecated BuddyPress (1.7) + * @return string The BuddyPress maintenance mode + */ + function bp_get_maintenance_mode() { + return buddypress()->maintenance_mode; + } + +/** + * @deprecated BuddyPress (1.7) + */ +function xprofile_get_profile() { + _deprecated_function( __FUNCTION__, '1.7' ); + bp_locate_template( array( 'profile/profile-loop.php' ), true ); +} + +/** + * @deprecated BuddyPress (1.7) + */ +function bp_get_profile_header() { + _deprecated_function( __FUNCTION__, '1.7' ); + bp_locate_template( array( 'profile/profile-header.php' ), true ); +} + +/** + * @deprecated BuddyPress (1.7) + * @param string $component_name + * @return boolean + */ +function bp_exists( $component_name ) { + _deprecated_function( __FUNCTION__, '1.7' ); + if ( function_exists( $component_name . '_install' ) ) + return true; + + return false; +} + +/** + * @deprecated BuddyPress (1.7) + */ +function bp_get_plugin_sidebar() { + _deprecated_function( __FUNCTION__, '1.7' ); + bp_locate_template( array( 'plugin-sidebar.php' ), true ); +} + +/** + * On multiblog installations you must first allow themes to be activated and + * show up on the theme selection screen. This function will let the BuddyPress + * bundled themes show up on the root blog selection screen and bypass this + * step. It also means that the themes won't show for selection on other blogs. + * + * @deprecated BuddyPress (1.7) + * @package BuddyPress Core + */ +function bp_core_allow_default_theme( $themes ) { + _deprecated_function( __FUNCTION__, '1.7' ); + + if ( !bp_current_user_can( 'bp_moderate' ) ) + return $themes; + + if ( bp_get_root_blog_id() != get_current_blog_id() ) + return $themes; + + if ( isset( $themes['bp-default'] ) ) + return $themes; + + $themes['bp-default'] = true; + + return $themes; +} + +/** + * No longer used by BuddyPress core + * + * @deprecated BuddyPress (1.7) + * @param string $page + * @return boolean True if is BuddyPress page + */ +function bp_is_page( $page = '' ) { + _deprecated_function( __FUNCTION__, '1.7' ); + + if ( !bp_is_user() && bp_is_current_component( $page ) ) + return true; + + if ( 'home' == $page ) + return is_front_page(); + + return false; +} + +/** Admin *********************************************************************/ + +/** + * This function was originally used to update pre-1.1 schemas, but that was + * before we had a legitimate update process. + * + * @deprecated BuddyPress (1.7) + * @global WPDB $wpdb + */ +function bp_update_db_stuff() { + global $wpdb; + + $bp = buddypress(); + $bp_prefix = bp_core_get_table_prefix(); + + // Rename the old user activity cached table if needed. + if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_activity_user_activity_cached%'" ) ) { + $wpdb->query( "RENAME TABLE {$bp_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" ); + } + + // Rename fields from pre BP 1.2 + if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) { + if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) { + $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" ); + } + + if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) ) { + $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" ); + } + } + + // On first installation - record all existing blogs in the system. + if ( !(int) $bp->site_options['bp-blogs-first-install'] ) { + bp_blogs_record_existing_blogs(); + bp_update_option( 'bp-blogs-first-install', 1 ); + } + + if ( is_multisite() ) { + bp_core_add_illegal_names(); + } + + // Update and remove the message threads table if it exists + if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp_prefix}bp_messages_threads%'" ) ) { + if ( BP_Messages_Thread::update_tables() ) { + $wpdb->query( "DROP TABLE {$bp_prefix}bp_messages_threads" ); + } + } +} diff --git a/wp-content/plugins/buddypress/bp-core/js/widget-members.js b/wp-content/plugins/buddypress/bp-core/js/widget-members.js index cf2c8d29b8229f67ca2a58026f281e8bd573cf06..6a8346edaad7799ee0b1bebbc27f44de13f36212 100644 --- a/wp-content/plugins/buddypress/bp-core/js/widget-members.js +++ b/wp-content/plugins/buddypress/bp-core/js/widget-members.js @@ -1 +1,49 @@ -jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").live("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#members-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");member_wiget_response(b)});return false})});function member_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]);jQuery(".widget ul#members-list").fadeIn(200)})}else{jQuery(".widget ul#members-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#members-list").html(b);jQuery(".widget ul#members-list").fadeIn(200)})}}; \ No newline at end of file +jQuery(document).ready( function() { + jQuery(".widget div#members-list-options a").on('click', + function() { + var link = this; + jQuery(link).addClass('loading'); + + jQuery(".widget div#members-list-options a").removeClass("selected"); + jQuery(this).addClass('selected'); + + jQuery.post( ajaxurl, { + action: 'widget_members', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce': jQuery("input#_wpnonce-members").val(), + 'max-members': jQuery("input#members_widget_max").val(), + 'filter': jQuery(this).attr('id') + }, + function(response) + { + jQuery(link).removeClass('loading'); + member_wiget_response(response); + }); + + return false; + } + ); +}); + +function member_wiget_response(response) { + response = response.substr(0, response.length-1); + response = response.split('[[SPLIT]]'); + + if ( response[0] != "-1" ) { + jQuery(".widget ul#members-list").fadeOut(200, + function() { + jQuery(".widget ul#members-list").html(response[1]); + jQuery(".widget ul#members-list").fadeIn(200); + } + ); + + } else { + jQuery(".widget ul#members-list").fadeOut(200, + function() { + var message = '<p>' + response[1] + '</p>'; + jQuery(".widget ul#members-list").html(message); + jQuery(".widget ul#members-list").fadeIn(200); + } + ); + } +} diff --git a/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js b/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js new file mode 100644 index 0000000000000000000000000000000000000000..f53122706bd9da6e306b1970e6d1a0b95fd5de3e --- /dev/null +++ b/wp-content/plugins/buddypress/bp-core/js/widget-members.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(){jQuery(".widget div#members-list-options a").on("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#members-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_members",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-members").val(),"max-members":jQuery("input#members_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");member_wiget_response(b)});return false})});function member_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#members-list").fadeOut(200,function(){jQuery(".widget ul#members-list").html(a[1]);jQuery(".widget ul#members-list").fadeIn(200)})}else{jQuery(".widget ul#members-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#members-list").html(b);jQuery(".widget ul#members-list").fadeIn(200)})}}; \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-forums/bb-config.php b/wp-content/plugins/buddypress/bp-forums/bb-config.php index b34b28bacca4a06515831d2de7906907b21cf401..70efbe81b2b73136c523afb889a7b3bf8cd7747c 100644 --- a/wp-content/plugins/buddypress/bp-forums/bb-config.php +++ b/wp-content/plugins/buddypress/bp-forums/bb-config.php @@ -8,4 +8,3 @@ */ header("HTTP/1.0 403 Forbidden"); die; -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php index edcda6d9768699e6c498b5dab342c8ab73e332e0..303eaff798834a73b0380310ca65d32198a54fa5 100644 --- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php +++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-meta.php @@ -300,7 +300,7 @@ function bb_get_option( $option ) $r = $bb_locale->text_direction; break; case 'version': - return '1.1'; // Don't filter + return '1.2'; // Don't filter break; case 'bb_db_version' : return '2471'; // Don't filter diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-posts.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-posts.php index 4a2fca32617b7a2860d327c4286294ae494543c4..eada58847583cdb0845355ba5a0b880b509ea63b 100644 --- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-posts.php +++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-posts.php @@ -626,14 +626,15 @@ function bb_get_recent_user_replies( $user_id ) { * @param int $post_id ID of new post */ function bb_notify_subscribers( $post_id ) { - global $bbdb, $bb_ksd_pre_post_status; - - if ( !empty( $bb_ksd_pre_post_status ) ) - return false; + global $bbdb; if ( !$post = bb_get_post( $post_id ) ) return false; + // bozo or spam + if ( 2 == $post->post_status ) + return false; + if ( !$topic = get_topic( $post->topic_id ) ) return false; diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php index 187fd2fa8527cd741d1a50f93129a7a44018c3c4..17c9a14c833c42ac094950f0949d927f3069508c 100644 --- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php +++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php @@ -1207,7 +1207,11 @@ function topic_last_poster( $id = 0 ) { function get_topic_last_poster( $id = 0 ) { $topic = get_topic( get_topic_id( $id ) ); - $user_display_name = get_post_author( $topic->topic_last_post_id ); + if ( isset( $topic->topic_last_post_id ) && ( 1 == $topic->topic_last_post_id ) ) { + $user_display_name = $topic->topic_poster_name; + } else { + $user_display_name = get_post_author( $topic->topic_last_post_id ); + } return apply_filters( 'get_topic_last_poster', $user_display_name, $topic->topic_last_poster, $topic->topic_id ); // $topic->topic_last_poster = user ID } @@ -1219,7 +1223,11 @@ function topic_author( $id = 0 ) { function get_topic_author( $id = 0 ) { $topic = get_topic( get_topic_id( $id ) ); $first_post = bb_get_first_post( $topic ); - $user_display_name = get_post_author( $first_post->post_id ); + if ( !empty( $first_post ) ) { + $user_display_name = get_post_author( $first_post->post_id ); + } else { + $user_display_name = $topic->topic_poster_name; + } return apply_filters( 'get_topic_author', $user_display_name, $topic->topic_poster, $topic->topic_id ); // $topic->topic_poster = user ID } diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php index a06bb72aa71fcc66c3f9b71f41e6eeb062b389ef..bd3ae059174e976079ff0e8ed80847619d0150a9 100644 --- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php +++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-includes/functions.bb-topic-tags.php @@ -65,9 +65,12 @@ function bb_create_tag( $tag ) { if ( list($term_id, $tt_id) = $wp_taxonomy_object->is_term( $tag, 'bb_topic_tag' ) ) return $tt_id; - list($term_id, $tt_id) = $wp_taxonomy_object->insert_term( $tag, 'bb_topic_tag' ); + $term = $wp_taxonomy_object->insert_term( $tag, 'bb_topic_tag' ); + if ( is_wp_error( $term ) ) + return false; - if ( is_wp_error($term_id) || is_wp_error($tt_id) || !$tt_id ) + list( $term_id, $tt_id ) = $term; + if ( ! $tt_id ) return false; return $tt_id; diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-login.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-login.php index 775e0eb5910bc8fc72e6126c5d14837eeca6b6d1..b135978109006cec000a2304fd1d0e9f5bd9f091 100644 --- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-login.php +++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-login.php @@ -12,11 +12,11 @@ nocache_headers(); /** Look for redirection ******************************************************/ // Look for 'redirect_to' -if ( isset( $_REQUEST['redirect_to'] ) ) +if ( isset( $_REQUEST['redirect_to'] ) && is_string( $_REQUEST['redirect_to'] ) ) $re = $_REQUEST['redirect_to']; // Look for 're' - if ( empty( $re ) && isset( $_REQUEST['re'] ) ) + if ( empty( $re ) && isset( $_REQUEST['re'] ) && is_string( $_REQUEST['re'] ) ) $re = $_REQUEST['re']; // Use referer @@ -31,6 +31,7 @@ if ( isset( $_REQUEST['redirect_to'] ) ) if ( false !== strpos( $re, $home_path . 'register.php' ) || false !== strpos( $re, $home_path . 'bb-reset-password.php' ) ) $re = bb_get_uri( null, null, BB_URI_CONTEXT_HEADER ); + } /** diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/akismet.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/akismet.php index add8df79acf9d426740acf76d329fd328ea31648..ca2fc7ad1c9fe8d5cb9031d05a50e7c96629dc41 100644 --- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/akismet.php +++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/akismet.php @@ -382,7 +382,7 @@ function bb_akismet_delete_old() } } -function bb_ksd_pre_post_status( $post_status ) +function bb_ksd_pre_post_status( $post_status, $post_ID ) { global $bb_current_user, $bb_ksd_pre_post_status, $bb_ksd_pre_post; @@ -392,13 +392,18 @@ function bb_ksd_pre_post_status( $post_status ) } $response = bb_ksd_submit( $bb_ksd_pre_post ); + + if ( isset( $response[1] ) ) { + bb_update_postmeta( $post_ID, 'akismet_response', $response[1] ); + } + if ( 'true' == $response[1] ) { $bb_ksd_pre_post_status = '2'; return $bb_ksd_pre_post_status; } return $post_status; } -add_filter( 'pre_post_status', 'bb_ksd_pre_post_status' ); +add_filter( 'pre_post_status', 'bb_ksd_pre_post_status', 10, 2 ); function bb_ksd_delete_post( $post_id, $new_status, $old_status ) { diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/bozo.php b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/bozo.php index c48ed6c8ab425b756bf92434b596140a7a84652a..4763659c6533bd324d12de09ad45661ef5177fd5 100644 --- a/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/bozo.php +++ b/wp-content/plugins/buddypress/bp-forums/bbpress/bb-plugins/bozo.php @@ -350,7 +350,7 @@ function bb_bozo_user_search_role_user_ids( $role_user_ids, $roles, $args ) return array(); } - return array_intersect( $bozo_user_ids, $role_user_ids ); + return array_intersect( (array) $bozo_user_ids, $role_user_ids ); } add_filter( 'bb_user_search_role_user_ids', 'bb_bozo_user_search_role_user_ids', 10, 3 ); diff --git a/wp-content/plugins/buddypress/bp-forums/bbpress/rss.php b/wp-content/plugins/buddypress/bp-forums/bbpress/rss.php index a99b6a9edffc31f0718efc23abf345a5c9539d9a..772b2797318acc3f611810584a160fc3dbd2087e 100644 --- a/wp-content/plugins/buddypress/bp-forums/bbpress/rss.php +++ b/wp-content/plugins/buddypress/bp-forums/bbpress/rss.php @@ -184,7 +184,7 @@ if ( !$bb_db_override ) { if ( !$posts ) /* We do typecasting in the template, but all themes don't have that! */ $posts = array(); else /* Only send 304 if there are posts */ - bb_send_304( $posts[0]->post_time ); + bb_send_304( gmdate('D, d M Y H:i:s \G\M\T', strtotime( $posts[0]->post_time ) ) ); if (!$description = bb_get_option( 'description' ) ) { $description = $title; @@ -196,4 +196,3 @@ $link_self = apply_filters( 'bb_link_self_rss', $link_self, $feed ); bb_load_template( 'rss2.php', array('bb_db_override', 'title', 'description', 'link', 'link_self'), $feed ); -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php index 6f2585e659d88a3301641593e206f7683f33fb61..9d3161346fcfb412bba8662557715c2657bc8a3f 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-actions.php @@ -1,5 +1,3 @@ <?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php index d8d0eede302b9d280624c5e0f8a60a3b1ccf129c..b6e0c8c4c92ddca04be090246e5b9e5cbc7d226c 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress-sa.php @@ -420,5 +420,3 @@ function bp_bb_dbDelta($queries, $execute = true) { return $for_update; } - -?> diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php index 71da6c37338f2fe4fd9c03cdfbdea71385cde742..65810a303359bc613457496bd0542f6e1a68c386 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-bbpress.php @@ -5,4 +5,3 @@ // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php index 4a16166f6b5ffc6d348858ee0360ad29afdf5404..171bd69477eb2a8be3c43cad59d3b7ae7299afc2 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-filters.php @@ -150,7 +150,6 @@ add_filter( 'bp_get_the_topic_text', 'bp_forums_strip_mentions_on_post_edit' ); * @package BuddyPress * @since BuddyPress (1.5) * - * @global object $wpdb The WordPress database global * @param string $sql * @return string $sql */ @@ -176,7 +175,7 @@ function bp_forums_add_replied_distinct_sql( $sql ) { function bp_forums_add_replied_join_sql( $sql ) { global $bbdb; - $sql .= " LEFT JOIN $bbdb->posts p ON p.topic_id = t.topic_id "; + $sql .= " LEFT JOIN {$bbdb->posts} p ON p.topic_id = t.topic_id "; return $sql; } @@ -203,5 +202,3 @@ function bp_forums_add_replied_where_sql( $sql ) { return $sql; } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php index 5085d491f38562112c3db8ac2818ce4cb47cabeb..3f92e0aaf293166e857bfca5816718b7e3f1e418 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-functions.php @@ -34,7 +34,7 @@ function bp_forums_is_bbpress_active() { * @return boolean True if option exists, false if not */ function bp_forums_is_installed_correctly() { - global $bp; + $bp = buddypress(); if ( isset( $bp->forums->bbconfig ) && is_file( $bp->forums->bbconfig ) ) return true; @@ -51,9 +51,7 @@ function bp_forums_is_installed_correctly() { * @return bool True if set, False if empty */ function bp_forums_has_directory() { - global $bp; - - return (bool) !empty( $bp->pages->forums->id ); + return (bool) !empty( buddypress()->pages->forums->id ); } /** Forum Functions ***********************************************************/ @@ -66,15 +64,13 @@ function bp_forums_get_forum( $forum_id ) { function bp_forums_new_forum( $args = '' ) { do_action( 'bbpress_init' ); - $defaults = array( + $r = wp_parse_args( $args, array( 'forum_name' => '', 'forum_desc' => '', 'forum_parent_id' => bp_forums_parent_forum_id(), 'forum_order' => false, 'forum_is_category' => 0 - ); - - $r = wp_parse_args( $args, $defaults ); + ) ); extract( $r, EXTR_SKIP ); return bb_new_forum( array( 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) ); @@ -83,7 +79,7 @@ function bp_forums_new_forum( $args = '' ) { function bp_forums_update_forum( $args = '' ) { do_action( 'bbpress_init' ); - $defaults = array( + $r = wp_parse_args( $args, array( 'forum_id' => '', 'forum_name' => '', 'forum_desc' => '', @@ -91,9 +87,7 @@ function bp_forums_update_forum( $args = '' ) { 'forum_parent_id' => bp_forums_parent_forum_id(), 'forum_order' => false, 'forum_is_category' => 0 - ); - - $r = wp_parse_args( $args, $defaults ); + ) ); extract( $r, EXTR_SKIP ); return bb_update_forum( array( 'forum_id' => (int) $forum_id, 'forum_name' => stripslashes( $forum_name ), 'forum_desc' => stripslashes( $forum_desc ), 'forum_slug' => stripslashes( $forum_slug ), 'forum_parent' => $forum_parent_id, 'forum_order' => $forum_order, 'forum_is_category' => $forum_is_category ) ); @@ -112,11 +106,9 @@ add_action( 'groups_delete_group', 'bp_forums_delete_group_forum' ); /** Topic Functions ***********************************************************/ function bp_forums_get_forum_topics( $args = '' ) { - global $bp; - do_action( 'bbpress_init' ); - $defaults = array( + $r = wp_parse_args( $args, array( 'type' => 'newest', 'forum_id' => false, 'user_id' => false, @@ -127,9 +119,7 @@ function bp_forums_get_forum_topics( $args = '' ) { 'exclude' => false, 'show_stickies' => 'all', 'filter' => false // if $type = tag then filter is the tag name, otherwise it's terms to search on. - ); - - $r = wp_parse_args( $args, $defaults ); + ) ); extract( $r, EXTR_SKIP ); if ( class_exists( 'BB_Query' ) ) { @@ -183,7 +173,7 @@ function bp_forums_new_topic( $args = '' ) { do_action( 'bbpress_init' ); - $defaults = array( + $r = wp_parse_args( $args, array( 'topic_title' => '', 'topic_slug' => '', 'topic_text' => '', @@ -196,9 +186,7 @@ function bp_forums_new_topic( $args = '' ) { 'topic_open' => 1, 'topic_tags' => false, // accepts array or comma delim 'forum_id' => 0 // accepts ids or slugs - ); - - $r = wp_parse_args( $args, $defaults ); + ) ); extract( $r, EXTR_SKIP ); $topic_title = strip_tags( $topic_title ); @@ -228,22 +216,18 @@ function bp_forums_new_topic( $args = '' ) { } function bp_forums_update_topic( $args = '' ) { - global $bp; - do_action( 'bbpress_init' ); - $defaults = array( + $r = wp_parse_args( $args, array( 'topic_id' => false, 'topic_title' => '', 'topic_text' => '', 'topic_tags' => false - ); - - $r = wp_parse_args( $args, $defaults ); + ) ); extract( $r, EXTR_SKIP ); - // Check if the user is a spammer - if ( bp_is_user_inactive( bp_loggedin_user_id() ) ) + // Check if the user is a spammer + if ( bp_is_user_inactive( bp_loggedin_user_id() ) ) return false; // bb_insert_topic() will append tags, but not remove them. So we remove all existing tags. @@ -263,16 +247,12 @@ function bp_forums_update_topic( $args = '' ) { } function bp_forums_sticky_topic( $args = '' ) { - global $bp; - do_action( 'bbpress_init' ); - $defaults = array( + $r = wp_parse_args( $args, array( 'topic_id' => false, 'mode' => 'stick' // stick/unstick - ); - - $r = wp_parse_args( $args, $defaults ); + ) ); extract( $r, EXTR_SKIP ); if ( 'stick' == $mode ) @@ -284,16 +264,12 @@ function bp_forums_sticky_topic( $args = '' ) { } function bp_forums_openclose_topic( $args = '' ) { - global $bp; - do_action( 'bbpress_init' ); - $defaults = array( + $r = wp_parse_args( $args, array( 'topic_id' => false, 'mode' => 'close' // stick/unstick - ); - - $r = wp_parse_args( $args, $defaults ); + ) ); extract( $r, EXTR_SKIP ); if ( 'close' == $mode ) @@ -305,15 +281,11 @@ function bp_forums_openclose_topic( $args = '' ) { } function bp_forums_delete_topic( $args = '' ) { - global $bp; - do_action( 'bbpress_init' ); - $defaults = array( + $r = wp_parse_args( $args, array( 'topic_id' => false - ); - - $r = wp_parse_args( $args, $defaults ); + ) ); extract( $r, EXTR_SKIP ); return bb_delete_topic( $topic_id, 1 ); @@ -345,33 +317,52 @@ function bp_forums_total_topic_count() { * Check to see whether a user has already left this particular reply on a given post. * Prevents dupes. * - * @since 1.6 + * @since BuddyPress (1.6) * * @param str $text The text of the comment * @param int $topic_id The topic id * @param int $user_id The user id */ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) { + $reply_exists = false; - + if ( $text && $topic_id && $user_id ) { do_action( 'bbpress_init' ); - + $args = array( 'post_author_id' => $user_id, 'topic_id' => $topic_id ); - + + // Set the reply_exists_text so we can check it in the filter below + buddypress()->forums->reply_exists_text = $text; + // BB_Query's post_text parameter does a MATCH, while we need exact matches - add_filter( 'get_posts_where', create_function( '$q', 'return $q . " AND p.post_text = \'' . $text . '\'";' ) ); - + add_filter( 'get_posts_where', '_bp_forums_reply_exists_posts_where' ); $query = new BB_Query( 'post', $args ); - - $reply_exists = !empty( $query->results ); + remove_filter( 'get_posts_where', '_bp_forums_reply_exists_posts_where' ); + + // Cleanup + unset( buddypress()->forums->reply_exists_text ); + + $reply_exists = (bool) !empty( $query->results ); + } + + return (bool) apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id ); +} + /** + * Private one-time-use function used in conjunction with bp_forums_reply_exists() + * + * @since BuddyPress (1.7) + * @access private + * @global WPDB $wpdb + * @param string $where + * @return string + */ + function _bp_forums_reply_exists_posts_where( $where = '' ) { + return $where . " AND p.post_text = '" . buddypress()->forums->reply_exists_text . "'"; } - - return apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id ); -} /** * Get a total "Topics Started" count for a given user @@ -383,8 +374,6 @@ function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) { * @return int $count The topic count */ function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' ) { - global $bp; - do_action( 'bbpress_init' ); if ( !$user_id ) @@ -423,8 +412,6 @@ function bp_forums_total_topic_count_for_user( $user_id = 0, $type = 'active' ) * @return int $count */ function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' ) { - global $bp; - do_action( 'bbpress_init' ); if ( !$user_id ) @@ -460,11 +447,13 @@ function bp_forums_total_replied_count_for_user( $user_id = 0, $type = 'active' } function bp_forums_get_topic_extras( $topics ) { - global $bp, $wpdb, $bbdb; + global $wpdb, $bbdb; if ( empty( $topics ) ) return $topics; + $bp = buddypress(); + // Get the topic ids foreach ( (array) $topics as $topic ) $topic_ids[] = $topic->topic_id; $topic_ids = $wpdb->escape( join( ',', (array) $topic_ids ) ); @@ -536,23 +525,18 @@ function bp_forums_get_post( $post_id ) { } function bp_forums_delete_post( $args = '' ) { - global $bp; - do_action( 'bbpress_init' ); - $defaults = array( + $r = wp_parse_args( $args, array( 'post_id' => false - ); + ) ); - $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); return bb_delete_post( $post_id, 1 ); } function bp_forums_insert_post( $args = '' ) { - global $bp; - do_action( 'bbpress_init' ); $defaults = array( @@ -646,7 +630,7 @@ function bp_forums_get_forum_topicpost_count( $forum_id ) { } function bp_forums_filter_caps( $allcaps ) { - global $bp, $wp_roles, $bb_table_prefix; + global $wp_roles, $bb_table_prefix; if ( !bp_loggedin_user_id() ) return $allcaps; @@ -746,4 +730,3 @@ function bp_embed_forum_cache( $cache, $id, $cachekey ) { function bp_embed_forum_save_cache( $cache, $cachekey, $id ) { bb_update_postmeta( $id, $cachekey, $cache ); } -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php index 24b9cfef57e44a44012087b923fdcbc66f3cb146..0d01eaa13962bb5c53f1278211f246192bdf306c 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-loader.php @@ -34,10 +34,9 @@ class BP_Forums_Component extends BP_Component { * backwards compatibility. * * @since BuddyPress (1.5) - * @global BuddyPress $bp The one true BuddyPress instance */ function setup_globals() { - global $bp; + $bp = buddypress(); // Define the parent forum ID if ( !defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) @@ -79,10 +78,6 @@ class BP_Forums_Component extends BP_Component { 'functions', ); - // Admin area - if ( is_admin() ) - $includes[] = 'admin'; - // bbPress stand-alone if ( !defined( 'BB_PATH' ) ) $includes[] = 'bbpress-sa'; @@ -92,11 +87,8 @@ class BP_Forums_Component extends BP_Component { /** * Setup BuddyBar navigation - * - * @global BuddyPress $bp The one true BuddyPress instance */ function setup_nav() { - global $bp; // Stop if forums haven't been set up yet if ( !bp_forums_is_installed_correctly() ) @@ -150,29 +142,13 @@ class BP_Forums_Component extends BP_Component { 'item_css_id' => 'replies' ); - // Favorite forums items. Disabled until future release. - /* - $sub_nav[] = array( - 'name' => __( 'Favorites', 'buddypress' ), - 'slug' => 'favorites', - 'parent_url' => $forums_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'bp_member_forums_screen_favorites', - 'position' => 60, - 'item_css_id' => 'favorites' - ); - */ - parent::setup_nav( $main_nav, $sub_nav ); } /** * Set up the Toolbar - * - * @global BuddyPress $bp The one true BuddyPress instance */ function setup_admin_bar() { - global $bp; // Prevent debug notices $wp_admin_nav = array(); @@ -185,7 +161,7 @@ class BP_Forums_Component extends BP_Component { // Add the "My Account" sub menus $wp_admin_nav[] = array( - 'parent' => $bp->my_account_menu_id, + 'parent' => buddypress()->my_account_menu_id, 'id' => 'my-account-' . $this->id, 'title' => __( 'Forums', 'buddypress' ), 'href' => trailingslashit( $forums_link ) @@ -221,11 +197,9 @@ class BP_Forums_Component extends BP_Component { /** * Sets up the title for pages and <title> - * - * @global BuddyPress $bp The one true BuddyPress instance */ function setup_title() { - global $bp; + $bp = buddypress(); // Adjust title based on view if ( bp_is_forums_component() ) { @@ -246,10 +220,6 @@ class BP_Forums_Component extends BP_Component { } function bp_setup_forums() { - global $bp; - - $bp->forums = new BP_Forums_Component(); + buddypress()->forums = new BP_Forums_Component(); } add_action( 'bp_setup_components', 'bp_setup_forums', 6 ); - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php index c2010f9ff01be2562a62dbc3ef609aa79aeec0f7..aed9f71c8cec2d873f780c6ef63101a62a495ab0 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-screens.php @@ -3,7 +3,9 @@ if ( !defined( 'ABSPATH' ) ) exit; function bp_forums_directory_forums_setup() { - global $bp; + + // Get BuddyPress once + $bp = buddypress(); if ( bp_is_forums_component() && ( !bp_current_action() || ( 'tag' == bp_current_action() && bp_action_variables() ) ) && !bp_current_item() ) { if ( !bp_forums_has_directory() ) @@ -71,16 +73,12 @@ function bp_forums_directory_forums_setup() { add_action( 'bp_screens', 'bp_forums_directory_forums_setup', 2 ); function bp_member_forums_screen_topics() { - global $bp; - do_action( 'bp_member_forums_screen_topics' ); bp_core_load_template( apply_filters( 'bp_member_forums_screen_topics', 'members/single/home' ) ); } function bp_member_forums_screen_replies() { - global $bp; - do_action( 'bp_member_forums_screen_replies' ); bp_core_load_template( apply_filters( 'bp_member_forums_screen_replies', 'members/single/home' ) ); @@ -94,15 +92,12 @@ function bp_member_forums_screen_replies() { * @package BuddyPress Forums */ function bp_member_forums_screen_favorites() { - global $bp; - do_action( 'bp_member_forums_screen_favorites' ); bp_core_load_template( apply_filters( 'bp_member_forums_screen_favorites', 'members/single/home' ) ); } function bp_forums_screen_single_forum() { - global $bp; if ( !bp_is_forums_component() || !bp_is_current_action( 'forum' ) || !bp_action_variable( 0 ) ) return false; @@ -114,7 +109,6 @@ function bp_forums_screen_single_forum() { add_action( 'bp_screens', 'bp_forums_screen_single_forum' ); function bp_forums_screen_single_topic() { - global $bp; if ( !bp_is_forums_component() || !bp_is_current_action( 'topic' ) || !bp_action_variable( 0 ) ) return false; @@ -124,4 +118,98 @@ function bp_forums_screen_single_topic() { bp_core_load_template( apply_filters( 'bp_forums_screen_single_topic', 'forums/single/topic' ) ); } add_action( 'bp_screens', 'bp_forums_screen_single_topic' ); -?> + + +/** Theme Compatability *******************************************************/ + +/** + * The main theme compat class for legacy BuddyPress forums, as powered by bbPress 1.x + * + * This class sets up the necessary theme compatability actions to safely output + * old forum template parts to the_title and the_content areas of a theme. + * + * @since BuddyPress (1.7) + */ +class BP_Forum_Legacy_Theme_Compat { + + /** + * Setup the old forums component theme compatibility + * + * @since BuddyPress (1.7) + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_legacy_forum' ) ); + } + + /** + * Are we looking at something that needs old forum theme compatability? + * + * @since BuddyPress (1.7) + */ + public function is_legacy_forum() { + + // Bail if not looking at a group + if ( ! bp_is_forums_component() ) + return; + + // forum Directory + if ( ( ! bp_current_action() || ( 'tag' == bp_current_action() && bp_action_variables() ) ) && ! bp_current_item() ) { + + if ( ! bp_forums_has_directory() ) + return false; + + if ( ! bp_forums_is_installed_correctly() ) { + bp_core_add_message( __( 'The forums component has not been set up yet.', 'buddypress' ), 'error' ); + bp_core_redirect( bp_get_root_domain() ); + } + + bp_update_is_directory( true, 'forums' ); + + do_action( 'bp_forums_directory_forums_setup' ); + + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); + + } + + } + + /** Directory *************************************************************/ + + /** + * Update the global $post with directory data + * + * @since BuddyPress (1.7) + */ + public function directory_dummy_post() { + + // Title based on ability to create groups + if ( is_user_logged_in() ) { + $title = __( 'Forums', 'buddypress' ) . ' <a class="button show-hide-new bp-title-button" href="#new-topic" id="new-topic-button">' . __( 'New Topic', 'buddypress' ) . '</a>'; + } else { + $title = __( 'Forums', 'buddypress' ); + } + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => $title, + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_forum', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the old forum index template part + * + * @since BuddyPress (1.7) + */ + public function directory_content() { + bp_buffer_template_part( 'forums/index' ); + } +} +new BP_Forum_Legacy_Theme_Compat(); diff --git a/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php b/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php index 527ff65288b06a50bb32e790bafc58e24dc1db07..88923bc1bc8df5eb3fcafd4babedf3c5bcc4443f 100644 --- a/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php +++ b/wp-content/plugins/buddypress/bp-forums/bp-forums-template.php @@ -1465,4 +1465,3 @@ function bp_forum_topic_count( $user_id = 0 ) { function bp_get_forum_topic_count( $user_id = 0 ) { return apply_filters( 'bp_get_forum_topic_count', bp_forums_total_topic_count( $user_id ) ); } -?> diff --git a/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php b/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php index 9368fe774e2fe091dd7af2069aa9323abfd4282c..a8a808399f938a045eac2ee6c78f7f0a42e5a1c1 100644 --- a/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php +++ b/wp-content/plugins/buddypress/bp-forums/deprecated/1.6.php @@ -5,7 +5,7 @@ * * This file contains all the deprecated functions for BuddyPress forums since * version 1.6. This was a major update for the forums component, moving from - * bbPress 1.1 to bbPress 2.1. + * bbPress 1.x to bbPress 2.x. * * @package BuddyPress * @subpackage Forums @@ -41,7 +41,7 @@ function bp_forums_bbpress_admin() { else : ?> - <div style="width: 45%; float: left; margin-top: 20px;"> + <div> <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3> <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p> @@ -60,23 +60,6 @@ function bp_forums_bbpress_admin() { </div> </div> - <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;"> - <h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3> - <p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p> - <p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p> - - <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4> - <ul class="description" style="list-style: square; margin-left: 30px;"> - <li><?php _e( 'Central Discussion Area', 'buddypress' ); ?></p></li> - <li><?php _e( 'Forum Plugins Available', 'buddypress' ); ?></p></li> - <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li> - <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li> - </ul> - <div> - <a class="button thickbox button-primary" href="<?php bp_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); ?>"><?php _e( 'Install Site Wide Forums', 'buddypress' ) ?></a> - </div> - </div> - <?php endif; ?> </div> @@ -84,7 +67,7 @@ function bp_forums_bbpress_admin() { } function bp_forums_bbpress_install_wizard() { - $post_url = network_admin_url( 'admin.php?page=bb-forums-setup' ); + $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' ); $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : ''; @@ -158,7 +141,7 @@ function bp_forums_bbpress_install_wizard() { wp_admin_css( 'plugin-install' ); ?> - <div style="width: 45%; float: left; margin-top: 20px;"> + <div> <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3> <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p> @@ -178,26 +161,7 @@ function bp_forums_bbpress_install_wizard() { </div> </div> - <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;"> - <h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3> - <p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p> - <p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p> - - <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4> - <ul class="description" style="list-style: square; margin-left: 30px;"> - <li><?php _e( 'Central Discussion Area', 'buddypress' ); ?></p></li> - <li><?php _e( 'Forum Plugins Available', 'buddypress' ); ?></p></li> - <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li> - <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li> - </ul> - <div> - <a class="button thickbox button-primary" href="<?php bp_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); ?>"><?php _e( 'Install Site Wide Forums', 'buddypress' ) ?></a> - </div> - </div> - <?php } break; } } - -?> diff --git a/wp-content/plugins/buddypress/bp-forums/deprecated/1.7.php b/wp-content/plugins/buddypress/bp-forums/deprecated/1.7.php new file mode 100644 index 0000000000000000000000000000000000000000..52cdcbb38649f3e365fa3465795a9a99cd87e0cb --- /dev/null +++ b/wp-content/plugins/buddypress/bp-forums/deprecated/1.7.php @@ -0,0 +1,434 @@ +<?php + +/** + * BuddyPress Forums Deprecated Functions + * + * This file contains all the deprecated functions for BuddyPress forums since + * version 1.7. This was a major update for the forums component, moving from + * bbPress 1.x to bbPress 2.x. + * + * @package BuddyPress + * @subpackage Forums + */ + +// Exit if accessed directly +if ( !defined( 'ABSPATH' ) ) exit; + +function bp_forums_add_admin_menu() { + + if ( !is_super_admin() ) + return false; + + $page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; + + // Add the administration tab under the "Site Admin" tab for site administrators + $hook = add_submenu_page( $page, __( 'Forums', 'buddypress' ), __( 'Forums', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" ); + + // Fudge the highlighted subnav item when on the BuddyPress Forums admin page + add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); +} +add_action( bp_core_admin_hook(), 'bp_forums_add_admin_menu' ); + +/** + * Outputs the markup for the bb-forums-admin panel + */ +function bp_forums_bbpress_admin() { + + // The text and URL of the Site Wide Forums button differs depending on whether bbPress + // is running + if ( is_plugin_active( 'bbpress/bbpress.php' ) ) { + // The bbPress admin page will always be on the root blog. switch_to_blog() will + // pass through if we're already there. + switch_to_blog( bp_get_root_blog_id() ); + $button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) ); + restore_current_blog(); + + $button_text = __( 'Configure Site Wide Forums', 'buddypress' ); + } else { + $button_url = bp_get_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); + $button_text = __( 'Install Site Wide Forums', 'buddypress' ); + } + + $action = bp_get_admin_url( 'admin.php?page=bb-forums-setup&reinstall=1' ); ?> + + <div class="wrap"> + <?php screen_icon( 'buddypress' ); ?> + + <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Forums', 'buddypress' ) ); ?></h2> + + <?php if ( isset( $_POST['submit'] ) ) : ?> + + <div id="message" class="updated fade"> + <p><?php _e( 'Settings Saved.', 'buddypress' ) ?></p> + </div> + + <?php endif; ?> + + <?php + + if ( isset( $_REQUEST['reinstall'] ) || !bp_forums_is_installed_correctly() ) : + + // Delete the bb-config.php location option + bp_delete_option( 'bb-config-location' ); + + // Now delete the bb-config.php file + @unlink( ABSPATH . 'bb-config.php' ); + + // show the updated wizard + bp_forums_bbpress_install_wizard(); + + else : ?> + + <div style="width: 45%; float: left; margin-top: 20px;"> + <h3><?php _e( '(Installed)', 'buddypress' ); ?> <?php _e( 'Forums for Groups', 'buddypress' ) ?></h3> + + <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p> + <p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p> + + <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4> + <ul class="description" style="list-style: square; margin-left: 30px;"> + <li><?php _e( 'Group Integration', 'buddypress' ); ?></p></li> + <li><?php _e( 'Member Profile Integration', 'buddypress' ); ?></p></li> + <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li> + <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li> + </ul> + + <div> + <a class="button button-primary confirm" href="<?php echo $action ?>"><?php _e( 'Uninstall Group Forums', 'buddypress' ) ?></a> + </div> + </div> + + <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;"> + <h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3> + <p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p> + <p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p> + + <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4> + <ul class="description" style="list-style: square; margin-left: 30px;"> + <li><?php _e( 'Central Discussion Area', 'buddypress' ); ?></p></li> + <li><?php _e( 'Forum Plugins Available', 'buddypress' ); ?></p></li> + <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li> + <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li> + </ul> + + <div> + <a class="button thickbox button-primary" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> + </div> + </div> + + <?php endif; ?> + + <p class="clear description"><?php printf( __( 'Need help deciding between Group Forums and Site Wide Forums? Visit <a href="%s">the BuddyPress codex</a> for more information.', 'buddypress' ), 'http://codex.buddypress.org/getting-started/installing-group-and-sitewide-forums/' ) ?></p> + </div> +<?php +} + +function bp_forums_bbpress_install_wizard() { + $post_url = bp_get_admin_url( 'admin.php?page=bb-forums-setup' ); + $bbpress_plugin_is_active = false; + + $step = isset( $_REQUEST['step'] ) ? $_REQUEST['step'] : ''; + + // The text and URL of the Site Wide Forums button differs depending on whether bbPress + // is running + if ( is_plugin_active( 'bbpress/bbpress.php' ) ) { + $bbpress_plugin_is_active = true; + + // The bbPress admin page will always be on the root blog. switch_to_blog() will + // pass through if we're already there. + switch_to_blog( bp_get_root_blog_id() ); + $button_url = admin_url( add_query_arg( array( 'page' => 'bbpress' ), 'options-general.php' ) ); + restore_current_blog(); + + $button_text = __( 'Configure Site Wide Forums', 'buddypress' ); + } else { + $button_url = bp_get_admin_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500' ), 'plugin-install.php' ) ); + $button_text = __( 'Install Site Wide Forums', 'buddypress' ); + } + + switch( $step ) { + case 'existing': + if ( isset( $_REQUEST['doinstall'] ) && ( 1 == (int) $_REQUEST['doinstall'] ) ) { + if ( !bp_forums_configure_existing_install() ) { + _e( 'The bb-config.php file was not found at that location, please try again.', 'buddypress' ); + } else { + ?> + <h3><?php _e( 'Forums were set up correctly using your existing bbPress install!', 'buddypress' ) ?></h3> + <p><?php _e( 'BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location.', 'buddypress' ) ?></p><?php + } + } else { ?> + + <form action="" method="post"> + <h3><?php _e( 'Existing bbPress Installation', 'buddypress' ) ?></h3> + <p><?php _e( "BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest.", 'buddypress' ) ?></p> + <p><label><code>bb-config.php</code> file location:</label><br /><input style="width: 50%" type="text" name="bbconfigloc" id="bbconfigloc" value="<?php echo str_replace( 'buddypress', '', $_SERVER['DOCUMENT_ROOT'] ) ?>" /></p> + <p><input type="submit" class="button-primary" value="<?php _e( 'Complete Installation', 'buddypress' ) ?>" /></p> + <input type="hidden" name="step" value="existing" /> + <input type="hidden" name="doinstall" value="1" /> + <?php wp_nonce_field( 'bp_forums_existing_install_init' ) ?> + </form> + + <?php + } + break; + + case 'new': + if ( isset( $_REQUEST['doinstall'] ) && 1 == (int)$_REQUEST['doinstall'] ) { + $result = bp_forums_bbpress_install(); + + switch ( $result ) { + case 1: + _e( '<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>', 'buddypress' ); + break; + default: + // Just write the contents to screen + _e( '<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>', 'buddypress' ); ?> + + <textarea style="display:block; margin-top: 30px; width: 80%;" rows="50"><?php echo htmlspecialchars( $result ); ?></textarea> + + <?php + break; + } + } else { ?> + + <h3><?php _e( 'New bbPress Installation', 'buddypress' ) ?></h3> + <p><?php _e( "You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click + process. When you're ready, hit the link below.", 'buddypress' ) ?></p> + <p><a class="button-primary" href="<?php echo wp_nonce_url( $post_url . '&step=new&doinstall=1', 'bp_forums_new_install_init' ) ?>"><?php _e( 'Complete Installation', 'buddypress' ) ?></a></p> + + <?php + } + break; + + default: + if ( !file_exists( BP_PLUGIN_DIR . '/bp-forums/bbpress/' ) ) { ?> + + <div id="message" class="error"> + <p><?php printf( __( 'bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: "%s"', 'buddypress' ), 'wp-content/plugins/buddypress/bp-forums/bbpress/' ) ?></p> + </div> + + <?php } else { + + // Include the plugin install + + add_thickbox(); + wp_enqueue_script( 'plugin-install' ); + wp_admin_css( 'plugin-install' ); + ?> + + <div style="width: 45%; float: left; margin-top: 20px;"> + <h3><?php _e( 'Forums for Groups', 'buddypress' ) ?></h3> + + <p><?php _e( 'Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.' , 'buddypress' ); ?></p> + <p class="description"><?php _e( 'You may use an existing bbPress installation if you have one.', 'buddypress' ); ?></p> + + <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4> + <ul class="description" style="list-style: square; margin-left: 30px;"> + <li><?php _e( 'Group Integration', 'buddypress' ); ?></p></li> + <li><?php _e( 'Member Profile Integration', 'buddypress' ); ?></p></li> + <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li> + <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li> + </ul> + + <div> + <a class="button button-primary" href="<?php echo $post_url . '&step=new' ?>"><?php _e( 'Install Group Forums', 'buddypress' ) ?></a> + <a class="button" href="<?php echo $post_url . '&step=existing' ?>"><?php _e( 'Use Existing Installation', 'buddypress' ) ?></a> + </div> + </div> + + <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;"> + <h3><?php _e( 'New! Site Wide Forums', 'buddypress' ) ?></h3> + <p><?php _e( 'Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress' ) ?></p> + <p class="description"><?php _e( 'You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress' ) ?></p> + + <h4 style="margin-bottom: 10px;"><?php _e( 'Features', 'buddypress' ); ?></h4> + <ul class="description" style="list-style: square; margin-left: 30px;"> + <li><?php _e( 'Central Discussion Area', 'buddypress' ); ?></p></li> + <li><?php _e( 'Forum Plugins Available', 'buddypress' ); ?></p></li> + <li><?php _e( 'Activity Stream Integration', 'buddypress' ); ?></p></li> + <li><?php _e( '@ Mention Integration', 'buddypress' ); ?></p></li> + </ul> + <div> + <a class="button button-primary <?php if ( ! $bbpress_plugin_is_active ) { echo esc_attr( 'thickbox' ); }?>" href="<?php echo esc_attr( $button_url ) ?>"><?php echo esc_html( $button_text ) ?></a> + </div> + </div> + + <?php } + break; + } +} + +function bp_forums_configure_existing_install() { + global $wpdb, $bbdb; + + check_admin_referer( 'bp_forums_existing_install_init' ); + + // Sanitize $_REQUEST['bbconfigloc'] + $_REQUEST['bbconfigloc'] = apply_filters( 'bp_forums_bbconfig_location', $_REQUEST['bbconfigloc'] ); + + if ( false === strpos( $_REQUEST['bbconfigloc'], 'bb-config.php' ) ) { + if ( '/' != substr( $_REQUEST['bbconfigloc'], -1, 1 ) ) + $_REQUEST['bbconfigloc'] .= '/'; + + $_REQUEST['bbconfigloc'] .= 'bb-config.php'; + } + + bp_update_option( 'bb-config-location', $_REQUEST['bbconfigloc'] ); + + if ( !file_exists( $_REQUEST['bbconfigloc'] ) ) { + return false; + } + + return true; +} + +function bp_forums_bbpress_install( $location = '' ) { + global $wpdb, $bbdb, $bp; + + check_admin_referer( 'bp_forums_new_install_init' ); + + if ( empty( $location ) ) { + $location = ABSPATH . 'bb-config.php'; + } + + // Create the bb-config.php file + $initial_write = bp_forums_bbpress_write( + BP_PLUGIN_DIR . '/bp-forums/bbpress/bb-config-sample.php', + $location, + array( + "define( 'BBDB_NAME'," => array( "'bbpress'", "'" . DB_NAME . "'" ), + "define( 'BBDB_USER'," => array( "'username'", "'" . DB_USER . "'" ), + "define( 'BBDB_PASSWO" => array( "'password'", "'" . DB_PASSWORD . "'" ), + "define( 'BBDB_HOST'," => array( "'localhost'", "'" . DB_HOST . "'" ), + "define( 'BBDB_CHARSE" => array( "'utf8'", "'" . DB_CHARSET . "'" ), + "define( 'BBDB_COLLAT" => array( "''", "'" . DB_COLLATE . "'" ), + "define( 'BB_AUTH_KEY" => array( "'put your unique phrase here'", "'" . addslashes( AUTH_KEY ) . "'" ), + "define( 'BB_SECURE_A" => array( "'put your unique phrase here'", "'" . addslashes( SECURE_AUTH_KEY ) . "'" ), + "define( 'BB_LOGGED_I" => array( "'put your unique phrase here'", "'" . addslashes( LOGGED_IN_KEY ) . "'" ), + "define( 'BB_NONCE_KE" => array( "'put your unique phrase here'", "'" . addslashes( NONCE_KEY ) . "'" ), + "\$bb_table_prefix = '" => array( "'bb_'", "'" . $bp->table_prefix . "bb_'" ), + "define( 'BB_LANG', '" => array( "''", "'" . get_locale() . "'" ) + ) + ); + + // Add the custom user and usermeta entries to the config file + if ( $initial_write == 1 ) { + $file = file_get_contents( $location ); + } else { + $file = &$initial_write; + } + + $file = trim( $file ); + if ( '?>' == substr( $file, -2, 2 ) ) { + $file = substr( $file, 0, -2 ); + } + + $file .= "\n" . '$bb->custom_user_table = \'' . $wpdb->users . '\';'; + $file .= "\n" . '$bb->custom_user_meta_table = \'' . $wpdb->usermeta . '\';'; + $file .= "\n\n" . '$bb->uri = \'' . BP_PLUGIN_URL . '/bp-forums/bbpress/\';'; + $file .= "\n" . '$bb->name = \'' . get_blog_option( bp_get_root_blog_id(), 'blogname' ) . ' ' . __( 'Forums', 'buddypress' ) . '\';'; + + if ( is_multisite() ) { + $file .= "\n" . '$bb->wordpress_mu_primary_blog_id = ' . bp_get_root_blog_id() . ';'; + } + + if ( defined( 'AUTH_SALT' ) ) { + $file .= "\n\n" . 'define(\'BB_AUTH_SALT\', \'' . addslashes( AUTH_SALT ) . '\');'; + } + + if ( defined( 'LOGGED_IN_SALT' ) ) { + $file .= "\n" . 'define(\'BB_LOGGED_IN_SALT\', \'' . addslashes( LOGGED_IN_SALT ) . '\');'; + } + + if ( defined( 'SECURE_AUTH_SALT' ) ) { + $file .= "\n" . 'define(\'BB_SECURE_AUTH_SALT\', \'' . addslashes( SECURE_AUTH_SALT ) . '\');'; + } + + $file .= "\n\n" . 'define(\'WP_AUTH_COOKIE_VERSION\', 2);'; + $file .= "\n\n" . '?>'; + + if ( $initial_write == 1 ) { + $file_handle = fopen( $location, 'w' ); + fwrite( $file_handle, $file ); + fclose( $file_handle ); + } else { + $initial_write = $file; + } + + bp_update_option( 'bb-config-location', $location ); + return $initial_write; +} + +function bp_forums_bbpress_write( $file_source, $file_target, $alterations ) { + + if ( empty( $file_source ) || !file_exists( $file_source ) || !is_file( $file_source ) ) { + return -1; + } + + if ( empty( $file_target ) ) { + $file_target = $file_source; + } + + if ( empty( $alterations ) || !is_array( $alterations ) ) { + return -2; + } + + // Get the existing lines in the file + $lines = file( $file_source ); + + // Initialise an array to store the modified lines + $modified_lines = array(); + + // Loop through the lines and modify them + foreach ( (array) $lines as $line ) { + if ( isset( $alterations[substr( $line, 0, 20 )] ) ) { + $alteration = $alterations[substr( $line, 0, 20 )]; + $modified_lines[] = str_replace( $alteration[0], $alteration[1], $line ); + } else { + $modified_lines[] = $line; + } + } + + $writable = true; + if ( file_exists( $file_target ) ) { + if ( !is_writable( $file_target ) ) { + $writable = false; + } + } else { + $dir_target = dirname( $file_target ); + + if ( file_exists( $dir_target ) ) { + if ( !is_writable( $dir_target ) || !is_dir( $dir_target ) ) { + $writable = false; + } + } else { + $writable = false; + } + } + + if ( empty( $writable ) ) { + return trim( join( null, $modified_lines ) ); + } + + // Open the file for writing - rewrites the whole file + $file_handle = fopen( $file_target, 'w' ); + + // Write lines one by one to avoid OS specific newline hassles + foreach ( (array) $modified_lines as $modified_line ) { + if ( strlen( $modified_line ) - 2 === strrpos( $modified_line, '?>' ) ) { + $modified_line = '?>'; + } + + fwrite( $file_handle, $modified_line ); + if ( $modified_line == '?>' ) { + break; + } + } + + // Close the config file + fclose( $file_handle ); + + @chmod( $file_target, 0666 ); + + return 1; +} diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php index 16b80726a1fbdfd7f6c75ffe7959961f94c49df2..354fc10487fc89747f6f521ada5fc1dec4ea24e9 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-actions.php @@ -83,5 +83,3 @@ function friends_action_remove_friend() { return false; } add_action( 'bp_init', 'friends_action_remove_friend' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php index 7c1b5be90d07f6ab19545498ee112f380fddaea3..7d75a1f1b40cbdd645d89d7424d424db6479c316 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-activity.php @@ -3,7 +3,7 @@ /** * BuddyPress Friends Activity Functions * - * These functions handle the recording, deleting and formatting of activity + * These functions handle the recording, deleting and formatting of activity * for the user and for this specific component. * * @package BuddyPress @@ -121,5 +121,3 @@ function friends_format_notifications( $action, $item_id, $secondary_item_id, $t return $return; } - -?> diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php index 0c15d89c06c87e0311493c49c6c8861bd3adca5e..c5dbf17224ab3899916564b320de14cc2d249791 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-cache.php @@ -39,5 +39,3 @@ add_action( 'friends_friendship_rejected', 'bp_core_clear_cache' ); add_action( 'friends_friendship_accepted', 'bp_core_clear_cache' ); add_action( 'friends_friendship_deleted', 'bp_core_clear_cache' ); add_action( 'friends_friendship_requested', 'bp_core_clear_cache' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php index 9d8197e369815515011438441a1d558ee63ee360..af89e2db9aa4f427508c160b5acce450ba7f0526 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-classes.php @@ -84,11 +84,11 @@ class BP_Friends_Friendship { global $wpdb, $bp; if ( !empty( $friend_requests_only ) ) { - $oc_sql = "AND is_confirmed = 0"; - $friend_sql = $wpdb->prepare ( " WHERE friend_user_id = %d", $user_id ); + $oc_sql = 'AND is_confirmed = 0'; + $friend_sql = $wpdb->prepare( " WHERE friend_user_id = %d", $user_id ); } else { - $oc_sql = "AND is_confirmed = 1"; - $friend_sql = $wpdb->prepare ( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id ); + $oc_sql = 'AND is_confirmed = 1'; + $friend_sql = $wpdb->prepare( " WHERE (initiator_user_id = %d OR friend_user_id = %d)", $user_id, $user_id ); } $friends = $wpdb->get_results( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} {$friend_sql} {$oc_sql} ORDER BY date_created DESC" ); @@ -160,10 +160,10 @@ class BP_Friends_Friendship { // filter the user_ids based on the search criteria. if ( bp_is_active( 'xprofile' ) ) { - $sql = "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%' {$pag_sql}"; + $sql = "SELECT DISTINCT user_id FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%' {$pag_sql}"; $total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$bp->profile->table_name_data} WHERE user_id IN ({$fids}) AND value LIKE '{$filter}%%'"; } else { - $sql = "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%' {$pag_sql}"; + $sql = "SELECT DISTINCT user_id FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%' {$pag_sql}"; $total_sql = "SELECT COUNT(DISTINCT user_id) FROM {$wpdb->usermeta} WHERE user_id IN ({$fids}) AND meta_key = 'nickname' AND meta_value LIKE '{$filter}%%'"; } @@ -346,5 +346,3 @@ class BP_Friends_Friendship { } } } - -?> diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-filters.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-filters.php new file mode 100644 index 0000000000000000000000000000000000000000..93251cb75fac59769f5b74befb683fb11d8429a5 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-filters.php @@ -0,0 +1,35 @@ +<?php + +/** + * BuddyPress Friend Filters + * + * @package BuddyPress + * @subpackage FriendsFilters + */ + +/** + * Filter BP_User_Query::populate_extras to override each queried users fullname + * + * @since BuddyPress (1.7) + * + * @global BuddyPress $bp + * @global WPDB $wpdb + * @param BP_User_Query $user_query + * @param string $user_ids_sql + */ +function bp_friends_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql ) { + global $bp, $wpdb; + + // Fetch whether or not the user is a friend of the current user + $friend_status = $wpdb->get_results( $wpdb->prepare( "SELECT initiator_user_id, friend_user_id, is_confirmed FROM {$bp->friends->table_name} WHERE (initiator_user_id = %d AND friend_user_id IN ( {$user_ids_sql} ) ) OR (initiator_user_id IN ( {$user_ids_sql} ) AND friend_user_id = %d )", bp_loggedin_user_id(), bp_loggedin_user_id() ) ); + + // The "friend" is the user ID in the pair who is *not* the logged in user + foreach ( (array) $friend_status as $fs ) { + $friend_id = bp_loggedin_user_id() == $fs->initiator_user_id ? $fs->friend_user_id : $fs->initiator_user_id; + + if ( isset( $user_query->results[ $friend_id ] ) ) { + $user_query->results[ $friend_id ]->is_friend = $fs->is_confirmed; + } + } +} +add_filter( 'bp_user_query_populate_extras', 'bp_friends_filter_user_query_populate_extras', 4, 2 ); diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php index 075a1d3f3d3185c7a4c94694ca3a78973fe00721..b03925949a541afd8b019e1ad2b73125e24ff83c 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-functions.php @@ -144,7 +144,7 @@ function friends_withdraw_friendship( $initiator_userid, $friend_userid ) { $friendship_id = BP_Friends_Friendship::get_friendship_id( $initiator_userid, $friend_userid ); $friendship = new BP_Friends_Friendship( $friendship_id, true, false ); - + if ( !$friendship->is_confirmed && BP_Friends_Friendship::withdraw( $friendship_id ) ) { // Remove the friend request notice bp_core_delete_notifications_by_item_id( $friendship->friend_user_id, $friendship->initiator_user_id, $bp->friends->id, 'friendship_request' ); @@ -226,11 +226,11 @@ function friends_get_bulk_last_active( $friend_ids ) { /** * Get a list of friends that a user can invite into this group. - * + * * Excludes friends that are already in the group, and banned friends if the * user is not a group admin. * - * @since 1.0 + * @since BuddyPress (1.0) * @param int $user_id User ID whose friends to see can be invited * @param int $group_id Group to check possible invitations against * @return mixed False if no friends, array of users if friends @@ -354,5 +354,3 @@ function friends_remove_data( $user_id ) { add_action( 'wpmu_delete_user', 'friends_remove_data' ); add_action( 'delete_user', 'friends_remove_data' ); add_action( 'bp_make_spam_user', 'friends_remove_data' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php index 99df5ab85b5af05b40bbfe5693ddde099516dde4..566eb37bcb9fe234755a1d048dfea6d6d6b599ec 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-loader.php @@ -102,7 +102,16 @@ class BP_Friends_Component extends BP_Component { 'item_css_id' => $bp->friends->id ); - $friends_link = trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() ); + // Determine user to use + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $friends_link = trailingslashit( $user_domain . bp_get_friends_slug() ); // Add the subnav items to the friends nav item $sub_nav[] = array( @@ -122,7 +131,7 @@ class BP_Friends_Component extends BP_Component { 'parent_slug' => bp_get_friends_slug(), 'screen_function' => 'friends_screen_requests', 'position' => 20, - 'user_has_access' => bp_is_my_profile() + 'user_has_access' => bp_core_can_edit_settings() ); parent::setup_nav( $main_nav, $sub_nav ); @@ -215,5 +224,3 @@ function bp_setup_friends() { $bp->friends = new BP_Friends_Component(); } add_action( 'bp_setup_components', 'bp_setup_friends', 6 ); - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php index 76303d541aae5f7c3a6b75afeeabf77c0383b8e1..c38b0274e75a7325f2f2fc366b638d9afb53e21f 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-notifications.php @@ -28,10 +28,8 @@ function friends_notification_new_request( $friendship_id, $initiator_id, $frien // Set up and send the message $to = $ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name ); - - $message = sprintf( __( + $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name ) ) ); + $message = sprintf( __( '%1$s wants to add you as a friend. To view all of your pending friendship requests: %2$s @@ -41,7 +39,10 @@ To view %3$s\'s profile: %4$s --------------------- ', 'buddypress' ), $initiator_name, $all_requests_link, $initiator_name, $initiator_link ); - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } /* Send the message */ $to = apply_filters( 'friends_notification_new_request_to', $to ); @@ -67,10 +68,8 @@ function friends_notification_accepted_request( $friendship_id, $initiator_id, $ // Set up and send the message $to = $ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name ); - - $message = sprintf( __( + $subject = bp_get_email_subject( array( 'text' => sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name ) ) ); + $message = sprintf( __( '%1$s accepted your friend request. To view %2$s\'s profile: %3$s @@ -78,7 +77,10 @@ To view %2$s\'s profile: %3$s --------------------- ', 'buddypress' ), $friend_name, $friend_name, $friend_link ); - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } /* Send the message */ $to = apply_filters( 'friends_notification_accepted_request_to', $to ); @@ -89,5 +91,3 @@ To view %2$s\'s profile: %3$s do_action( 'bp_friends_sent_accepted_email', $initiator_id, $subject, $message, $friendship_id, $friend_id ); } - -?> diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php index 29b376dda6223cc5ff2eac0ac6124c6ac040b2ac..9dba23b7745a737aae499eb36ff945f1895ae212 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-screens.php @@ -47,7 +47,7 @@ function friends_screen_requests() { bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' ); bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() ) ); - + } elseif ( bp_is_action_variable( 'cancel', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) { // Check the nonce check_admin_referer( 'friends_withdraw_friendship' ); @@ -108,5 +108,3 @@ function friends_screen_notification_settings() { <?php } add_action( 'bp_notification_settings', 'friends_screen_notification_settings' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php b/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php index 689083ca6bb1db2df3fe34dc7e74a13fc0b6ce65..8106e6d357392660d3432e0c9dd02f5c92b6b013 100644 --- a/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php +++ b/wp-content/plugins/buddypress/bp-friends/bp-friends-template.php @@ -355,19 +355,19 @@ function bp_get_friendship_requests( $user_id = 0 ) { if ( !$user_id ) { $user_id = bp_displayed_user_id(); } - + if ( !$user_id ) { - return 0; + return 0; } - + $requests = friends_get_friendship_request_user_ids( $user_id ); - + if ( !empty( $requests ) ) { $requests = implode( ',', (array) $requests ); } else { $requests = 0; } - + return apply_filters( 'bp_get_friendship_requests', $requests ); } @@ -430,5 +430,3 @@ function bp_friend_total_requests_count( $user_id = 0 ) { return apply_filters( 'bp_friend_get_total_requests_count', count( BP_Friends_Friendship::get_friend_user_ids( $user_id, true ) ) ); } - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/admin/css/admin.css b/wp-content/plugins/buddypress/bp-groups/admin/css/admin.css new file mode 100644 index 0000000000000000000000000000000000000000..253eee306f85464f1b36c9ac94288379c4267b2b --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/admin/css/admin.css @@ -0,0 +1,20 @@ +#bp-groups-edit-form input { + outline: medium none; + padding: 3px 8px; +} +#bp-groups-edit-form input#bp-groups-name { + font-size: 1.7em; + width: 100%; +} +#bp-groups-edit-form input#bp-groups-new-members { + width: 100%; + max-width: 90%; + border: 0; +} +.bp-groups-settings-section { + margin-bottom: 15px; +} +ul.bp-group-delete-list { + list-style-type: disc; + margin: 4px 26px; +} diff --git a/wp-content/plugins/buddypress/bp-groups/admin/css/admin.min.css b/wp-content/plugins/buddypress/bp-groups/admin/css/admin.min.css new file mode 100644 index 0000000000000000000000000000000000000000..8c91e580cc26516066eafcd31845519f0f740d8b --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/admin/css/admin.min.css @@ -0,0 +1 @@ +#bp-groups-edit-form input{outline:medium none;padding:3px 8px}#bp-groups-edit-form input#bp-groups-name{font-size:1.7em;width:100%}#bp-groups-edit-form input#bp-groups-new-members{width:100%;max-width:90%;border:0}.bp-groups-settings-section{margin-bottom:15px}ul.bp-group-delete-list{list-style-type:disc;margin:4px 26px} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-groups/admin/js/admin.js b/wp-content/plugins/buddypress/bp-groups/admin/js/admin.js new file mode 100644 index 0000000000000000000000000000000000000000..58575d2d22462a84fae594a46055b446d161f525 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/admin/js/admin.js @@ -0,0 +1,31 @@ +(function($) { + function add_member_to_list( e, ui ) { + var remove_id = 'bp-groups-remove-new-member-' + ui.item.value; + $('#bp-groups-new-members-list').append('<li><a href="#" class="bp-groups-remove-new-member" id="' + remove_id + '">x</a> ' + ui.item.label + '</li>'); + $('#' + remove_id).bind('click', function(e) { remove_member_from_list(e); return false; }); + + $('#bp-groups-new-members-list').after('<input name="new_members[]" type="hidden" value="' + ui.item.value + '" />'); + } + + function remove_member_from_list( e ) { + $(e.target).closest('li').remove(); + } + + var id = 'undefined' !== typeof group_members ? '&group_members=' + group_members : ''; + $(document).ready( function() { + /* Initialize autocomplete */ + $( '.bp-suggest-user' ).autocomplete({ + source: ajaxurl + '?action=bp_group_admin_member_autocomplete' + id, + delay: 500, + minLength: 2, + position: ( 'undefined' !== typeof isRtl && isRtl ) ? { my: 'right top', at: 'right bottom', offset: '0, -1' } : { offset: '0, -1' }, + open: function() { $(this).addClass('open'); }, + close: function() { $(this).removeClass('open'); $(this).val(''); }, + select: function( event, ui ) { add_member_to_list( event, ui ); } + }); + + /* Replace noscript placeholder */ + $( '#bp-groups-new-members' ).attr( 'placeholder', BP_Group_Admin.add_member_placeholder ); + + }); +})(jQuery); diff --git a/wp-content/plugins/buddypress/bp-groups/admin/js/admin.min.js b/wp-content/plugins/buddypress/bp-groups/admin/js/admin.min.js new file mode 100644 index 0000000000000000000000000000000000000000..65b5150b53a8c4b62859dd6176fd404237daa7c8 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/admin/js/admin.min.js @@ -0,0 +1 @@ +(function(c){function b(h,f){var g="bp-groups-remove-new-member-"+f.item.value;c("#bp-groups-new-members-list").append('<li><a href="#" class="bp-groups-remove-new-member" id="'+g+'">x</a> '+f.item.label+"</li>");c("#"+g).bind("click",function(i){a(i);return false});c("#bp-groups-new-members-list").after('<input name="new_members[]" type="hidden" value="'+f.item.value+'" />')}function a(f){c(f.target).closest("li").remove()}var d="undefined"!==typeof group_members?"&group_members="+group_members:"";c(document).ready(function(){c(".bp-suggest-user").autocomplete({source:ajaxurl+"?action=bp_group_admin_member_autocomplete"+d,delay:500,minLength:2,position:("undefined"!==typeof isRtl&&isRtl)?{my:"right top",at:"right bottom",offset:"0, -1"}:{offset:"0, -1"},open:function(){c(this).addClass("open")},close:function(){c(this).removeClass("open");c(this).val("")},select:function(e,f){b(e,f)}});c("#bp-groups-new-members").attr("placeholder",BP_Group_Admin.add_member_placeholder)})})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php index fa16119b613b3d3c497374cfa28af4f7babd3814..f8193767953c0d4bc8ebbb093a500af1f3c6adf4 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-actions.php @@ -173,6 +173,10 @@ function groups_action_create_group() { // Group avatar is handled separately if ( 'group-avatar' == bp_get_groups_current_create_step() && isset( $_POST['upload'] ) ) { + if ( ! isset( $bp->avatar_admin ) ) { + $bp->avatar_admin = new stdClass(); + } + if ( !empty( $_FILES ) && isset( $_POST['upload'] ) ) { // Normally we would check a nonce here, but the group save nonce is used instead @@ -196,7 +200,7 @@ function groups_action_create_group() { } } - bp_core_load_template( apply_filters( 'groups_template_create_group', 'groups/create' ) ); + bp_core_load_template( apply_filters( 'groups_template_create_group', 'groups/create' ) ); } add_action( 'bp_actions', 'groups_action_create_group' ); @@ -321,5 +325,3 @@ function groups_action_group_feed() { die; } add_action( 'bp_actions', 'groups_action_group_feed' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php index 944bb037d0e9fe3f10796f84c1d3647c309291f5..c46bcc8a13733cda7ae007b33c6826fce7d13eea 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-activity.php @@ -312,5 +312,3 @@ function groups_format_notifications( $action, $item_id, $secondary_item_id, $to return false; } - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-admin.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-admin.php new file mode 100644 index 0000000000000000000000000000000000000000..68cd3d0cfde7a28c93a65021348f280a7d85a078 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-admin.php @@ -0,0 +1,1327 @@ +<?php +/** + * BuddyPress Groups component admin screen + * + * Props to WordPress core for the Comments admin screen, and its contextual help text, + * on which this implementation is heavily based. + * + * @package BuddyPress + * @since BuddyPress (1.7) + * @subpackage Groups + */ + +// Exit if accessed directly +if ( !defined( 'ABSPATH' ) ) exit; + +// Include WP's list table class +if ( !class_exists( 'WP_List_Table' ) ) require( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); + +// per_page screen option. Has to be hooked in extremely early. +if ( is_admin() && ! empty( $_REQUEST['page'] ) && 'bp-groups' == $_REQUEST['page'] ) + add_filter( 'set-screen-option', 'bp_groups_admin_screen_options', 10, 3 ); + +/** + * Registers the Groups component admin screen + * + * @since BuddyPress (1.7) + */ +function bp_groups_add_admin_menu() { + + if ( ! bp_current_user_can( 'bp_moderate' ) ) + return; + + // Add our screen + $hook = add_menu_page( + __( 'Groups', 'buddypress' ), + __( 'Groups', 'buddypress' ), + 'manage_options', + 'bp-groups', + 'bp_groups_admin', + 'div' + ); + + // Hook into early actions to load custom CSS and our init handler. + add_action( "load-$hook", 'bp_groups_admin_load' ); +} +add_action( bp_core_admin_hook(), 'bp_groups_add_admin_menu' ); + +/** + * Add groups component to custom menus array + * + * @since BuddyPress (1.7) + * + * @param array $custom_menus + * @return array + */ +function bp_groups_admin_menu_order( $custom_menus = array() ) { + array_push( $custom_menus, 'bp-groups' ); + return $custom_menus; +} +add_filter( 'bp_admin_menu_order', 'bp_groups_admin_menu_order' ); + +/** + * Set up the admin page before any output is sent. Register contextual help and screen options for this admin page. + * + * @global object $bp BuddyPress global settings + * @global BP_Groups_List_Table $bp_groups_list_table Groups screen list table + * @since BuddyPress (1.7) + */ +function bp_groups_admin_load() { + global $bp_groups_list_table; + + // Build redirection URL + $redirect_to = remove_query_arg( array( 'action', 'action2', 'gid', 'deleted', 'error', 'updated', 'success_new', 'error_new', 'success_modified', 'error_modified' ), $_SERVER['REQUEST_URI'] ); + + // Decide whether to load the dev version of the CSS and JavaScript + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : 'min.'; + + $doaction = bp_admin_list_table_current_bulk_action(); + + // Call an action for plugins to hook in early + do_action( 'bp_groups_admin_load', $doaction ); + + // Edit screen + if ( 'do_delete' == $doaction && ! empty( $_GET['gid'] ) ) { + + check_admin_referer( 'bp-groups-delete' ); + + $group_ids = wp_parse_id_list( $_GET['gid'] ); + + $count = 0; + foreach ( $group_ids as $group_id ) { + if ( groups_delete_group( $group_id ) ) { + $count++; + } + } + + $redirect_to = add_query_arg( 'deleted', $count, $redirect_to ); + + bp_core_redirect( $redirect_to ); + + } else if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) { + // columns screen option + add_screen_option( 'layout_columns', array( 'default' => 2, 'max' => 2, ) ); + + get_current_screen()->add_help_tab( array( + 'id' => 'bp-group-edit-overview', + 'title' => __( 'Overview', 'buddypress' ), + 'content' => + '<p>' . __( 'This page is a convenient way to edit the details associated with one of your groups.', 'buddypress' ) . '</p>' . + '<p>' . __( 'The Name and Description box is fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to hide or unhide, or to choose a 1- or 2-column layout for this screen.', 'buddypress' ) . '</p>' + ) ); + + // Help panel - sidebar links + get_current_screen()->set_help_sidebar( + '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . + '<p><a href="http://buddypress.org/support">' . __( 'Support Forums', 'buddypress' ) . '</a></p>' + ); + + // Register metaboxes for the edit screen. + add_meta_box( 'submitdiv', _x( 'Save', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_status', get_current_screen()->id, 'side', 'high' ); + add_meta_box( 'bp_group_settings', _x( 'Settings', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_settings', get_current_screen()->id, 'side', 'core' ); + add_meta_box( 'bp_group_add_members', _x( 'Add New Members', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_add_new_members', get_current_screen()->id, 'normal', 'core' ); + add_meta_box( 'bp_group_members', _x( 'Manage Members', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_members', get_current_screen()->id, 'normal', 'core' ); + + do_action( 'bp_groups_admin_meta_boxes' ); + + // Enqueue javascripts + wp_enqueue_script( 'postbox' ); + wp_enqueue_script( 'dashboard' ); + wp_enqueue_script( 'comment' ); + + // Index screen + } else { + // Create the Groups screen list table + $bp_groups_list_table = new BP_Groups_List_Table(); + + // per_page screen option + add_screen_option( 'per_page', array( 'label' => _x( 'Groups', 'Groups per page (screen options)', 'buddypress' )) ); + + // Help panel - overview text + get_current_screen()->add_help_tab( array( + 'id' => 'bp-groups-overview', + 'title' => __( 'Overview', 'buddypress' ), + 'content' => + '<p>' . __( 'You can manage groups much like you can manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on groups by using the on-hover action links or the Bulk Actions.', 'buddypress' ) . '</p>', + ) ); + + get_current_screen()->add_help_tab( array( + 'id' => 'bp-groups-overview-actions', + 'title' => __( 'Group Actions', 'buddypress' ), + 'content' => + '<p>' . __( 'Clicking "Visit" will take you to the group’s public page. Use this link to see what the group looks like on the front end of your site.', 'buddypress' ) . '</p>' . + '<p>' . __( 'Clicking "Edit" will take you to a Dashboard panel where you can manage various details about the group, such as its name and description, its members, and other settings.', 'buddypress' ) . '</p>' . + '<p>' . __( 'If you click "Delete" under a specific group, or select a number of groups and then choose Delete from the Bulk Actions menu, you will be led to a page where you’ll be asked to confirm the permanent deletion of the group(s).', 'buddypress' ) . '</p>', + ) ); + + // Help panel - sidebar links + get_current_screen()->set_help_sidebar( + '<p><strong>' . __( 'For more information:', 'buddypress' ) . '</strong></p>' . + '<p>' . __( '<a href="http://buddypress.org/support/">Support Forums</a>', 'buddypress' ) . '</p>' + ); + } + + // Enqueue CSS and JavaScript + wp_enqueue_script( 'bp_groups_admin_js', BP_PLUGIN_URL . "bp-groups/admin/js/admin.{$min}js", array( 'jquery', 'wp-ajax-response', 'jquery-ui-autocomplete' ), bp_get_version(), true ); + wp_enqueue_style( 'bp_groups_admin_css', BP_PLUGIN_URL . "bp-groups/admin/css/admin.{$min}css", array(), bp_get_version() ); + + wp_localize_script( 'bp_groups_admin_js', 'BP_Group_Admin', array( + 'add_member_placeholder' => __( 'Start typing a username to add a new member.', 'buddypress' ) + ) ); + + if ( $doaction && 'save' == $doaction ) { + // Get group ID + $group_id = isset( $_REQUEST['gid'] ) ? (int) $_REQUEST['gid'] : ''; + + $redirect_to = add_query_arg( array( + 'gid' => (int) $group_id, + 'action' => 'edit' + ), $redirect_to ); + + // Check this is a valid form submission + check_admin_referer( 'edit-group_' . $group_id ); + + // Get the group from the database + $group = groups_get_group( 'group_id=' . $group_id ); + + // If the group doesn't exist, just redirect back to the index + if ( empty( $group->slug ) ) { + wp_redirect( $redirect_to ); + exit; + } + + // Check the form for the updated properties + + // Store errors + $error = 0; + $success_new = $error_new = $success_modified = $error_modified = array(); + + // Group name and description are handled with + // groups_edit_base_group_details() + if ( !groups_edit_base_group_details( $group_id, $_POST['bp-groups-name'], $_POST['bp-groups-description'], 0 ) ) { + $error = $group_id; + } + + // Enable discussion forum + $enable_forum = ( isset( $_POST['group-show-forum'] ) ) ? 1 : 0; + + // Privacy setting + $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) ); + $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public'; + + // Invite status + $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) ); + $invite_status = in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members'; + + if ( !groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_status ) ) { + $error = $group_id; + } + + // Process new members + $user_names = array(); + + if ( ! empty( $_POST['bp-groups-new-members'] ) ) { + $user_names = array_merge( $user_names, explode( ',', $_POST['bp-groups-new-members'] ) ); + } + + if ( ! empty( $_POST['new_members'] ) ) { + $user_names = array_merge( $user_names, $_POST['new_members'] ); + } + + if ( ! empty( $user_names ) ) { + + foreach( array_values( $user_names ) as $user_name ) { + $un = trim( $user_name ); + + // Make sure the user exists before attempting + // to add to the group + if ( ! $user_id = username_exists( $un ) ) { + $error_new[] = $un; + } else if ( ! groups_join_group( $group_id, $user_id ) ) { + $error_new[] = $un; + } else { + $success_new[] = $un; + } + } + } + + // Process member role changes + if ( ! empty( $_POST['bp-groups-role'] ) && ! empty( $_POST['bp-groups-existing-role'] ) ) { + + // Before processing anything, make sure you're not + // attempting to remove the all user admins + $admin_count = 0; + foreach ( (array) $_POST['bp-groups-role'] as $new_role ) { + if ( 'admin' == $new_role ) { + $admin_count++; + break; + } + } + + if ( ! $admin_count ) { + + $redirect_to = add_query_arg( 'no_admins', 1, $redirect_to ); + $error = $group_id; + + } else { + + // Process only those users who have had their roles changed + foreach ( (array) $_POST['bp-groups-role'] as $user_id => $new_role ) { + + $existing_role = isset( $_POST['bp-groups-existing-role'][$user_id] ) ? $_POST['bp-groups-existing-role'][$user_id] : ''; + + if ( $existing_role != $new_role ) { + + switch ( $new_role ) { + case 'mod' : + // Admin to mod is a demotion. Demote to + // member, then fall through + if ( 'admin' == $existing_role ) { + groups_demote_member( $user_id, $group_id ); + } + + case 'admin' : + // If the user was banned, we must + // unban first + if ( 'banned' == $existing_role ) { + groups_unban_member( $user_id, $group_id ); + } + + // At this point, each existing_role + // is a member, so promote + $result = groups_promote_member( $user_id, $group_id, $new_role ); + + break; + + case 'member' : + + if ( 'admin' == $existing_role || 'mod' == $existing_role ) { + $result = groups_demote_member( $user_id, $group_id ); + } else if ( 'banned' == $existing_role ) { + $result = groups_unban_member( $user_id, $group_id ); + } + + break; + + case 'banned' : + + $result = groups_ban_member( $user_id, $group_id ); + + break; + + case 'remove' : + + $result = groups_remove_member( $user_id, $group_id ); + + break; + } + + // Store the success or failure + if ( $result ) { + $success_modified[] = $user_id; + } else { + $error_modified[] = $user_id; + } + } + } + } + } + + // Call actions for plugins to do something before we redirect + do_action( 'bp_group_admin_edit_after', $group_id ); + + // Create the redirect URL + + if ( $error ) { + // This means there was an error updating group details + $redirect_to = add_query_arg( 'error', (int) $error, $redirect_to ); + } else { + // Group details were update successfully + $redirect_to = add_query_arg( 'updated', 1, $redirect_to ); + } + + if ( !empty( $success_new ) ) { + $success_new = implode( ',', array_filter( $success_new, 'urlencode' ) ); + $redirect_to = add_query_arg( 'success_new', $success_new, $redirect_to ); + } + + if ( !empty( $error_new ) ) { + $error_new = implode( ',', array_filter( $error_new, 'urlencode' ) ); + $redirect_to = add_query_arg( 'error_new', $error_new, $redirect_to ); + } + + if ( !empty( $success_modified ) ) { + $success_modified = implode( ',', array_filter( $success_modified, 'urlencode' ) ); + $redirect_to = add_query_arg( 'success_modified', $success_modified, $redirect_to ); + } + + if ( !empty( $error_modified ) ) { + $error_modified = implode( ',', array_filter( $error_modified, 'urlencode' ) ); + $redirect_to = add_query_arg( 'error_modified', $error_modified, $redirect_to ); + } + + // Redirect + wp_redirect( apply_filters( 'bp_group_admin_edit_redirect', $redirect_to ) ); + exit; + + + // If a referrer and a nonce is supplied, but no action, redirect back. + } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { + wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) ); + exit; + } +} + +/** + * Handle save/update of screen options for the Groups component admin screen + * + * @since BuddyPress (1.7) + * + * @param string $value Will always be false unless another plugin filters it first. + * @param string $option Screen option name + * @param string $new_value Screen option form value + * @return string Option value. False to abandon update. + */ +function bp_groups_admin_screen_options( $value, $option, $new_value ) { + if ( 'toplevel_page_bp_groups_per_page' != $option && 'toplevel_page_bp_groups_network_per_page' != $option ) + return $value; + + // Per page + $new_value = (int) $new_value; + if ( $new_value < 1 || $new_value > 999 ) + return $value; + + return $new_value; +} + +/** + * Outputs the Groups component admin screens + * + * @since BuddyPress (1.7) + */ +function bp_groups_admin() { + // Decide whether to load the index or edit screen + $doaction = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : ''; + + // Display the single group edit screen + if ( 'edit' == $doaction && ! empty( $_GET['gid'] ) ) { + bp_groups_admin_edit(); + + // Display the group deletion confirmation screen + } else if ( 'delete' == $doaction && ! empty( $_GET['gid'] ) ) { + bp_groups_admin_delete(); + + // Otherwise, display the groups index screen + } else { + bp_groups_admin_index(); + } +} + +/** + * Display the single groups edit screen + * + * @since BuddyPress (1.7) + */ +function bp_groups_admin_edit() { + + if ( ! is_super_admin() ) + die( '-1' ); + + $messages = array(); + + // If the user has just made a change to a group, build status messages + if ( !empty( $_REQUEST['no_admins'] ) || ! empty( $_REQUEST['error'] ) || ! empty( $_REQUEST['updated'] ) || ! empty( $_REQUEST['error_new'] ) || ! empty( $_REQUEST['success_new'] ) || ! empty( $_REQUEST['error_modified'] ) || ! empty( $_REQUEST['success_modified'] ) ) { + $no_admins = ! empty( $_REQUEST['no_admins'] ) ? 1 : 0; + $errors = ! empty( $_REQUEST['error'] ) ? $_REQUEST['error'] : ''; + $updated = ! empty( $_REQUEST['updated'] ) ? $_REQUEST['updated'] : ''; + $error_new = ! empty( $_REQUEST['error_new'] ) ? explode( ',', $_REQUEST['error_new'] ) : array(); + $success_new = ! empty( $_REQUEST['success_new'] ) ? explode( ',', $_REQUEST['success_new'] ) : array(); + $error_modified = ! empty( $_REQUEST['error_modified'] ) ? explode( ',', $_REQUEST['error_modified'] ) : array(); + $success_modified = ! empty( $_REQUEST['success_modified'] ) ? explode( ',', $_REQUEST['success_modified'] ) : array(); + + if ( ! empty( $no_admins ) ) { + $messages[] = __( 'You cannot remove all administrators from a group.', 'buddypress' ); + } + + if ( ! empty( $errors ) ) { + $messages[] = __( 'An error occurred when trying to update your group details.', 'buddypress' ); + } else if ( ! empty( $updated ) ) { + $messages[] = __( 'The group has been updated successfully.', 'buddypress' ); + } + + if ( ! empty( $error_new ) ) { + $messages[] = sprintf( __( 'The following users could not be added to the group: <em>%s</em>', 'buddypress' ), implode( ', ', $error_new ) ); + } + + if ( ! empty( $success_new ) ) { + $messages[] = sprintf( __( 'The following users were successfully added to the group: <em>%s</em>', 'buddypress' ), implode( ', ', $success_new ) ); + } + + if ( ! empty( $error_modified ) ) { + $error_modified = bp_groups_admin_get_usernames_from_ids( $error_modified ); + $messages[] = sprintf( __( 'An error occurred when trying to modify the following members: <em>%s</em>', 'buddypress' ), implode( ', ', $error_modified ) ); + } + + if ( ! empty( $success_modified ) ) { + $success_modified = bp_groups_admin_get_usernames_from_ids( $success_modified ); + $messages[] = sprintf( __( 'The following members were successfully modified: <em>%s</em>', 'buddypress' ), implode( ', ', $success_modified ) ); + } + } + + $is_error = ! empty( $no_admins ) || ! empty( $errors ) || ! empty( $error_new ) || ! empty( $error_modified ); + + // Get the group from the database + $group = groups_get_group( 'group_id=' . $_GET['gid'] ); + $group_name = isset( $group->name ) ? apply_filters( 'bp_get_group_name', $group->name ) : ''; + + // Construct URL for form + $form_url = remove_query_arg( array( 'action', 'deleted', 'no_admins', 'error', 'error_new', 'success_new', 'error_modified', 'success_modified' ), $_SERVER['REQUEST_URI'] ); + $form_url = add_query_arg( 'action', 'save', $form_url ); + + // Call an action for plugins to modify the group before we display the edit form + do_action_ref_array( 'bp_groups_admin_edit', array( &$group ) ); ?> + + <div class="wrap"> + <?php screen_icon( 'buddypress-groups' ); ?> + <h2><?php _e( 'Edit Group', 'buddypress' ); ?> + + <?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?> + <a class="add-new-h2" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ); ?>"><?php _e( 'Add New', 'buddypress' ); ?></a> + <?php endif; ?> + + </h2> + + <?php // If the user has just made a change to an group, display the status messages ?> + <?php if ( !empty( $messages ) ) : ?> + <div id="moderated" class="<?php echo ( $is_error ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div> + <?php endif; ?> + + <?php if ( ! empty( $group ) ) : ?> + + <form action="<?php echo esc_attr( $form_url ); ?>" id="bp-groups-edit-form" method="post"> + <div id="poststuff"> + + <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> + <div id="post-body-content"> + <div id="postdiv" class="postarea"> + <div id="bp_groups_name" class="postbox"> + <h3><?php _e( 'Name and Description', 'buddypress' ); ?></h3> + <div class="inside"> + <input type="text" name="bp-groups-name" id="bp-groups-name" value="<?php echo esc_attr( stripslashes( $group_name ) ) ?>" /> + + <?php wp_editor( stripslashes( $group->description ), 'bp-groups-description', array( 'media_buttons' => false, 'teeny' => true, 'textarea_rows' => 5, 'quicktags' => array( 'buttons' => 'strong,em,link,block,del,ins,img,code,spell,close' ) ) ); ?> + </div> + </div> + </div> + </div><!-- #post-body-content --> + + <div id="postbox-container-1" class="postbox-container"> + <?php do_meta_boxes( get_current_screen()->id, 'side', $group ); ?> + </div> + + <div id="postbox-container-2" class="postbox-container"> + <?php do_meta_boxes( get_current_screen()->id, 'normal', $group ); ?> + <?php do_meta_boxes( get_current_screen()->id, 'advanced', $group ); ?> + </div> + </div><!-- #post-body --> + + </div><!-- #poststuff --> + <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?> + <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> + <?php wp_nonce_field( 'edit-group_' . $group->id ); ?> + </form> + + <?php else : ?> + <p><?php printf( __( 'No group found with this ID. <a href="%s">Go back and try again</a>.', 'buddypress' ), esc_url( bp_get_admin_url( 'admin.php?page=bp-groups' ) ) ); ?></p> + <?php endif; ?> + + </div><!-- .wrap --> + +<?php +} + +/** + * Display the Group delete confirmation screen + * + * We include a separate confirmation because group deletion is truly + * irreversible. + * + * @since (BuddyPress) 1.7 + */ +function bp_groups_admin_delete() { + + if ( ! is_super_admin() ) + die( '-1' ); + + $group_ids = isset( $_REQUEST['gid'] ) ? $_REQUEST['gid'] : 0; + if ( ! is_array( $group_ids ) ) { + $group_ids = explode( ',', $group_ids ); + } + $group_ids = wp_parse_id_list( $group_ids ); + $groups = groups_get_groups( array( 'include' => $group_ids, 'show_hidden' => true, ) ); + + // Create a new list of group ids, based on those that actually exist + $gids = array(); + foreach ( $groups['groups'] as $group ) { + $gids[] = $group->id; + } + + $base_url = remove_query_arg( array( 'action', 'action2', 'paged', 's', '_wpnonce', 'gid' ), $_SERVER['REQUEST_URI'] ); ?> + + <div class="wrap"> + <?php screen_icon( 'buddypress-groups' ); ?> + <h2><?php _e( 'Delete Groups', 'buddypress' ) ?></h2> + <p><?php _e( 'You are about to delete the following groups:', 'buddypress' ) ?></p> + + <ul class="bp-group-delete-list"> + <?php foreach ( $groups['groups'] as $group ) : ?> + <li><?php echo esc_html( $group->name ) ?></li> + <?php endforeach; ?> + </ul> + + <p><strong><?php _e( 'This action cannot be undone.', 'buddypress' ) ?></strong></p> + + <a class="button-primary" href="<?php echo wp_nonce_url( add_query_arg( array( 'action' => 'do_delete', 'gid' => implode( ',', $gids ) ), $base_url ), 'bp-groups-delete' ) ?>"><?php _e( 'Delete Permanently', 'buddypress' ) ?></a> + <a class="button" href="<?php echo esc_attr( $base_url ); ?>"><?php _e( 'Cancel', 'buddypress' ) ?></a> + </div> + + <?php +} + +/** + * Display the Groups admin index screen, which contains a list of all your + * BuddyPress groups. + * + * @global BP_Group_List_Table $bp_groups_list_table Group screen list table + * @global string $plugin_page + * @since BuddyPress (1.7) + */ +function bp_groups_admin_index() { + global $bp_groups_list_table, $plugin_page; + + $messages = array(); + + // If the user has just made a change to a group, build status messages + if ( ! empty( $_REQUEST['deleted'] ) ) { + $deleted = ! empty( $_REQUEST['deleted'] ) ? (int) $_REQUEST['deleted'] : 0; + + if ( $deleted > 0 ) { + $messages[] = sprintf( _n( '%s group has been permanently deleted.', '%s groups have been permanently deleted.', $deleted, 'buddypress' ), number_format_i18n( $deleted ) ); + } + } + + // Prepare the group items for display + $bp_groups_list_table->prepare_items(); + + // Call an action for plugins to modify the messages before we display the edit form + do_action( 'bp_groups_admin_index', $messages ); ?> + + <div class="wrap"> + <?php screen_icon( 'buddypress-groups' ); ?> + <h2> + <?php _e( 'Groups', 'buddypress' ); ?> + + <?php if ( !empty( $_REQUEST['s'] ) ) : ?> + <span class="subtitle"><?php printf( __( 'Search results for “%s”', 'buddypress' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ); ?></span> + <?php endif; ?> + </h2> + + <?php // If the user has just made a change to an group, display the status messages ?> + <?php if ( !empty( $messages ) ) : ?> + <div id="moderated" class="<?php echo ( ! empty( $_REQUEST['error'] ) ) ? 'error' : 'updated'; ?>"><p><?php echo implode( "<br/>\n", $messages ); ?></p></div> + <?php endif; ?> + + <?php // Display each group on its own row ?> + <?php $bp_groups_list_table->views(); ?> + + <form id="bp-groups-form" action="" method="get"> + <?php $bp_groups_list_table->search_box( __( 'Search all Groups', 'buddypress' ), 'bp-groups' ); ?> + <input type="hidden" name="page" value="<?php echo esc_attr( $plugin_page ); ?>" /> + <?php $bp_groups_list_table->display(); ?> + </form> + + </div> + +<?php +} + +/** + * Settings metabox + * + * @param object $item Group item + * @since BuddyPress (1.7) + */ +function bp_groups_admin_edit_metabox_settings( $item ) { + + $invite_status = groups_get_groupmeta( $item->id, 'invite_status' ); ?> + + <?php if ( bp_is_active( 'forums' ) ) : ?> + <div class="bp-groups-settings-section" id="bp-groups-settings-section-forum"> + <label for="group-show-forum"><input type="checkbox" name="group-show-forum" id="group-show-forum" <?php checked( $item->enable_forum ) ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ) ?><br /> + </div> + <?php endif; ?> + + <div class="bp-groups-settings-section" id="bp-groups-settings-section-status"> + <label for="group-status"><?php _e( 'Privacy', 'buddypress' ); ?></label> + + <ul> + <li><input type="radio" name="group-status" id="bp-group-status-public" value="public" <?php checked( $item->status, 'public' ) ?> /> <?php _e( 'Public', 'buddypress' ) ?></li> + <li><input type="radio" name="group-status" id="bp-group-status-private" value="private" <?php checked( $item->status, 'private' ) ?> /> <?php _e( 'Private', 'buddypress' ) ?></li> + <li><input type="radio" name="group-status" id="bp-group-status-hidden" value="hidden" <?php checked( $item->status, 'hidden' ) ?> /> <?php _e( 'Hidden', 'buddypress' ) ?></li> + </div> + + <div class="bp-groups-settings-section" id="bp-groups-settings-section-invite-status"> + <label for="group-invite-status"><?php _e( 'Who can invite others to this group?', 'buddypress' ); ?></label> + + <ul> + <li><input type="radio" name="group-invite-status" id="bp-group-invite-status-members" value="members" <?php checked( $invite_status, 'members' ) ?> /> <?php _e( 'All group members', 'buddypress' ) ?></li> + <li><input type="radio" name="group-invite-status" id="bp-group-invite-status-mods" value="mods" <?php checked( $invite_status, 'mods' ) ?> /> <?php _e( 'Group admins and mods only', 'buddypress' ) ?></li> + <li><input type="radio" name="group-invite-status" id="bp-group-invite-status-admins" value="admins" <?php checked( $invite_status, 'admins' ) ?> /> <?php _e( 'Group admins only', 'buddypress' ) ?></li> + </ul> + </div> + +<?php +} + +/** + * Add New Members metabox + * + * @since BuddyPress (1.7) + */ +function bp_groups_admin_edit_metabox_add_new_members( $item ) { + ?> + + <input name="bp-groups-new-members" id="bp-groups-new-members" class="bp-suggest-user" placeholder="<?php _e( 'Enter a comma-separated list of user logins.', 'buddypress' ) ?>" /> + <ul id="bp-groups-new-members-list"></ul> + <?php +} + +/** + * Members metabox + * + * @since BuddyPress (1.7) + */ +function bp_groups_admin_edit_metabox_members( $item ) { + global $members_template; + + // Pull up a list of group members, so we can separate out the types + // We'll also keep track of group members here to place them into a + // javascript variable, which will help with group member autocomplete + $member_ids = array(); + $members = array( + 'admin' => array(), + 'mod' => array(), + 'member' => array(), + 'banned' => array() + ); + + if ( bp_group_has_members( array( + 'group_id' => $item->id, + 'exclude_admins_mods' => false, + 'exclude_banned' => false + ) ) ) { + // Get a list of admins and mods, to reduce lookups + // We'll rekey them by user_id for convenience + $admins = $mods = array(); + + foreach ( (array) groups_get_group_admins( $item->id ) as $admin_obj ) { + $admins[ $admin_obj->user_id ] = $admin_obj; + } + + foreach ( (array) groups_get_group_mods( $item->id ) as $admin_obj ) { + $mods[ $admin_obj->user_id ] = $admin_obj; + } + + while ( bp_group_members() ) { + bp_group_the_member(); + if ( bp_get_group_member_is_banned() ) { + $members['banned'][] = $members_template->member; + } else if ( isset( $admins[ bp_get_group_member_id() ] ) ) { + $members['admin'][] = $members_template->member; + } else if ( isset( $mods[ bp_get_group_member_id() ] ) ) { + $members['mod'][] = $members_template->member; + } else { + $members['member'][] = $members_template->member; + } + + $member_ids[] = bp_get_group_member_id(); + } + } + + // Echo out the javascript variable + $member_ids = ! empty( $member_ids ) ? implode( ',', $member_ids ) : ''; + echo '<script type="text/javascript">var group_members = "' . $member_ids . '";</script>'; + + // Loop through each member type + foreach ( $members as $member_type => $type_users ) : ?> + + <div class="bp-groups-member-type" id="bp-groups-member-type-<?php echo esc_attr( $member_type ) ?>"> + + <h4> + <?php switch ( $member_type ) : + case 'admin' : _e( 'Administrators', 'buddypress' ); break; + case 'mod' : _e( 'Moderators', 'buddypress' ); break; + case 'member' : _e( 'Members', 'buddypress' ); break; + case 'banned' : _e( 'Banned Users', 'buddypress' ); break; + endswitch; ?> + </h4> + + <?php if ( !empty( $type_users ) ) : ?> + + <table class="widefat bp-group-members"> + <thead> + <tr> + <th scope="col" class="uid-column"><?php _ex( 'ID', 'Group member user_id in group admin', 'buddypress' ) ?></th> + <th scope="col" class="uname-column"><?php _ex( 'Name', 'Group member name in group admin', 'buddypress' ) ?></th> + <th scope="col" class="urole-column"><?php _ex( 'Group Role', 'Group member role in group admin', 'buddypress' ) ?></th> + </tr> + </thead> + + <tbody> + + <?php foreach ( $type_users as $type_user ) : ?> + + <tr> + <th scope="row" class="uid-column"><?php echo esc_html( $type_user->user_id ); ?></th> + + <td class="uname-column"> + <a style="float: left;" href="<?php echo bp_core_get_user_domain( $type_user->user_id ); ?>"><?php echo bp_core_fetch_avatar( array( + 'item_id' => $type_user->user_id, + 'width' => '32', + 'height' => '32' + ) ); ?></a> + + <span style="margin: 8px; float: left;"><?php echo bp_core_get_userlink( $type_user->user_id ) ?></span> + </td> + + <td class="urole-column"> + <select class="bp-groups-role" id="bp-groups-role-<?php echo esc_attr( $type_user->user_id ); ?>" name="bp-groups-role[<?php echo esc_attr( $type_user->user_id ); ?>]"> + <option value="admin" <?php selected( 'admin', $member_type ) ?>><?php _e( 'Administrator', 'buddypress' ) ?></option> + <option value="mod" <?php selected( 'mod', $member_type ) ?>><?php _e( 'Moderator', 'buddypress' ) ?></option> + <option value="member" <?php selected( 'member', $member_type ) ?>><?php _e( 'Member', 'buddypress' ) ?></option> + <option class="banned" value="banned" <?php selected( 'banned', $member_type ) ?>><?php _e( 'Banned', 'buddypress' ) ?></option> + <option class="remove" value="remove"><?php _e( 'Remove From Group', 'buddypress' ) ?></option> + </select> + + <?php + /** + * Store the current role for this user, + * so we can easily detect changes. + * + * @todo remove this, and do database detection on save + */ ?> + <input type="hidden" name="bp-groups-existing-role[<?php echo esc_attr( $type_user->user_id ); ?>]" value="<?php echo esc_attr( $member_type ); ?>" /> + </td> + </tr> + + <?php endforeach; ?> + + </tbody> + </table> + + <?php else : ?> + + <p class="bp-groups-no-members description"><?php _e( 'No members of this type', 'buddypress' ) ?></p> + + <?php endif; ?> + + </div><!-- .bp-groups-member-type --> + + <?php endforeach; + +} + +/** + * Status metabox for the Groups admin edit screen + * + * @param object $item Group item + * @since BuddyPress (1.7) + */ +function bp_groups_admin_edit_metabox_status( $item ) { + $base_url = add_query_arg( array( + 'page' => 'bp-groups', + 'gid' => $item->id + ), bp_get_admin_url( 'admin.php' ) ); ?> + + <div id="submitcomment" class="submitbox"> + <div id="major-publishing-actions"> + <div id="delete-action"> + <a class="submitdelete deletion" href="<?php echo wp_nonce_url( add_query_arg( 'action', 'delete', $base_url ), 'bp-groups-delete' ) ?>"><?php _e( 'Delete Group', 'buddypress' ) ?></a> + </div> + + <div id="publishing-action"> + <?php submit_button( __( 'Save Changes', 'buddypress' ), 'primary', 'save', false, array( 'tabindex' => '4' ) ); ?> + </div> + <div class="clear"></div> + </div><!-- #major-publishing-actions --> + </div><!-- #submitcomment --> + +<?php +} + +/** + * Match a set of user ids up to a set of usernames + * + * @since BuddyPress (1.7) + */ +function bp_groups_admin_get_usernames_from_ids( $user_ids = array() ) { + + $usernames = array(); + $users = new WP_User_Query( array( 'blog_id' => 0, 'include' => $user_ids ) ); + + foreach ( (array) $users->results as $user ) { + $usernames[] = $user->user_login; + } + + return $usernames; +} + +/** + * AJAX handler for group member autocomplete requests + * + * @since BuddyPress (1.7) + */ +function bp_groups_admin_autocomplete_handler() { + + // Bail if user user shouldn't be here, or is a large network + if ( ! current_user_can( 'bp_moderate' ) || ( is_multisite() && wp_is_large_network( 'users' ) ) ) + wp_die( -1 ); + + $return = array(); + + // Exclude current group members + $group_members = isset( $_REQUEST['group_members'] ) ? wp_parse_id_list( $_REQUEST['group_members'] ) : array(); + $terms = isset( $_REQUEST['term'] ) ? $_REQUEST['term'] : ''; + $users = get_users( array( + 'blog_id' => false, + 'search' => '*' . $terms . '*', + 'exclude' => $group_members, + 'search_columns' => array( 'user_login', 'user_nicename', 'user_email', 'display_name' ), + 'number' => 10 + ) ); + + foreach ( (array) $users as $user ) { + $return[] = array( + /* translators: 1: user_login, 2: user_email */ + 'label' => sprintf( __( '%1$s (%2$s)' ), $user->user_login, $user->user_email ), + 'value' => $user->user_login, + ); + } + + wp_die( json_encode( $return ) ); +} +add_action( 'wp_ajax_bp_group_admin_member_autocomplete', 'bp_groups_admin_autocomplete_handler' ); + +/** + * List table class for the Groups component admin page. + * + * @since BuddyPress (1.7) + */ +class BP_Groups_List_Table extends WP_List_Table { + + /** + * What type of view is being displayed? e.g. "All", "Pending", "Approved", "Spam"... + * + * @since BuddyPress (1.7) + */ + public $view = 'all'; + + /** + * Group counts for each group type + * + * @since BuddyPress (1.7) + */ + public $group_counts = 0; + + /** + * Constructor + * + * @since BuddyPress (1.7) + */ + public function __construct() { + + // Define singular and plural labels, as well as whether we support AJAX. + parent::__construct( array( + 'ajax' => false, + 'plural' => 'groups', + 'singular' => 'group', + ) ); + } + + /** + * Handle filtering of data, sorting, pagination, and any other data-manipulation required prior to rendering. + * + * @since BuddyPress (1.7) + */ + function prepare_items() { + global $groups_template; + + $screen = get_current_screen(); + + // Option defaults + $include_id = false; + $search_terms = false; + + // Set current page + $page = $this->get_pagenum(); + + // Set per page from the screen options + $per_page = $this->get_items_per_page( str_replace( '-', '_', "{$screen->id}_per_page" ) ); + + // Sort order. Note: not supported in bp_has_groups() + $order = 'ASC'; + if ( !empty( $_REQUEST['order'] ) ) { + $order = ( 'desc' == strtolower( $_REQUEST['order'] ) ) ? 'DESC' : 'ASC'; + } + + // Order by - default to newest + $type = 'newest'; + if ( !empty( $_REQUEST['orderby'] ) ) { + switch ( $_REQUEST['orderby'] ) { + case 'name' : + $type = 'alphabetical'; + break; + case 'id' : + $type = 'newest'; + break; + case 'members' : + $type = 'popular'; + break; + } + } + + // Are we doing a search? + if ( !empty( $_REQUEST['s'] ) ) + $search_terms = $_REQUEST['s']; + + // Check if user has clicked on a specific group (if so, fetch only that group). + if ( !empty( $_REQUEST['gid'] ) ) + $include_id = (int) $_REQUEST['gid']; + + // Set the current view + if ( isset( $_GET['group_status'] ) && in_array( $_GET['group_status'], array( 'public', 'private', 'hidden' ) ) ) { + $this->view = $_GET['group_status']; + } + + // We'll use the ids of group types for the 'include' param + $this->group_type_ids = BP_Groups_Group::get_group_type_ids(); + + // Pass a dummy array if there are no groups of this type + $include = false; + if ( 'all' != $this->view && isset( $this->group_type_ids[ $this->view ] ) ) { + $include = ! empty( $this->group_type_ids[ $this->view ] ) ? $this->group_type_ids[ $this->view ] : array( 0 ); + } + + // Get group type counts for display in the filter tabs + $this->group_counts = array(); + foreach ( $this->group_type_ids as $group_type => $group_ids ) { + $this->group_counts[ $group_type ] = count( $group_ids ); + } + + // If we're viewing a specific group, flatten all activites into a single array. + if ( $include_id ) { + $groups = array( (array) groups_get_group( 'group_id=' . $include_id ) ); + } else { + $groups_args = array( + 'include' => $include, + 'per_page' => $per_page, + 'page' => $page, + 'type' => $type, + 'order' => $order + ); + + $groups = array(); + if ( bp_has_groups( $groups_args ) ) { + while ( bp_groups() ) { + bp_the_group(); + $groups[] = (array) $groups_template->group; + } + } + } + + // Set raw data to display + $this->items = $groups; + + // Store information needed for handling table pagination + $this->set_pagination_args( array( + 'per_page' => $per_page, + 'total_items' => $groups_template->total_group_count, + 'total_pages' => ceil( $groups_template->total_group_count / $per_page ) + ) ); + } + + /** + * Get an array of all the columns on the page + * + * @return array + * @since BuddyPress (1.7) + */ + function get_column_info() { + $this->_column_headers = array( + $this->get_columns(), + array(), + $this->get_sortable_columns(), + ); + + return $this->_column_headers; + } + + /** + * Displays a message on screen when no items are found (e.g. no search matches) + * + * @since BuddyPress (1.7) + */ + function no_items() { + _e( 'No groups found.', 'buddypress' ); + } + + /** + * Outputs the Groups data table + * + * @since BuddyPress (1.7) + */ + function display() { + extract( $this->_args ); + + $this->display_tablenav( 'top' ); ?> + + <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0"> + <thead> + <tr> + <?php $this->print_column_headers(); ?> + </tr> + </thead> + + <tfoot> + <tr> + <?php $this->print_column_headers( false ); ?> + </tr> + </tfoot> + + <tbody id="the-comment-list"> + <?php $this->display_rows_or_placeholder(); ?> + </tbody> + </table> + <?php + + $this->display_tablenav( 'bottom' ); + } + + /** + * Generates content for a single row of the table + * + * @param object $item The current item + * @since BuddyPress (1.7) + */ + function single_row( $item = array() ) { + static $row_class = ''; + + if ( empty( $row_class ) ) { + $row_class = ' class="alternate odd"'; + } else { + $row_class = ' class="even"'; + } + + echo '<tr' . $row_class . ' id="group-' . esc_attr( $item['id'] ) . '" data-parent_id="' . esc_attr( $item['id'] ) . '" data-root_id="' . esc_attr( $item['id'] ) . '">'; + echo $this->single_row_columns( $item ); + echo '</tr>'; + } + + /** + * Get the list of views available on this table (e.g. "all", "public"). + * + * @since BuddyPress (1.7) + */ + function get_views() { + $url_base = remove_query_arg( array( 'orderby', 'order', 'group_status' ), $_SERVER['REQUEST_URI'] ); ?> + <ul class="subsubsub"> + <li class="all"><a href="<?php echo esc_attr( esc_url( $url_base ) ); ?>" class="<?php if ( 'all' == $this->view ) echo 'current'; ?>"><?php _e( 'All', 'buddypress' ); ?></a> |</li> + <li class="public"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'public', $url_base ) ) ); ?>" class="<?php if ( 'public' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Public <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->group_counts['public'] ) ); ?></a> |</li> + <li class="private"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'private', $url_base ) ) ); ?>" class="<?php if ( 'private' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Private <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->group_counts['private'] ) ); ?></a> |</li> + <li class="hidden"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'hidden', $url_base ) ) ); ?>" class="<?php if ( 'hidden' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Hidden <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->group_counts['hidden'] ) ); ?></a></li> + + <?php do_action( 'bp_groups_list_table_get_views', $url_base, $this->view ); ?> + </ul> + <?php + } + + /** + * Get bulk actions + * + * @return array Key/value pairs for the bulk actions dropdown + * @since BuddyPress (1.7) + */ + function get_bulk_actions() { + return apply_filters( 'bp_groups_list_table_get_bulk_actions', array( + 'delete' => __( 'Delete', 'buddypress' ) + ) ); + } + + /** + * Get the table column titles. + * + * @see WP_List_Table::single_row_columns() + * @return array + * @since BuddyPress (1.7) + */ + function get_columns() { + return array( + 'cb' => '<input name type="checkbox" />', + 'comment' => _x( 'Name', 'Groups admin Group Name column header', 'buddypress' ), + 'description' => _x( 'Description', 'Groups admin Group Description column header', 'buddypress' ), + 'status' => _x( 'Status', 'Groups admin Privacy Status column header', 'buddypress' ), + 'members' => _x( '# Members', 'Groups admin Members column header', 'buddypress' ), + 'last_active' => _x( 'Last Active', 'Groups admin Last Active column header', 'buddypress' ) + ); + } + + /** + * Get the column names for sortable columns + * + * @return array + * @since BuddyPress (1.7) + */ + function get_sortable_columns() { + return array( + 'gid' => array( 'gid', false ), + 'comment' => array( 'name', false ), + 'members' => array( 'members', false ), + 'last_active' => array( 'last_active', false ) + ); + } + + /** + * Checkbox column + * + * @param array $item A singular item (one full row) + * @see WP_List_Table::single_row_columns() + * @since BuddyPress (1.7) + */ + function column_cb( $item = array() ) { + printf( '<input type="checkbox" name="gid[]" value="%d" />', (int) $item['id'] ); + } + + /** + * Group id column + * + * @param array $item A singular item (one full row) + * @see WP_List_Table::single_row_columns() + * @since BuddyPress (1.7) + */ + function column_gid( $item = array() ) { + echo '<strong>' . $item['id'] . '</strong>'; + } + + /** + * Name column, and "quick admin" rollover actions. + * + * Called "comment" in the CSS so we can re-use some WP core CSS. + * + * @param array $item A singular item (one full row) + * @see WP_List_Table::single_row_columns() + * @since BuddyPress (1.7) + */ + function column_comment( $item = array() ) { + + // Preorder items: Visit | Edit | Delete + $actions = array( + 'visit' => '', + 'edit' => '', + 'delete' => '', + ); + + // We need the group object for some BP functions + $item_obj = (object) $item; + + // Build actions URLs + $base_url = bp_get_admin_url( 'admin.php?page=bp-groups&gid=' . $item['id'] ); + $delete_url = wp_nonce_url( $base_url . "&action=delete", 'bp-groups-delete' ); + $edit_url = $base_url . '&action=edit'; + $visit_url = bp_get_group_permalink( $item_obj ); + + // Rollover actions + + // Visit + $actions['visit'] = sprintf( '<a href="%s">%s</a>', esc_url( $visit_url ), __( 'Visit', 'buddypress' ) ); + + // Edit + $actions['edit'] = sprintf( '<a href="%s">%s</a>', esc_url( $edit_url ), __( 'Edit', 'buddypress' ) ); + + // Delete + $actions['delete'] = sprintf( '<a href="%s">%s</a>', esc_url( $delete_url ), __( 'Delete', 'buddypress' ) ); + + // Other plugins can filter which actions are shown + $actions = apply_filters( 'bp_groups_admin_comment_row_actions', array_filter( $actions ), $item ); + + // Get group name and avatar + $avatar = bp_core_fetch_avatar( array( + 'item_id' => $item['id'], + 'object' => 'group', + 'type' => 'thumb', + 'avatar_dir' => 'group-avatars', + 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $item['name'] ), + 'width' => '32', + 'height' => '32', + 'title' => $item['name'] + ) ); + + $content = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'], $item ) ); + + echo $avatar . ' ' . $content . ' ' . $this->row_actions( $actions ); + } + + /** + * Description column + * + * @since BuddyPress (1.7) + */ + function column_description( $item = array() ) { + echo apply_filters_ref_array( 'bp_get_group_description', array( $item['description'], $item ) ); + } + + /** + * Status column + * + * @since BuddyPress (1.7) + */ + function column_status( $item = array() ) { + $status = $item['status']; + $status_desc = ''; + + // @todo This should be abstracted out somewhere for the whole + // Groups component + switch ( $status ) { + case 'public' : + $status_desc = __( 'Public', 'buddypress' ); + break; + case 'private' : + $status_desc = __( 'Private', 'buddypress' ); + break; + case 'hidden' : + $status_desc = __( 'Hidden', 'buddypress' ); + break; + } + + echo apply_filters_ref_array( 'bp_groups_admin_get_group_status', array( $status_desc, $item ) ); + } + + /** + * Number of Members column + * + * @since BuddyPress (1.7) + */ + function column_members( $item = array() ) { + $count = groups_get_groupmeta( $item['id'], 'total_member_count' ); + echo apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( (int) $count, $item ) ); + } + + /** + * Last Active column + * + * @since BuddyPress (1.7) + */ + function column_last_active( $item = array() ) { + $last_active = groups_get_groupmeta( $item['id'], 'last_activity' ); + echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) ); + } +} diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php index 26e57f8cdedec3505be0cb5e4fd0f2e322c389c8..02cc795df49e53e25ff8c833f1e079c45551ad42 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-adminbar.php @@ -116,5 +116,3 @@ function bp_groups_remove_edit_page_menu() { } } add_action( 'bp_init', 'bp_groups_remove_edit_page_menu', 99 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-buddybar.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-buddybar.php index 4ae3dc9d9537e09f18ab3c4c957ee527d9829a95..adf69f05913d7963b9c6bed5389699fb7858b8b2 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-buddybar.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-buddybar.php @@ -65,5 +65,3 @@ function bp_groups_adminbar_admin_menu() { <?php } add_action( 'bp_adminbar_menus', 'bp_groups_adminbar_admin_menu', 20 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php index e51456e09a22c57a9efab9a9419c7d41b3b72e77..afb9e99f1a9f8cb48a343626eebe5d1e8ef791f9 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-cache.php @@ -28,7 +28,7 @@ if ( !defined( 'ABSPATH' ) ) exit; */ function bp_groups_update_meta_cache( $group_ids = false ) { global $bp; - + $cache_args = array( 'object_ids' => $group_ids, 'object_type' => $bp->groups->id, @@ -36,7 +36,7 @@ function bp_groups_update_meta_cache( $group_ids = false ) { 'meta_table' => $bp->groups->table_name_groupmeta, 'cache_key_prefix' => 'bp_groups_groupmeta' ); - + bp_update_meta_cache( $cache_args ); } @@ -49,6 +49,21 @@ add_action( 'groups_details_updated', 'groups_clear_group_object_cach add_action( 'groups_group_avatar_updated', 'groups_clear_group_object_cache' ); add_action( 'groups_create_group_step_complete', 'groups_clear_group_object_cache' ); +/** + * Bust group caches when editing or deleting + * + * @since BuddyPress (1.7) + * @param int $group_id The group being edited + */ +function bp_groups_delete_group_cache( $group_id = 0 ) { + wp_cache_delete( 'bp_groups_group_' . $group_id . '_load_users', 'bp' ); + wp_cache_delete( 'bp_groups_group_' . $group_id . '_noload_users', 'bp' ); +} +add_action( 'groups_delete_group', 'bp_groups_delete_group_cache' ); +add_action( 'groups_update_group', 'bp_groups_delete_group_cache' ); +add_action( 'groups_details_updated', 'bp_groups_delete_group_cache' ); +add_action( 'groups_settings_updated', 'bp_groups_delete_group_cache' ); + /** * Clears caches for the group creator when a group is created * @@ -103,5 +118,3 @@ add_action( 'groups_membership_requested', 'bp_core_clear_cache' ); add_action( 'groups_create_group_step_complete', 'bp_core_clear_cache' ); add_action( 'groups_created_group', 'bp_core_clear_cache' ); add_action( 'groups_group_avatar_updated', 'bp_core_clear_cache' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php index 033dd41be0388d4aec248163cb37f344bb3ce2fe..8c9fb51045faa31aea6a0ab97772615aab1c3eaa 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-classes.php @@ -58,9 +58,9 @@ class BP_Groups_Group { function populate() { global $wpdb, $bp; - if ( $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) ) ) { + if ( $group = $wpdb->get_row( $wpdb->prepare( "SELECT g.* FROM {$bp->groups->table_name} g WHERE g.id = %d", $this->id ) ) ) { bp_groups_update_meta_cache( $this->id ); - + $this->id = $group->id; $this->creator_id = $group->creator_id; $this->name = stripslashes($group->name); @@ -72,7 +72,7 @@ class BP_Groups_Group { $this->last_activity = groups_get_groupmeta( $this->id, 'last_activity' ); $this->total_member_count = groups_get_groupmeta( $this->id, 'total_member_count' ); $this->is_member = BP_Groups_Member::check_is_member( bp_loggedin_user_id(), $this->id ); - + // If this is a private or hidden group, does the current user have access? if ( 'private' == $this->status || 'hidden' == $this->status ) { if ( $this->is_member && is_user_logged_in() || bp_current_user_can( 'bp_moderate' ) ) @@ -159,7 +159,7 @@ class BP_Groups_Group { $this->id = $wpdb->insert_id; do_action_ref_array( 'groups_group_after_save', array( &$this ) ); - + wp_cache_delete( 'bp_groups_group_' . $this->id, 'bp' ); return true; @@ -257,8 +257,8 @@ class BP_Groups_Group { if ( !bp_current_user_can( 'bp_moderate' ) ) $hidden_sql = "AND status != 'hidden'"; - $paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '%%$filter%%' OR description LIKE '%%$filter%%' ) {$hidden_sql} {$order_sql} {$pag_sql}" ); - $total_groups = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '%%$filter%%' OR description LIKE '%%$filter%%' ) {$hidden_sq}" ); + $paged_groups = $wpdb->get_results( "SELECT id as group_id FROM {$bp->groups->table_name} WHERE ( name LIKE '%%{$filter}%%' OR description LIKE '%%{$filter}%%' ) {$hidden_sql} {$order_sql} {$pag_sql}" ); + $total_groups = $wpdb->get_var( "SELECT COUNT(id) FROM {$bp->groups->table_name} WHERE ( name LIKE '%%{$filter}%%' OR description LIKE '%%{$filter}%%' ) {$hidden_sql}" ); return array( 'groups' => $paged_groups, 'total' => $total_groups ); } @@ -305,9 +305,44 @@ class BP_Groups_Group { return array( 'requests' => $paged_requests, 'total' => $total_requests ); } - function get( $type = 'newest', $per_page = null, $page = null, $user_id = 0, $search_terms = false, $include = false, $populate_extras = true, $exclude = false, $show_hidden = false ) { + function get( $args = array() ) { global $wpdb, $bp; + // Backward compatibility with old method of passing arguments + if ( ! is_array( $args ) || func_num_args() > 1 ) { + _deprecated_argument( __METHOD__, '1.7', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); + + $old_args_keys = array( + 0 => 'type', + 1 => 'per_page', + 2 => 'page', + 3 => 'user_id', + 4 => 'search_terms', + 5 => 'include', + 6 => 'populate_extras', + 7 => 'exclude', + 8 => 'show_hidden', + ); + + $func_args = func_get_args(); + $args = bp_core_parse_args_array( $old_args_keys, $func_args ); + } + + $defaults = array( + 'type' => 'newest', + 'per_page' => null, + 'page' => null, + 'user_id' => 0, + 'search_terms' => false, + 'include' => false, + 'populate_extras' => true, + 'exclude' => false, + 'show_hidden' => false + ); + + $r = wp_parse_args( $args, $defaults ); + extract( $r ); + $sql = array(); $total_sql = array(); @@ -415,13 +450,13 @@ class BP_Groups_Group { foreach ( (array) $paged_groups as $group ) { $group_ids[] = $group->id; } - + // Populate some extra information instead of querying each time in the loop if ( !empty( $populate_extras ) ) { $group_ids = $wpdb->escape( join( ',', (array) $group_ids ) ); $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, $type ); } - + // Grab all groupmeta bp_groups_update_meta_cache( $group_ids ); @@ -537,15 +572,17 @@ class BP_Groups_Group { $letter = like_escape( $wpdb->escape( $letter ) ); if ( !empty( $limit ) && !empty( $page ) ) { - $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); - $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql}" ); + $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) ); + $total_groups = $wpdb->get_var( "SELECT COUNT(DISTINCT g.id) FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '{$letter}%%' {$hidden_sql} {$exclude_sql}" ); } - $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '$letter%%' {$hidden_sql} {$search_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}" ); + $paged_groups = $wpdb->get_results( "SELECT g.*, gm1.meta_value as total_member_count, gm2.meta_value as last_activity FROM {$bp->groups->table_name_groupmeta} gm1, {$bp->groups->table_name_groupmeta} gm2, {$bp->groups->table_name} g WHERE g.id = gm1.group_id AND g.id = gm2.group_id AND gm2.meta_key = 'last_activity' AND gm1.meta_key = 'total_member_count' AND g.name LIKE '{$letter}%%' {$hidden_sql} {$exclude_sql} ORDER BY g.name ASC {$pag_sql}" ); if ( !empty( $populate_extras ) ) { - foreach ( (array) $paged_groups as $group ) $group_ids[] = $group->id; - $group_ids = $wpdb->escape( join( ',', (array) $group_ids ) ); + foreach ( (array) $paged_groups as $group ) { + $group_ids[] = $group->id; + } + $group_ids = $wpdb->escape( join( ',', (array) $group_ids ) ); $paged_groups = BP_Groups_Group::get_group_extras( $paged_groups, $group_ids, 'newest' ); } @@ -645,19 +682,7 @@ class BP_Groups_Group { if ( 'unreplied' == $type ) $bp->groups->filter_sql = ' AND t.topic_posts = 1'; - /** - * Provide backward-compatibility for the groups_total_public_forum_topic_count SQL filter. - * Developers: DO NOT use this filter. It will be removed in BP 1.7. Instead, use - * get_global_forum_topic_count_extra_sql. See https://buddypress.trac.wordpress.org/ticket/4306 - */ - $maybe_extra_sql = apply_filters( 'groups_total_public_forum_topic_count', $bp->groups->filter_sql, $type ); - - if ( is_int( $maybe_extra_sql ) ) - $extra_sql = $bp->groups->filter_sql; - else - $extra_sql = $maybe_extra_sql; - - // Developers: use this filter instead + // https://buddypress.trac.wordpress.org/ticket/4306 $extra_sql = apply_filters( 'get_global_forum_topic_count_extra_sql', $bp->groups->filter_sql, $type ); // Make sure the $extra_sql begins with an AND @@ -707,10 +732,8 @@ class BP_Groups_Group { $sql = array(); $sql['select'] = "SELECT COUNT(t.topic_id)"; - - $sql['from'] = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id"; - - $sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'"; + $sql['from'] = "FROM {$bbdb->topics} AS t INNER JOIN {$bp->groups->table_name_groupmeta} AS gm ON t.forum_id = gm.meta_value INNER JOIN {$bp->groups->table_name} AS g ON gm.group_id = g.id"; + $sql['where'] = "WHERE gm.meta_key = 'forum_id' {$status_sql} AND t.topic_status = '0' AND t.topic_sticky != '2'"; if ( $search_terms ) { $st = like_escape( $search_terms ); @@ -719,6 +742,29 @@ class BP_Groups_Group { return $wpdb->get_var( implode( ' ', $sql ) ); } + + /** + * Get an array containing ids for each group type + * + * A bit of a kludge workaround for some issues + * with bp_has_groups() + * + * @since BuddyPress (1.7) + * + * @return array + */ + function get_group_type_ids() { + global $wpdb, $bp; + + $ids = array(); + + $ids['all'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name}" ); + $ids['public'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'public'" ); + $ids['private'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'private'" ); + $ids['hidden'] = $wpdb->get_col( "SELECT id FROM {$bp->groups->table_name} WHERE status = 'hidden'" ); + + return $ids; + } } class BP_Groups_Member { @@ -811,7 +857,7 @@ class BP_Groups_Member { if ( $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND group_id = %d AND is_confirmed = 1 LIMIT 1", $this->user_id, $this->group_id ) ) ) { return false; } - + $sql = $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_members} ( user_id, group_id, inviter_id, is_admin, is_mod, is_banned, user_title, date_modified, is_confirmed, comments, invite_sent ) VALUES ( %d, %d, %d, %d, %d, %d, %s, %s, %d, %s, %d )", $this->user_id, $this->group_id, $this->inviter_id, $this->is_admin, $this->is_mod, $this->is_banned, $this->user_title, $this->date_modified, $this->is_confirmed, $this->comments, $this->invite_sent ); } @@ -1109,7 +1155,7 @@ class BP_Groups_Member { * @global wpdb $wpdb WordPress database object * @param int $user_id * @param int $group_id - * @since 1.2.6 + * @since BuddyPress (1.2.6) */ function check_is_creator( $user_id, $group_id ) { global $bp, $wpdb; @@ -1134,9 +1180,9 @@ class BP_Groups_Member { // If the user is logged in and viewing their random groups, we can show hidden and private groups if ( bp_is_my_profile() ) { - return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT {$total_groups}", $user_id ) ); + return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT group_id FROM {$bp->groups->table_name_members} WHERE user_id = %d AND is_confirmed = 1 AND is_banned = 0 ORDER BY rand() LIMIT $total_groups", $user_id ) ); } else { - return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT {$total_groups}", $user_id ) ); + return $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT m.group_id FROM {$bp->groups->table_name_members} m, {$bp->groups->table_name} g WHERE m.group_id = g.id AND g.status != 'hidden' AND m.user_id = %d AND m.is_confirmed = 1 AND m.is_banned = 0 ORDER BY rand() LIMIT $total_groups", $user_id ) ); } } @@ -1180,21 +1226,26 @@ class BP_Groups_Member { $banned_sql = " AND is_banned = 0"; $exclude_sql = ''; - if ( !empty( $exclude ) ) + if ( !empty( $exclude ) ) { + $exclude = implode( ',', wp_parse_id_list( $exclude ) ); $exclude_sql = " AND m.user_id NOT IN ({$exclude})"; + } - if ( bp_is_active( 'xprofile' ) ) + if ( bp_is_active( 'xprofile' ) ) { $members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, pd.value as display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u, {$bp->profile->table_name_data} pd WHERE u.ID = m.user_id AND u.ID = pd.user_id AND pd.field_id = 1 AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) ); - else + } else { $members = $wpdb->get_results( apply_filters( 'bp_group_members_user_join_filter', $wpdb->prepare( "SELECT m.user_id, m.date_modified, m.is_banned, u.user_login, u.user_nicename, u.user_email, u.display_name FROM {$bp->groups->table_name_members} m, {$wpdb->users} u WHERE u.ID = m.user_id AND group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql} ORDER BY m.date_modified DESC {$pag_sql}", $group_id ) ) ); + } - if ( empty( $members ) ) + if ( empty( $members ) ) { return false; + } - if ( empty( $pag_sql ) ) + if ( empty( $pag_sql ) ) { $total_member_count = count( $members ); - else - $total_member_count = $wpdb->get_var( apply_filters( 'bp_group_members_count_user_join_filter', $wpdb->prepare( "SELECT COUNT(user_id) FROM {$bp->groups->table_name_members} WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql}", $group_id ) ) ); + } else { + $total_member_count = $wpdb->get_var( apply_filters( 'bp_group_members_count_user_join_filter', $wpdb->prepare( "SELECT COUNT(user_id) FROM {$bp->groups->table_name_members} m WHERE group_id = %d AND is_confirmed = 1 {$banned_sql} {$exclude_admins_sql} {$exclude_sql}", $group_id ) ) ); + } // Fetch whether or not the user is a friend foreach ( (array) $members as $user ) @@ -1228,7 +1279,7 @@ class BP_Groups_Member { * @global object $bp BuddyPress global settings * @global wpdb $wpdb WordPress database object * @param int $user_id - * @since 1.0 + * @since BuddyPress (1.0) * @uses BP_Groups_Member */ function delete_all_for_user( $user_id ) { @@ -1260,12 +1311,12 @@ class BP_Groups_Member { * * @package BuddyPress * @subpackage Groups - * @since 1.1 + * @since BuddyPress (1.1) */ class BP_Group_Extension { var $name = false; var $slug = false; - + // The name/slug of the Group Admin tab for this extension var $admin_name = ''; var $admin_slug = ''; @@ -1280,9 +1331,26 @@ class BP_Group_Extension { var $create_step_position = 81; var $nav_item_position = 81; + /** + * @var string Context for the optional admin metabox + * @see https://codex.wordpress.org/Function_Reference/add_meta_box for + * possible values + * @since BuddyPress (1.7) + */ + var $admin_metabox_context = 'normal'; + + /** + * @var string Priority for the optional admin menabox + * @see https://codex.wordpress.org/Function_Reference/add_meta_box for + * possible values + * @since BuddyPress (1.7) + */ + var $admin_metabox_priority = 'core'; + var $enable_create_step = true; var $enable_nav_item = true; var $enable_edit_item = true; + var $enable_admin_item = true; var $nav_item_name = false; @@ -1307,21 +1375,21 @@ class BP_Group_Extension { function _register() { global $bp; - + // If admin/create names and slugs are not provided, they fall back on the main // name and slug for the extension if ( !$this->admin_name ) { $this->admin_name = $this->name; } - + if ( !$this->admin_slug ) { $this->admin_slug = $this->slug; } - + if ( !$this->create_name ) { $this->create_name = $this->name; } - + if ( !$this->create_slug ) { $this->create_slug = $this->slug; } @@ -1367,7 +1435,7 @@ class BP_Group_Extension { add_action( 'groups_custom_edit_steps', array( &$this, 'edit_screen' ) ); - if ( '' != locate_template( array( 'groups/single/home.php' ), false ) ) { + if ( '' != bp_locate_template( array( 'groups/single/home.php' ), false ) ) { bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); } else { add_action( 'bp_template_content_header', create_function( '', 'echo "<ul class=\"content-header-nav\">"; bp_group_admin_tabs(); echo "</ul>";' ) ); @@ -1376,12 +1444,44 @@ class BP_Group_Extension { } } } + + // Construct the admin metabox + // Plugin authors: Note that $this->enable_admin_item must be + // set to true, and self::admin_screen() must be defined + if ( ! empty( $this->enable_admin_item ) && is_admin() && method_exists( get_class( $this ), 'admin_screen' ) ) { + // Hook the admin screen markup function to the content hook + add_action( 'bp_groups_admin_meta_box_content_' . $this->slug, array( $this, 'admin_screen' ) ); + + // Initialize the metabox + add_action( 'bp_groups_admin_meta_boxes', array( $this, '_meta_box_display_callback' ) ); + + // Catch the metabox save + add_action( 'bp_group_admin_edit_after', array( $this, 'admin_screen_save' ), 10 ); + } } function _display_hook() { add_action( 'bp_template_content', array( &$this, 'display' ) ); bp_core_load_template( apply_filters( 'bp_core_template_plugin', $this->template_file ) ); } + + /** + * Create the Dashboard meta box for this extension + * + * @since BuddyPress (1.7) + */ + function _meta_box_display_callback() { + $group_id = isset( $_GET['gid'] ) ? (int) $_GET['gid'] : 0; + + add_meta_box( + $this->slug, + $this->name, + create_function( '', 'do_action( "bp_groups_admin_meta_box_content_' . $this->slug . '", ' . $group_id . ' );' ), + get_current_screen()->id, + $this->admin_metabox_context, + $this->admin_metabox_priority + ); + } } function bp_register_group_extension( $group_extension_class ) { @@ -1391,7 +1491,9 @@ function bp_register_group_extension( $group_extension_class ) { // Register the group extension on the bp_init action so we have access // to all plugins. - add_action( 'bp_init', create_function( '', '$extension = new ' . $group_extension_class . '; add_action( "bp_actions", array( &$extension, "_register" ), 8 );' ), 11 ); + add_action( 'bp_init', create_function( '', ' + $extension = new ' . $group_extension_class . '; + add_action( "bp_actions", array( &$extension, "_register" ), 8 ); + add_action( "admin_init", array( &$extension, "_register" ) ); + ' ), 11 ); } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php index 41e59c4279548531075dbd8e943577d0ffae0029..08b9040b8fa92ea90857ec08913979f333ebac85 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-filters.php @@ -10,6 +10,11 @@ // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; +// Filter bbPress template locations + +add_filter( 'bp_groups_get_directory_template', 'bp_add_template_locations' ); +add_filter( 'bp_get_single_group_template', 'bp_add_template_locations' ); + /* Apply WordPress defined filters */ add_filter( 'bp_get_group_description', 'wptexturize' ); add_filter( 'bp_get_group_description_excerpt', 'wptexturize' ); @@ -72,7 +77,7 @@ function bp_groups_filter_kses( $content ) { /** Group forums **************************************************************/ /** - * Only filter the forum SQL on group pages or on the forums directory + * Only filter the forum SQL on group pages or on the forums directory */ function groups_add_forum_privacy_sql() { add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' ); @@ -142,7 +147,7 @@ function groups_filter_bbpress_caps( $value, $cap, $args ) { if ( bp_current_user_can( 'bp_moderate' ) ) return true; - + if ( 'add_tag_to' == $cap ) if ( $bp->groups->current_group->user_has_access ) return true; @@ -164,5 +169,3 @@ function groups_filter_forums_root_page_sql( $sql ) { return apply_filters( 'groups_filter_bbpress_root_page_sql', 't.topic_id' ); } add_filter( 'get_latest_topics_fields', 'groups_filter_forums_root_page_sql' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php index 694c3b52fe9e9e1f6a299f84e24d508092e9c882..509f56af93168bbafabe20fedb46b3e42e6eabc6 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-forums.php @@ -23,7 +23,7 @@ if ( !defined( 'ABSPATH' ) ) exit; * @param string $group_name The group name * @param string $group_description The group description * - * @since 1.0 + * @since BuddyPress (1.0) */ function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = '' ) { global $bp; @@ -52,7 +52,7 @@ function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = * * @param int $group_id Group id, passed from groups_details_updated * - * @since 1.1 + * @since BuddyPress (1.1) */ function groups_update_group_forum( $group_id ) { @@ -89,7 +89,7 @@ add_action( 'groups_details_updated', 'groups_update_group_forum' ); * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false. * @return mixed The new forum post ID on success. Boolean false on failure. * - * @since 1.0 + * @since BuddyPress (1.0) */ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { if ( empty( $post_text ) ) @@ -137,7 +137,7 @@ function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) { * @param int $forum_id The forum ID this forum topic resides in * @return mixed The new topic object on success. Boolean false on failure. * - * @since 1.0 + * @since BuddyPress (1.0) */ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $forum_id ) { if ( empty( $topic_title ) || empty( $topic_text ) ) @@ -183,7 +183,7 @@ function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $ * @param mixed $topic_tags A comma-delimited string of topic tags. Defaults to boolean false. * @return mixed The topic object on success. Boolean false on failure. * - * @since 1.1 + * @since BuddyPress (1.1) */ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) { global $bp; @@ -203,7 +203,7 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, ) ); } - $activity_action = sprintf( __( '%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' ); + $activity_action = sprintf( __( '%1$s edited the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic->topic_slug .'/">' . esc_attr( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . esc_attr( bp_get_current_group_name() ) . '</a>' ); $activity_content = bp_create_excerpt( $topic_text ); // Record this in activity streams @@ -238,7 +238,7 @@ function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false. * @return mixed The forum post ID on success. Boolean false on failure. * - * @since 1.1 + * @since BuddyPress (1.1) */ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) { global $bp; @@ -302,7 +302,7 @@ function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page * @param int $topic_id The id of the topic to be deleted * @return bool True if the delete routine went through properly * - * @since 1.1 + * @since BuddyPress (1.1) */ function groups_delete_group_forum_topic( $topic_id ) { global $bp; @@ -354,7 +354,7 @@ function groups_delete_group_forum_topic( $topic_id ) { * function but is passed along to do_action() hooks. * @return bool True on success. * - * @since 1.1 + * @since BuddyPress (1.1) */ function groups_delete_group_forum_post( $post_id, $topic_id = false ) { global $bp; @@ -383,7 +383,7 @@ function groups_delete_group_forum_post( $post_id, $topic_id = false ) { * Get a total count of all public topics of a given type, across groups/forums * * @package BuddyPress - * @since 1.5 + * @since BuddyPress (1.5) * * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'. Defaults to 'newest'. * @return int The topic count @@ -396,7 +396,7 @@ function groups_total_public_forum_topic_count( $type = 'newest' ) { * Get a total count of all topics of a given status, across groups/forums * * @package BuddyPress - * @since 1.5 + * @since BuddyPress (1.5) * * @param str $status 'public', 'private', 'hidden', 'all' Which group types to count * @return int The topic count @@ -404,5 +404,3 @@ function groups_total_public_forum_topic_count( $type = 'newest' ) { function groups_total_forum_topic_count( $status = 'public', $search_terms = false ) { return apply_filters( 'groups_total_forum_topic_count', BP_Groups_Group::get_global_topic_count( $status, $search_terms ) ); } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php index 1fba041289e65352aa3a4223caadb8e018dfd68c..1a490a0930bf0d9d4e548ab879024575d22ae5ba 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-functions.php @@ -195,7 +195,7 @@ function groups_edit_group_settings( $group_id, $enable_forum, $status, $invite_ * * @global object $bp BuddyPress global settings * @param int $group_id - * @since 1.0 + * @since BuddyPress (1.0) */ function groups_delete_group( $group_id ) { global $bp; @@ -204,13 +204,13 @@ function groups_delete_group( $group_id ) { if ( ! bp_is_item_admin() ) return false; + do_action( 'groups_before_delete_group', $group_id ); + // Get the group object $group = groups_get_group( array( 'group_id' => $group_id ) ); if ( !$group->delete() ) return false; - do_action( 'groups_before_delete_group', $group_id ); - // Delete all group activity from activity streams if ( bp_is_active( 'activity' ) ) bp_activity_delete_by_item_id( array( 'item_id' => $group_id, 'component' => $bp->groups->id ) ); @@ -265,7 +265,7 @@ function groups_get_slug( $group_id ) { /** * Get a group ID by its slug * - * @since 1.6 + * @since BuddyPress (1.6) * * @param string $group_slug The group's slug * @return int The ID @@ -379,8 +379,21 @@ function groups_get_group_mods( $group_id ) { return BP_Groups_Member::get_group_moderator_ids( $group_id ); } -function groups_get_group_members( $group_id, $limit = false, $page = false ) { - return BP_Groups_Member::get_all_for_group( $group_id, $limit, $page ); +/** + * Fetch the members of a group + * + * Procedural wrapper for BP_Groups_Member::get_all_for_group(). + * + * @param int $group_id + * @param int $limit Maximum members to return + * @param int $page The page of results to return (requires $limit) + * @param bool $exclude_admins_mods Whether to exclude admins and mods + * @param bool $exclude_banned Whether to exclude banned users + * @param array|string $exclude Array or comma-sep list of users to exclude + * @return array Multi-d array of 'members' list and 'count' + */ +function groups_get_group_members( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false ) { + return BP_Groups_Member::get_all_for_group( $group_id, $limit, $page, $exclude_admins_mods, $exclude_banned, $exclude ); } function groups_get_total_member_count( $group_id ) { @@ -389,6 +402,14 @@ function groups_get_total_member_count( $group_id ) { /*** Group Fetching, Filtering & Searching *************************************/ +/** + * Get a collection of groups, based on the parameters passed + * + * @uses apply_filters_ref_array() Filter 'groups_get_groups' to modify return value + * @uses BP_Groups_Group::get() + * @param array $args See inline documentation for details + * @return array + */ function groups_get_groups( $args = '' ) { $defaults = array( @@ -403,12 +424,21 @@ function groups_get_groups( $args = '' ) { 'populate_extras' => true, // Fetch meta such as is_banned and is_member ); - $params = wp_parse_args( $args, $defaults ); - extract( $params, EXTR_SKIP ); + $r = wp_parse_args( $args, $defaults ); - $groups = BP_Groups_Group::get( $type, $per_page, $page, $user_id, $search_terms, $include, $populate_extras, $exclude, $show_hidden ); + $groups = BP_Groups_Group::get( array( + 'type' => $r['type'], + 'user_id' => $r['user_id'], + 'include' => $r['include'], + 'exclude' => $r['exclude'], + 'search_terms' => $r['search_terms'], + 'show_hidden' => $r['show_hidden'], + 'per_page' => $r['per_page'], + 'page' => $r['page'], + 'populate_extras' => $r['populate_extras'] + ) ); - return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$params ) ); + return apply_filters_ref_array( 'groups_get_groups', array( &$groups, &$r ) ); } function groups_get_total_group_count() { @@ -501,7 +531,7 @@ function groups_is_user_banned( $user_id, $group_id ) { * * @param int $user_id * @param int $group_id - * @since 1.2.6 + * @since BuddyPress (1.2.6) * @uses BP_Groups_Member */ function groups_is_user_creator( $user_id, $group_id ) { @@ -917,11 +947,11 @@ function groups_delete_groupmeta( $group_id, $meta_key = false, $meta_value = fa $meta_value = trim( $meta_value ); if ( !$meta_key ) - $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $group_id ) ); + $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d", $group_id ) ); else if ( $meta_value ) - $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s AND meta_value = %s", $group_id, $meta_key, $meta_value ) ); + $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s AND meta_value = %s", $group_id, $meta_key, $meta_value ) ); else - $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) ); + $wpdb->query( $wpdb->prepare( "DELETE FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) ); // Delete the cached object wp_cache_delete( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' ); @@ -942,11 +972,11 @@ function groups_get_groupmeta( $group_id, $meta_key = '') { $metas = wp_cache_get( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, 'bp' ); if ( false === $metas ) { - $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key) ); + $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) ); wp_cache_set( 'bp_groups_groupmeta_' . $group_id . '_' . $meta_key, $metas, 'bp' ); } } else { - $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d", $group_id) ); + $metas = $wpdb->get_col( $wpdb->prepare("SELECT meta_value FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d", $group_id ) ); } if ( empty( $metas ) ) { @@ -977,12 +1007,12 @@ function groups_update_groupmeta( $group_id, $meta_key, $meta_value ) { $meta_value = maybe_serialize( $meta_value ); - $cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$bp->groups->table_name_groupmeta} WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) ); + $cur = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM " . $bp->groups->table_name_groupmeta . " WHERE group_id = %d AND meta_key = %s", $group_id, $meta_key ) ); if ( !$cur ) - $wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->groups->table_name_groupmeta} ( group_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $group_id, $meta_key, $meta_value ) ); + $wpdb->query( $wpdb->prepare( "INSERT INTO " . $bp->groups->table_name_groupmeta . " ( group_id, meta_key, meta_value ) VALUES ( %d, %s, %s )", $group_id, $meta_key, $meta_value ) ); else if ( $cur->meta_value != $meta_value ) - $wpdb->query( $wpdb->prepare( "UPDATE {$bp->groups->table_name_groupmeta} SET meta_value = %s WHERE group_id = %d AND meta_key = %s", $meta_value, $group_id, $meta_key ) ); + $wpdb->query( $wpdb->prepare( "UPDATE " . $bp->groups->table_name_groupmeta . " SET meta_value = %s WHERE group_id = %d AND meta_key = %s", $meta_value, $group_id, $meta_key ) ); else return false; @@ -1006,5 +1036,3 @@ function groups_remove_data_for_user( $user_id ) { add_action( 'wpmu_delete_user', 'groups_remove_data_for_user' ); add_action( 'delete_user', 'groups_remove_data_for_user' ); add_action( 'bp_make_spam_user', 'groups_remove_data_for_user' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php index 6b70eb2379caa7d99f3d53a6f3e8b719836437b5..d56500f650c4ee3ed07c76c40c438d1a214b23aa 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-loader.php @@ -104,6 +104,10 @@ class BP_Groups_Component extends BP_Component { 'functions', 'notifications' ); + + if ( is_admin() ) + $includes[] = 'admin'; + parent::includes( $includes ); } @@ -130,7 +134,7 @@ class BP_Groups_Component extends BP_Component { 'table_name_groupmeta' => $bp->table_prefix . 'bp_groups_groupmeta' ); - // All globals for messaging component. + // All globals for groups component. // Note that global_tables is included in this array. $globals = array( 'slug' => BP_GROUPS_SLUG, @@ -267,7 +271,7 @@ class BP_Groups_Component extends BP_Component { if ( is_user_logged_in() ) { bp_core_no_access( array( 'message' => __( 'You do not have access to this group.', 'buddypress' ), - 'root' => bp_get_group_permalink( $bp->groups->current_group ), + 'root' => bp_get_group_permalink( $bp->groups->current_group ) . 'home/', 'redirect' => false ) ); @@ -339,7 +343,7 @@ class BP_Groups_Component extends BP_Component { // Add 'Groups' to the main navigation $main_nav = array( - 'name' => sprintf( __( 'Groups <span>%d</span>', 'buddypress' ), groups_total_groups_for_user() ), + 'name' => sprintf( __( 'Groups <span>%d</span>', 'buddypress' ), bp_get_total_group_count_for_user() ), 'slug' => $this->slug, 'position' => 70, 'screen_function' => 'groups_screen_my_groups', @@ -347,31 +351,42 @@ class BP_Groups_Component extends BP_Component { 'item_css_id' => $this->id ); - $groups_link = trailingslashit( bp_loggedin_user_domain() . $this->slug ); - - // Add the My Groups nav item - $sub_nav[] = array( - 'name' => __( 'Memberships', 'buddypress' ), - 'slug' => 'my-groups', - 'parent_url' => $groups_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'groups_screen_my_groups', - 'position' => 10, - 'item_css_id' => 'groups-my-groups' - ); + // Determine user to use + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + $user_domain = false; + } - // Add the Group Invites nav item - $sub_nav[] = array( - 'name' => __( 'Invitations', 'buddypress' ), - 'slug' => 'invites', - 'parent_url' => $groups_link, - 'parent_slug' => $this->slug, - 'screen_function' => 'groups_screen_group_invites', - 'user_has_access' => bp_is_my_profile(), - 'position' => 30 - ); + if ( !empty( $user_domain ) ) { + $groups_link = trailingslashit( $user_domain . $this->slug ); + + // Add the My Groups nav item + $sub_nav[] = array( + 'name' => __( 'Memberships', 'buddypress' ), + 'slug' => 'my-groups', + 'parent_url' => $groups_link, + 'parent_slug' => $this->slug, + 'screen_function' => 'groups_screen_my_groups', + 'position' => 10, + 'item_css_id' => 'groups-my-groups' + ); - parent::setup_nav( $main_nav, $sub_nav ); + // Add the Group Invites nav item + $sub_nav[] = array( + 'name' => __( 'Invitations', 'buddypress' ), + 'slug' => 'invites', + 'parent_url' => $groups_link, + 'parent_slug' => $this->slug, + 'screen_function' => 'groups_screen_group_invites', + 'user_has_access' => bp_core_can_edit_settings(), + 'position' => 30 + ); + + parent::setup_nav( $main_nav, $sub_nav ); + } if ( bp_is_groups_component() && bp_is_single_item() ) { @@ -456,8 +471,8 @@ class BP_Groups_Component extends BP_Component { ); } - // If the user is a group mod or more, then show the group admin nav item - if ( bp_is_item_admin() || bp_is_item_mod() ) { + // If the user is a group admin, then show the group admin nav item + if ( bp_is_item_admin() ) { $sub_nav[] = array( 'name' => __( 'Admin', 'buddypress' ), 'slug' => 'admin', @@ -586,5 +601,3 @@ function bp_setup_groups() { $bp->groups = new BP_Groups_Component(); } add_action( 'bp_setup_components', 'bp_setup_groups', 6 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php index 859bda449ba4b60d648e40f2a2833ed26486184c..37d2f56be5b63a0af1885876783030c68c8f9b46 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-notifications.php @@ -16,10 +16,9 @@ if ( !defined( 'ABSPATH' ) ) exit; function groups_notification_group_updated( $group_id ) { $group = groups_get_group( array( 'group_id' => $group_id ) ); - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . __( 'Group Details Updated', 'buddypress' ); - + $subject = bp_get_email_subject( array( 'text' => __( 'Group Details Updated', 'buddypress' ) ) ); $user_ids = BP_Groups_Member::get_group_member_ids( $group->id ); + foreach ( (array) $user_ids as $user_id ) { if ( 'no' == bp_get_user_meta( $user_id, 'notification_groups_group_updated', true ) ) continue; @@ -73,8 +72,7 @@ function groups_notification_new_membership_request( $requesting_user_id, $admin // Set up and send the message $to = $ud->user_email; - $sitename = wp_specialchars_decode( bp_get_option( 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name ); + $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group: %s', 'buddypress' ), $group->name ) ) ); $message = sprintf( __( '%1$s wants to join the group "%2$s". @@ -89,7 +87,10 @@ To view %4$s\'s profile: %5$s --------------------- ', 'buddypress' ), $requesting_user_name, $group->name, $group_requests, $requesting_user_name, $profile_link ); - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } /* Send the message */ $to = apply_filters( 'groups_notification_new_membership_request_to', $to ); @@ -122,10 +123,9 @@ function groups_notification_membership_request_completed( $requesting_user_id, // Set up and send the message $to = $ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); if ( $accepted ) { - $subject = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name ); + $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), $group->name ) ) ); $message = sprintf( __( 'Your membership request for the group "%1$s" has been accepted. @@ -135,7 +135,7 @@ To view the group please login and visit: %2$s ', 'buddypress' ), $group->name, $group_link ); } else { - $subject = '[' . $sitename . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name ); + $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), $group->name ) ) ); $message = sprintf( __( 'Your membership request for the group "%1$s" has been rejected. @@ -145,7 +145,10 @@ To submit another request please log in and visit: %2$s ', 'buddypress' ), $group->name, $group_link ); } - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } /* Send the message */ $to = apply_filters( 'groups_notification_membership_request_completed_to', $to ); @@ -181,10 +184,8 @@ function groups_notification_promoted_member( $user_id, $group_id ) { // Set up and send the message $to = $ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name ); - - $message = sprintf( __( + $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), $group->name ) ) ); + $message = sprintf( __( 'You have been promoted to %1$s for the group: "%2$s". To view the group please visit: %3$s @@ -192,7 +193,10 @@ To view the group please visit: %3$s --------------------- ', 'buddypress' ), $promoted_to, $group->name, $group_link ); - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } /* Send the message */ $to = apply_filters( 'groups_notification_promoted_member_to', $to ); @@ -231,8 +235,7 @@ function groups_notification_group_invites( &$group, &$member, $inviter_user_id // Set up and send the message $to = $invited_ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $subject = '[' . $sitename . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name ); + $subject = bp_get_email_subject( array( 'text' => sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), $group->name ) ) ); $message = sprintf( __( 'One of your friends %1$s has invited you to the group: "%2$s". @@ -246,7 +249,10 @@ To view %5$s\'s profile visit: %6$s --------------------- ', 'buddypress' ), $inviter_name, $group->name, $invites_link, $group_link, $inviter_name, $inviter_link ); - $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } /* Send the message */ $to = apply_filters( 'groups_notification_group_invites_to', $to ); @@ -258,5 +264,3 @@ To view %5$s\'s profile visit: %6$s do_action( 'bp_groups_sent_invited_email', $invited_user_id, $subject, $message, $group ); } } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php index b294494fd2f0f80cad6e9112139cbb784bf6c48f..634dc9e8fdb9927dd70860f62d8511487d0dac6d 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-screens.php @@ -26,7 +26,8 @@ function groups_directory_groups_setup() { add_action( 'bp_screens', 'groups_directory_groups_setup', 2 ); function groups_screen_my_groups() { - global $bp; + + $bp = buddypress(); // Delete group request notifications for the user if ( isset( $_GET['n'] ) ) { @@ -71,10 +72,11 @@ function groups_screen_group_invites() { if ( !check_admin_referer( 'groups_reject_invite' ) ) return false; - if ( !groups_reject_invite( bp_loggedin_user_id(), $group_id ) ) - bp_core_add_message( __('Group invite could not be rejected', 'buddypress'), 'error' ); - else - bp_core_add_message( __('Group invite rejected', 'buddypress') ); + if ( !groups_reject_invite( bp_loggedin_user_id(), $group_id ) ) { + bp_core_add_message( __( 'Group invite could not be rejected', 'buddypress' ), 'error' ); + } else { + bp_core_add_message( __( 'Group invite rejected', 'buddypress' ) ); + } bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ) ); } @@ -88,20 +90,22 @@ function groups_screen_group_invites() { } function groups_screen_group_home() { - global $bp; - if ( bp_is_single_item() ) { - if ( isset( $_GET['n'] ) ) { - bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' ); - bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' ); - bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' ); - bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' ); - } + if ( ! bp_is_single_item() ) + return false; - do_action( 'groups_screen_group_home' ); + $bp = buddypress(); - bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); + if ( isset( $_GET['n'] ) ) { + bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_accepted' ); + bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'membership_request_rejected' ); + bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_mod' ); + bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'member_promoted_to_admin' ); } + + do_action( 'groups_screen_group_home' ); + + bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); } /** @@ -110,7 +114,6 @@ function groups_screen_group_home() { * @package BuddyPress */ function groups_screen_group_forum() { - global $bp; if ( !bp_is_active( 'forums' ) || !bp_forums_is_installed_correctly() ) return false; @@ -120,313 +123,336 @@ function groups_screen_group_forum() { return; } + $bp = buddypress(); + if ( !$bp->groups->current_group->user_has_access ) { bp_core_no_access(); return; } - if ( bp_is_single_item() ) { + if ( ! bp_is_single_item() ) + return false; - // Fetch the details we need - $topic_slug = (string)bp_action_variable( 1 ); - $topic_id = bp_forums_get_topic_id_from_slug( $topic_slug ); - $forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' ); - $user_is_banned = false; + // Fetch the details we need + $topic_slug = (string)bp_action_variable( 1 ); + $topic_id = bp_forums_get_topic_id_from_slug( $topic_slug ); + $forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' ); + $user_is_banned = false; - if ( !bp_current_user_can( 'bp_moderate' ) && groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) - $user_is_banned = true; + if ( !bp_current_user_can( 'bp_moderate' ) && groups_is_user_banned( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) + $user_is_banned = true; - if ( !empty( $topic_slug ) && !empty( $topic_id ) ) { + if ( !empty( $topic_slug ) && !empty( $topic_id ) ) { - // Posting a reply - if ( !$user_is_banned && !bp_action_variable( 2 ) && isset( $_POST['submit_reply'] ) ) { - // Check the nonce - check_admin_referer( 'bp_forums_new_reply' ); + // Posting a reply + if ( !$user_is_banned && !bp_action_variable( 2 ) && isset( $_POST['submit_reply'] ) ) { + // Check the nonce + check_admin_referer( 'bp_forums_new_reply' ); - // Auto join this user if they are not yet a member of this group - if ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) - groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() ); + // Auto join this user if they are not yet a member of this group + if ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { + groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() ); + } - $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false; - - // Don't allow reply flooding - if ( bp_forums_reply_exists( $_POST['reply_text'], $topic_id, bp_loggedin_user_id() ) ) { - bp_core_add_message( __( 'It looks like you\'ve already said that!', 'buddypress' ), 'error' ); - } else { - if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $topic_page ) ) - bp_core_add_message( __( 'There was an error when replying to that topic', 'buddypress'), 'error' ); - else - bp_core_add_message( __( 'Your reply was posted successfully', 'buddypress') ); + $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false; + + // Don't allow reply flooding + if ( bp_forums_reply_exists( $_POST['reply_text'], $topic_id, bp_loggedin_user_id() ) ) { + bp_core_add_message( __( 'It looks like you\'ve already said that!', 'buddypress' ), 'error' ); + } else { + if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $topic_page ) ) { + bp_core_add_message( __( 'There was an error when replying to that topic', 'buddypress'), 'error' ); + } else { + bp_core_add_message( __( 'Your reply was posted successfully', 'buddypress') ); } + } - $query_vars = isset( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : ''; - - $redirect = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' . $query_vars; + $query_vars = isset( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : ''; - if ( !empty( $post_id ) ) { - $redirect .= '#post-' . $post_id; - } + $redirect = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' . $query_vars; - bp_core_redirect( $redirect ); + if ( !empty( $post_id ) ) { + $redirect .= '#post-' . $post_id; } - // Sticky a topic - else if ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { - // Check the nonce - check_admin_referer( 'bp_forums_stick_topic' ); + bp_core_redirect( $redirect ); + } - if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id ) ) ) - bp_core_add_message( __( 'There was an error when making that topic a sticky', 'buddypress' ), 'error' ); - else - bp_core_add_message( __( 'The topic was made sticky successfully', 'buddypress' ) ); + // Sticky a topic + else if ( bp_is_action_variable( 'stick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { + // Check the nonce + check_admin_referer( 'bp_forums_stick_topic' ); - do_action( 'groups_stick_forum_topic', $topic_id ); - bp_core_redirect( wp_get_referer() ); + if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id ) ) ) { + bp_core_add_message( __( 'There was an error when making that topic a sticky', 'buddypress' ), 'error' ); + } else { + bp_core_add_message( __( 'The topic was made sticky successfully', 'buddypress' ) ); } - // Un-Sticky a topic - else if ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { - // Check the nonce - check_admin_referer( 'bp_forums_unstick_topic' ); + do_action( 'groups_stick_forum_topic', $topic_id ); + bp_core_redirect( wp_get_referer() ); + } - if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id, 'mode' => 'unstick' ) ) ) - bp_core_add_message( __( 'There was an error when unsticking that topic', 'buddypress'), 'error' ); - else - bp_core_add_message( __( 'The topic was unstuck successfully', 'buddypress') ); + // Un-Sticky a topic + else if ( bp_is_action_variable( 'unstick', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { + // Check the nonce + check_admin_referer( 'bp_forums_unstick_topic' ); - do_action( 'groups_unstick_forum_topic', $topic_id ); - bp_core_redirect( wp_get_referer() ); + if ( !bp_forums_sticky_topic( array( 'topic_id' => $topic_id, 'mode' => 'unstick' ) ) ) { + bp_core_add_message( __( 'There was an error when unsticking that topic', 'buddypress'), 'error' ); + } else { + bp_core_add_message( __( 'The topic was unstuck successfully', 'buddypress') ); } - // Close a topic - else if ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { - // Check the nonce - check_admin_referer( 'bp_forums_close_topic' ); + do_action( 'groups_unstick_forum_topic', $topic_id ); + bp_core_redirect( wp_get_referer() ); + } - if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id ) ) ) - bp_core_add_message( __( 'There was an error when closing that topic', 'buddypress'), 'error' ); - else - bp_core_add_message( __( 'The topic was closed successfully', 'buddypress') ); + // Close a topic + else if ( bp_is_action_variable( 'close', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { + // Check the nonce + check_admin_referer( 'bp_forums_close_topic' ); - do_action( 'groups_close_forum_topic', $topic_id ); - bp_core_redirect( wp_get_referer() ); + if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id ) ) ) { + bp_core_add_message( __( 'There was an error when closing that topic', 'buddypress'), 'error' ); + } else { + bp_core_add_message( __( 'The topic was closed successfully', 'buddypress') ); } - // Open a topic - else if ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { - // Check the nonce - check_admin_referer( 'bp_forums_open_topic' ); + do_action( 'groups_close_forum_topic', $topic_id ); + bp_core_redirect( wp_get_referer() ); + } - if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id, 'mode' => 'open' ) ) ) - bp_core_add_message( __( 'There was an error when opening that topic', 'buddypress'), 'error' ); - else - bp_core_add_message( __( 'The topic was opened successfully', 'buddypress') ); + // Open a topic + else if ( bp_is_action_variable( 'open', 2 ) && ( bp_is_item_admin() || bp_is_item_mod() ) ) { + // Check the nonce + check_admin_referer( 'bp_forums_open_topic' ); - do_action( 'groups_open_forum_topic', $topic_id ); - bp_core_redirect( wp_get_referer() ); + if ( !bp_forums_openclose_topic( array( 'topic_id' => $topic_id, 'mode' => 'open' ) ) ) { + bp_core_add_message( __( 'There was an error when opening that topic', 'buddypress'), 'error' ); + } else { + bp_core_add_message( __( 'The topic was opened successfully', 'buddypress') ); } - // Delete a topic - else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) { - // Fetch the topic - $topic = bp_forums_get_topic_details( $topic_id ); + do_action( 'groups_open_forum_topic', $topic_id ); + bp_core_redirect( wp_get_referer() ); + } - /* Check the logged in user can delete this topic */ - if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) ) - bp_core_redirect( wp_get_referer() ); + // Delete a topic + else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && !bp_action_variable( 3 ) ) { + // Fetch the topic + $topic = bp_forums_get_topic_details( $topic_id ); - // Check the nonce - check_admin_referer( 'bp_forums_delete_topic' ); + /* Check the logged in user can delete this topic */ + if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) ) { + bp_core_redirect( wp_get_referer() ); + } - do_action( 'groups_before_delete_forum_topic', $topic_id ); + // Check the nonce + check_admin_referer( 'bp_forums_delete_topic' ); - if ( !groups_delete_group_forum_topic( $topic_id ) ) - bp_core_add_message( __( 'There was an error deleting the topic', 'buddypress' ), 'error' ); - else - bp_core_add_message( __( 'The topic was deleted successfully', 'buddypress' ) ); + do_action( 'groups_before_delete_forum_topic', $topic_id ); - do_action( 'groups_delete_forum_topic', $topic_id ); - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/' ); + if ( !groups_delete_group_forum_topic( $topic_id ) ) { + bp_core_add_message( __( 'There was an error deleting the topic', 'buddypress' ), 'error' ); + } else { + bp_core_add_message( __( 'The topic was deleted successfully', 'buddypress' ) ); } - // Editing a topic - else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) { - // Fetch the topic - $topic = bp_forums_get_topic_details( $topic_id ); + do_action( 'groups_delete_forum_topic', $topic_id ); + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/' ); + } - // Check the logged in user can edit this topic - if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) ) - bp_core_redirect( wp_get_referer() ); + // Editing a topic + else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && !bp_action_variable( 3 ) ) { + // Fetch the topic + $topic = bp_forums_get_topic_details( $topic_id ); - if ( isset( $_POST['save_changes'] ) ) { - // Check the nonce - check_admin_referer( 'bp_forums_edit_topic' ); + // Check the logged in user can edit this topic + if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $topic->topic_poster ) ) { + bp_core_redirect( wp_get_referer() ); + } - $topic_tags = !empty( $_POST['topic_tags'] ) ? $_POST['topic_tags'] : false; + if ( isset( $_POST['save_changes'] ) ) { + // Check the nonce + check_admin_referer( 'bp_forums_edit_topic' ); - if ( !groups_update_group_forum_topic( $topic_id, $_POST['topic_title'], $_POST['topic_text'], $topic_tags ) ) - bp_core_add_message( __( 'There was an error when editing that topic', 'buddypress'), 'error' ); - else - bp_core_add_message( __( 'The topic was edited successfully', 'buddypress') ); + $topic_tags = !empty( $_POST['topic_tags'] ) ? $_POST['topic_tags'] : false; - do_action( 'groups_edit_forum_topic', $topic_id ); - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' ); + if ( !groups_update_group_forum_topic( $topic_id, $_POST['topic_title'], $_POST['topic_text'], $topic_tags ) ) { + bp_core_add_message( __( 'There was an error when editing that topic', 'buddypress'), 'error' ); + } else { + bp_core_add_message( __( 'The topic was edited successfully', 'buddypress') ); } - bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) ); + do_action( 'groups_edit_forum_topic', $topic_id ); + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' ); } - // Delete a post - else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) { - // Fetch the post - $post = bp_forums_get_post( $post_id ); + bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) ); - // Check the logged in user can edit this topic - if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) - bp_core_redirect( wp_get_referer() ); + // Delete a post + } else if ( empty( $user_is_banned ) && bp_is_action_variable( 'delete', 2 ) && $post_id = bp_action_variable( 4 ) ) { + // Fetch the post + $post = bp_forums_get_post( $post_id ); - // Check the nonce - check_admin_referer( 'bp_forums_delete_post' ); + // Check the logged in user can edit this topic + if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) { + bp_core_redirect( wp_get_referer() ); + } - do_action( 'groups_before_delete_forum_post', $post_id ); + // Check the nonce + check_admin_referer( 'bp_forums_delete_post' ); - if ( !groups_delete_group_forum_post( $post_id ) ) - bp_core_add_message( __( 'There was an error deleting that post', 'buddypress'), 'error' ); - else - bp_core_add_message( __( 'The post was deleted successfully', 'buddypress') ); + do_action( 'groups_before_delete_forum_post', $post_id ); - do_action( 'groups_delete_forum_post', $post_id ); - bp_core_redirect( wp_get_referer() ); + if ( !groups_delete_group_forum_post( $post_id ) ) { + bp_core_add_message( __( 'There was an error deleting that post', 'buddypress'), 'error' ); + } else { + bp_core_add_message( __( 'The post was deleted successfully', 'buddypress') ); } - // Editing a post - else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) { - // Fetch the post - $post = bp_forums_get_post( $post_id ); + do_action( 'groups_delete_forum_post', $post_id ); + bp_core_redirect( wp_get_referer() ); - // Check the logged in user can edit this topic - if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) - bp_core_redirect( wp_get_referer() ); + // Editing a post + } else if ( empty( $user_is_banned ) && bp_is_action_variable( 'edit', 2 ) && $post_id = bp_action_variable( 4 ) ) { - if ( isset( $_POST['save_changes'] ) ) { - // Check the nonce - check_admin_referer( 'bp_forums_edit_post' ); + // Fetch the post + $post = bp_forums_get_post( $post_id ); - $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false; + // Check the logged in user can edit this topic + if ( ! bp_is_item_admin() && ! bp_is_item_mod() && ( (int) bp_loggedin_user_id() != (int) $post->poster_id ) ) { + bp_core_redirect( wp_get_referer() ); + } - if ( !$post_id = groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id, $topic_page ) ) - bp_core_add_message( __( 'There was an error when editing that post', 'buddypress'), 'error' ); - else - bp_core_add_message( __( 'The post was edited successfully', 'buddypress') ); + if ( isset( $_POST['save_changes'] ) ) { + // Check the nonce + check_admin_referer( 'bp_forums_edit_post' ); + + $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false; - if ( $_SERVER['QUERY_STRING'] ) - $query_vars = '?' . $_SERVER['QUERY_STRING']; + if ( !$post_id = groups_update_group_forum_post( $post_id, $_POST['post_text'], $topic_id, $topic_page ) ) { + bp_core_add_message( __( 'There was an error when editing that post', 'buddypress'), 'error' ); + } else { + bp_core_add_message( __( 'The post was edited successfully', 'buddypress') ); + } - do_action( 'groups_edit_forum_post', $post_id ); - bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id ); + if ( $_SERVER['QUERY_STRING'] ) { + $query_vars = '?' . $_SERVER['QUERY_STRING']; } - bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) ); + do_action( 'groups_edit_forum_post', $post_id ); + bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id ); } - // Standard topic display - else { - if ( !empty( $user_is_banned ) ) - bp_core_add_message( __( "You have been banned from this group.", 'buddypress' ) ); + bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) ); - bp_core_load_template( apply_filters( 'groups_template_group_forum_topic', 'groups/single/home' ) ); + // Standard topic display + } else { + if ( !empty( $user_is_banned ) ) { + bp_core_add_message( __( "You have been banned from this group.", 'buddypress' ) ); } - // Forum topic does not exist - } elseif ( !empty( $topic_slug ) && empty( $topic_id ) ) { - bp_do_404(); - return; + bp_core_load_template( apply_filters( 'groups_template_group_forum_topic', 'groups/single/home' ) ); + } - } else { - // Posting a topic - if ( isset( $_POST['submit_topic'] ) && bp_is_active( 'forums' ) ) { - // Check the nonce - check_admin_referer( 'bp_forums_new_topic' ); + // Forum topic does not exist + } elseif ( !empty( $topic_slug ) && empty( $topic_id ) ) { + bp_do_404(); + return; - if ( $user_is_banned ) { - $error_message = __( "You have been banned from this group.", 'buddypress' ); + } else { + // Posting a topic + if ( isset( $_POST['submit_topic'] ) && bp_is_active( 'forums' ) ) { - } elseif ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { - // Auto join this user if they are not yet a member of this group - groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() ); - } + // Check the nonce + check_admin_referer( 'bp_forums_new_topic' ); - if ( empty( $_POST['topic_title'] ) ) - $error_message = __( 'Please provide a title for your forum topic.', 'buddypress' ); - else if ( empty( $_POST['topic_text'] ) ) - $error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' ); + if ( $user_is_banned ) { + $error_message = __( "You have been banned from this group.", 'buddypress' ); - if ( empty( $forum_id ) ) - $error_message = __( 'This group does not have a forum setup yet.', 'buddypress' ); + } elseif ( bp_groups_auto_join() && !bp_current_user_can( 'bp_moderate' ) && 'public' == $bp->groups->current_group->status && !groups_is_user_member( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { + // Auto join this user if they are not yet a member of this group + groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() ); + } - if ( isset( $error_message ) ) { - bp_core_add_message( $error_message, 'error' ); + if ( empty( $_POST['topic_title'] ) ) { + $error_message = __( 'Please provide a title for your forum topic.', 'buddypress' ); + } else if ( empty( $_POST['topic_text'] ) ) { + $error_message = __( 'Forum posts cannot be empty. Please enter some text.', 'buddypress' ); + } + + if ( empty( $forum_id ) ) { + $error_message = __( 'This group does not have a forum setup yet.', 'buddypress' ); + } + + if ( isset( $error_message ) ) { + bp_core_add_message( $error_message, 'error' ); + $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum'; + } else { + if ( !$topic = groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ) ) { + bp_core_add_message( __( 'There was an error when creating the topic', 'buddypress'), 'error' ); $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum'; } else { - if ( !$topic = groups_new_group_forum_topic( $_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id ) ) { - bp_core_add_message( __( 'There was an error when creating the topic', 'buddypress'), 'error' ); - $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum'; - } else { - bp_core_add_message( __( 'The topic was created successfully', 'buddypress') ); - $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/'; - } + bp_core_add_message( __( 'The topic was created successfully', 'buddypress') ); + $redirect = bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/'; } - - bp_core_redirect( $redirect ); } - do_action( 'groups_screen_group_forum', $topic_id, $forum_id ); - - bp_core_load_template( apply_filters( 'groups_template_group_forum', 'groups/single/home' ) ); + bp_core_redirect( $redirect ); } + + do_action( 'groups_screen_group_forum', $topic_id, $forum_id ); + + bp_core_load_template( apply_filters( 'groups_template_group_forum', 'groups/single/home' ) ); } } function groups_screen_group_members() { - global $bp; - 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 ) ); + if ( !bp_is_single_item() ) + return false; + + $bp = buddypress(); - do_action( 'groups_screen_group_members', $bp->groups->current_group->id ); - bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) ); - } + // 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' ) ); } function groups_screen_group_invite() { - global $bp; - if ( $bp->is_single_item ) { - if ( bp_is_action_variable( 'send', 0 ) ) { + if ( !bp_is_single_item() ) + return false; - if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) ) - return false; + $bp = buddypress(); - if ( !empty( $_POST['friends'] ) ) { - foreach( (array) $_POST['friends'] as $friend ) { - groups_invite_user( array( 'user_id' => $friend, 'group_id' => $bp->groups->current_group->id ) ); - } + if ( bp_is_action_variable( 'send', 0 ) ) { + + if ( !check_admin_referer( 'groups_send_invites', '_wpnonce_send_invites' ) ) + return false; + + if ( !empty( $_POST['friends'] ) ) { + foreach( (array) $_POST['friends'] as $friend ) { + groups_invite_user( array( 'user_id' => $friend, 'group_id' => $bp->groups->current_group->id ) ); } + } - // Send the invites. - groups_send_invites( bp_loggedin_user_id(), $bp->groups->current_group->id ); - bp_core_add_message( __('Group invites sent.', 'buddypress') ); - do_action( 'groups_screen_group_invite', $bp->groups->current_group->id ); - bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); + // Send the invites. + groups_send_invites( bp_loggedin_user_id(), $bp->groups->current_group->id ); + bp_core_add_message( __('Group invites sent.', 'buddypress') ); + do_action( 'groups_screen_group_invite', $bp->groups->current_group->id ); + bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); - } elseif ( !bp_action_variable( 0 ) ) { - // Show send invite page - bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) ); + } elseif ( !bp_action_variable( 0 ) ) { + // Show send invite page + bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) ); - } else { - bp_do_404(); - } + } else { + bp_do_404(); } } @@ -436,34 +462,37 @@ function groups_screen_group_request_membership() { if ( !is_user_logged_in() ) return false; - if ( 'private' == $bp->groups->current_group->status ) { - // If the user has submitted a request, send it. - if ( isset( $_POST['group-request-send']) ) { - // Check the nonce - if ( !check_admin_referer( 'groups_request_membership' ) ) - return false; + $bp = buddypress(); - if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { - bp_core_add_message( __( 'There was an error sending your group membership request, please try again.', 'buddypress' ), 'error' ); - } else { - bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) ); - } - bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); - } + if ( 'private' != $bp->groups->current_group->status ) + return false; + + // If the user has submitted a request, send it. + if ( isset( $_POST['group-request-send']) ) { - do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id ); + // Check the nonce + if ( !check_admin_referer( 'groups_request_membership' ) ) + return false; - bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) ); + if ( !groups_send_membership_request( bp_loggedin_user_id(), $bp->groups->current_group->id ) ) { + bp_core_add_message( __( 'There was an error sending your group membership request, please try again.', 'buddypress' ), 'error' ); + } else { + bp_core_add_message( __( 'Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request.', 'buddypress' ) ); + } + bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); } + + do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id ); + + bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) ); } function groups_screen_group_activity_permalink() { - global $bp; if ( !bp_is_groups_component() || !bp_is_active( 'activity' ) || ( bp_is_active( 'activity' ) && !bp_is_current_action( bp_get_activity_slug() ) ) || !bp_action_variable( 0 ) ) return false; - $bp->is_single_item = true; + buddypress()->is_single_item = true; bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); } @@ -480,135 +509,153 @@ function groups_screen_group_admin() { } function groups_screen_group_admin_edit_details() { - global $bp; - - if ( 'edit-details' == bp_get_group_current_admin_tab() ) { - if ( bp_is_item_admin() || bp_is_item_mod() ) { + if ( 'edit-details' != bp_get_group_current_admin_tab() ) + return false; - // If the edit form has been submitted, save the edited details - if ( isset( $_POST['save'] ) ) { - // Check the nonce - if ( !check_admin_referer( 'groups_edit_group_details' ) ) - return false; + if ( bp_is_item_admin() ) { - if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], (int) $_POST['group-notify-members'] ) ) { - bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' ); - } else { - bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) ); - } + $bp = buddypress(); - do_action( 'groups_group_details_edited', $bp->groups->current_group->id ); + // If the edit form has been submitted, save the edited details + if ( isset( $_POST['save'] ) ) { + // Check the nonce + if ( !check_admin_referer( 'groups_edit_group_details' ) ) + return false; - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' ); + if ( !groups_edit_base_group_details( $_POST['group-id'], $_POST['group-name'], $_POST['group-desc'], (int) $_POST['group-notify-members'] ) ) { + bp_core_add_message( __( 'There was an error updating group details, please try again.', 'buddypress' ), 'error' ); + } else { + bp_core_add_message( __( 'Group details were successfully updated.', 'buddypress' ) ); } - do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id ); + do_action( 'groups_group_details_edited', $bp->groups->current_group->id ); - bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) ); + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/edit-details/' ); } + + do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id ); + + bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) ); } } add_action( 'bp_screens', 'groups_screen_group_admin_edit_details' ); function groups_screen_group_admin_settings() { - global $bp; - if ( 'group-settings' == bp_get_group_current_admin_tab() ) { + if ( 'group-settings' != bp_get_group_current_admin_tab() ) + return false; - if ( ! bp_is_item_admin() ) - return false; + if ( ! bp_is_item_admin() ) + return false; - // If the edit form has been submitted, save the edited details - if ( isset( $_POST['save'] ) ) { - $enable_forum = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0; + $bp = buddypress(); - // Checked against a whitelist for security - $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) ); - $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public'; + // If the edit form has been submitted, save the edited details + if ( isset( $_POST['save'] ) ) { + $enable_forum = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0; - // Checked against a whitelist for security - $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) ); - $invite_status = in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members'; + // Checked against a whitelist for security + $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) ); + $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public'; - // Check the nonce - if ( !check_admin_referer( 'groups_edit_group_settings' ) ) - return false; + // Checked against a whitelist for security + $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) ); + $invite_status = in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members'; - if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) { - bp_core_add_message( __( 'There was an error updating group settings, please try again.', 'buddypress' ), 'error' ); - } else { - bp_core_add_message( __( 'Group settings were successfully updated.', 'buddypress' ) ); - } - - do_action( 'groups_group_settings_edited', $bp->groups->current_group->id ); + // Check the nonce + if ( !check_admin_referer( 'groups_edit_group_settings' ) ) + return false; - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/group-settings/' ); + if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) { + bp_core_add_message( __( 'There was an error updating group settings, please try again.', 'buddypress' ), 'error' ); + } else { + bp_core_add_message( __( 'Group settings were successfully updated.', 'buddypress' ) ); } - do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id ); + do_action( 'groups_group_settings_edited', $bp->groups->current_group->id ); - bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) ); + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/group-settings/' ); } + + do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id ); + + bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) ); } add_action( 'bp_screens', 'groups_screen_group_admin_settings' ); function groups_screen_group_admin_avatar() { - global $bp; - if ( 'group-avatar' == bp_get_group_current_admin_tab() ) { + if ( 'group-avatar' != bp_get_group_current_admin_tab() ) + return false; - // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here - if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) ) - return false; + // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here + if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) ) + return false; - // If the group admin has deleted the admin avatar - if ( bp_is_action_variable( 'delete', 1 ) ) { + $bp = buddypress(); - // Check the nonce - check_admin_referer( 'bp_group_avatar_delete' ); + // If the group admin has deleted the admin avatar + if ( bp_is_action_variable( 'delete', 1 ) ) { - if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group' ) ) ) - bp_core_add_message( __( 'Your avatar was deleted successfully!', 'buddypress' ) ); - else - bp_core_add_message( __( 'There was a problem deleting that avatar, please try again.', 'buddypress' ), 'error' ); + // Check the nonce + check_admin_referer( 'bp_group_avatar_delete' ); + if ( bp_core_delete_existing_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group' ) ) ) { + bp_core_add_message( __( 'Your avatar was deleted successfully!', 'buddypress' ) ); + } else { + bp_core_add_message( __( 'There was a problem deleting that avatar, please try again.', 'buddypress' ), 'error' ); } + } - $bp->avatar_admin->step = 'upload-image'; + if ( ! isset( $bp->avatar_admin ) ) { + $bp->avatar_admin = new stdClass(); + } - if ( !empty( $_FILES ) ) { + $bp->avatar_admin->step = 'upload-image'; - // Check the nonce - check_admin_referer( 'bp_avatar_upload' ); + if ( !empty( $_FILES ) ) { - // Pass the file to the avatar upload handler - if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) { - $bp->avatar_admin->step = 'crop-image'; + // Check the nonce + check_admin_referer( 'bp_avatar_upload' ); - // Make sure we include the jQuery jCrop file for image cropping - add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' ); - } + // Pass the file to the avatar upload handler + if ( bp_core_avatar_handle_upload( $_FILES, 'groups_avatar_upload_dir' ) ) { + $bp->avatar_admin->step = 'crop-image'; + // Make sure we include the jQuery jCrop file for image cropping + add_action( 'wp_print_scripts', 'bp_core_add_jquery_cropper' ); } - // If the image cropping is done, crop the image and save a full/thumb version - if ( isset( $_POST['avatar-crop-submit'] ) ) { - - // Check the nonce - check_admin_referer( 'bp_avatar_cropstore' ); + } - if ( !bp_core_avatar_handle_crop( array( 'object' => 'group', 'avatar_dir' => 'group-avatars', 'item_id' => $bp->groups->current_group->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) ) - bp_core_add_message( __( 'There was a problem cropping the avatar, please try uploading it again', 'buddypress' ) ); - else - bp_core_add_message( __( 'The new group avatar was uploaded successfully!', 'buddypress' ) ); + // If the image cropping is done, crop the image and save a full/thumb version + if ( isset( $_POST['avatar-crop-submit'] ) ) { + // Check the nonce + check_admin_referer( 'bp_avatar_cropstore' ); + + $args = array( + 'object' => 'group', + 'avatar_dir' => 'group-avatars', + 'item_id' => $bp->groups->current_group->id, + 'original_file' => $_POST['image_src'], + 'crop_x' => $_POST['x'], + 'crop_y' => $_POST['y'], + 'crop_w' => $_POST['w'], + 'crop_h' => $_POST['h'] + ); + + if ( !bp_core_avatar_handle_crop( $args ) ) { + bp_core_add_message( __( 'There was a problem cropping the avatar.', ' buddypress' ), 'error' ); + } else { + bp_core_add_message( __( 'The new group avatar was uploaded successfully.', 'buddypress' ) ); } + } - do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id ); + do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id ); - bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) ); - } + bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) ); } add_action( 'bp_screens', 'groups_screen_group_admin_avatar' ); @@ -618,202 +665,205 @@ add_action( 'bp_screens', 'groups_screen_group_admin_avatar' ); * @package BuddyPress */ function groups_screen_group_admin_manage_members() { - global $bp; - if ( 'manage-members' == bp_get_group_current_admin_tab() ) { + if ( 'manage-members' != bp_get_group_current_admin_tab() ) + return false; - if ( ! bp_is_item_admin() ) - return false; + if ( ! bp_is_item_admin() ) + return false; - if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) && bp_action_variable( 3 ) ) { - if ( bp_is_action_variable( 'promote', 1 ) && ( bp_is_action_variable( 'mod', 2 ) || bp_is_action_variable( 'admin', 2 ) ) && is_numeric( bp_action_variable( 3 ) ) ) { - $user_id = bp_action_variable( 3 ); - $status = bp_action_variable( 2 ); + $bp = buddypress(); - // Check the nonce first. - if ( !check_admin_referer( 'groups_promote_member' ) ) - return false; + if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) && bp_action_variable( 3 ) ) { + if ( bp_is_action_variable( 'promote', 1 ) && ( bp_is_action_variable( 'mod', 2 ) || bp_is_action_variable( 'admin', 2 ) ) && is_numeric( bp_action_variable( 3 ) ) ) { + $user_id = bp_action_variable( 3 ); + $status = bp_action_variable( 2 ); - // Promote a user. - if ( !groups_promote_member( $user_id, $bp->groups->current_group->id, $status ) ) - bp_core_add_message( __( 'There was an error when promoting that user, please try again', 'buddypress' ), 'error' ); - else - bp_core_add_message( __( 'User promoted successfully', 'buddypress' ) ); + // Check the nonce first. + if ( !check_admin_referer( 'groups_promote_member' ) ) + return false; + + // Promote a user. + if ( !groups_promote_member( $user_id, $bp->groups->current_group->id, $status ) ) + bp_core_add_message( __( 'There was an error when promoting that user, please try again', 'buddypress' ), 'error' ); + else + bp_core_add_message( __( 'User promoted successfully', 'buddypress' ) ); - do_action( 'groups_promoted_member', $user_id, $bp->groups->current_group->id ); + do_action( 'groups_promoted_member', $user_id, $bp->groups->current_group->id ); - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); - } + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); } + } - if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) ) { - if ( bp_is_action_variable( 'demote', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { - $user_id = bp_action_variable( 2 ); + if ( bp_action_variable( 1 ) && bp_action_variable( 2 ) ) { + if ( bp_is_action_variable( 'demote', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { + $user_id = bp_action_variable( 2 ); - // Check the nonce first. - if ( !check_admin_referer( 'groups_demote_member' ) ) - return false; + // Check the nonce first. + if ( !check_admin_referer( 'groups_demote_member' ) ) + return false; - // Stop sole admins from abandoning their group - $group_admins = groups_get_group_admins( $bp->groups->current_group->id ); - if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == $user_id ) - bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' ); + // Stop sole admins from abandoning their group + $group_admins = groups_get_group_admins( $bp->groups->current_group->id ); + if ( 1 == count( $group_admins ) && $group_admins[0]->user_id == $user_id ) + bp_core_add_message( __( 'This group must have at least one admin', 'buddypress' ), 'error' ); - // Demote a user. - elseif ( !groups_demote_member( $user_id, $bp->groups->current_group->id ) ) - bp_core_add_message( __( 'There was an error when demoting that user, please try again', 'buddypress' ), 'error' ); - else - bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) ); + // Demote a user. + elseif ( !groups_demote_member( $user_id, $bp->groups->current_group->id ) ) + bp_core_add_message( __( 'There was an error when demoting that user, please try again', 'buddypress' ), 'error' ); + else + bp_core_add_message( __( 'User demoted successfully', 'buddypress' ) ); - do_action( 'groups_demoted_member', $user_id, $bp->groups->current_group->id ); + do_action( 'groups_demoted_member', $user_id, $bp->groups->current_group->id ); - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); - } + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); + } - if ( bp_is_action_variable( 'ban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { - $user_id = bp_action_variable( 2 ); + if ( bp_is_action_variable( 'ban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { + $user_id = bp_action_variable( 2 ); - // Check the nonce first. - if ( !check_admin_referer( 'groups_ban_member' ) ) - return false; + // Check the nonce first. + if ( !check_admin_referer( 'groups_ban_member' ) ) + return false; - // Ban a user. - if ( !groups_ban_member( $user_id, $bp->groups->current_group->id ) ) - bp_core_add_message( __( 'There was an error when banning that user, please try again', 'buddypress' ), 'error' ); - else - bp_core_add_message( __( 'User banned successfully', 'buddypress' ) ); + // Ban a user. + if ( !groups_ban_member( $user_id, $bp->groups->current_group->id ) ) + bp_core_add_message( __( 'There was an error when banning that user, please try again', 'buddypress' ), 'error' ); + else + bp_core_add_message( __( 'User banned successfully', 'buddypress' ) ); - do_action( 'groups_banned_member', $user_id, $bp->groups->current_group->id ); + do_action( 'groups_banned_member', $user_id, $bp->groups->current_group->id ); - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); - } + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); + } - if ( bp_is_action_variable( 'unban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { - $user_id = bp_action_variable( 2 ); + if ( bp_is_action_variable( 'unban', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { + $user_id = bp_action_variable( 2 ); - // Check the nonce first. - if ( !check_admin_referer( 'groups_unban_member' ) ) - return false; + // Check the nonce first. + if ( !check_admin_referer( 'groups_unban_member' ) ) + return false; - // Remove a ban for user. - if ( !groups_unban_member( $user_id, $bp->groups->current_group->id ) ) - bp_core_add_message( __( 'There was an error when unbanning that user, please try again', 'buddypress' ), 'error' ); - else - bp_core_add_message( __( 'User ban removed successfully', 'buddypress' ) ); + // Remove a ban for user. + if ( !groups_unban_member( $user_id, $bp->groups->current_group->id ) ) + bp_core_add_message( __( 'There was an error when unbanning that user, please try again', 'buddypress' ), 'error' ); + else + bp_core_add_message( __( 'User ban removed successfully', 'buddypress' ) ); - do_action( 'groups_unbanned_member', $user_id, $bp->groups->current_group->id ); + do_action( 'groups_unbanned_member', $user_id, $bp->groups->current_group->id ); - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); - } + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); + } - if ( bp_is_action_variable( 'remove', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { - $user_id = bp_action_variable( 2 ); + if ( bp_is_action_variable( 'remove', 1 ) && is_numeric( bp_action_variable( 2 ) ) ) { + $user_id = bp_action_variable( 2 ); - // Check the nonce first. - if ( !check_admin_referer( 'groups_remove_member' ) ) - return false; + // Check the nonce first. + if ( !check_admin_referer( 'groups_remove_member' ) ) + return false; - // Remove a user. - if ( !groups_remove_member( $user_id, $bp->groups->current_group->id ) ) - bp_core_add_message( __( 'There was an error removing that user from the group, please try again', 'buddypress' ), 'error' ); - else - bp_core_add_message( __( 'User removed successfully', 'buddypress' ) ); + // Remove a user. + if ( !groups_remove_member( $user_id, $bp->groups->current_group->id ) ) + bp_core_add_message( __( 'There was an error removing that user from the group, please try again', 'buddypress' ), 'error' ); + else + bp_core_add_message( __( 'User removed successfully', 'buddypress' ) ); - do_action( 'groups_removed_member', $user_id, $bp->groups->current_group->id ); + do_action( 'groups_removed_member', $user_id, $bp->groups->current_group->id ); - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); - } + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/manage-members/' ); } + } - do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id ); + do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id ); - bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) ); - } + bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) ); } add_action( 'bp_screens', 'groups_screen_group_admin_manage_members' ); function groups_screen_group_admin_requests() { global $bp; - if ( 'membership-requests' == bp_get_group_current_admin_tab() ) { - - if ( ! bp_is_item_admin() || ( 'public' == $bp->groups->current_group->status ) ) - return false; + if ( 'membership-requests' != bp_get_group_current_admin_tab() ) + return false; - // Remove any screen notifications - bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' ); + if ( ! bp_is_item_admin() || ( 'public' == $bp->groups->current_group->status ) ) + return false; - $request_action = (string)bp_action_variable( 1 ); - $membership_id = (int)bp_action_variable( 2 ); + // Remove any screen notifications + bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request' ); - if ( !empty( $request_action ) && !empty( $membership_id ) ) { - if ( 'accept' == $request_action && is_numeric( $membership_id ) ) { + $request_action = (string)bp_action_variable( 1 ); + $membership_id = (int)bp_action_variable( 2 ); - // Check the nonce first. - if ( !check_admin_referer( 'groups_accept_membership_request' ) ) - return false; + if ( !empty( $request_action ) && !empty( $membership_id ) ) { + if ( 'accept' == $request_action && is_numeric( $membership_id ) ) { - // Accept the membership request - if ( !groups_accept_membership_request( $membership_id ) ) - bp_core_add_message( __( 'There was an error accepting the membership request, please try again.', 'buddypress' ), 'error' ); - else - bp_core_add_message( __( 'Group membership request accepted', 'buddypress' ) ); + // Check the nonce first. + if ( !check_admin_referer( 'groups_accept_membership_request' ) ) + return false; - } elseif ( 'reject' == $request_action && is_numeric( $membership_id ) ) { - /* Check the nonce first. */ - if ( !check_admin_referer( 'groups_reject_membership_request' ) ) - return false; + // Accept the membership request + if ( !groups_accept_membership_request( $membership_id ) ) + bp_core_add_message( __( 'There was an error accepting the membership request, please try again.', 'buddypress' ), 'error' ); + else + bp_core_add_message( __( 'Group membership request accepted', 'buddypress' ) ); - // Reject the membership request - if ( !groups_reject_membership_request( $membership_id ) ) - bp_core_add_message( __( 'There was an error rejecting the membership request, please try again.', 'buddypress' ), 'error' ); - else - bp_core_add_message( __( 'Group membership request rejected', 'buddypress' ) ); - } + } elseif ( 'reject' == $request_action && is_numeric( $membership_id ) ) { + /* Check the nonce first. */ + if ( !check_admin_referer( 'groups_reject_membership_request' ) ) + return false; - do_action( 'groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id ); - bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/' ); + // Reject the membership request + if ( !groups_reject_membership_request( $membership_id ) ) + bp_core_add_message( __( 'There was an error rejecting the membership request, please try again.', 'buddypress' ), 'error' ); + else + bp_core_add_message( __( 'Group membership request rejected', 'buddypress' ) ); } - do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id ); - bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) ); + do_action( 'groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id ); + bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/' ); } + + do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id ); + bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) ); } add_action( 'bp_screens', 'groups_screen_group_admin_requests' ); function groups_screen_group_admin_delete_group() { global $bp; - if ( 'delete-group' == bp_get_group_current_admin_tab() ) { + if ( 'delete-group' != bp_get_group_current_admin_tab() ) + return false; - if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) ) - return false; + if ( ! bp_is_item_admin() && !bp_current_user_can( 'bp_moderate' ) ) + return false; - if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) { - // Check the nonce first. - if ( !check_admin_referer( 'groups_delete_group' ) ) - return false; + if ( isset( $_REQUEST['delete-group-button'] ) && isset( $_REQUEST['delete-group-understand'] ) ) { - do_action( 'groups_before_group_deleted', $bp->groups->current_group->id ); + // Check the nonce first. + if ( !check_admin_referer( 'groups_delete_group' ) ) { + return false; + } - // Group admin has deleted the group, now do it. - if ( !groups_delete_group( $bp->groups->current_group->id ) ) { - bp_core_add_message( __( 'There was an error deleting the group, please try again.', 'buddypress' ), 'error' ); - } else { - bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) ); + do_action( 'groups_before_group_deleted', $bp->groups->current_group->id ); - do_action( 'groups_group_deleted', $bp->groups->current_group->id ); + // Group admin has deleted the group, now do it. + if ( !groups_delete_group( $bp->groups->current_group->id ) ) { + bp_core_add_message( __( 'There was an error deleting the group, please try again.', 'buddypress' ), 'error' ); + } else { + bp_core_add_message( __( 'The group was deleted successfully', 'buddypress' ) ); - bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) ); - } + do_action( 'groups_group_deleted', $bp->groups->current_group->id ); bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) ); } - do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id ); - - bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) ); + bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) ); } + + do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id ); + + bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) ); } add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' ); @@ -834,8 +884,7 @@ function groups_screen_notification_settings() { $group_promo = 'yes'; if ( !$group_request = bp_get_user_meta( bp_displayed_user_id(), 'notification_groups_membership_request', true ) ) - $group_request = 'yes'; -?> + $group_request = 'yes'; ?> <table class="notification-settings" id="groups-notification-settings"> <thead> @@ -882,4 +931,164 @@ function groups_screen_notification_settings() { } add_action( 'bp_notification_settings', 'groups_screen_notification_settings' ); -?> +/** Theme Compatability *******************************************************/ + +/** + * The main theme compat class for BuddyPress Groups + * + * This class sets up the necessary theme compatability actions to safely output + * group template parts to the_title and the_content areas of a theme. + * + * @since BuddyPress (1.7) + */ +class BP_Groups_Theme_Compat { + + /** + * Setup the groups component theme compatibility + * + * @since BuddyPress (1.7) + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_group' ) ); + } + + /** + * Are we looking at something that needs group theme compatability? + * + * @since BuddyPress (1.7) + */ + public function is_group() { + + // Bail if not looking at a group + if ( ! bp_is_groups_component() ) + return; + + // Group Directory + if ( ! bp_current_action() && ! bp_current_item() ) { + bp_update_is_directory( true, 'groups' ); + + do_action( 'groups_directory_groups_setup' ); + + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); + + // Creating a group + } elseif ( bp_is_groups_component() && bp_is_current_action( 'create' ) ) { + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'create_content' ) ); + + // Group admin + } elseif ( bp_is_single_item() ) { + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'single_content' ) ); + + } + } + + /** Directory *************************************************************/ + + /** + * Update the global $post with directory data + * + * @since BuddyPress (1.7) + */ + public function directory_dummy_post() { + + // Title based on ability to create groups + if ( is_user_logged_in() && bp_user_can_create_groups() ) { + $title = __( 'Groups', 'buddypress' ) . ' <a class="button bp-title-button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ) . '">' . __( 'Create a Group', 'buddypress' ) . '</a>'; + } else { + $title = __( 'Groups', 'buddypress' ); + } + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => $title, + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_group', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the groups index template part + * + * @since BuddyPress (1.7) + */ + public function directory_content() { + bp_buffer_template_part( 'groups/index' ); + } + + /** Create ****************************************************************/ + + /** + * Update the global $post with create screen data + * + * @since BuddyPress (1.7) + */ + public function create_dummy_post() { + + // Title based on ability to create groups + if ( is_user_logged_in() && bp_user_can_create_groups() ) { + $title = '<a class="button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . __( 'Groups', 'buddypress' ) . '</a> ' . __( 'Create a Group', 'buddypress' ); + } else { + $title = __( 'Groups', 'buddypress' ); + } + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => $title, + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_group', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the create screen template part + * + * @since BuddyPress (1.7) + */ + public function create_content() { + bp_buffer_template_part( 'groups/create' ); + } + + /** Single ****************************************************************/ + + /** + * Update the global $post with single group data + * + * @since BuddyPress (1.7) + */ + public function single_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => '<a href="' . bp_get_group_permalink( groups_get_current_group() ) . '">' . bp_get_current_group_name() . '</a>', + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_group', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the single group template part + * + * @since BuddyPress (1.7) + */ + public function single_content() { + bp_buffer_template_part( 'groups/single/home' ); + } +} +new BP_Groups_Theme_Compat(); diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php index e471241ed8508ecb37d77d28c50d23095b27ddeb..ec625c1ca67daeb241bb1716022fa63b273ef59b 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-template.php @@ -107,7 +107,48 @@ class BP_Groups_Template { var $sort_by; var $order; - function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false, $page_arg = 'grpage' ){ + function __construct( $args = array() ){ + + // Backward compatibility with old method of passing arguments + if ( ! is_array( $args ) || func_num_args() > 1 ) { + _deprecated_argument( __METHOD__, '1.7', sprintf( __( 'Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details.', 'buddypress' ), __METHOD__, __FILE__ ) ); + + $old_args_keys = array( + 0 => 'user_id', + 1 => 'type', + 2 => 'page', + 3 => 'per_page', + 4 => 'max', + 5 => 'slug', + 6 => 'search_terms', + 7 => 'populate_extras', + 8 => 'include', + 9 => 'exclude', + 10 => 'show_hidden', + 11 => 'page_arg', + ); + + $func_args = func_get_args(); + $args = bp_core_parse_args_array( $old_args_keys, $func_args ); + } + + $defaults = array( + 'type' => 'active', + 'page' => 1, + 'per_page' => 20, + 'max' => false, + 'show_hidden' => false, + 'page_arg' => 'grpage', + 'user_id' => 0, + 'slug' => false, + 'include' => false, + 'exclude' => false, + 'search_terms' => '', + 'populate_extras' => true + ); + + $r = wp_parse_args( $args, $defaults ); + extract( $r ); $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page; $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; @@ -273,19 +314,32 @@ function bp_has_groups( $args = '' ) { ); $r = wp_parse_args( $args, $defaults ); - extract( $r ); - if ( empty( $search_terms ) ) { + if ( empty( $r['search_terms'] ) ) { if ( isset( $_REQUEST['group-filter-box'] ) && !empty( $_REQUEST['group-filter-box'] ) ) - $search_terms = $_REQUEST['group-filter-box']; + $r['search_terms'] = $_REQUEST['group-filter-box']; elseif ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) ) - $search_terms = $_REQUEST['s']; + $r['search_terms'] = $_REQUEST['s']; else - $search_terms = false; + $r['search_terms'] = false; } - $groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden, $page_arg ); - return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template ); + $groups_template = new BP_Groups_Template( array( + 'type' => $r['type'], + 'page' => (int) $r['page'], + 'per_page' => (int) $r['per_page'], + 'max' => (int) $r['max'], + 'show_hidden' => $r['show_hidden'], + 'page_arg' => $r['page_arg'], + 'user_id' => (int) $r['user_id'], + 'slug' => $r['slug'], + 'search_terms' => $r['search_terms'], + 'include' => $r['include'], + 'exclude' => $r['exclude'], + 'populate_extras' => (bool) $r['populate_extras'] + ) ); + + return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template, $r ); } function bp_groups() { @@ -318,8 +372,8 @@ function bp_group_is_visible( $group = false ) { return false; } -function bp_group_id() { - echo bp_get_group_id(); +function bp_group_id( $group = false ) { + echo bp_get_group_id( $group ); } function bp_get_group_id( $group = false ) { global $groups_template; @@ -330,8 +384,57 @@ function bp_group_id() { return apply_filters( 'bp_get_group_id', $group->id ); } -function bp_group_name() { - echo bp_get_group_name(); +/** + * Output the row class of a group + * + * @since BuddyPress (1.7) + */ +function bp_group_class() { + echo bp_get_group_class(); +} + /** + * Return the row class of a group + * + * @global BP_Groups_Template $groups_template + * @return string Row class of the group + * @since BuddyPress (1.7) + */ + function bp_get_group_class() { + global $groups_template; + + $classes = array(); + $pos_in_loop = (int) $groups_template->current_group; + + // If we've only one group in the loop, don't both with odd and even. + if ( $groups_template->group_count > 1 ) + $classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd'; + else + $classes[] = 'bp-single-group'; + + // Group type - public, private, hidden. + $classes[] = esc_attr( $groups_template->group->status ); + + // User's group status + if ( bp_is_user_active() ) { + if ( bp_group_is_admin() ) + $classes[] = 'is-admin'; + + if ( bp_group_is_member() ) + $classes[] = 'is-member'; + + if ( bp_group_is_mod() ) + $classes[] = 'is-mod'; + } + + $classes = apply_filters( 'bp_get_group_class', $classes ); + $classes = array_merge( $classes, array() ); + $retval = 'class="' . join( ' ', $classes ) . '"'; + + return $retval; + } + +function bp_group_name( $group = false ) { + echo bp_get_group_name( $group ); } function bp_get_group_name( $group = false ) { global $groups_template; @@ -342,8 +445,8 @@ function bp_group_name() { return apply_filters( 'bp_get_group_name', $group->name ); } -function bp_group_type() { - echo bp_get_group_type(); +function bp_group_type( $group = false ) { + echo bp_get_group_type( $group ); } function bp_get_group_type( $group = false ) { global $groups_template; @@ -364,8 +467,8 @@ function bp_group_type() { return apply_filters( 'bp_get_group_type', $type ); } -function bp_group_status() { - echo bp_get_group_status(); +function bp_group_status( $group = false ) { + echo bp_get_group_status( $group ); } function bp_get_group_status( $group = false ) { global $groups_template; @@ -401,22 +504,22 @@ function bp_group_avatar( $args = '' ) { return apply_filters( 'bp_get_group_avatar', $avatar ); } -function bp_group_avatar_thumb() { - echo bp_get_group_avatar_thumb(); +function bp_group_avatar_thumb( $group = false ) { + echo bp_get_group_avatar_thumb( $group ); } function bp_get_group_avatar_thumb( $group = false ) { return bp_get_group_avatar( 'type=thumb' ); } -function bp_group_avatar_mini() { - echo bp_get_group_avatar_mini(); +function bp_group_avatar_mini( $group = false ) { + echo bp_get_group_avatar_mini( $group ); } function bp_get_group_avatar_mini( $group = false ) { return bp_get_group_avatar( 'type=thumb&width=30&height=30' ); } -function bp_group_last_active() { - echo bp_get_group_last_active(); +function bp_group_last_active( $group = false ) { + echo bp_get_group_last_active( $group ); } function bp_get_group_last_active( $group = false ) { global $groups_template; @@ -436,8 +539,8 @@ function bp_group_last_active() { } } -function bp_group_permalink() { - echo bp_get_group_permalink(); +function bp_group_permalink( $group = false ) { + echo bp_get_group_permalink( $group ); } function bp_get_group_permalink( $group = false ) { global $groups_template; @@ -448,8 +551,8 @@ function bp_group_permalink() { return apply_filters( 'bp_get_group_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/' ) ); } -function bp_group_admin_permalink() { - echo bp_get_group_admin_permalink(); +function bp_group_admin_permalink( $group = false ) { + echo bp_get_group_admin_permalink( $group ); } function bp_get_group_admin_permalink( $group = false ) { global $groups_template; @@ -460,8 +563,8 @@ function bp_group_admin_permalink() { return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'admin' ) ); } -function bp_group_slug() { - echo bp_get_group_slug(); +function bp_group_slug( $group = false ) { + echo bp_get_group_slug( $group ); } function bp_get_group_slug( $group = false ) { global $groups_template; @@ -472,8 +575,8 @@ function bp_group_slug() { return apply_filters( 'bp_get_group_slug', $group->slug ); } -function bp_group_description() { - echo bp_get_group_description(); +function bp_group_description( $group = false ) { + echo bp_get_group_description( $group ); } function bp_get_group_description( $group = false ) { global $groups_template; @@ -484,8 +587,8 @@ function bp_group_description() { return apply_filters( 'bp_get_group_description', stripslashes($group->description) ); } -function bp_group_description_editable() { - echo bp_get_group_description_editable(); +function bp_group_description_editable( $group = false ) { + echo bp_get_group_description_editable( $group ); } function bp_get_group_description_editable( $group = false ) { global $groups_template; @@ -496,8 +599,8 @@ function bp_group_description_editable() { return apply_filters( 'bp_get_group_description_editable', $group->description ); } -function bp_group_description_excerpt() { - echo bp_get_group_description_excerpt(); +function bp_group_description_excerpt( $group = false ) { + echo bp_get_group_description_excerpt( $group ); } function bp_get_group_description_excerpt( $group = false ) { global $groups_template; @@ -509,8 +612,8 @@ function bp_group_description_excerpt() { } -function bp_group_public_status() { - echo bp_get_group_public_status(); +function bp_group_public_status( $group = false ) { + echo bp_get_group_public_status( $group ); } function bp_get_group_public_status( $group = false ) { global $groups_template; @@ -525,8 +628,8 @@ function bp_group_public_status() { } } -function bp_group_is_public() { - echo bp_get_group_is_public(); +function bp_group_is_public( $group = false ) { + echo bp_get_group_is_public( $group ); } function bp_get_group_is_public( $group = false ) { global $groups_template; @@ -537,8 +640,8 @@ function bp_group_is_public() { return apply_filters( 'bp_get_group_is_public', $group->is_public ); } -function bp_group_date_created() { - echo bp_get_group_date_created(); +function bp_group_date_created( $group = false ) { + echo bp_get_group_date_created( $group ); } function bp_get_group_date_created( $group = false ) { global $groups_template; @@ -548,7 +651,82 @@ function bp_group_date_created() { return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ) ); } + +function bp_group_creator_username( $group = false ) { + echo bp_get_group_creator_username( $group ); +} + function bp_get_group_creator_username( $group = false ) { + global $groups_template; + + if ( empty( $group ) ) + $group =& $groups_template->group; + + return apply_filters( 'bp_get_group_creator_username', bp_core_get_user_displayname( $group->creator_id ) ); + } + +function bp_group_creator_id( $group = false ) { + echo bp_get_group_creator_id( $group ); +} + function bp_get_group_creator_id( $group = false ) { + global $groups_template; + + if ( empty( $group ) ) + $group =& $groups_template->group; + + return apply_filters( 'bp_get_group_creator_id', $group->creator_id ); + } + +function bp_group_creator_permalink( $group = false ) { + echo bp_get_group_creator_permalink( $group ); +} + function bp_get_group_creator_permalink( $group = false ) { + global $groups_template; + + if ( empty( $group ) ) + $group =& $groups_template->group; + + return apply_filters( 'bp_get_group_creator_permalink', bp_core_get_user_domain( $group->creator_id ) ); + } + +function bp_is_group_creator( $group = false, $user_id = 0 ) { + global $groups_template; + + if ( empty( $group ) ) + $group =& $groups_template->group; + + if ( empty( $user_id ) ) + $user_id = bp_loggedin_user_id(); + + return (bool) ( $group->creator_id == $user_id ); +} + +function bp_group_creator_avatar( $group = false, $args = array() ) { + echo bp_get_group_creator_avatar( $group, $args ); +} + function bp_get_group_creator_avatar( $group = false, $args = array() ) { + global $groups_template; + + if ( empty( $group ) ) + $group =& $groups_template->group; + + $defaults = array( + 'type' => 'full', + 'width' => false, + 'height' => false, + 'class' => 'avatar', + 'id' => false, + 'alt' => sprintf( __( 'Group creator avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $group->creator_id ) ) + ); + + $r = wp_parse_args( $args, $defaults ); + extract( $r, EXTR_SKIP ); + + $avatar = bp_core_fetch_avatar( array( 'item_id' => $group->creator_id, 'type' => $type, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'alt' => $alt ) ); + + return apply_filters( 'bp_get_group_creator_avatar', $avatar ); + } + function bp_group_is_admin() { return bp_is_item_admin(); } @@ -848,16 +1026,8 @@ function bp_group_is_forum_enabled( $group = false ) { if ( empty( $group ) ) $group =& $groups_template->group; - if ( bp_is_active( 'forums' ) ) { - if ( bp_forums_is_installed_correctly() ) { - if ( $group->enable_forum ) - return true; - - return false; - } else { - return false; - } - } + if ( ! empty( $group->enable_forum ) ) + return true; return false; } @@ -1005,7 +1175,7 @@ function bp_groups_user_can_send_invites( $group_id = false ) { * * @deprecated 1.5 * @deprecated No longer used. - * @since 1.0 + * @since BuddyPress (1.0) * @todo Remove in 1.4 */ function bp_group_admin_memberlist( $admin_list = false, $group = false ) { @@ -1264,7 +1434,7 @@ function bp_group_admin_tabs( $group = false ) { $current_tab = bp_get_group_current_admin_tab(); - if ( bp_is_item_admin() || bp_is_item_mod() ) : ?> + if ( bp_is_item_admin() ) : ?> <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_group_permalink( $group ) . 'admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li> @@ -1475,9 +1645,30 @@ function bp_has_friends_to_invite( $group = false ) { return true; } +/** + * Outputs a 'New Topic' button for a group. + * + * @since BuddyPress (1.2.7) + * + * @param obj|bool $group The BP Groups_Group object if passed, boolean false if not passed. + * @uses bp_get_group_new_topic_button() Returns the 'New Topic' button + */ function bp_group_new_topic_button( $group = false ) { echo bp_get_group_new_topic_button( $group ); } + /** + * Returns a 'New Topic' button for a group. + * + * @since BuddyPress (1.2.7) + * + * @param obj|bool $group The BP Groups_Group object if passed, boolean false if not passed. + * @uses is_user_logged_in() Is there a user logged in? + * @uses bp_group_is_user_banned() Is the current user banned from the current group? + * @uses bp_is_group_forum() Are we on a group forum page? + * @uses bp_is_group_forum_topic() Are we on a group topic page? + * @uses bp_get_button() Renders a button + * @return HTML code for the button + */ function bp_get_group_new_topic_button( $group = false ) { global $groups_template; @@ -1487,7 +1678,7 @@ function bp_group_new_topic_button( $group = false ) { if ( !is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic() ) return false; - $button = bp_button( array ( + $button = array( 'id' => 'new_topic', 'component' => 'groups', 'must_be_logged_in' => true, @@ -1498,7 +1689,7 @@ function bp_group_new_topic_button( $group = false ) { 'link_id' => 'new-topic-button', 'link_text' => __( 'New Topic', 'buddypress' ), 'link_title' => __( 'New Topic', 'buddypress' ), - ) ); + ); // Filter and return the HTML button return bp_get_button( apply_filters( 'bp_get_group_new_topic_button', $button ) ); @@ -1521,7 +1712,7 @@ function bp_group_join_button( $group = false ) { return false; // Already a member - if ( $group->is_member ) { + if ( isset( $group->is_member ) && $group->is_member ) { // Stop sole admins from abandoning their group $group_admins = groups_get_group_admins( $group->id ); @@ -1612,7 +1803,7 @@ function bp_group_join_button( $group = false ) { * * @global BP_Groups_Template $groups_template Groups template object * @param object $group Group to get status message for. Optional; defaults to current group. - * @since 1.0 + * @since BuddyPress (1.0) */ function bp_group_status_message( $group = null ) { global $groups_template; @@ -2194,7 +2385,7 @@ function bp_group_creation_previous_link() { /** * Echoes the current group creation step * - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_groups_current_create_step() { echo bp_get_groups_current_create_step(); @@ -2202,20 +2393,20 @@ function bp_groups_current_create_step() { /** * Returns the current group creation step. If none is found, returns an empty string * - * @since 1.6 + * @since BuddyPress (1.6) * * @uses apply_filters() Filter bp_get_groups_current_create_step to modify * @return str $current_create_step */ function bp_get_groups_current_create_step() { global $bp; - + if ( !empty( $bp->groups->current_create_step ) ) { $current_create_step = $bp->groups->current_create_step; } else { $current_create_step = ''; } - + return apply_filters( 'bp_get_groups_current_create_step', $current_create_step ); } @@ -2360,7 +2551,7 @@ function bp_is_group_admin_screen( $slug ) { /** * Echoes the current group admin tab slug * - * @since 1.6 + * @since BuddyPress (1.6) */ function bp_group_current_admin_tab() { echo bp_get_group_current_admin_tab(); @@ -2368,7 +2559,7 @@ function bp_group_current_admin_tab() { /** * Returns the current group admin tab slug * - * @since 1.6 + * @since BuddyPress (1.6) * * @uses apply_filters() Filter bp_get_current_group_admin_tab to modify return value * @return str $tab The current tab's slug @@ -2379,7 +2570,7 @@ function bp_group_current_admin_tab() { } else { $tab = ''; } - + return apply_filters( 'bp_get_current_group_admin_tab', $tab ); } @@ -2896,4 +3087,3 @@ function bp_groups_action_link( $action = '', $query_args = '', $nonce = false ) if ( !empty( $url ) ) return $url; } -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php b/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php index d2765db0408aaab8998fed34ff10dc9893668259..2a264e21b03c9856b54392f6d1fb52ebcf6db69a 100644 --- a/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php +++ b/wp-content/plugins/buddypress/bp-groups/bp-groups-widgets.php @@ -24,15 +24,15 @@ class BP_Groups_Widget extends WP_Widget { } function __construct() { - $widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ) ); - parent::__construct( false, __( 'Groups', 'buddypress' ), $widget_ops ); + $widget_ops = array( + 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ), + 'classname' => 'widget_bp_groups_widget buddypress', + ); + parent::__construct( false, _x( '(BuddyPress) Groups', 'widget name', 'buddypress' ), $widget_ops ); if ( is_active_widget( false, false, $this->id_base ) && !is_admin() && !is_network_admin() ) { - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { - wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.dev.js', array( 'jquery' ), bp_get_version() ); - } else { - wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . 'bp-groups/js/widget-groups.js', array( 'jquery' ), bp_get_version() ); - } + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + wp_enqueue_script( 'groups_widget_groups_list-js', BP_PLUGIN_URL . "bp-groups/js/widget-groups{$min}.js", array( 'jquery' ), bp_get_version() ); } } @@ -48,12 +48,10 @@ class BP_Groups_Widget extends WP_Widget { $instance['title'] = __( 'Groups', 'buddypress' ); echo $before_widget; - - $title = $instance['link_title'] ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title']; - - echo $before_title - . $title - . $after_title; ?> + + $title = !empty( $instance['link_title'] ) ? '<a href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . $instance['title'] . '</a>' : $instance['title']; + + echo $before_title . $title . $after_title; ?> <?php if ( bp_has_groups( 'user_id=' . $user_id . '&type=' . $instance['group_default'] . '&max=' . $instance['max_groups'] ) ) : ?> <div class="item-options" id="groups-list-options"> @@ -105,7 +103,7 @@ class BP_Groups_Widget extends WP_Widget { function update( $new_instance, $old_instance ) { $instance = $old_instance; - + $instance['title'] = strip_tags( $new_instance['title'] ); $instance['max_groups'] = strip_tags( $new_instance['max_groups'] ); $instance['group_default'] = strip_tags( $new_instance['group_default'] ); @@ -130,7 +128,7 @@ class BP_Groups_Widget extends WP_Widget { ?> <p><label for="bp-groups-widget-title"><?php _e('Title:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" style="width: 100%" /></label></p> - + <p><label for="<?php echo $this->get_field_name('link_title') ?>"><input type="checkbox" name="<?php echo $this->get_field_name('link_title') ?>" value="1" <?php checked( $link_title ) ?> /> <?php _e( 'Link widget title to Groups directory', 'buddypress' ) ?></label></p> <p><label for="bp-groups-widget-groups-max"><?php _e('Max groups to show:', 'buddypress'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_groups' ); ?>" name="<?php echo $this->get_field_name( 'max_groups' ); ?>" type="text" value="<?php echo esc_attr( $max_groups ); ?>" style="width: 30%" /></label></p> @@ -166,34 +164,31 @@ function groups_ajax_widget_groups_list() { if ( bp_has_groups( 'type=' . $type . '&per_page=' . $_POST['max_groups'] . '&max=' . $_POST['max_groups'] ) ) : ?> <?php echo "0[[SPLIT]]"; ?> - - <ul id="groups-list" class="item-list"> - <?php while ( bp_groups() ) : bp_the_group(); ?> - <li> - <div class="item-avatar"> - <a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a> + <?php while ( bp_groups() ) : bp_the_group(); ?> + <li> + <div class="item-avatar"> + <a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a> + </div> + + <div class="item"> + <div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div> + <div class="item-meta"> + <span class="activity"> + <?php + if ( 'newest-groups' == $_POST['filter'] ) { + printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() ); + } else if ( 'recently-active-groups' == $_POST['filter'] ) { + printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); + } else if ( 'popular-groups' == $_POST['filter'] ) { + bp_group_member_count(); + } + ?> + </span> </div> + </div> + </li> + <?php endwhile; ?> - <div class="item"> - <div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div> - <div class="item-meta"> - <span class="activity"> - <?php - if ( 'newest-groups' == $_POST['filter'] ) { - printf( __( 'created %s', 'buddypress' ), bp_get_group_date_created() ); - } else if ( 'recently-active-groups' == $_POST['filter'] ) { - printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); - } else if ( 'popular-groups' == $_POST['filter'] ) { - bp_group_member_count(); - } - ?> - </span> - </div> - </div> - </li> - - <?php endwhile; ?> - </ul> <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?> <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo esc_attr( $_POST['max_groups'] ); ?>" /> @@ -204,7 +199,5 @@ function groups_ajax_widget_groups_list() { <?php endif; } -add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' ); +add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' ); add_action( 'wp_ajax_nopriv_widget_groups_list', 'groups_ajax_widget_groups_list' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js index f893d060eb9e9af5f07da7bf431b68f7503e2480..781c2aa11f2c41684849ba92bf23ebdb4ee7a27f 100644 --- a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js +++ b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.js @@ -1 +1,49 @@ -jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").live("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#groups-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");groups_wiget_response(b)});return false})});function groups_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]);jQuery(".widget ul#groups-list").fadeIn(200)})}else{jQuery(".widget ul#groups-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#groups-list").html(b);jQuery(".widget ul#groups-list").fadeIn(200)})}}; \ No newline at end of file +jQuery(document).ready( function() { + jQuery(".widget div#groups-list-options a").on('click', + function() { + var link = this; + jQuery(link).addClass('loading'); + + jQuery(".widget div#groups-list-options a").removeClass("selected"); + jQuery(this).addClass('selected'); + + jQuery.post( ajaxurl, { + action: 'widget_groups_list', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce': jQuery("input#_wpnonce-groups").val(), + 'max_groups': jQuery("input#groups_widget_max").val(), + 'filter': jQuery(this).attr('id') + }, + function(response) + { + jQuery(link).removeClass('loading'); + groups_wiget_response(response); + }); + + return false; + } + ); +}); + +function groups_wiget_response(response) { + response = response.substr(0, response.length-1); + response = response.split('[[SPLIT]]'); + + if ( response[0] != "-1" ) { + jQuery(".widget ul#groups-list").fadeOut(200, + function() { + jQuery(".widget ul#groups-list").html(response[1]); + jQuery(".widget ul#groups-list").fadeIn(200); + } + ); + + } else { + jQuery(".widget ul#groups-list").fadeOut(200, + function() { + var message = '<p>' + response[1] + '</p>'; + jQuery(".widget ul#groups-list").html(message); + jQuery(".widget ul#groups-list").fadeIn(200); + } + ); + } +} diff --git a/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js new file mode 100644 index 0000000000000000000000000000000000000000..e4ba8c60c4443307926352d2438f6427fb31b1b0 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-groups/js/widget-groups.min.js @@ -0,0 +1 @@ +jQuery(document).ready(function(){jQuery(".widget div#groups-list-options a").on("click",function(){var a=this;jQuery(a).addClass("loading");jQuery(".widget div#groups-list-options a").removeClass("selected");jQuery(this).addClass("selected");jQuery.post(ajaxurl,{action:"widget_groups_list",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce-groups").val(),max_groups:jQuery("input#groups_widget_max").val(),filter:jQuery(this).attr("id")},function(b){jQuery(a).removeClass("loading");groups_wiget_response(b)});return false})});function groups_wiget_response(a){a=a.substr(0,a.length-1);a=a.split("[[SPLIT]]");if(a[0]!="-1"){jQuery(".widget ul#groups-list").fadeOut(200,function(){jQuery(".widget ul#groups-list").html(a[1]);jQuery(".widget ul#groups-list").fadeIn(200)})}else{jQuery(".widget ul#groups-list").fadeOut(200,function(){var b="<p>"+a[1]+"</p>";jQuery(".widget ul#groups-list").html(b);jQuery(".widget ul#groups-list").fadeIn(200)})}}; \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-languages/buddypress.pot b/wp-content/plugins/buddypress/bp-languages/buddypress.pot index e12df5dd18e641d22e488185e8601624e9694dea..07ffff96d423bd44b8028e9e49e3559ebed22f45 100644 --- a/wp-content/plugins/buddypress/bp-languages/buddypress.pot +++ b/wp-content/plugins/buddypress/bp-languages/buddypress.pot @@ -1,14 +1,14 @@ -# Copyright (C) 2012 BuddyPress +# Copyright (C) 2013 BuddyPress # This file is distributed under the same license as the BuddyPress package. msgid "" msgstr "" "Project-Id-Version: BuddyPress \n" "Report-Msgid-Bugs-To: http://wppolyglots.wordpress.com\n" -"POT-Creation-Date: 2012-12-10 06:36:53+00:00\n" +"POT-Creation-Date: 2013-04-26 13:36:03+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -25,6 +25,7 @@ msgid "The activity item has been marked as spam and is no longer visible." msgstr "" #: bp-activity/bp-activity-actions.php:263 +#: bp-templates/bp-legacy/buddypress-functions.php:554 #: bp-themes/bp-default/_inc/ajax.php:263 msgid "Please enter some content to post." msgstr "" @@ -38,6 +39,7 @@ msgid "There was an error when posting your update, please try again." msgstr "" #: bp-activity/bp-activity-actions.php:323 +#: bp-templates/bp-legacy/buddypress-functions.php:602 #: bp-themes/bp-default/_inc/ajax.php:311 msgid "Please do not leave the comment area blank." msgstr "" @@ -47,6 +49,8 @@ msgid "Reply Posted!" msgstr "" #: bp-activity/bp-activity-actions.php:336 +#: bp-templates/bp-legacy/buddypress-functions.php:605 +#: bp-templates/bp-legacy/buddypress-functions.php:614 #: bp-themes/bp-default/_inc/ajax.php:314 #: bp-themes/bp-default/_inc/ajax.php:323 msgid "There was an error posting that reply, please try again." @@ -71,147 +75,162 @@ msgstr "" #. translators: Personal activity RSS title - "[Site Name] | [Displayed User #. Name] | Activity" -#: bp-activity/bp-activity-admin.php:34 bp-activity/bp-activity-admin.php:835 -#: bp-activity/bp-activity-admin.php:1145 +#: bp-activity/bp-activity-admin.php:35 bp-activity/bp-activity-admin.php:36 +#: bp-activity/bp-activity-admin.php:852 bp-activity/bp-activity-admin.php:1167 #: bp-activity/bp-activity-loader.php:118 -#: bp-activity/bp-activity-loader.php:241 +#: bp-activity/bp-activity-loader.php:242 #: bp-activity/bp-activity-screens.php:278 -#: bp-activity/feeds/bp-activity-personal-feed.php:28 -#: bp-core/admin/bp-core-update.php:391 +#: bp-activity/bp-activity-screens.php:394 +#: bp-activity/feeds/bp-activity-personal-feed.php:27 +#: bp-core/bp-core-admin.php:409 msgid "Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:64 +#: bp-activity/bp-activity-admin.php:85 msgid "ERROR: Please type a reply." msgstr "" -#: bp-activity/bp-activity-admin.php:69 +#: bp-activity/bp-activity-admin.php:90 msgid "ERROR: The item you are trying to reply to cannot be found, or it has been deleted." msgstr "" -#: bp-activity/bp-activity-admin.php:177 bp-activity/bp-activity-admin.php:224 +#: bp-activity/bp-activity-admin.php:197 bp-activity/bp-activity-admin.php:244 +#: bp-core/admin/bp-core-functions.php:402 +#: bp-core/admin/bp-core-functions.php:420 +#: bp-core/admin/bp-core-functions.php:439 +#: bp-core/admin/bp-core-functions.php:458 bp-groups/bp-groups-admin.php:107 +#: bp-groups/bp-groups-admin.php:143 msgid "Overview" msgstr "" -#: bp-activity/bp-activity-admin.php:179 +#: bp-activity/bp-activity-admin.php:199 msgid "You edit activities made on your site similar to the way you edit a comment. This is useful if you need to change which page the activity links to, or when you notice that the author has made a typographical error." msgstr "" -#: bp-activity/bp-activity-admin.php:180 +#: bp-activity/bp-activity-admin.php:200 msgid "The two big editing areas for the activity title and content are fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to unhide more boxes (Primary Item/Secondary Item, Link, Type, Author ID) or to choose a 1- or 2-column layout for this screen." msgstr "" -#: bp-activity/bp-activity-admin.php:181 +#: bp-activity/bp-activity-admin.php:201 msgid "You can also moderate the activity from this screen using the Status box, where you can also change the timestamp of the activity." msgstr "" -#: bp-activity/bp-activity-admin.php:186 +#: bp-activity/bp-activity-admin.php:206 msgid "Item, Link, Type" msgstr "" -#: bp-activity/bp-activity-admin.php:188 +#: bp-activity/bp-activity-admin.php:208 msgid "<strong>Primary Item/Secondary Item</strong> - These identify the object that created the activity. For example, the fields could reference a comment left on a specific site. Some types of activity may only use one, or none, of these fields." msgstr "" -#: bp-activity/bp-activity-admin.php:189 +#: bp-activity/bp-activity-admin.php:209 msgid "<strong>Link</strong> - Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item. Some types of activity may not use this field, even if it has been set." msgstr "" -#: bp-activity/bp-activity-admin.php:190 +#: bp-activity/bp-activity-admin.php:210 msgid "<strong>Type</strong> - Each distinct kind of activity has its own type. For example, <code>created_group</code> is used when a group is created and <code>joined_group</code> is used when a user joins a group." msgstr "" -#: bp-activity/bp-activity-admin.php:191 +#: bp-activity/bp-activity-admin.php:211 msgid "For information about when and how BuddyPress uses all of these settings, see the Managing Activity link in the panel to the side." msgstr "" -#: bp-activity/bp-activity-admin.php:196 bp-activity/bp-activity-admin.php:241 +#: bp-activity/bp-activity-admin.php:216 bp-activity/bp-activity-admin.php:261 +#: bp-core/admin/bp-core-functions.php:408 +#: bp-core/admin/bp-core-functions.php:426 +#: bp-core/admin/bp-core-functions.php:445 +#: bp-core/admin/bp-core-functions.php:464 bp-groups/bp-groups-admin.php:115 +#: bp-groups/bp-groups-admin.php:159 msgid "For more information:" msgstr "" -#: bp-activity/bp-activity-admin.php:197 +#: bp-activity/bp-activity-admin.php:217 msgid "<a href=\"http://codex.buddypress.org/buddypress-site-administration/managing-activity/\">Managing Activity</a>" msgstr "" -#: bp-activity/bp-activity-admin.php:198 bp-activity/bp-activity-admin.php:242 +#: bp-activity/bp-activity-admin.php:218 bp-activity/bp-activity-admin.php:262 +#: bp-core/admin/bp-core-functions.php:410 +#: bp-core/admin/bp-core-functions.php:428 +#: bp-core/admin/bp-core-functions.php:447 +#: bp-core/admin/bp-core-functions.php:466 bp-groups/bp-groups-admin.php:160 msgid "<a href=\"http://buddypress.org/support/\">Support Forums</a>" msgstr "" -#: bp-activity/bp-activity-admin.php:202 +#: bp-activity/bp-activity-admin.php:222 msgctxt "activity admin edit screen" msgid "Status" msgstr "" -#: bp-activity/bp-activity-admin.php:203 +#: bp-activity/bp-activity-admin.php:223 msgctxt "activity admin edit screen" msgid "Primary Item/Secondary Item" msgstr "" -#: bp-activity/bp-activity-admin.php:204 +#: bp-activity/bp-activity-admin.php:224 msgctxt "activity admin edit screen" msgid "Link" msgstr "" -#: bp-activity/bp-activity-admin.php:205 +#: bp-activity/bp-activity-admin.php:225 msgctxt "activity admin edit screen" msgid "Type" msgstr "" -#: bp-activity/bp-activity-admin.php:206 +#: bp-activity/bp-activity-admin.php:226 msgctxt "activity admin edit screen" msgid "Author ID" msgstr "" -#: bp-activity/bp-activity-admin.php:219 +#: bp-activity/bp-activity-admin.php:239 msgctxt "Activity items per page (screen options)" msgid "Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:226 +#: bp-activity/bp-activity-admin.php:246 msgid "You can manage activities made on your site similar to the way you manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on activities using the on-hover action links or the Bulk Actions." msgstr "" -#: bp-activity/bp-activity-admin.php:227 +#: bp-activity/bp-activity-admin.php:247 msgid "There are many different types of activities. Some are generated automatically by BuddyPress and other plugins, and some are entered directly by a user in the form of status update. To help manage the different activity types, use the filter dropdown box to switch between them." msgstr "" -#: bp-activity/bp-activity-admin.php:233 +#: bp-activity/bp-activity-admin.php:253 msgid "Moderating Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:235 +#: bp-activity/bp-activity-admin.php:255 msgid "In the <strong>Activity</strong> column, above each activity it says “Submitted on,” followed by the date and time the activity item was generated on your site. Clicking on the date/time link will take you to that activity on your live site. Hovering over any activity gives you options to reply, edit, spam mark, or delete that activity." msgstr "" -#: bp-activity/bp-activity-admin.php:236 +#: bp-activity/bp-activity-admin.php:256 msgid "In the <strong>In Response To</strong> column, if the activity was in reply to another activity, it shows that activity's author's picture and name, and a link to that activity on your live site. If there is a small bubble, the number in it shows how many other activities are related to this one; these are usually comments. Clicking the bubble will filter the activity screen to show only related activity items." msgstr "" -#: bp-activity/bp-activity-admin.php:564 +#: bp-activity/bp-activity-admin.php:582 msgid "Editing Activity (ID #%s)" msgstr "" -#: bp-activity/bp-activity-admin.php:575 +#: bp-activity/bp-activity-admin.php:593 msgid "Action" msgstr "" -#: bp-activity/bp-activity-admin.php:582 +#: bp-activity/bp-activity-admin.php:600 msgid "Content" msgstr "" -#: bp-activity/bp-activity-admin.php:607 +#: bp-activity/bp-activity-admin.php:625 msgid "No activity found with this ID. <a href=\"%s\">Go back and try again</a>." msgstr "" -#: bp-activity/bp-activity-admin.php:629 +#: bp-activity/bp-activity-admin.php:647 msgid "View Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:637 +#: bp-activity/bp-activity-admin.php:655 msgid "Approved" msgstr "" -#: bp-activity/bp-activity-admin.php:638 bp-activity/bp-activity-admin.php:1283 +#: bp-activity/bp-activity-admin.php:656 bp-activity/bp-activity-admin.php:1288 #: bp-activity/bp-activity-akismet.php:178 #: bp-activity/bp-activity-akismet.php:207 msgid "Spam" @@ -219,172 +238,179 @@ msgstr "" #. translators: Publish box date format, see http:php.net/date -#: bp-activity/bp-activity-admin.php:644 +#: bp-activity/bp-activity-admin.php:662 msgid "M j, Y @ G:i" msgstr "" -#: bp-activity/bp-activity-admin.php:647 +#: bp-activity/bp-activity-admin.php:665 msgid "Submitted on: <strong>%1$s</strong>" msgstr "" -#: bp-activity/bp-activity-admin.php:647 bp-activity/bp-activity-admin.php:1276 -#: bp-forums/bp-forums-template.php:1270 bp-themes/bp-default/functions.php:507 -#: bp-xprofile/bp-xprofile-admin.php:456 bp-xprofile/bp-xprofile-loader.php:172 -#: bp-xprofile/bp-xprofile-loader.php:230 +#: bp-activity/bp-activity-admin.php:665 bp-activity/bp-activity-admin.php:1281 +#: bp-forums/bp-forums-template.php:1270 bp-groups/bp-groups-admin.php:1248 +#: bp-themes/bp-default/functions.php:507 bp-xprofile/bp-xprofile-admin.php:456 +#: bp-xprofile/bp-xprofile-loader.php:185 +#: bp-xprofile/bp-xprofile-loader.php:245 msgid "Edit" msgstr "" -#: bp-activity/bp-activity-admin.php:660 bp-core/admin/bp-core-update.php:135 +#: bp-activity/bp-activity-admin.php:678 msgid "Update" msgstr "" -#: bp-activity/bp-activity-admin.php:679 +#: bp-activity/bp-activity-admin.php:697 msgid "Link" msgstr "" -#: bp-activity/bp-activity-admin.php:681 +#: bp-activity/bp-activity-admin.php:699 msgid "Activity generated by blog posts and comments, forum topics and replies, and some plugins, uses the link field for a permalink back to the content item." msgstr "" -#: bp-activity/bp-activity-admin.php:695 +#: bp-activity/bp-activity-admin.php:713 msgid "Author ID" msgstr "" -#: bp-activity/bp-activity-admin.php:747 +#: bp-activity/bp-activity-admin.php:764 msgid "Primary Item ID" msgstr "" -#: bp-activity/bp-activity-admin.php:751 +#: bp-activity/bp-activity-admin.php:768 msgid "Secondary Item ID" msgstr "" -#: bp-activity/bp-activity-admin.php:754 +#: bp-activity/bp-activity-admin.php:771 msgid "These identify the object that created this activity. For example, the fields could reference a pair of site and comment IDs." msgstr "" -#: bp-activity/bp-activity-admin.php:791 -msgid "%s activity has been permanently deleted." +#: bp-activity/bp-activity-admin.php:809 +msgid "%s activity item has been permanently deleted." msgid_plural "%s activity items have been permanently deleted." msgstr[0] "" msgstr[1] "" -#: bp-activity/bp-activity-admin.php:795 +#: bp-activity/bp-activity-admin.php:813 msgid "An error occurred when trying to update activity ID #%s." msgstr "" -#: bp-activity/bp-activity-admin.php:798 +#: bp-activity/bp-activity-admin.php:816 msgid "Errors occurred when trying to update these activity items:" msgstr "" -#: bp-activity/bp-activity-admin.php:804 +#. Translators: This is a bulleted list of item IDs + +#: bp-activity/bp-activity-admin.php:822 msgid "#%s" msgstr "" -#: bp-activity/bp-activity-admin.php:813 -msgid "%s activity has been successfully spammed." +#: bp-activity/bp-activity-admin.php:831 +msgid "%s activity item has been successfully spammed." msgid_plural "%s activity items have been successfully spammed." msgstr[0] "" msgstr[1] "" -#: bp-activity/bp-activity-admin.php:816 -msgid "%s activity has been successfully unspammed." +#: bp-activity/bp-activity-admin.php:834 +msgid "%s activity item has been successfully unspammed." msgid_plural "%s activity items have been successfully unspammed." msgstr[0] "" msgstr[1] "" -#: bp-activity/bp-activity-admin.php:819 -msgid "The activity has been updated succesfully." +#: bp-activity/bp-activity-admin.php:837 +msgid "The activity item has been updated succesfully." msgstr "" -#: bp-activity/bp-activity-admin.php:833 +#: bp-activity/bp-activity-admin.php:850 msgid "Activity related to ID #%s" msgstr "" -#: bp-activity/bp-activity-admin.php:839 +#: bp-activity/bp-activity-admin.php:856 bp-groups/bp-groups-admin.php:625 msgid "Search results for “%s”" msgstr "" -#: bp-activity/bp-activity-admin.php:852 +#: bp-activity/bp-activity-admin.php:869 msgid "Search all Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:863 +#: bp-activity/bp-activity-admin.php:880 msgid "Reply to Activity" msgstr "" -#: bp-activity/bp-activity-admin.php:867 +#: bp-activity/bp-activity-admin.php:884 bp-groups/bp-groups-admin.php:585 +#: bp-templates/bp-legacy/buddypress/activity/entry.php:102 +#: bp-templates/bp-legacy/buddypress/forums/index.php:116 #: bp-themes/bp-default/forums/index.php:134 -#: bp-xprofile/bp-xprofile-classes.php:405 -#: bp-xprofile/bp-xprofile-classes.php:913 +#: bp-xprofile/bp-xprofile-classes.php:406 +#: bp-xprofile/bp-xprofile-classes.php:929 msgid "Cancel" msgstr "" -#: bp-activity/bp-activity-admin.php:868 bp-activity/bp-activity-admin.php:1273 -#: bp-themes/bp-default/activity/comment.php:37 +#: bp-activity/bp-activity-admin.php:885 bp-activity/bp-activity-admin.php:1278 +#: bp-templates/bp-legacy/buddypress/activity/comment.php:37 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:10 +#: bp-themes/bp-default/activity/comment.php:40 #: bp-themes/bp-default/groups/single/forum/edit.php:10 msgid "Reply" msgstr "" -#: bp-activity/bp-activity-admin.php:1051 +#: bp-activity/bp-activity-admin.php:1069 msgid "No activities found." msgstr "" -#: bp-activity/bp-activity-admin.php:1111 -#: bp-messages/bp-messages-template.php:440 +#: bp-activity/bp-activity-admin.php:1133 bp-groups/bp-groups-admin.php:1138 +#: bp-messages/bp-messages-template.php:434 msgid "All" msgstr "" -#: bp-activity/bp-activity-admin.php:1112 +#: bp-activity/bp-activity-admin.php:1134 msgid "Spam <span class=\"count\">(%s)</span>" msgstr "" -#: bp-activity/bp-activity-admin.php:1127 +#: bp-activity/bp-activity-admin.php:1149 msgid "Mark as Spam" msgstr "" -#: bp-activity/bp-activity-admin.php:1128 -#: bp-activity/bp-activity-admin.php:1281 +#: bp-activity/bp-activity-admin.php:1150 +#: bp-activity/bp-activity-admin.php:1286 msgid "Not Spam" msgstr "" -#: bp-activity/bp-activity-admin.php:1129 -#: bp-activity/bp-activity-admin.php:1286 +#: bp-activity/bp-activity-admin.php:1151 +#: bp-activity/bp-activity-admin.php:1291 bp-groups/bp-groups-admin.php:584 msgid "Delete Permanently" msgstr "" -#: bp-activity/bp-activity-admin.php:1144 +#: bp-activity/bp-activity-admin.php:1166 msgid "Author" msgstr "" -#: bp-activity/bp-activity-admin.php:1146 +#: bp-activity/bp-activity-admin.php:1168 msgid "In Response To" msgstr "" -#: bp-activity/bp-activity-admin.php:1201 +#: bp-activity/bp-activity-admin.php:1206 msgid "Show all activity types" msgstr "" -#: bp-activity/bp-activity-admin.php:1208 +#: bp-activity/bp-activity-admin.php:1213 msgid "Filter" msgstr "" -#: bp-activity/bp-activity-admin.php:1286 bp-core/bp-core-cssjs.php:17 +#: bp-activity/bp-activity-admin.php:1291 bp-core/bp-core-cssjs.php:20 msgid "Are you sure?" msgstr "" #. translators: 2: activity admin ui date/time -#: bp-activity/bp-activity-admin.php:1295 +#: bp-activity/bp-activity-admin.php:1300 msgid "Submitted on <a href=\"%1$s\">%2$s at %3$s</a>" msgstr "" -#: bp-activity/bp-activity-admin.php:1324 +#: bp-activity/bp-activity-admin.php:1330 msgid "%s related activity" msgid_plural "%s related activities" msgstr[0] "" msgstr[1] "" -#: bp-activity/bp-activity-admin.php:1335 +#: bp-activity/bp-activity-admin.php:1341 msgid "<a href=\"%1$s\">View Activity</a>" msgstr "" @@ -437,53 +463,54 @@ msgctxt "x hours ago - akismet cleared this item" msgid "<span>%1$s</span> — %2$s" msgstr "" -#: bp-activity/bp-activity-classes.php:122 -#: bp-activity/bp-activity-template.php:120 +#: bp-activity/bp-activity-classes.php:120 +#: bp-activity/bp-activity-template.php:120 bp-groups/bp-groups-classes.php:313 +#: bp-groups/bp-groups-template.php:114 msgid "Arguments passed to %1$s should be in an associative array. See the inline documentation at %2$s for more details." msgstr "" -#: bp-activity/bp-activity-filters.php:321 +#: bp-activity/bp-activity-filters.php:348 msgid "[Read more]" msgstr "" -#: bp-activity/bp-activity-filters.php:326 +#: bp-activity/bp-activity-filters.php:353 msgid "…" msgstr "" -#: bp-activity/bp-activity-functions.php:149 +#: bp-activity/bp-activity-functions.php:199 msgid "@%s Mentions" msgstr "" -#: bp-activity/bp-activity-functions.php:152 +#: bp-activity/bp-activity-functions.php:202 msgid "You have %1$d new mentions" msgstr "" -#: bp-activity/bp-activity-functions.php:156 +#: bp-activity/bp-activity-functions.php:206 msgid "%1$s mentioned you" msgstr "" -#: bp-activity/bp-activity-functions.php:767 +#: bp-activity/bp-activity-functions.php:843 msgid "Posted a status update" msgstr "" -#: bp-activity/bp-activity-functions.php:768 +#: bp-activity/bp-activity-functions.php:844 msgid "Replied to a status update" msgstr "" -#: bp-activity/bp-activity-functions.php:1016 +#: bp-activity/bp-activity-functions.php:1092 msgid "%s posted an update" msgstr "" -#: bp-activity/bp-activity-functions.php:1085 +#: bp-activity/bp-activity-functions.php:1161 msgid "%s posted a new activity comment" msgstr "" -#: bp-activity/bp-activity-functions.php:1458 +#: bp-activity/bp-activity-functions.php:1536 msgid "Thumbnail" msgstr "" #: bp-activity/bp-activity-loader.php:30 -#: bp-core/admin/bp-core-components.php:83 +#: bp-core/admin/bp-core-components.php:372 msgid "Activity Streams" msgstr "" @@ -491,71 +518,77 @@ msgstr "" msgid "Search Activity..." msgstr "" -#: bp-activity/bp-activity-loader.php:143 -#: bp-activity/bp-activity-loader.php:257 +#: bp-activity/bp-activity-loader.php:144 +#: bp-activity/bp-activity-loader.php:258 msgid "Personal" msgstr "" #. translators: Mentions RSS title - "[Site Name] | [Displayed User Name] | #. Mentions" -#: bp-activity/bp-activity-loader.php:153 -#: bp-activity/bp-activity-loader.php:234 -#: bp-activity/feeds/bp-activity-mentions-feed.php:28 +#: bp-activity/bp-activity-loader.php:154 +#: bp-activity/bp-activity-loader.php:235 +#: bp-activity/feeds/bp-activity-mentions-feed.php:27 +#: bp-templates/bp-legacy/buddypress/activity/index.php:57 #: bp-themes/bp-default/activity/index.php:77 msgid "Mentions" msgstr "" -#: bp-activity/bp-activity-loader.php:164 -#: bp-activity/bp-activity-loader.php:265 +#: bp-activity/bp-activity-loader.php:165 +#: bp-activity/bp-activity-loader.php:266 msgid "Favorites" msgstr "" -#: bp-activity/bp-activity-loader.php:176 -#: bp-activity/bp-activity-loader.php:274 bp-friends/bp-friends-loader.php:155 +#: bp-activity/bp-activity-loader.php:177 +#: bp-activity/bp-activity-loader.php:275 bp-friends/bp-friends-loader.php:164 #: bp-friends/bp-friends-screens.php:83 msgid "Friends" msgstr "" -#: bp-activity/bp-activity-loader.php:189 -#: bp-activity/bp-activity-loader.php:284 bp-core/admin/bp-core-update.php:354 -#: bp-core/bp-core-template.php:260 bp-groups/bp-groups-activity.php:143 -#: bp-groups/bp-groups-activity.php:179 bp-groups/bp-groups-activity.php:215 -#: bp-groups/bp-groups-activity.php:251 bp-groups/bp-groups-loader.php:502 -#: bp-groups/bp-groups-screens.php:844 bp-groups/bp-groups-widgets.php:28 -#: bp-groups/bp-groups-widgets.php:48 bp-groups/bp-groups-widgets.php:119 +#: bp-activity/bp-activity-loader.php:190 +#: bp-activity/bp-activity-loader.php:285 bp-core/bp-core-template.php:246 +#: bp-groups/bp-groups-activity.php:143 bp-groups/bp-groups-activity.php:179 +#: bp-groups/bp-groups-activity.php:215 bp-groups/bp-groups-activity.php:251 +#: bp-groups/bp-groups-admin.php:35 bp-groups/bp-groups-admin.php:36 +#: bp-groups/bp-groups-admin.php:622 bp-groups/bp-groups-loader.php:517 +#: bp-groups/bp-groups-screens.php:893 bp-groups/bp-groups-screens.php:999 +#: bp-groups/bp-groups-screens.php:1001 bp-groups/bp-groups-screens.php:1037 +#: bp-groups/bp-groups-screens.php:1039 bp-groups/bp-groups-widgets.php:48 +#: bp-groups/bp-groups-widgets.php:117 msgid "Groups" msgstr "" -#: bp-activity/bp-activity-loader.php:232 +#: bp-activity/bp-activity-loader.php:233 msgid "Mentions <span class=\"count\">%s</span>" msgstr "" -#: bp-activity/bp-activity-loader.php:309 +#: bp-activity/bp-activity-loader.php:310 msgid "My Activity" msgstr "" -#: bp-activity/bp-activity-loader.php:314 -#: bp-activity/bp-activity-template.php:968 -#: bp-activity/bp-activity-template.php:1089 -#: bp-activity/bp-activity-template.php:1099 bp-blogs/bp-blogs-loader.php:200 -#: bp-forums/bp-forums-loader.php:238 bp-forums/bp-forums-template.php:487 +#: bp-activity/bp-activity-loader.php:315 +#: bp-activity/bp-activity-template.php:975 +#: bp-activity/bp-activity-template.php:1111 +#: bp-activity/bp-activity-template.php:1122 bp-blogs/bp-blogs-loader.php:209 +#: bp-forums/bp-forums-loader.php:212 bp-forums/bp-forums-template.php:487 #: bp-forums/bp-forums-template.php:604 bp-forums/bp-forums-template.php:1200 -#: bp-friends/bp-friends-loader.php:203 bp-groups/bp-groups-loader.php:557 -#: bp-groups/bp-groups-template.php:570 bp-groups/bp-groups-template.php:593 -#: bp-groups/bp-groups-template.php:1030 bp-groups/bp-groups-template.php:1046 -#: bp-groups/bp-groups-template.php:1095 bp-groups/bp-groups-template.php:1111 -#: bp-groups/bp-groups-template.php:1801 bp-groups/bp-groups-template.php:1810 -#: bp-groups/bp-groups-template.php:1819 bp-groups/bp-groups-template.php:2567 -#: bp-members/bp-members-buddybar.php:90 bp-members/bp-members-loader.php:197 -#: bp-members/bp-members-template.php:478 -#: bp-members/bp-members-template.php:778 -#: bp-members/bp-members-template.php:797 -#: bp-messages/bp-messages-loader.php:255 +#: bp-friends/bp-friends-loader.php:212 bp-groups/bp-groups-loader.php:572 +#: bp-groups/bp-groups-template.php:748 bp-groups/bp-groups-template.php:771 +#: bp-groups/bp-groups-template.php:1200 bp-groups/bp-groups-template.php:1216 +#: bp-groups/bp-groups-template.php:1265 bp-groups/bp-groups-template.php:1281 +#: bp-groups/bp-groups-template.php:1992 bp-groups/bp-groups-template.php:2001 +#: bp-groups/bp-groups-template.php:2010 bp-groups/bp-groups-template.php:2758 +#: bp-members/bp-members-buddybar.php:90 bp-members/bp-members-loader.php:198 +#: bp-members/bp-members-template.php:519 +#: bp-members/bp-members-template.php:819 +#: bp-members/bp-members-template.php:838 +#: bp-messages/bp-messages-loader.php:264 #: bp-messages/bp-messages-template.php:326 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:185 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:212 #: bp-themes/bp-default/groups/single/admin.php:185 #: bp-themes/bp-default/groups/single/admin.php:212 -#: bp-xprofile/bp-xprofile-loader.php:262 +#: bp-xprofile/bp-xprofile-loader.php:277 msgid "Profile picture of %s" msgstr "" @@ -563,7 +596,7 @@ msgstr "" msgid "%s mentioned you in an update" msgstr "" -#: bp-activity/bp-activity-notifications.php:77 bp-core/deprecated/1.5.php:337 +#: bp-activity/bp-activity-notifications.php:77 bp-core/deprecated/1.5.php:354 msgid "" "%1$s mentioned you in the group \"%2$s\":\n" "\n" @@ -585,25 +618,25 @@ msgid "" "---------------------\n" msgstr "" -#: bp-activity/bp-activity-notifications.php:98 -#: bp-activity/bp-activity-notifications.php:175 -#: bp-activity/bp-activity-notifications.php:221 bp-core/deprecated/1.5.php:347 +#: bp-activity/bp-activity-notifications.php:100 +#: bp-activity/bp-activity-notifications.php:178 +#: bp-activity/bp-activity-notifications.php:226 bp-core/deprecated/1.5.php:364 #: bp-friends/bp-friends-notifications.php:44 -#: bp-friends/bp-friends-notifications.php:81 -#: bp-groups/bp-groups-notifications.php:43 +#: bp-friends/bp-friends-notifications.php:82 +#: bp-groups/bp-groups-notifications.php:42 #: bp-groups/bp-groups-notifications.php:92 -#: bp-groups/bp-groups-notifications.php:148 -#: bp-groups/bp-groups-notifications.php:195 -#: bp-groups/bp-groups-notifications.php:249 -#: bp-messages/bp-messages-notifications.php:60 +#: bp-groups/bp-groups-notifications.php:150 +#: bp-groups/bp-groups-notifications.php:198 +#: bp-groups/bp-groups-notifications.php:254 +#: bp-messages/bp-messages-notifications.php:66 msgid "To disable these notifications please log in and go to: %s" msgstr "" -#: bp-activity/bp-activity-notifications.php:163 +#: bp-activity/bp-activity-notifications.php:165 msgid "%s replied to one of your updates" msgstr "" -#: bp-activity/bp-activity-notifications.php:165 +#: bp-activity/bp-activity-notifications.php:166 msgid "" "%1$s replied to one of your updates:\n" "\n" @@ -614,11 +647,11 @@ msgid "" "---------------------\n" msgstr "" -#: bp-activity/bp-activity-notifications.php:206 +#: bp-activity/bp-activity-notifications.php:209 msgid "%s replied to one of your comments" msgstr "" -#: bp-activity/bp-activity-notifications.php:211 +#: bp-activity/bp-activity-notifications.php:214 msgid "" "%1$s replied to one of your comments:\n" "\n" @@ -633,19 +666,23 @@ msgstr "" msgid "You do not have access to this activity." msgstr "" -#: bp-activity/bp-activity-screens.php:279 bp-blogs/bp-blogs-template.php:499 -#: bp-friends/bp-friends-screens.php:84 bp-groups/bp-groups-screens.php:845 -#: bp-messages/bp-messages-screens.php:149 +#: bp-activity/bp-activity-screens.php:279 bp-blogs/bp-blogs-template.php:683 +#: bp-friends/bp-friends-screens.php:84 bp-groups/bp-groups-screens.php:894 +#: bp-messages/bp-messages-screens.php:169 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:26 +#: bp-templates/bp-legacy/buddypress/members/register.php:223 #: bp-themes/bp-default/groups/single/admin.php:26 -#: bp-themes/bp-default/registration/register.php:227 +#: bp-themes/bp-default/registration/register.php:228 msgid "Yes" msgstr "" -#: bp-activity/bp-activity-screens.php:280 bp-blogs/bp-blogs-template.php:503 -#: bp-friends/bp-friends-screens.php:85 bp-groups/bp-groups-screens.php:846 -#: bp-messages/bp-messages-screens.php:150 +#: bp-activity/bp-activity-screens.php:280 bp-blogs/bp-blogs-template.php:687 +#: bp-friends/bp-friends-screens.php:85 bp-groups/bp-groups-screens.php:895 +#: bp-messages/bp-messages-screens.php:170 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:27 +#: bp-templates/bp-legacy/buddypress/members/register.php:224 #: bp-themes/bp-default/groups/single/admin.php:27 -#: bp-themes/bp-default/registration/register.php:228 +#: bp-themes/bp-default/registration/register.php:229 msgid "No" msgstr "" @@ -657,6 +694,10 @@ msgstr "" msgid "A member replies to an update or comment you've posted" msgstr "" +#: bp-activity/bp-activity-screens.php:364 +msgid "Sitewide Activity" +msgstr "" + #: bp-activity/bp-activity-template.php:220 msgctxt "Activity pagination previous text" msgid "←" @@ -667,152 +708,159 @@ msgctxt "Activity pagination next text" msgid "→" msgstr "" -#: bp-activity/bp-activity-template.php:523 +#: bp-activity/bp-activity-template.php:526 msgid "Viewing item %1$s to %2$s (of %3$s items)" msgstr "" -#: bp-activity/bp-activity-template.php:968 +#: bp-activity/bp-activity-template.php:975 msgid "Profile picture" msgstr "" -#: bp-activity/bp-activity-template.php:1065 +#: bp-activity/bp-activity-template.php:1087 msgid "Group logo" msgstr "" -#: bp-activity/bp-activity-template.php:1070 -#: bp-groups/bp-groups-template.php:391 +#: bp-activity/bp-activity-template.php:1090 bp-groups/bp-groups-admin.php:1262 +#: bp-groups/bp-groups-template.php:494 msgid "Group logo of %s" msgstr "" -#: bp-activity/bp-activity-template.php:1080 +#: bp-activity/bp-activity-template.php:1101 msgid "Profile picture of the author of the site %s" msgstr "" -#: bp-activity/bp-activity-template.php:1270 +#: bp-activity/bp-activity-template.php:1326 msgid "View Discussion" msgstr "" -#: bp-activity/bp-activity-template.php:2065 -#: bp-forums/bp-forums-template.php:1271 bp-groups/bp-groups-template.php:1294 -#: bp-themes/bp-default/activity/comment.php:43 +#: bp-activity/bp-activity-template.php:2167 +#: bp-forums/bp-forums-template.php:1271 bp-groups/bp-groups-admin.php:1156 +#: bp-groups/bp-groups-admin.php:1251 bp-groups/bp-groups-template.php:1464 +#: bp-templates/bp-legacy/buddypress/activity/comment.php:43 +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:51 +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:24 +#: bp-themes/bp-default/activity/comment.php:46 #: bp-themes/bp-default/members/single/messages/messages-loop.php:51 #: bp-themes/bp-default/members/single/messages/single.php:24 #: bp-xprofile/bp-xprofile-admin.php:460 msgid "Delete" msgstr "" -#: bp-activity/bp-activity-template.php:2112 -#: bp-core/admin/bp-core-slugs.php:112 bp-core/admin/bp-core-slugs.php:173 -#: bp-members/bp-members-template.php:583 +#: bp-activity/bp-activity-template.php:2214 +#: bp-core/admin/bp-core-slugs.php:109 bp-core/admin/bp-core-slugs.php:172 +#: bp-core/bp-core-loader.php:225 bp-members/bp-members-loader.php:172 +#: bp-members/bp-members-template.php:624 +#: bp-templates/bp-legacy/buddypress-functions.php:258 #: bp-themes/bp-default/activity/entry.php:37 #: bp-themes/bp-default/functions.php:165 -#: bp-xprofile/bp-xprofile-loader.php:222 +#: bp-xprofile/bp-xprofile-loader.php:175 +#: bp-xprofile/bp-xprofile-loader.php:237 msgid "View" msgstr "" -#: bp-activity/bp-activity-template.php:2206 +#: bp-activity/bp-activity-template.php:2308 msgid "Clear Filter" msgstr "" -#: bp-activity/bp-activity-template.php:2389 +#: bp-activity/bp-activity-template.php:2491 msgid "a user" msgstr "" -#: bp-activity/bp-activity-template.php:2429 +#: bp-activity/bp-activity-template.php:2531 msgid "Send a public message on your activity stream." msgstr "" -#: bp-activity/bp-activity-template.php:2430 +#: bp-activity/bp-activity-template.php:2532 msgid "Public Message" msgstr "" -#: bp-activity/bp-activity-template.php:2737 +#: bp-activity/bp-activity-template.php:2954 msgid "Site Wide Activity RSS Feed" msgstr "" #. translators: Favorited activity RSS title - "[Site Name] | [Displayed User #. Name] | Favorite Activity" -#: bp-activity/feeds/bp-activity-favorites-feed.php:28 +#: bp-activity/feeds/bp-activity-favorites-feed.php:27 msgid "Favorite Activity" msgstr "" -#: bp-activity/feeds/bp-activity-favorites-feed.php:31 +#: bp-activity/feeds/bp-activity-favorites-feed.php:30 msgid "%s - Favorite Activity" msgstr "" -#: bp-activity/feeds/bp-activity-favorites-feed.php:57 -#: bp-activity/feeds/bp-activity-friends-feed.php:50 -#: bp-activity/feeds/bp-activity-group-feed.php:50 -#: bp-activity/feeds/bp-activity-mentions-feed.php:51 -#: bp-activity/feeds/bp-activity-mygroups-feed.php:56 -#: bp-activity/feeds/bp-activity-personal-feed.php:50 -#: bp-activity/feeds/bp-activity-sitewide-feed.php:50 +#: bp-activity/feeds/bp-activity-favorites-feed.php:56 +#: bp-activity/feeds/bp-activity-friends-feed.php:49 +#: bp-activity/feeds/bp-activity-group-feed.php:49 +#: bp-activity/feeds/bp-activity-mentions-feed.php:50 +#: bp-activity/feeds/bp-activity-mygroups-feed.php:55 +#: bp-activity/feeds/bp-activity-personal-feed.php:49 +#: bp-activity/feeds/bp-activity-sitewide-feed.php:49 msgid "Comments: %s" msgstr "" -#: bp-activity/feeds/bp-activity-favorites-feed.php:61 -#: bp-activity/feeds/bp-activity-friends-feed.php:54 -#: bp-activity/feeds/bp-activity-mentions-feed.php:55 -#: bp-activity/feeds/bp-activity-personal-feed.php:54 +#: bp-activity/feeds/bp-activity-favorites-feed.php:60 +#: bp-activity/feeds/bp-activity-friends-feed.php:53 +#: bp-activity/feeds/bp-activity-mentions-feed.php:54 +#: bp-activity/feeds/bp-activity-personal-feed.php:53 msgid "In reply to" msgstr "" #. translators: Member friends activity RSS title - "[Site Name] | Friends #. Activity" -#: bp-activity/feeds/bp-activity-friends-feed.php:28 +#: bp-activity/feeds/bp-activity-friends-feed.php:27 msgid "Friends Activity" msgstr "" -#: bp-activity/feeds/bp-activity-friends-feed.php:31 +#: bp-activity/feeds/bp-activity-friends-feed.php:30 msgid "%s - Friends Activity Feed" msgstr "" #. translators: Single group activity RSS title - "[Site Name] | [Group Name] | #. Group Activity" -#: bp-activity/feeds/bp-activity-group-feed.php:28 +#: bp-activity/feeds/bp-activity-group-feed.php:27 msgid "Group Activity" msgstr "" -#: bp-activity/feeds/bp-activity-group-feed.php:31 +#: bp-activity/feeds/bp-activity-group-feed.php:30 msgid "%s - Group Activity Feed" msgstr "" #. translators: Mentions RSS title - "[Site Name] | [Displayed User Name] | #. Mentions" -#: bp-activity/feeds/bp-activity-mentions-feed.php:32 +#: bp-activity/feeds/bp-activity-mentions-feed.php:31 msgid "%s - Mentions" msgstr "" #. translators: Member groups activity RSS title - "[Site Name] | [Displayed #. User Name] | My Groups - Public Activity" -#: bp-activity/feeds/bp-activity-mygroups-feed.php:28 +#: bp-activity/feeds/bp-activity-mygroups-feed.php:27 msgid "My Groups - Public Activity" msgstr "" #. translators: Member groups activity RSS description - "[Displayed user name] #. - My Groups - Public Activity" -#: bp-activity/feeds/bp-activity-mygroups-feed.php:32 +#: bp-activity/feeds/bp-activity-mygroups-feed.php:31 msgid "%1$s - My Groups - Public Activity" msgstr "" -#: bp-activity/feeds/bp-activity-personal-feed.php:31 +#: bp-activity/feeds/bp-activity-personal-feed.php:30 msgid "%s - Activity Feed" msgstr "" #. translators: Sitewide activity RSS title - "[Site Name] | Site Wide #. Activity" -#: bp-activity/feeds/bp-activity-sitewide-feed.php:28 +#: bp-activity/feeds/bp-activity-sitewide-feed.php:27 msgid "Site Wide Activity" msgstr "" -#: bp-activity/feeds/bp-activity-sitewide-feed.php:31 +#: bp-activity/feeds/bp-activity-sitewide-feed.php:30 msgid "Site Wide Activity Feed" msgstr "" @@ -828,24 +876,24 @@ msgstr "" msgid "New post comment posted" msgstr "" -#: bp-blogs/bp-blogs-buddybar.php:43 bp-blogs/bp-blogs-loader.php:122 -#: bp-blogs/bp-blogs-loader.php:170 bp-blogs/bp-blogs-loader.php:191 +#: bp-blogs/bp-blogs-buddybar.php:43 bp-blogs/bp-blogs-loader.php:131 +#: bp-blogs/bp-blogs-loader.php:179 bp-blogs/bp-blogs-loader.php:200 msgid "My Sites" msgstr "" -#: bp-blogs/bp-blogs-buddybar.php:55 bp-core/bp-core-buddybar.php:545 +#: bp-blogs/bp-blogs-buddybar.php:55 bp-core/bp-core-buddybar.php:548 msgid "Dashboard" msgstr "" -#: bp-blogs/bp-blogs-buddybar.php:56 bp-core/bp-core-buddybar.php:549 +#: bp-blogs/bp-blogs-buddybar.php:56 bp-core/bp-core-buddybar.php:552 msgid "New Post" msgstr "" -#: bp-blogs/bp-blogs-buddybar.php:57 bp-core/bp-core-buddybar.php:550 +#: bp-blogs/bp-blogs-buddybar.php:57 bp-core/bp-core-buddybar.php:553 msgid "Manage Posts" msgstr "" -#: bp-blogs/bp-blogs-buddybar.php:58 bp-core/bp-core-buddybar.php:551 +#: bp-blogs/bp-blogs-buddybar.php:58 bp-core/bp-core-buddybar.php:554 msgid "Manage Comments" msgstr "" @@ -853,27 +901,27 @@ msgstr "" msgid "Create a Site!" msgstr "" -#: bp-blogs/bp-blogs-functions.php:110 +#: bp-blogs/bp-blogs-functions.php:175 msgid "%s created the site %s" msgstr "" -#: bp-blogs/bp-blogs-functions.php:183 +#: bp-blogs/bp-blogs-functions.php:252 msgid "%1$s wrote a new post, %2$s, on the site %3$s" msgstr "" -#: bp-blogs/bp-blogs-functions.php:185 +#: bp-blogs/bp-blogs-functions.php:254 msgid "%1$s wrote a new post, %2$s" msgstr "" -#: bp-blogs/bp-blogs-functions.php:287 +#: bp-blogs/bp-blogs-functions.php:361 msgid "%1$s commented on the post, %2$s, on the site %3$s" msgstr "" -#: bp-blogs/bp-blogs-functions.php:289 +#: bp-blogs/bp-blogs-functions.php:363 msgid "%1$s commented on the post, %2$s" msgstr "" -#: bp-blogs/bp-blogs-loader.php:25 bp-core/admin/bp-core-components.php:95 +#: bp-blogs/bp-blogs-loader.php:25 bp-core/admin/bp-core-components.php:384 msgid "Site Tracking" msgstr "" @@ -885,134 +933,148 @@ msgstr "" msgid "Sites <span>%d</span>" msgstr "" -#: bp-blogs/bp-blogs-loader.php:162 +#: bp-blogs/bp-blogs-loader.php:171 msgid "Sites" msgstr "" -#: bp-blogs/bp-blogs-template.php:138 +#: bp-blogs/bp-blogs-screens.php:110 bp-blogs/bp-blogs-screens.php:112 +#: bp-blogs/bp-blogs-screens.php:148 bp-blogs/bp-blogs-screens.php:150 +#: bp-core/bp-core-template.php:249 +msgid "Blogs" +msgstr "" + +#: bp-blogs/bp-blogs-screens.php:110 bp-blogs/bp-blogs-screens.php:148 +msgid "Create a Blog" +msgstr "" + +#: bp-blogs/bp-blogs-template.php:136 msgctxt "Blog pagination previous text" msgid "←" msgstr "" -#: bp-blogs/bp-blogs-template.php:139 +#: bp-blogs/bp-blogs-template.php:137 msgctxt "Blog pagination next text" msgid "→" msgstr "" -#: bp-blogs/bp-blogs-template.php:263 +#: bp-blogs/bp-blogs-template.php:261 msgid "Viewing site %1$s to %2$s (of %3$s sites)" msgstr "" -#: bp-blogs/bp-blogs-template.php:287 +#: bp-blogs/bp-blogs-template.php:285 msgid "Profile picture of site author %s" msgstr "" -#: bp-blogs/bp-blogs-template.php:350 bp-core/bp-core-classes.php:177 -#: bp-groups/bp-groups-widgets.php:80 bp-groups/bp-groups-widgets.php:185 -#: bp-members/bp-members-template.php:554 -#: bp-members/bp-members-template.php:829 +#: bp-blogs/bp-blogs-template.php:403 bp-core/bp-core-classes.php:718 +#: bp-groups/bp-groups-widgets.php:78 bp-groups/bp-groups-widgets.php:181 +#: bp-members/bp-members-template.php:595 +#: bp-members/bp-members-template.php:870 +#: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:47 +#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:42 #: bp-themes/bp-default/groups/groups-loop.php:47 #: bp-themes/bp-default/groups/single/group-header.php:42 msgid "active %s" msgstr "" -#: bp-blogs/bp-blogs-template.php:362 +#: bp-blogs/bp-blogs-template.php:415 msgid "Latest Post: %s" msgstr "" -#: bp-blogs/bp-blogs-template.php:425 +#: bp-blogs/bp-blogs-template.php:609 msgid "There was a problem, please correct the form below and try again." msgstr "" -#: bp-blogs/bp-blogs-template.php:428 +#: bp-blogs/bp-blogs-template.php:612 msgid "By filling out the form below, you can <strong>add a site to your account</strong>. There is no limit to the number of sites that you can have, so create to your heart's content, but blog responsibly!" msgstr "" -#: bp-blogs/bp-blogs-template.php:430 +#: bp-blogs/bp-blogs-template.php:614 msgid "If you’re not going to use a great domain, leave it for a new user. Now have at it!" msgstr "" -#: bp-blogs/bp-blogs-template.php:439 +#: bp-blogs/bp-blogs-template.php:623 msgid "Create Site" msgstr "" -#: bp-blogs/bp-blogs-template.php:453 +#: bp-blogs/bp-blogs-template.php:637 msgid "Site Name:" msgstr "" -#: bp-blogs/bp-blogs-template.php:455 +#: bp-blogs/bp-blogs-template.php:639 msgid "Site Domain:" msgstr "" -#: bp-blogs/bp-blogs-template.php:469 +#: bp-blogs/bp-blogs-template.php:653 msgid "Your address will be " msgstr "" -#: bp-blogs/bp-blogs-template.php:472 +#: bp-blogs/bp-blogs-template.php:656 msgid "blogname" msgstr "" -#: bp-blogs/bp-blogs-template.php:474 +#: bp-blogs/bp-blogs-template.php:658 msgid "domain." msgstr "" -#: bp-blogs/bp-blogs-template.php:477 +#: bp-blogs/bp-blogs-template.php:661 msgid "Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)" msgstr "" -#: bp-blogs/bp-blogs-template.php:483 +#: bp-blogs/bp-blogs-template.php:667 msgid "Site Title:" msgstr "" -#: bp-blogs/bp-blogs-template.php:494 +#: bp-blogs/bp-blogs-template.php:678 msgid "Privacy:" msgstr "" -#: bp-blogs/bp-blogs-template.php:495 -#: bp-themes/bp-default/registration/register.php:224 +#: bp-blogs/bp-blogs-template.php:679 +#: bp-templates/bp-legacy/buddypress/members/register.php:220 +#: bp-themes/bp-default/registration/register.php:225 msgid "I would like my site to appear in search engines, and in public listings around this network." msgstr "" -#: bp-blogs/bp-blogs-template.php:578 +#: bp-blogs/bp-blogs-template.php:762 msgid "Congratulations! You have successfully registered a new site." msgstr "" -#: bp-blogs/bp-blogs-template.php:580 +#: bp-blogs/bp-blogs-template.php:764 msgid "<a href=\"%1$s\">%2$s</a> is your new site. <a href=\"%3$s\">Login</a> as \"%4$s\" using your existing password." msgstr "" -#: bp-blogs/bp-blogs-template.php:589 bp-core/bp-core-filters.php:348 +#: bp-blogs/bp-blogs-template.php:773 bp-core/bp-core-filters.php:377 #: bp-themes/bp-default/blogs/create.php:21 #: bp-themes/bp-default/blogs/index.php:21 msgid "Create a Site" msgstr "" -#: bp-blogs/bp-blogs-template.php:601 +#: bp-blogs/bp-blogs-template.php:785 msgid "%s's Sites" msgstr "" -#: bp-blogs/bp-blogs-template.php:602 +#: bp-blogs/bp-blogs-template.php:786 msgid "%s's Recent Posts" msgstr "" -#: bp-blogs/bp-blogs-template.php:603 +#: bp-blogs/bp-blogs-template.php:787 msgid "%s's Recent Comments" msgstr "" -#: bp-blogs/bp-blogs-template.php:617 bp-core/deprecated/1.5.php:397 -#: bp-forums/bp-forums-template.php:1321 bp-groups/bp-groups-template.php:2292 -#: bp-members/bp-members-template.php:668 -#: bp-messages/bp-messages-template.php:373 bp-themes/bp-default/header.php:30 +#: bp-blogs/bp-blogs-template.php:803 bp-core/deprecated/1.5.php:417 +#: bp-forums/bp-forums-template.php:1321 bp-groups/bp-groups-template.php:2483 +#: bp-members/bp-members-template.php:709 +#: bp-messages/bp-messages-template.php:367 bp-themes/bp-default/header.php:30 #: bp-themes/bp-default/searchform.php:5 msgid "Search" msgstr "" -#: bp-blogs/bp-blogs-template.php:650 bp-blogs/bp-blogs-template.php:651 +#: bp-blogs/bp-blogs-template.php:836 bp-blogs/bp-blogs-template.php:837 msgid "Visit Site" msgstr "" #: bp-blogs/bp-blogs-widgets.php:25 -msgid "Recent Networkwide Posts" +msgctxt "widget name" +msgid "(BuddyPress) Recent Networkwide Posts" msgstr "" #: bp-blogs/bp-blogs-widgets.php:67 @@ -1024,217 +1086,241 @@ msgid "Max posts to show:" msgstr "" #: bp-core/admin/bp-core-components.php:26 -#: bp-core/admin/bp-core-functions.php:365 bp-core/admin/bp-core-update.php:57 -#: bp-core/admin/bp-core-update.php:69 bp-core/admin/bp-core-update.php:201 +#: bp-core/admin/bp-core-functions.php:356 msgid "Components" msgstr "" #: bp-core/admin/bp-core-components.php:32 +#: bp-core/admin/bp-core-settings.php:267 bp-core/admin/bp-core-slugs.php:32 msgid "Save Settings" msgstr "" -#: bp-core/admin/bp-core-components.php:67 +#: bp-core/admin/bp-core-components.php:59 +#: bp-core/admin/bp-core-components.php:356 #: bp-xprofile/bp-xprofile-loader.php:41 msgid "Extended Profiles" msgstr "" -#: bp-core/admin/bp-core-components.php:68 +#: bp-core/admin/bp-core-components.php:60 +#: bp-core/admin/bp-core-components.php:357 msgid "Customize your community with fully editable profile fields that allow your users to describe themselves." msgstr "" -#: bp-core/admin/bp-core-components.php:71 -msgid "Account Settings" -msgstr "" +#: bp-core/admin/bp-core-components.php:136 +msgctxt "plugins" +msgid "All <span class=\"count\">(%s)</span>" +msgid_plural "All <span class=\"count\">(%s)</span>" +msgstr[0] "" +msgstr[1] "" -#: bp-core/admin/bp-core-components.php:72 -msgid "Allow your users to modify their account and notification settings directly from within their profiles." -msgstr "" +#: bp-core/admin/bp-core-components.php:137 +msgid "Active <span class=\"count\">(%s)</span>" +msgid_plural "Active <span class=\"count\">(%s)</span>" +msgstr[0] "" +msgstr[1] "" -#: bp-core/admin/bp-core-components.php:75 bp-friends/bp-friends-loader.php:24 -msgid "Friend Connections" -msgstr "" +#: bp-core/admin/bp-core-components.php:138 +msgid "Inactive <span class=\"count\">(%s)</span>" +msgid_plural "Inactive <span class=\"count\">(%s)</span>" +msgstr[0] "" +msgstr[1] "" -#: bp-core/admin/bp-core-components.php:76 -msgid "Let your users make connections so they can track the activity of others and focus on the people they care about the most." -msgstr "" +#: bp-core/admin/bp-core-components.php:139 +msgid "Must-Use <span class=\"count\">(%s)</span>" +msgid_plural "Must-Use <span class=\"count\">(%s)</span>" +msgstr[0] "" +msgstr[1] "" -#: bp-core/admin/bp-core-components.php:79 -msgid "Private Messaging" +#: bp-core/admin/bp-core-components.php:140 +msgid "Retired <span class=\"count\">(%s)</span>" +msgid_plural "Retired <span class=\"count\">(%s)</span>" +msgstr[0] "" +msgstr[1] "" + +#: bp-core/admin/bp-core-components.php:147 +#: bp-core/admin/bp-core-components.php:155 +msgid "Component" msgstr "" -#: bp-core/admin/bp-core-components.php:80 -msgid "Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members." +#: bp-core/admin/bp-core-components.php:148 +#: bp-core/admin/bp-core-components.php:156 +msgid "Description" msgstr "" -#: bp-core/admin/bp-core-components.php:84 -msgid "Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support." +#: bp-core/admin/bp-core-components.php:181 +msgid "Select %s" msgstr "" -#: bp-core/admin/bp-core-components.php:87 bp-groups/bp-groups-loader.php:83 -msgid "User Groups" +#: bp-core/admin/bp-core-components.php:206 +msgid "No components found." msgstr "" -#: bp-core/admin/bp-core-components.php:88 -msgid "Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings." +#: bp-core/admin/bp-core-components.php:336 bp-core/bp-core-loader.php:27 +msgid "BuddyPress Core" msgstr "" -#: bp-core/admin/bp-core-components.php:91 bp-forums/bp-forums-loader.php:25 -msgid "Discussion Forums" +#: bp-core/admin/bp-core-components.php:337 +msgid "It‘s what makes <del>time travel</del> BuddyPress possible!" msgstr "" -#: bp-core/admin/bp-core-components.php:92 -msgid "Site-wide and Group forums allow for focused, bulletin-board style conversations. Powered by bbPress." +#: bp-core/admin/bp-core-components.php:340 +msgid "Community Members" msgstr "" -#: bp-core/admin/bp-core-components.php:96 -msgid "Record activity for new posts and comments from your site." +#: bp-core/admin/bp-core-components.php:341 +msgid "Everything in a BuddyPress community revolves around its members." msgstr "" -#: bp-core/admin/bp-core-components.php:102 -msgid "Record activity for new sites, posts, and comments across your network." +#: bp-core/admin/bp-core-components.php:348 +#: bp-templates/bp-legacy/buddypress/groups/create.php:105 +#: bp-themes/bp-default/groups/create.php:112 +msgid "Group Forums" msgstr "" -#: bp-core/admin/bp-core-components.php:108 bp-core/bp-core-loader.php:27 -msgid "BuddyPress Core" +#: bp-core/admin/bp-core-components.php:349 +msgid "BuddyPress Forums are retired. Use %s." msgstr "" -#: bp-core/admin/bp-core-components.php:109 -msgid "It‘s what makes <del>time travel</del> BuddyPress possible!" +#: bp-core/admin/bp-core-components.php:360 +msgid "Account Settings" msgstr "" -#: bp-core/admin/bp-core-components.php:112 -msgid "Community Members" +#: bp-core/admin/bp-core-components.php:361 +msgid "Allow your users to modify their account and notification settings directly from within their profiles." msgstr "" -#: bp-core/admin/bp-core-components.php:113 -msgid "Everything in a BuddyPress community revolves around its members." +#: bp-core/admin/bp-core-components.php:364 bp-friends/bp-friends-loader.php:24 +msgid "Friend Connections" msgstr "" -#: bp-core/admin/bp-core-components.php:179 -msgid "Available Components" +#: bp-core/admin/bp-core-components.php:365 +msgid "Let your users make connections so they can track the activity of others and focus on the people they care about the most." msgstr "" -#: bp-core/admin/bp-core-components.php:181 -msgid "Each component has a unique purpose, and your community may not need each one." +#: bp-core/admin/bp-core-components.php:368 +msgid "Private Messaging" msgstr "" -#: bp-core/admin/bp-core-components.php:186 -msgctxt "plugins" -msgid "All <span class=\"count\">(%s)</span>" -msgid_plural "All <span class=\"count\">(%s)</span>" -msgstr[0] "" -msgstr[1] "" +#: bp-core/admin/bp-core-components.php:369 +msgid "Allow your users to talk to each other directly and in private. Not just limited to one-on-one discussions, messages can be sent between any number of members." +msgstr "" -#: bp-core/admin/bp-core-components.php:187 -msgid "Active <span class=\"count\">(%s)</span>" -msgid_plural "Active <span class=\"count\">(%s)</span>" -msgstr[0] "" -msgstr[1] "" +#: bp-core/admin/bp-core-components.php:373 +msgid "Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support." +msgstr "" -#: bp-core/admin/bp-core-components.php:188 -msgid "Inactive <span class=\"count\">(%s)</span>" -msgid_plural "Inactive <span class=\"count\">(%s)</span>" -msgstr[0] "" -msgstr[1] "" +#: bp-core/admin/bp-core-components.php:376 bp-groups/bp-groups-loader.php:83 +msgid "User Groups" +msgstr "" -#: bp-core/admin/bp-core-components.php:189 -msgid "Must-Use <span class=\"count\">(%s)</span>" -msgid_plural "Must-Use <span class=\"count\">(%s)</span>" -msgstr[0] "" -msgstr[1] "" +#: bp-core/admin/bp-core-components.php:377 +msgid "Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings." +msgstr "" -#: bp-core/admin/bp-core-components.php:196 -#: bp-core/admin/bp-core-components.php:204 -msgid "Component" +#: bp-core/admin/bp-core-components.php:380 +msgid "Group Forums (Legacy)" msgstr "" -#: bp-core/admin/bp-core-components.php:197 -#: bp-core/admin/bp-core-components.php:205 -msgid "Description" +#: bp-core/admin/bp-core-components.php:381 +msgid "Group forums allow for focused, bulletin-board style conversations." msgstr "" -#: bp-core/admin/bp-core-components.php:230 -msgid "Select %s" +#: bp-core/admin/bp-core-components.php:385 +msgid "Record activity for new posts and comments from your site." msgstr "" -#: bp-core/admin/bp-core-components.php:255 -msgid "No components found." +#: bp-core/admin/bp-core-components.php:392 +msgid "Record activity for new sites, posts, and comments across your network." msgstr "" -#: bp-core/admin/bp-core-functions.php:113 +#: bp-core/admin/bp-core-functions.php:99 msgid "Why have all my BuddyPress menus disappeared?" msgstr "" -#: bp-core/admin/bp-core-functions.php:115 +#: bp-core/admin/bp-core-functions.php:101 msgid "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated." msgstr "" -#: bp-core/admin/bp-core-functions.php:116 +#: bp-core/admin/bp-core-functions.php:102 msgid "Components, Pages, Settings, and Forums, have been moved to <a href=\"%s\">Settings > BuddyPress</a>. Profile Fields has been moved into the <a href=\"%s\">Users</a> menu." msgstr "" -#: bp-core/admin/bp-core-functions.php:234 +#: bp-core/admin/bp-core-functions.php:216 msgid "<strong>BuddyPress is almost ready</strong>. You must <a href=\"%s\">update your permalink structure</a> to something other than the default for it to work." msgstr "" -#: bp-core/admin/bp-core-functions.php:253 -msgid "You'll need to <a href='%s'>activate a <strong>BuddyPress-compatible theme</strong></a> to take advantage of all of BuddyPress's features. We've bundled a default theme, but you can always <a href='%s'>install some other compatible themes</a> or <a href='%s'>update your existing WordPress theme</a>." -msgstr "" - -#: bp-core/admin/bp-core-functions.php:278 bp-core/admin/bp-core-slugs.php:139 -#: bp-core/admin/bp-core-update.php:439 -#: bp-messages/bp-messages-template.php:564 -#: bp-themes/bp-default/registration/activate.php:36 +#: bp-core/admin/bp-core-functions.php:240 bp-core/admin/bp-core-slugs.php:135 +#: bp-messages/bp-messages-template.php:558 +#: bp-templates/bp-legacy/buddypress/members/activate.php:29 +#: bp-themes/bp-default/registration/activate.php:38 msgid "Activate" msgstr "" -#: bp-core/admin/bp-core-functions.php:283 bp-core/admin/bp-core-slugs.php:138 -#: bp-core/admin/bp-core-update.php:425 bp-members/bp-members-adminbar.php:60 +#: bp-core/admin/bp-core-functions.php:245 bp-core/admin/bp-core-slugs.php:134 +#: bp-members/bp-members-adminbar.php:60 msgid "Register" msgstr "" -#: bp-core/admin/bp-core-functions.php:304 +#: bp-core/admin/bp-core-functions.php:270 msgid "The following active BuddyPress Components do not have associated WordPress Pages: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>" msgstr "" -#: bp-core/admin/bp-core-functions.php:329 +#: bp-core/admin/bp-core-functions.php:292 msgid "Each BuddyPress Component needs its own WordPress page. The following WordPress Pages have more than one component associated with them: %2$s. <a href=\"%1$s\" class=\"button-secondary\">Repair</a>" msgstr "" -#: bp-core/admin/bp-core-functions.php:342 -msgid "IMPORTANT: <a href=\"http://codex.buddypress.org/buddypress-site-administration/upgrading-buddypress/\">Read this before attempting to update BuddyPress</a>" -msgstr "" - -#: bp-core/admin/bp-core-functions.php:369 bp-core/admin/bp-core-slugs.php:26 -#: bp-core/admin/bp-core-update.php:58 bp-core/admin/bp-core-update.php:70 -#: bp-core/admin/bp-core-update.php:205 +#: bp-core/admin/bp-core-functions.php:360 bp-core/admin/bp-core-slugs.php:26 msgid "Pages" msgstr "" -#: bp-core/admin/bp-core-functions.php:373 -#: bp-core/admin/bp-core-settings.php:258 bp-core/bp-core-admin.php:374 -#: bp-groups/bp-groups-loader.php:298 bp-groups/bp-groups-template.php:1276 -#: bp-settings/bp-settings-loader.php:23 bp-settings/bp-settings-loader.php:78 -#: bp-settings/bp-settings-loader.php:169 +#: bp-core/admin/bp-core-functions.php:364 +#: bp-core/admin/bp-core-settings.php:258 bp-core/bp-core-admin.php:331 +#: bp-groups/bp-groups-loader.php:302 bp-groups/bp-groups-template.php:1446 +#: bp-settings/bp-settings-loader.php:23 bp-settings/bp-settings-loader.php:73 +#: bp-settings/bp-settings-loader.php:165 msgid "Settings" msgstr "" -#: bp-core/admin/bp-core-functions.php:381 bp-core/admin/bp-core-update.php:409 -#: bp-core/bp-core-template.php:266 bp-forums/bp-forums-admin.php:14 -#: bp-forums/bp-forums-admin.php:47 bp-forums/bp-forums-admin.php:314 -#: bp-forums/bp-forums-loader.php:111 bp-forums/bp-forums-loader.php:190 -#: bp-forums/bp-forums-loader.php:233 bp-forums/deprecated/1.6.php:24 -msgid "Forums" +#: bp-core/admin/bp-core-functions.php:409 +msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-components\">Managing Components</a>" msgstr "" -#: bp-core/admin/bp-core-schema.php:247 -msgctxt "First XProfile group name" -msgid "Base" +#: bp-core/admin/bp-core-functions.php:427 +msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-pages\">Managing Pages</a>" msgstr "" -#: bp-core/admin/bp-core-schema.php:251 -msgctxt "XProfile fullname field name" -msgid "Name" +#: bp-core/admin/bp-core-functions.php:446 +msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#settings-buddypress-settings\">Managing Settings</a>" +msgstr "" + +#: bp-core/admin/bp-core-functions.php:465 +msgid "<a href=\"http://codex.buddypress.org/getting-started/configure-buddypress-components/#users-profile-fields\">Managing Profile Fields</a>" +msgstr "" + +#: bp-core/admin/bp-core-functions.php:483 +msgid "By default, all BuddyPress components are enabled. You can selectively disable any of the components by using the form. Your BuddyPress installation will continue to function. However, the features of the disabled components will no longer be accessible to anyone using the site." +msgstr "" + +#: bp-core/admin/bp-core-functions.php:487 +msgid "BuddyPress Components use WordPress Pages for their root directory/archive pages. Here you can change the page associations for each active component." +msgstr "" + +#: bp-core/admin/bp-core-functions.php:491 +msgid "Extra configuration settings." +msgstr "" + +#: bp-core/admin/bp-core-functions.php:495 +msgid "Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.</br></br>Note: Any fields in the first group will appear on the signup page." +msgstr "" + +#: bp-core/admin/bp-core-schema.php:244 +msgctxt "First field-group name" +msgid "General" +msgstr "" + +#: bp-core/admin/bp-core-schema.php:248 +msgctxt "Display name field" +msgid "Display Name" msgstr "" #: bp-core/admin/bp-core-settings.php:31 @@ -1289,728 +1375,652 @@ msgstr "" msgid "Absolute path to your bbPress configuration file." msgstr "" -#: bp-core/admin/bp-core-settings.php:267 -#: bp-themes/bp-default/groups/single/admin.php:32 -#: bp-themes/bp-default/groups/single/admin.php:117 -#: bp-themes/bp-default/groups/single/forum/edit.php:58 -#: bp-themes/bp-default/groups/single/forum/edit.php:74 -#: bp-themes/bp-default/members/single/profile/edit.php:146 -#: bp-themes/bp-default/members/single/settings/general.php:72 -#: bp-themes/bp-default/members/single/settings/notifications.php:61 -#: bp-xprofile/bp-xprofile-classes.php:363 -msgid "Save Changes" -msgstr "" - -#: bp-core/admin/bp-core-slugs.php:32 -msgid "Save All" -msgstr "" - -#: bp-core/admin/bp-core-slugs.php:82 +#: bp-core/admin/bp-core-slugs.php:79 msgid "Directories" msgstr "" -#: bp-core/admin/bp-core-slugs.php:84 +#: bp-core/admin/bp-core-slugs.php:81 msgid "Associate a WordPress Page with each BuddyPress component directory." msgstr "" -#: bp-core/admin/bp-core-slugs.php:103 bp-core/admin/bp-core-slugs.php:164 +#: bp-core/admin/bp-core-slugs.php:100 bp-core/admin/bp-core-slugs.php:163 msgid "- None -" msgstr "" -#: bp-core/admin/bp-core-slugs.php:107 bp-core/admin/bp-core-slugs.php:168 +#: bp-core/admin/bp-core-slugs.php:104 bp-core/admin/bp-core-slugs.php:167 msgid "New Page" msgstr "" -#: bp-core/admin/bp-core-slugs.php:108 bp-core/admin/bp-core-slugs.php:169 +#: bp-core/admin/bp-core-slugs.php:105 bp-core/admin/bp-core-slugs.php:168 +#: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:19 #: bp-themes/bp-default/members/single/settings/capabilities.php:61 -#: bp-xprofile/bp-xprofile-classes.php:912 +#: bp-xprofile/bp-xprofile-classes.php:401 +#: bp-xprofile/bp-xprofile-classes.php:928 msgid "Save" msgstr "" -#: bp-core/admin/bp-core-slugs.php:146 +#: bp-core/admin/bp-core-slugs.php:142 msgid "Registration" msgstr "" -#: bp-core/admin/bp-core-slugs.php:148 +#: bp-core/admin/bp-core-slugs.php:144 msgid "Associate WordPress Pages with the following BuddyPress Registration pages." msgstr "" -#: bp-core/admin/bp-core-update.php:59 bp-core/admin/bp-core-update.php:209 -msgid "Permalinks" +#: bp-core/bp-core-admin.php:154 bp-core/bp-core-admin.php:155 +#: bp-core/bp-core-admin.php:163 bp-core/bp-core-admin.php:164 +msgid "Welcome to BuddyPress" msgstr "" -#: bp-core/admin/bp-core-update.php:60 bp-core/admin/bp-core-update.php:213 -msgid "Theme" +#: bp-core/bp-core-admin.php:174 bp-core/bp-core-admin.php:175 +#: bp-core/bp-core-admin.php:195 +msgid "BuddyPress" msgstr "" -#: bp-core/admin/bp-core-update.php:61 bp-core/admin/bp-core-update.php:80 -#: bp-core/admin/bp-core-update.php:178 bp-core/admin/bp-core-update.php:221 -#: bp-themes/bp-default/groups/create.php:289 -msgid "Finish" +#: bp-core/bp-core-admin.php:184 +msgid "BuddyPress Help" msgstr "" -#: bp-core/admin/bp-core-update.php:75 bp-core/admin/bp-core-update.php:217 -#: bp-core/bp-core-admin.php:286 bp-core/bp-core-admin.php:291 -msgid "Toolbar" +#: bp-core/bp-core-admin.php:185 +msgid "Help" msgstr "" -#: bp-core/admin/bp-core-update.php:78 bp-core/admin/bp-core-update.php:197 -msgid "Database Update" +#: bp-core/bp-core-admin.php:194 +msgid "BuddyPress Components" msgstr "" -#: bp-core/admin/bp-core-update.php:135 -msgid "Setup" +#: bp-core/bp-core-admin.php:203 bp-core/bp-core-admin.php:204 +msgid "BuddyPress Pages" msgstr "" -#: bp-core/admin/bp-core-update.php:143 -msgid "BuddyPress %s" +#: bp-core/bp-core-admin.php:212 bp-core/bp-core-admin.php:213 +msgid "BuddyPress Settings" msgstr "" -#: bp-core/admin/bp-core-update.php:181 -msgid "Finish & Activate" +#: bp-core/bp-core-admin.php:239 +msgid "Main Settings" msgstr "" -#: bp-core/admin/bp-core-update.php:187 -msgid "Save & Next" +#: bp-core/bp-core-admin.php:242 bp-core/bp-core-admin.php:247 +msgid "Toolbar" msgstr "" -#: bp-core/admin/bp-core-update.php:238 -msgid "To complete the update, a few changes need to be made to your database. These changes are not destructive and will not remove or change any existing settings." +#: bp-core/bp-core-admin.php:252 +msgid "Account Deletion" msgstr "" -#: bp-core/admin/bp-core-update.php:256 -msgid "BuddyPress bundles several individual social components together, each one adding a distinct feature. This first step decides which features are enabled on your site; all features are enabled by default. Don't worry, you can change your mind at any point in the future." +#: bp-core/bp-core-admin.php:260 +msgid "Profile Settings" msgstr "" -#: bp-core/admin/bp-core-update.php:298 -msgid "members" +#: bp-core/bp-core-admin.php:263 +msgid "Avatar Uploads" msgstr "" -#: bp-core/admin/bp-core-update.php:301 -msgid "groups" +#: bp-core/bp-core-admin.php:267 +msgid "Profile Syncing" msgstr "" -#: bp-core/admin/bp-core-update.php:304 -msgid "activity" +#: bp-core/bp-core-admin.php:276 +msgid "Groups Settings" msgstr "" -#: bp-core/admin/bp-core-update.php:307 -msgid "forums" +#: bp-core/bp-core-admin.php:279 +msgid "Group Creation" msgstr "" -#: bp-core/admin/bp-core-update.php:310 -msgid "blogs" +#: bp-core/bp-core-admin.php:288 +msgid "Legacy Group Forums" msgstr "" -#: bp-core/admin/bp-core-update.php:313 -msgid "register" +#: bp-core/bp-core-admin.php:291 +msgid "bbPress Configuration" msgstr "" -#: bp-core/admin/bp-core-update.php:316 -msgid "activate" +#: bp-core/bp-core-admin.php:300 +msgid "Activity Settings" msgstr "" -#: bp-core/admin/bp-core-update.php:328 -msgid "BuddyPress uses WordPress pages to display directories. This allows you to easily change their titles and relocate them." +#: bp-core/bp-core-admin.php:303 +msgid "Blog & Forum Comments" msgstr "" -#: bp-core/admin/bp-core-update.php:330 -msgid "Choose an existing page, have one auto-created, or create them manually and come back here once you are finished." +#: bp-core/bp-core-admin.php:308 +msgid "Akismet" msgstr "" -#: bp-core/admin/bp-core-update.php:336 bp-core/bp-core-template.php:257 -#: bp-core/bp-core-widgets.php:19 bp-core/bp-core-widgets.php:111 -#: bp-groups/bp-groups-template.php:1284 bp-members/bp-members-loader.php:24 -#: bp-themes/bp-default/groups/single/admin.php:231 -msgid "Members" +#: bp-core/bp-core-admin.php:332 +msgid "About" msgstr "" -#: bp-core/admin/bp-core-update.php:337 -msgid "Displays member profiles, and a directory of all site members." +#: bp-core/bp-core-admin.php:383 bp-core/bp-core-admin.php:492 +msgid "Welcome to BuddyPress %s" msgstr "" -#: bp-core/admin/bp-core-update.php:340 bp-core/admin/bp-core-update.php:358 -#: bp-core/admin/bp-core-update.php:377 bp-core/admin/bp-core-update.php:395 -#: bp-core/admin/bp-core-update.php:413 bp-core/admin/bp-core-update.php:429 -#: bp-core/admin/bp-core-update.php:443 -msgid "Automatically create a page at:" +#: bp-core/bp-core-admin.php:386 +msgid "BuddyPress %s is our safest, fastest, most flexible version ever." msgstr "" -#: bp-core/admin/bp-core-update.php:342 bp-core/admin/bp-core-update.php:360 -#: bp-core/admin/bp-core-update.php:379 bp-core/admin/bp-core-update.php:397 -#: bp-core/admin/bp-core-update.php:415 bp-core/admin/bp-core-update.php:431 -#: bp-core/admin/bp-core-update.php:445 -msgid "- Select -" +#: bp-core/bp-core-admin.php:388 +msgid "Thank you for updating! BuddyPress %s is our safest, fastest, most flexible version ever." msgstr "" -#: bp-core/admin/bp-core-update.php:344 bp-core/admin/bp-core-update.php:361 -#: bp-core/admin/bp-core-update.php:380 bp-core/admin/bp-core-update.php:398 -#: bp-core/admin/bp-core-update.php:416 bp-core/admin/bp-core-update.php:432 -#: bp-core/admin/bp-core-update.php:446 -msgid "Use an existing page:" +#: bp-core/bp-core-admin.php:391 bp-core/bp-core-admin.php:494 +msgid "Version %s" msgstr "" -#: bp-core/admin/bp-core-update.php:355 -msgid "Displays individual groups as well as a directory of groups." +#: bp-core/bp-core-admin.php:395 bp-core/bp-core-admin.php:498 +msgid "What’s New" msgstr "" -#: bp-core/admin/bp-core-update.php:373 bp-core/bp-core-template.php:263 -msgid "Blogs" +#: bp-core/bp-core-admin.php:397 bp-core/bp-core-admin.php:500 +msgid "Credits" msgstr "" -#: bp-core/admin/bp-core-update.php:374 -msgid "Displays a directory of the blogs in your network." +#: bp-core/bp-core-admin.php:402 +msgid "Getting Started" msgstr "" -#: bp-core/admin/bp-core-update.php:392 -msgid "Displays the activity for the entire site, a member's friends, groups and @mentions." +#: bp-core/bp-core-admin.php:405 +msgid "Your Default Setup" msgstr "" -#: bp-core/admin/bp-core-update.php:410 -msgid "Displays a directory of public forum topics." +#: bp-core/bp-core-admin.php:407 +msgid "BuddyPress’s powerful features help your users connect and collaborate. To help get your community started, we’ve activated two of the most commonly used tools in BP: <strong>Extended Profiles</strong> and <strong>Activity Streams</strong>. See these components in action at the %1$s and %2$s directories, and be sure to spend a few minutes <a href=\"%3$s\">configuring user profiles</a>. Want to explore more of BP’s features? Visit the <a href=\"%4$s\">Components panel</a>." msgstr "" -#: bp-core/admin/bp-core-update.php:426 -msgid "Displays a site registration page where users can create new accounts." +#: bp-core/bp-core-admin.php:408 bp-core/bp-core-template.php:243 +#: bp-core/bp-core-widgets.php:111 bp-groups/bp-groups-admin.php:764 +#: bp-groups/bp-groups-template.php:1454 bp-members/bp-members-loader.php:24 +#: bp-members/bp-members-screens.php:327 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:231 +#: bp-themes/bp-default/groups/single/admin.php:231 +msgid "Members" msgstr "" -#: bp-core/admin/bp-core-update.php:440 -msgid "The page users will visit to activate their account once they have registered." +#: bp-core/bp-core-admin.php:414 +msgid "Community and Support" msgstr "" -#: bp-core/admin/bp-core-update.php:473 -msgid "Your permalink settings are compatible with BuddyPress." +#: bp-core/bp-core-admin.php:415 +msgid "Looking for help? The <a href=\"http://codex.buddypress.org/\">BuddyPress Codex</a> has you covered, with dozens of user-contributed guides on how to configure and use your BP site. Can’t find what you need? Stop by <a href=\"http://buddypress.org/support/\">our support forums</a>, where a vibrant community of BuddyPress users and developers is waiting to share tips, show off their sites, talk about the future of BuddyPress, and much more." msgstr "" -#: bp-core/admin/bp-core-update.php:475 -msgid "Pretty permalinks must be active on your site." +#: bp-core/bp-core-admin.php:421 +msgid "A Declaration of (Theme) Independence" msgstr "" -#: bp-core/admin/bp-core-update.php:481 -msgid "For more advanced options please visit the <a href=\"%s\">permalink settings page</a> now and come back here later." +#: bp-core/bp-core-admin.php:424 +msgid "It Just Works" msgstr "" -#: bp-core/admin/bp-core-update.php:485 -msgid "Day and name" +#: bp-core/bp-core-admin.php:425 +msgid "BuddyPress is now compatible with <strong>any WordPress theme</strong>. If your theme has BuddyPress-specific templates and styling, we’ll use them. If not, we provide what you need to make your BuddyPress content look great. Still want to customize? No problem - you can override our templates just like you would in a WordPress child theme. <a href=\"http://codex.buddypress.org/theme-compatibility/\">Learn more about theme compatibility</a>." msgstr "" -#: bp-core/admin/bp-core-update.php:489 -msgid "Month and name" +#: bp-core/bp-core-admin.php:430 +msgid "Group Management" msgstr "" -#: bp-core/admin/bp-core-update.php:493 -msgid "Numeric" +#: bp-core/bp-core-admin.php:433 +msgid "Get More Done Quickly" msgstr "" -#: bp-core/admin/bp-core-update.php:559 -msgid "Use BuddyPress Default" +#: bp-core/bp-core-admin.php:436 +msgid "Groups administration panel" msgstr "" -#: bp-core/admin/bp-core-update.php:560 -msgid "BuddyPress Default" +#: bp-core/bp-core-admin.php:443 +msgid "The new %s makes it easy to handle large numbers of groups on your BuddyPress installation. Delete groups, edit group details, modify memberships, and more, with just a few clicks." msgstr "" -#: bp-core/admin/bp-core-update.php:563 -msgid "The default BuddyPress theme comes with the basics, to get up and running out of the box. It supports all features and is highly customizable." +#: bp-core/bp-core-admin.php:450 +msgid "Under the Hood" msgstr "" -#: bp-core/admin/bp-core-update.php:564 -msgid "This is the best choice if you want to start using BuddyPress immediately." +#: bp-core/bp-core-admin.php:454 +msgid "Faster Member Queries" msgstr "" -#: bp-core/admin/bp-core-update.php:565 -msgid "Yes, please!" +#: bp-core/bp-core-admin.php:455 +msgid "The new <code>BP_User_Query</code> makes member queries (like in the Members directory) up to 4x faster than before." msgstr "" -#: bp-core/admin/bp-core-update.php:573 -msgid "Other themes" +#: bp-core/bp-core-admin.php:457 +msgid "Sortable Profile Options" msgstr "" -#: bp-core/admin/bp-core-update.php:574 -msgid "A BuddyPress theme" +#: bp-core/bp-core-admin.php:458 +msgid "Profile field types with multiple options - like radio buttons and checkboxes - now support drag-and-drop reordering." msgstr "" -#: bp-core/admin/bp-core-update.php:577 -msgid "You have some other BuddyPress compatible themes available. Pick one of them from this list to use it." +#: bp-core/bp-core-admin.php:462 +msgid "New Visibility Level" msgstr "" -#: bp-core/admin/bp-core-update.php:580 -msgid "Use this theme" +#: bp-core/bp-core-admin.php:463 +msgid "By popular demand, the \"Admins Only\" visibility setting is now available for profile fields." msgstr "" -#: bp-core/admin/bp-core-update.php:601 -msgid "Manually update current theme" +#: bp-core/bp-core-admin.php:465 +msgid "Better bbPress Integration" msgstr "" -#: bp-core/admin/bp-core-update.php:605 -msgid "Your existing theme" +#: bp-core/bp-core-admin.php:466 +msgid "Support for group and sitewide forums, using the latest version of the bbPress plugin, is better than ever. Still using bbPress 1.x? Our new migration tools are field-tested." msgstr "" -#: bp-core/admin/bp-core-update.php:611 -msgid "The BuddyPress Template Pack will guide you through the process of manually editing your existing theme. It comes with a step-by-step guide and involves copying the BuddyPress template files into your theme. <strong>This option requires knowledge of CSS and HTML.</strong> You will need to tweak the new templates to match your existing theme." +#: bp-core/bp-core-admin.php:471 bp-core/bp-core-admin.php:598 +msgid "Go to the BuddyPress Settings page" msgstr "" -#: bp-core/admin/bp-core-update.php:615 -msgid "Install BuddyPress Template Pack" +#: bp-core/bp-core-admin.php:493 +msgid "Thank you for updating to the latest version! BuddyPress %s is ready to make your community a safer, faster, and better looking place to hang out!" msgstr "" -#: bp-core/admin/bp-core-update.php:619 -msgid "Choose this option (go to Appearance → BP Compatibility after setup is complete)" +#: bp-core/bp-core-admin.php:504 +msgid "BuddyPress is created by a worldwide network of friendly folks." msgstr "" -#: bp-core/admin/bp-core-update.php:620 -msgid "Plugin Installed" +#: bp-core/bp-core-admin.php:506 +msgid "Project Leaders" msgstr "" -#: bp-core/admin/bp-core-update.php:631 -msgid "Do not change theme" +#: bp-core/bp-core-admin.php:511 +msgid "Founding Developer" msgstr "" -#: bp-core/admin/bp-core-update.php:634 -msgid "You are happy with your current theme and plan on changing it later." +#: bp-core/bp-core-admin.php:516 +msgid "Project Lead" msgstr "" -#: bp-core/admin/bp-core-update.php:635 -msgid "This is the best choice if you have a custom theme already and want to manually integrate BuddyPress later." +#: bp-core/bp-core-admin.php:521 bp-core/bp-core-admin.php:526 +msgid "Lead Developer" msgstr "" -#: bp-core/admin/bp-core-update.php:637 -msgid "Don't change my current theme" +#: bp-core/bp-core-admin.php:530 +msgid "Core Developers" msgstr "" -#: bp-core/admin/bp-core-update.php:662 -msgid "BuddyPress now uses the WordPress Toolbar; we've turbo-charged it by adding social items to help your users explore your site and manage their content." +#: bp-core/bp-core-admin.php:538 +msgid "Recent Rockstars" msgstr "" -#: bp-core/admin/bp-core-update.php:664 -msgid "We've noticed that your site uses the old bar from earlier versions of BuddyPress." +#: bp-core/bp-core-admin.php:543 +msgid "Design Officer" msgstr "" -#: bp-core/admin/bp-core-update.php:669 -msgid "If you'd prefer to not switch to the WordPress Toolbar just yet, check this box. Don't worry, you can change your mind later." +#: bp-core/bp-core-admin.php:548 +msgid "Support Officer" msgstr "" -#: bp-core/admin/bp-core-update.php:687 -msgid "setup" +#: bp-core/bp-core-admin.php:552 +msgid "Core Contributors to BuddyPress 1.7" msgstr "" -#: bp-core/admin/bp-core-update.php:687 -msgid "update" +#: bp-core/bp-core-adminbar.php:36 bp-core/bp-core-buddybar.php:498 +msgid "My Account" msgstr "" -#: bp-core/admin/bp-core-update.php:689 -msgid "The BuddyPress %1$s is complete, and your site is ready to go!" +#: bp-core/bp-core-avatars.php:231 +msgid "Avatar Image" msgstr "" -#: bp-core/admin/bp-core-update.php:826 -msgid "Oops, there was a problem creating a configuration file. " +#: bp-core/bp-core-avatars.php:499 +msgid "The image was uploaded successfully" msgstr "" -#: bp-core/admin/bp-core-update.php:832 -msgid "If your <code>web.config</code> file were <a href=\"http://codex.wordpress.org/Changing_File_Permissions\">writable</a>, we could do this automatically, but it isn’t so this is the url rewrite rule you should have in your <code>web.config</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all. Then insert this rule inside of the <code>/<configuration>/<system.webServer>/<rewrite>/<rules></code> element in <code>web.config</code> file." +#: bp-core/bp-core-avatars.php:500 bp-core/bp-core-avatars.php:501 +msgid "The image exceeds the maximum allowed file size of: " msgstr "" -#: bp-core/admin/bp-core-update.php:841 -msgid "Permalink structure updated. Remove write access on web.config file now!" +#: bp-core/bp-core-avatars.php:502 +msgid "The uploaded file was only partially uploaded." msgstr "" -#: bp-core/admin/bp-core-update.php:846 -msgid "If your <code>.htaccess</code> file were <a href=\"http://codex.wordpress.org/Changing_File_Permissions\">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all." +#: bp-core/bp-core-avatars.php:503 +msgid "The image was not uploaded." msgstr "" -#: bp-core/admin/bp-core-update.php:858 -msgid "Paste all these rules into a new <code>.htaccess</code> file in the root of your WordPress installation and save the file. Once you're done, please hit the \"Save and Next\" button to continue." +#: bp-core/bp-core-avatars.php:504 +msgid "Missing a temporary folder." msgstr "" -#: bp-core/bp-core-admin.php:192 -msgid "BuddyPress Setup" +#: bp-core/bp-core-avatars.php:508 +msgid "Your upload failed, please try again. Error was: %s" msgstr "" -#: bp-core/bp-core-admin.php:194 -msgid "Update BuddyPress" +#: bp-core/bp-core-avatars.php:513 +msgid "The file you uploaded is too big. Please upload a file under %s" msgstr "" -#: bp-core/bp-core-admin.php:216 bp-core/bp-core-admin.php:217 -#: bp-core/bp-core-admin.php:237 bp-members/bp-members-functions.php:1310 -msgid "BuddyPress" +#: bp-core/bp-core-avatars.php:518 +msgid "Please upload only JPG, GIF or PNG photos." msgstr "" -#: bp-core/bp-core-admin.php:226 -msgid "BuddyPress Help" +#: bp-core/bp-core-avatars.php:535 bp-core/bp-core-avatars.php:572 +msgid "Upload Failed! Error was: %s" msgstr "" -#: bp-core/bp-core-admin.php:227 -msgid "Help" +#: bp-core/bp-core-avatars.php:590 +msgid "Upload failed! Error was: %s" msgstr "" -#: bp-core/bp-core-admin.php:236 -msgid "BuddyPress Components" +#: bp-core/bp-core-avatars.php:733 bp-core/bp-core-classes.php:715 +#: bp-core/bp-core-classes.php:716 bp-core/bp-core-classes.php:717 +#: bp-core/bp-core-template.php:98 bp-core/bp-core-template.php:107 +msgid "Avatar of %s" msgstr "" -#: bp-core/bp-core-admin.php:245 bp-core/bp-core-admin.php:246 -msgid "BuddyPress Pages" +#: bp-core/bp-core-buddybar.php:303 +msgid "You do not have access to this page." msgstr "" -#: bp-core/bp-core-admin.php:254 bp-core/bp-core-admin.php:255 -msgid "BuddyPress Settings" +#: bp-core/bp-core-buddybar.php:482 bp-themes/bp-default/sidebar.php:53 +msgid "Log In" msgstr "" -#: bp-core/bp-core-admin.php:283 -msgid "Main Settings" +#: bp-core/bp-core-buddybar.php:486 +msgid "Sign Up" msgstr "" -#: bp-core/bp-core-admin.php:296 -msgid "Account Deletion" +#: bp-core/bp-core-buddybar.php:540 bp-core/deprecated/1.5.php:307 +#: bp-members/bp-members-template.php:773 bp-themes/bp-default/sidebar.php:18 +msgid "Log Out" msgstr "" -#: bp-core/bp-core-admin.php:304 -msgid "Profile Settings" +#: bp-core/bp-core-buddybar.php:569 bp-groups/bp-groups-admin.php:1245 +msgid "Visit" msgstr "" -#: bp-core/bp-core-admin.php:307 -msgid "Avatar Uploads" +#: bp-core/bp-core-buddybar.php:571 +msgid "Random Member" msgstr "" -#: bp-core/bp-core-admin.php:311 -msgid "Profile Syncing" +#: bp-core/bp-core-buddybar.php:575 +msgid "Random Group" msgstr "" -#: bp-core/bp-core-admin.php:320 -msgid "Groups Settings" +#: bp-core/bp-core-buddybar.php:581 +msgid "Random Site" msgstr "" -#: bp-core/bp-core-admin.php:323 -msgid "Group Creation" +#: bp-core/bp-core-caps.php:250 bp-core/bp-core-caps.php:263 +#: bp-core/bp-core-caps.php:278 bp-core/bp-core-caps.php:289 +msgid "Special community roles no longer exist. Use mapped capabilities instead" msgstr "" -#: bp-core/bp-core-admin.php:332 -msgid "Forums Settings" +#: bp-core/bp-core-catchuri.php:280 +msgid "This user has been marked as a spammer. Only site admins can view this profile." msgstr "" -#: bp-core/bp-core-admin.php:335 -msgid "bbPress Configuration" +#: bp-core/bp-core-catchuri.php:466 bp-core/bp-core-catchuri.php:525 +msgid "You must log in to access the page you requested." msgstr "" -#: bp-core/bp-core-admin.php:344 -msgid "Activity Settings" -msgstr "" +#: bp-core/bp-core-classes.php:732 +msgid "%d group" +msgid_plural "%d groups" +msgstr[0] "" +msgstr[1] "" -#: bp-core/bp-core-admin.php:347 -msgid "Blog & Forum Comments" +#: bp-core/bp-core-dependency.php:81 +msgid "The current user is being initialized without using $wp->init()." msgstr "" -#: bp-core/bp-core-admin.php:352 -msgid "Akismet" +#: bp-core/bp-core-filters.php:215 bp-core/bp-core-filters.php:239 +msgid "[User Set]" msgstr "" -#: bp-core/bp-core-admin.php:482 -msgid "BuddyPress has been updated! Please run the <a href=\"%s\">update wizard</a>." +#: bp-core/bp-core-filters.php:257 +msgid "" +"Thanks for registering! To complete the activation of your account and blog, please click the following link:\n" +"\n" +"%1$s\n" +"\n" +"\n" +"\n" +"After you activate, you can visit your blog here:\n" +"\n" +"%2$s" msgstr "" -#: bp-core/bp-core-admin.php:487 -msgid "BuddyPress was successfully activated! Please run the <a href=\"%s\">installation wizard</a>." +#: bp-core/bp-core-filters.php:258 +msgid "Activate %s" msgstr "" -#: bp-core/bp-core-adminbar.php:36 bp-core/bp-core-buddybar.php:495 -msgid "My Account" +#: bp-core/bp-core-filters.php:285 bp-members/bp-members-functions.php:1357 +msgid "" +"Thanks for registering! To complete the activation of your account please click the following link:\n" +"\n" +"%1$s\n" +"\n" msgstr "" -#: bp-core/bp-core-avatars.php:221 -msgid "Avatar Image" +#: bp-core/bp-core-filters.php:286 bp-members/bp-members-functions.php:1358 +msgid "Activate Your Account" msgstr "" -#: bp-core/bp-core-avatars.php:481 -msgid "There is no error, the file uploaded with success" +#: bp-core/bp-core-filters.php:342 +msgctxt "Construct the page title. 1 = user name, 2 = component name, 3 = seperator" +msgid "%1$s %3$s %2$s" msgstr "" -#: bp-core/bp-core-avatars.php:482 bp-core/bp-core-avatars.php:483 -msgid "Your image was bigger than the maximum allowed file size of: " -msgstr "" +#. translators: "group name | group nav section name" -#: bp-core/bp-core-avatars.php:484 -msgid "The uploaded file was only partially uploaded" +#: bp-core/bp-core-filters.php:348 +msgid "%1$s | %2$s" msgstr "" -#: bp-core/bp-core-avatars.php:485 -msgid "No file was uploaded" -msgstr "" +#. translators: "component item name | component nav section name | root +#. component name" -#: bp-core/bp-core-avatars.php:486 -msgid "Missing a temporary folder" +#: bp-core/bp-core-filters.php:353 +msgid "%1$s | %2$s | %3$s" msgstr "" -#: bp-core/bp-core-avatars.php:490 -msgid "Your upload failed, please try again. Error was: %s" +#: bp-core/bp-core-filters.php:358 bp-core/bp-core-filters.php:360 +msgid "%s Directory" msgstr "" -#: bp-core/bp-core-avatars.php:495 -msgid "The file you uploaded is too big. Please upload a file under %s" +#: bp-core/bp-core-filters.php:365 bp-members/bp-members-screens.php:428 +#: bp-themes/bp-default/registration/register.php:23 +msgid "Create an Account" msgstr "" -#: bp-core/bp-core-avatars.php:500 -msgid "Please upload only JPG, GIF or PNG photos." +#: bp-core/bp-core-filters.php:369 bp-members/bp-members-screens.php:436 +#: bp-themes/bp-default/registration/activate.php:13 +msgid "Activate your Account" msgstr "" -#: bp-core/bp-core-avatars.php:511 bp-core/bp-core-avatars.php:546 -msgid "Upload Failed! Error was: %s" -msgstr "" - -#: bp-core/bp-core-avatars.php:561 -msgid "Upload failed! Error was: %s" -msgstr "" - -#: bp-core/bp-core-avatars.php:696 bp-core/bp-core-classes.php:174 -#: bp-core/bp-core-classes.php:175 bp-core/bp-core-classes.php:176 -#: bp-core/bp-core-template.php:98 bp-core/bp-core-template.php:107 -msgid "Avatar of %s" -msgstr "" - -#: bp-core/bp-core-buddybar.php:303 -msgid "You do not have access to this page." -msgstr "" - -#: bp-core/bp-core-buddybar.php:479 bp-themes/bp-default/sidebar.php:53 -msgid "Log In" -msgstr "" - -#: bp-core/bp-core-buddybar.php:483 -msgid "Sign Up" -msgstr "" - -#: bp-core/bp-core-buddybar.php:537 bp-core/deprecated/1.5.php:287 -#: bp-members/bp-members-template.php:732 bp-themes/bp-default/sidebar.php:18 -msgid "Log Out" -msgstr "" - -#: bp-core/bp-core-buddybar.php:566 -msgid "Visit" -msgstr "" - -#: bp-core/bp-core-buddybar.php:568 -msgid "Random Member" -msgstr "" - -#: bp-core/bp-core-buddybar.php:572 -msgid "Random Group" -msgstr "" - -#: bp-core/bp-core-buddybar.php:578 -msgid "Random Site" -msgstr "" - -#: bp-core/bp-core-catchuri.php:281 -msgid "This user has been marked as a spammer. Only site admins can view this profile." -msgstr "" - -#: bp-core/bp-core-catchuri.php:455 bp-core/bp-core-catchuri.php:514 -msgid "You must log in to access the page you requested." -msgstr "" - -#: bp-core/bp-core-classes.php:191 -msgid "%d group" -msgid_plural "%d groups" -msgstr[0] "" -msgstr[1] "" - -#: bp-core/bp-core-filters.php:178 bp-core/bp-core-filters.php:203 -msgid "[User Set]" -msgstr "" - -#: bp-core/bp-core-filters.php:222 -msgid "" -"Thanks for registering! To complete the activation of your account and blog, please click the following link:\n" -"\n" -"%1$s\n" -"\n" -"\n" -"\n" -"After you activate, you can visit your blog here:\n" -"\n" -"%2$s" -msgstr "" - -#: bp-core/bp-core-filters.php:223 -msgid "Activate %s" -msgstr "" - -#: bp-core/bp-core-filters.php:255 bp-members/bp-members-functions.php:1312 -msgid "" -"Thanks for registering! To complete the activation of your account please click the following link:\n" -"\n" -"%1$s\n" -"\n" -msgstr "" - -#: bp-core/bp-core-filters.php:256 bp-members/bp-members-functions.php:1313 -msgid "Activate Your Account" +#: bp-core/bp-core-filters.php:373 bp-groups/bp-groups-screens.php:999 +#: bp-groups/bp-groups-screens.php:1037 +#: bp-themes/bp-default/groups/create.php:18 +#: bp-themes/bp-default/groups/index.php:21 +msgid "Create a Group" msgstr "" -#. translators: "displayed user's name | canonicalised component name" -#. translators: "group name | group nav section name" - -#: bp-core/bp-core-filters.php:313 bp-core/bp-core-filters.php:319 -msgid "%1$s | %2$s" +#: bp-core/bp-core-functions.php:204 +msgctxt "Page title for the Activity directory." +msgid "Activity" msgstr "" -#. translators: "component item name | component nav section name | root -#. component name" - -#: bp-core/bp-core-filters.php:324 -msgid "%1$s | %2$s | %3$s" +#: bp-core/bp-core-functions.php:205 +msgctxt "Page title for the Groups directory." +msgid "Groups" msgstr "" -#: bp-core/bp-core-filters.php:329 bp-core/bp-core-filters.php:331 -msgid "%s Directory" +#: bp-core/bp-core-functions.php:206 +msgctxt "Page title for the Sites directory." +msgid "Sites" msgstr "" -#: bp-core/bp-core-filters.php:336 -#: bp-themes/bp-default/registration/register.php:23 -msgid "Create an Account" +#: bp-core/bp-core-functions.php:207 +msgctxt "Page title for the user account activation screen." +msgid "Activate" msgstr "" -#: bp-core/bp-core-filters.php:340 -#: bp-themes/bp-default/registration/activate.php:24 -msgid "Activate your Account" +#: bp-core/bp-core-functions.php:208 +msgctxt "Page title for the Members directory." +msgid "Members" msgstr "" -#: bp-core/bp-core-filters.php:344 bp-themes/bp-default/groups/create.php:18 -#: bp-themes/bp-default/groups/index.php:21 -msgid "Create a Group" +#: bp-core/bp-core-functions.php:209 +msgctxt "Page title for the user registration screen." +msgid "Register" msgstr "" -#: bp-core/bp-core-functions.php:384 +#: bp-core/bp-core-functions.php:441 msgid "sometime" msgstr "" -#: bp-core/bp-core-functions.php:385 +#: bp-core/bp-core-functions.php:442 msgid "right now" msgstr "" -#: bp-core/bp-core-functions.php:386 +#: bp-core/bp-core-functions.php:443 msgid "%s ago" msgstr "" -#: bp-core/bp-core-functions.php:390 +#: bp-core/bp-core-functions.php:447 msgid "year" msgstr "" -#: bp-core/bp-core-functions.php:390 +#: bp-core/bp-core-functions.php:447 msgid "years" msgstr "" -#: bp-core/bp-core-functions.php:391 +#: bp-core/bp-core-functions.php:448 msgid "month" msgstr "" -#: bp-core/bp-core-functions.php:391 +#: bp-core/bp-core-functions.php:448 msgid "months" msgstr "" -#: bp-core/bp-core-functions.php:392 +#: bp-core/bp-core-functions.php:449 msgid "week" msgstr "" -#: bp-core/bp-core-functions.php:392 +#: bp-core/bp-core-functions.php:449 msgid "weeks" msgstr "" -#: bp-core/bp-core-functions.php:393 +#: bp-core/bp-core-functions.php:450 msgid "day" msgstr "" -#: bp-core/bp-core-functions.php:393 +#: bp-core/bp-core-functions.php:450 msgid "days" msgstr "" -#: bp-core/bp-core-functions.php:394 +#: bp-core/bp-core-functions.php:451 msgid "hour" msgstr "" -#: bp-core/bp-core-functions.php:394 +#: bp-core/bp-core-functions.php:451 msgid "hours" msgstr "" -#: bp-core/bp-core-functions.php:395 +#: bp-core/bp-core-functions.php:452 msgid "minute" msgstr "" -#: bp-core/bp-core-functions.php:395 +#: bp-core/bp-core-functions.php:452 msgid "minutes" msgstr "" -#: bp-core/bp-core-functions.php:396 +#: bp-core/bp-core-functions.php:453 msgid "second" msgstr "" -#: bp-core/bp-core-functions.php:396 +#: bp-core/bp-core-functions.php:453 msgid "seconds" msgstr "" -#: bp-core/bp-core-functions.php:455 +#: bp-core/bp-core-functions.php:512 msgctxt "Separator in time since" msgid "," msgstr "" -#: bp-core/bp-core-functions.php:523 +#: bp-core/bp-core-functions.php:580 msgid "Not recently active" msgstr "" -#: bp-core/bp-core-loader.php:211 bp-members/bp-members-loader.php:157 -#: bp-xprofile/bp-xprofile-loader.php:150 -#: bp-xprofile/bp-xprofile-loader.php:214 +#: bp-core/bp-core-loader.php:214 bp-members/bp-members-loader.php:158 +#: bp-xprofile/bp-xprofile-loader.php:154 +#: bp-xprofile/bp-xprofile-loader.php:229 msgid "Profile" msgstr "" -#: bp-core/bp-core-loader.php:222 bp-groups/bp-groups-template.php:522 -#: bp-members/bp-members-loader.php:171 bp-xprofile/bp-xprofile-loader.php:162 -msgid "Public" -msgstr "" - #: bp-core/bp-core-template.php:65 msgid "Options" msgstr "" -#: bp-core/bp-core-template.php:202 +#: bp-core/bp-core-template.php:191 msgid "%1$s at %2$s" msgstr "" -#: bp-core/bp-core-template.php:268 bp-themes/bp-default/activity/index.php:99 +#: bp-core/bp-core-template.php:252 bp-forums/bp-forums-loader.php:103 +#: bp-forums/bp-forums-loader.php:166 bp-forums/bp-forums-loader.php:207 +#: bp-forums/bp-forums-screens.php:188 bp-forums/bp-forums-screens.php:190 +#: bp-forums/deprecated/1.6.php:24 bp-forums/deprecated/1.7.php:25 +#: bp-forums/deprecated/1.7.php:57 bp-forums/deprecated/1.7.php:329 +msgid "Forums" +msgstr "" + +#: bp-core/bp-core-template.php:254 +#: bp-templates/bp-legacy/buddypress/activity/index.php:79 +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:40 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:27 +#: bp-themes/bp-default/activity/index.php:99 #: bp-themes/bp-default/forums/forums-loop.php:40 #: bp-themes/bp-default/members/single/activity.php:27 msgid "Posts" msgstr "" -#: bp-core/bp-core-template.php:271 +#: bp-core/bp-core-template.php:257 msgid "Search these:" msgstr "" -#: bp-core/bp-core-template.php:299 +#: bp-core/bp-core-template.php:285 msgid "Search anything..." msgstr "" -#: bp-core/bp-core-template.php:393 +#: bp-core/bp-core-template.php:379 msgid " […]" msgstr "" -#: bp-core/bp-core-widgets.php:18 +#: bp-core/bp-core-template.php:557 +msgid "Community" +msgstr "" + +#: bp-core/bp-core-widgets.php:19 msgid "A dynamic list of recently active, popular, and newest members" msgstr "" +#: bp-core/bp-core-widgets.php:22 +msgctxt "widget name" +msgid "(BuddyPress) Members" +msgstr "" + #: bp-core/bp-core-widgets.php:47 bp-core/bp-core-widgets.php:133 -#: bp-core/deprecated/1.6.php:111 bp-core/deprecated/1.6.php:134 -#: bp-groups/bp-groups-widgets.php:60 bp-groups/bp-groups-widgets.php:141 +#: bp-core/deprecated/1.6.php:129 bp-core/deprecated/1.6.php:152 +#: bp-groups/bp-groups-widgets.php:58 bp-groups/bp-groups-widgets.php:139 +#: bp-templates/bp-legacy/buddypress/blogs/index.php:39 +#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:22 #: bp-themes/bp-default/blogs/index.php:56 #: bp-themes/bp-default/members/single/blogs.php:22 msgid "Newest" msgstr "" #: bp-core/bp-core-widgets.php:48 bp-core/bp-core-widgets.php:134 -#: bp-groups/bp-groups-widgets.php:61 bp-groups/bp-groups-widgets.php:142 +#: bp-groups/bp-groups-widgets.php:59 bp-groups/bp-groups-widgets.php:140 msgid "Active" msgstr "" #: bp-core/bp-core-widgets.php:52 bp-core/bp-core-widgets.php:135 -#: bp-groups/bp-groups-widgets.php:62 bp-groups/bp-groups-widgets.php:143 +#: bp-groups/bp-groups-widgets.php:60 bp-groups/bp-groups-widgets.php:141 msgid "Popular" msgstr "" @@ -2018,8 +2028,11 @@ msgstr "" msgid "No one has signed up yet!" msgstr "" -#: bp-core/bp-core-widgets.php:124 bp-core/bp-core-widgets.php:201 -#: bp-core/bp-core-widgets.php:265 bp-groups/bp-groups-widgets.php:132 +#: bp-core/bp-core-widgets.php:124 bp-core/bp-core-widgets.php:204 +#: bp-core/bp-core-widgets.php:271 bp-groups/bp-groups-widgets.php:130 +#: bp-templates/bp-legacy/buddypress/forums/index.php:86 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:47 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:75 #: bp-themes/bp-default/forums/index.php:104 #: bp-themes/bp-default/groups/single/forum/edit.php:47 #: bp-themes/bp-default/groups/single/forum.php:75 @@ -2038,288 +2051,161 @@ msgstr "" msgid "Default members to show:" msgstr "" -#: bp-core/bp-core-widgets.php:149 +#: bp-core/bp-core-widgets.php:150 msgid "Avatars of users who are currently online" msgstr "" -#: bp-core/bp-core-widgets.php:150 -msgid "Who's Online Avatars" +#: bp-core/bp-core-widgets.php:153 +msgctxt "widget name" +msgid "(BuddyPress) Who's Online" msgstr "" -#: bp-core/bp-core-widgets.php:173 +#: bp-core/bp-core-widgets.php:176 msgid "There are no users currently online" msgstr "" -#: bp-core/bp-core-widgets.php:192 +#: bp-core/bp-core-widgets.php:195 msgid "Who's Online" msgstr "" -#: bp-core/bp-core-widgets.php:203 bp-core/bp-core-widgets.php:267 +#: bp-core/bp-core-widgets.php:206 bp-core/bp-core-widgets.php:273 msgid "Max Members to show:" msgstr "" -#: bp-core/bp-core-widgets.php:213 +#: bp-core/bp-core-widgets.php:217 msgid "Avatars of recently active members" msgstr "" -#: bp-core/bp-core-widgets.php:214 -msgid "Recently Active Member Avatars" +#: bp-core/bp-core-widgets.php:220 +msgctxt "widget name" +msgid "(BuddyPress) Recently Active Members" msgstr "" -#: bp-core/bp-core-widgets.php:237 +#: bp-core/bp-core-widgets.php:243 msgid "There are no recently active members" msgstr "" -#: bp-core/bp-core-widgets.php:322 +#: bp-core/bp-core-widgets.php:325 msgid "There were no members found, please try another filter." msgstr "" -#: bp-core/deprecated/1.5.php:135 +#: bp-core/deprecated/1.5.php:142 +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:45 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:8 #: bp-themes/bp-default/activity/post-form.php:45 #: bp-themes/bp-default/members/single/profile/profile-wp.php:8 -#: bp-xprofile/bp-xprofile-loader.php:257 +#: bp-xprofile/bp-xprofile-loader.php:272 msgid "My Profile" msgstr "" -#: bp-core/deprecated/1.5.php:142 bp-themes/bp-default/functions.php:641 +#: bp-core/deprecated/1.5.php:149 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:15 +#: bp-themes/bp-default/functions.php:641 #: bp-themes/bp-default/members/single/profile/profile-wp.php:15 msgid "Name" msgstr "" -#: bp-core/deprecated/1.5.php:151 +#: bp-core/deprecated/1.5.php:158 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:24 #: bp-themes/bp-default/members/single/profile/profile-wp.php:24 msgid "About Me" msgstr "" -#: bp-core/deprecated/1.5.php:160 bp-themes/bp-default/functions.php:645 +#: bp-core/deprecated/1.5.php:167 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:33 +#: bp-themes/bp-default/functions.php:645 #: bp-themes/bp-default/members/single/profile/profile-wp.php:33 msgid "Website" msgstr "" -#: bp-core/deprecated/1.5.php:169 +#: bp-core/deprecated/1.5.php:176 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:42 #: bp-themes/bp-default/members/single/profile/profile-wp.php:42 msgid "Jabber" msgstr "" -#: bp-core/deprecated/1.5.php:178 +#: bp-core/deprecated/1.5.php:185 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:51 #: bp-themes/bp-default/members/single/profile/profile-wp.php:51 msgid "AOL Messenger" msgstr "" -#: bp-core/deprecated/1.5.php:187 +#: bp-core/deprecated/1.5.php:194 +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:60 #: bp-themes/bp-default/members/single/profile/profile-wp.php:60 msgid "Yahoo Messenger" msgstr "" -#: bp-core/deprecated/1.5.php:335 +#: bp-core/deprecated/1.5.php:352 msgid "%1$s mentioned you in the group \"%2$s\"" msgstr "" -#: bp-core/deprecated/1.6.php:110 bp-core/deprecated/1.6.php:131 -#: bp-groups/bp-groups-template.php:2307 bp-groups/bp-groups-template.php:2329 +#: bp-core/deprecated/1.6.php:128 bp-core/deprecated/1.6.php:149 +#: bp-groups/bp-groups-template.php:2498 bp-groups/bp-groups-template.php:2520 msgid "Recently Active" msgstr "" -#: bp-core/deprecated/1.6.php:112 bp-core/deprecated/1.6.php:137 -#: bp-groups/bp-groups-template.php:2312 bp-groups/bp-groups-template.php:2344 +#: bp-core/deprecated/1.6.php:130 bp-core/deprecated/1.6.php:155 +#: bp-groups/bp-groups-template.php:2503 bp-groups/bp-groups-template.php:2535 msgid "Alphabetically" msgstr "" -#: bp-forums/bp-forums-admin.php:36 bp-forums/bp-forums-admin.php:128 -msgid "Configure Site Wide Forums" -msgstr "" - -#: bp-forums/bp-forums-admin.php:39 bp-forums/bp-forums-admin.php:131 -#: bp-forums/deprecated/1.6.php:76 bp-forums/deprecated/1.6.php:194 -msgid "Install Site Wide Forums" -msgstr "" - -#: bp-forums/bp-forums-admin.php:52 bp-forums/deprecated/1.6.php:29 -msgid "Settings Saved." -msgstr "" - -#: bp-forums/bp-forums-admin.php:68 -msgid "(Installed)" -msgstr "" - -#: bp-forums/bp-forums-admin.php:68 bp-forums/bp-forums-admin.php:205 -#: bp-forums/deprecated/1.6.php:45 bp-forums/deprecated/1.6.php:162 -msgid "Forums for Groups" -msgstr "" - -#: bp-forums/bp-forums-admin.php:70 bp-forums/bp-forums-admin.php:207 -#: bp-forums/deprecated/1.6.php:47 bp-forums/deprecated/1.6.php:164 -msgid "Give each individual group its own discussion forum. Choose this if you'd like to keep your members' conversations separated into distinct areas." -msgstr "" - -#: bp-forums/bp-forums-admin.php:71 bp-forums/bp-forums-admin.php:208 -#: bp-forums/deprecated/1.6.php:48 bp-forums/deprecated/1.6.php:165 -msgid "You may use an existing bbPress installation if you have one." -msgstr "" - -#: bp-forums/bp-forums-admin.php:73 bp-forums/bp-forums-admin.php:91 -#: bp-forums/bp-forums-admin.php:210 bp-forums/bp-forums-admin.php:229 -#: bp-forums/deprecated/1.6.php:50 bp-forums/deprecated/1.6.php:68 -#: bp-forums/deprecated/1.6.php:167 bp-forums/deprecated/1.6.php:186 -msgid "Features" -msgstr "" - -#: bp-forums/bp-forums-admin.php:75 bp-forums/bp-forums-admin.php:212 -#: bp-forums/deprecated/1.6.php:52 bp-forums/deprecated/1.6.php:169 -msgid "Group Integration" -msgstr "" - -#: bp-forums/bp-forums-admin.php:76 bp-forums/bp-forums-admin.php:213 -#: bp-forums/deprecated/1.6.php:53 bp-forums/deprecated/1.6.php:170 -msgid "Member Profile Integration" -msgstr "" - -#: bp-forums/bp-forums-admin.php:77 bp-forums/bp-forums-admin.php:95 -#: bp-forums/bp-forums-admin.php:214 bp-forums/bp-forums-admin.php:233 -#: bp-forums/deprecated/1.6.php:54 bp-forums/deprecated/1.6.php:72 -#: bp-forums/deprecated/1.6.php:171 bp-forums/deprecated/1.6.php:190 -msgid "Activity Stream Integration" -msgstr "" - -#: bp-forums/bp-forums-admin.php:78 bp-forums/bp-forums-admin.php:96 -#: bp-forums/bp-forums-admin.php:215 bp-forums/bp-forums-admin.php:234 -#: bp-forums/deprecated/1.6.php:55 bp-forums/deprecated/1.6.php:73 -#: bp-forums/deprecated/1.6.php:172 bp-forums/deprecated/1.6.php:191 -msgid "@ Mention Integration" -msgstr "" - -#: bp-forums/bp-forums-admin.php:82 -msgid "Uninstall Group Forums" -msgstr "" - -#: bp-forums/bp-forums-admin.php:87 bp-forums/bp-forums-admin.php:225 -#: bp-forums/deprecated/1.6.php:64 bp-forums/deprecated/1.6.php:182 -msgid "New! Site Wide Forums" -msgstr "" - -#: bp-forums/bp-forums-admin.php:88 bp-forums/bp-forums-admin.php:226 -#: bp-forums/deprecated/1.6.php:65 bp-forums/deprecated/1.6.php:183 -msgid "Your site will have central forums that are not isolated to any specific group. Choose this if you'd like to have a central forum area for your members." -msgstr "" - -#: bp-forums/bp-forums-admin.php:89 bp-forums/bp-forums-admin.php:227 -#: bp-forums/deprecated/1.6.php:66 bp-forums/deprecated/1.6.php:184 -msgid "You may activate both Group and Site Wide forums, but this may create a poor experience for your members." -msgstr "" - -#: bp-forums/bp-forums-admin.php:93 bp-forums/bp-forums-admin.php:231 -#: bp-forums/deprecated/1.6.php:70 bp-forums/deprecated/1.6.php:188 -msgid "Central Discussion Area" -msgstr "" - -#: bp-forums/bp-forums-admin.php:94 bp-forums/bp-forums-admin.php:232 -#: bp-forums/deprecated/1.6.php:71 bp-forums/deprecated/1.6.php:189 -msgid "Forum Plugins Available" -msgstr "" - -#: bp-forums/bp-forums-admin.php:106 -msgid "Need help deciding between Group Forums and Site Wide Forums? Visit <a href=\"%s\">the BuddyPress codex</a> for more information." -msgstr "" - -#: bp-forums/bp-forums-admin.php:138 bp-forums/deprecated/1.6.php:95 -msgid "The bb-config.php file was not found at that location, please try again." -msgstr "" - -#: bp-forums/bp-forums-admin.php:141 bp-forums/deprecated/1.6.php:98 -msgid "Forums were set up correctly using your existing bbPress install!" -msgstr "" - -#: bp-forums/bp-forums-admin.php:142 bp-forums/deprecated/1.6.php:99 -msgid "BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location." -msgstr "" - -#: bp-forums/bp-forums-admin.php:147 bp-forums/deprecated/1.6.php:104 -msgid "Existing bbPress Installation" -msgstr "" - -#: bp-forums/bp-forums-admin.php:148 bp-forums/deprecated/1.6.php:105 -msgid "BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest." -msgstr "" - -#: bp-forums/bp-forums-admin.php:150 bp-forums/bp-forums-admin.php:182 -#: bp-forums/deprecated/1.6.php:107 bp-forums/deprecated/1.6.php:139 -msgid "Complete Installation" -msgstr "" - -#: bp-forums/bp-forums-admin.php:166 bp-forums/deprecated/1.6.php:123 -msgid "<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>" -msgstr "" - -#: bp-forums/bp-forums-admin.php:170 bp-forums/deprecated/1.6.php:127 -msgid "<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>" -msgstr "" - -#: bp-forums/bp-forums-admin.php:179 bp-forums/deprecated/1.6.php:136 -msgid "New bbPress Installation" -msgstr "" - -#: bp-forums/bp-forums-admin.php:180 bp-forums/deprecated/1.6.php:137 -msgid "" -"You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click\n" -"\t\t\t\tprocess. When you're ready, hit the link below." -msgstr "" - -#: bp-forums/bp-forums-admin.php:192 bp-forums/deprecated/1.6.php:149 -msgid "bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: \"%s\"" -msgstr "" - -#: bp-forums/bp-forums-admin.php:219 bp-forums/deprecated/1.6.php:176 -msgid "Install Group Forums" -msgstr "" - -#: bp-forums/bp-forums-admin.php:220 bp-forums/deprecated/1.6.php:177 -msgid "Use Existing Installation" +#: bp-forums/bp-forums-loader.php:25 +msgid "Discussion Forums" msgstr "" -#: bp-forums/bp-forums-loader.php:61 +#: bp-forums/bp-forums-loader.php:60 msgid "Search Forums..." msgstr "" -#: bp-forums/bp-forums-loader.php:133 bp-forums/bp-forums-loader.php:198 +#: bp-forums/bp-forums-loader.php:125 bp-forums/bp-forums-loader.php:174 msgid "Topics Started" msgstr "" -#: bp-forums/bp-forums-loader.php:144 +#: bp-forums/bp-forums-loader.php:136 msgid "Replied To" msgstr "" -#: bp-forums/bp-forums-loader.php:206 +#: bp-forums/bp-forums-loader.php:182 msgid "Replies" msgstr "" -#: bp-forums/bp-forums-loader.php:214 +#: bp-forums/bp-forums-loader.php:190 msgid "Favorite Topics" msgstr "" -#: bp-forums/bp-forums-screens.php:13 +#: bp-forums/bp-forums-screens.php:15 bp-forums/bp-forums-screens.php:162 msgid "The forums component has not been set up yet." msgstr "" -#: bp-forums/bp-forums-screens.php:36 bp-groups/bp-groups-screens.php:360 +#: bp-forums/bp-forums-screens.php:38 bp-groups/bp-groups-screens.php:381 msgid "Please provide a title for your forum topic." msgstr "" -#: bp-forums/bp-forums-screens.php:38 bp-groups/bp-groups-screens.php:362 +#: bp-forums/bp-forums-screens.php:40 bp-groups/bp-groups-screens.php:383 msgid "Forum posts cannot be empty. Please enter some text." msgstr "" -#: bp-forums/bp-forums-screens.php:45 bp-groups/bp-groups-screens.php:372 +#: bp-forums/bp-forums-screens.php:47 bp-groups/bp-groups-screens.php:395 msgid "There was an error when creating the topic" msgstr "" -#: bp-forums/bp-forums-screens.php:48 bp-groups/bp-groups-screens.php:375 +#: bp-forums/bp-forums-screens.php:50 bp-groups/bp-groups-screens.php:398 msgid "The topic was created successfully" msgstr "" -#: bp-forums/bp-forums-screens.php:56 bp-forums/bp-forums-screens.php:61 +#: bp-forums/bp-forums-screens.php:58 bp-forums/bp-forums-screens.php:63 msgid "Please pick the group forum where you would like to post this topic." msgstr "" +#: bp-forums/bp-forums-screens.php:188 bp-groups/bp-groups-template.php:1690 +#: bp-groups/bp-groups-template.php:1691 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:19 +#: bp-themes/bp-default/forums/index.php:23 +#: bp-themes/bp-default/groups/single/forum.php:19 +msgid "New Topic" +msgstr "" + #: bp-forums/bp-forums-template.php:188 bp-forums/bp-forums-template.php:404 msgctxt "Forum topic pagination previous text" msgid "←" @@ -2333,7 +2219,8 @@ msgstr "" #: bp-forums/bp-forums-template.php:505 bp-forums/bp-forums-template.php:567 #: bp-forums/bp-forums-template.php:1216 #: bp-messages/bp-messages-classes.php:269 -#: bp-messages/bp-messages-template.php:847 +#: bp-messages/bp-messages-template.php:841 +#: bp-messages/bp-messages-template.php:902 msgid "Deleted User" msgstr "" @@ -2341,11 +2228,11 @@ msgstr "" msgid "Group logo for %s" msgstr "" -#: bp-forums/bp-forums-template.php:683 bp-groups/bp-groups-template.php:835 +#: bp-forums/bp-forums-template.php:683 bp-groups/bp-groups-template.php:1013 msgid "%d post" msgstr "" -#: bp-forums/bp-forums-template.php:685 bp-groups/bp-groups-template.php:837 +#: bp-forums/bp-forums-template.php:685 bp-groups/bp-groups-template.php:1015 msgid "%d posts" msgstr "" @@ -2395,68 +2282,212 @@ msgstr "" msgid "Viewing post %1$s to %2$s (%3$s total posts)" msgstr "" -#: bp-forums/deprecated/1.6.php:59 -msgid "Reinstall Group Forums" +#: bp-forums/deprecated/1.6.php:29 bp-forums/deprecated/1.7.php:62 +msgid "Settings Saved." msgstr "" -#: bp-friends/bp-friends-actions.php:35 -msgid "Friendship could not be requested." +#: bp-forums/deprecated/1.6.php:45 bp-forums/deprecated/1.6.php:145 +#: bp-forums/deprecated/1.7.php:83 bp-forums/deprecated/1.7.php:220 +msgid "Forums for Groups" msgstr "" -#: bp-friends/bp-friends-actions.php:37 -msgid "Friendship requested" +#: bp-forums/deprecated/1.6.php:47 bp-forums/deprecated/1.6.php:147 +#: bp-forums/deprecated/1.7.php:85 bp-forums/deprecated/1.7.php:222 +msgid "Give each individual group its own discussion forum. Choose this if you'd like to keep your members' conversations separated into distinct areas." msgstr "" -#: bp-friends/bp-friends-actions.php:41 -msgid "You are already friends with this user" +#: bp-forums/deprecated/1.6.php:48 bp-forums/deprecated/1.6.php:148 +#: bp-forums/deprecated/1.7.php:86 bp-forums/deprecated/1.7.php:223 +msgid "You may use an existing bbPress installation if you have one." msgstr "" -#: bp-friends/bp-friends-actions.php:43 -msgid "You already have a pending friendship request with this user" +#: bp-forums/deprecated/1.6.php:50 bp-forums/deprecated/1.6.php:150 +#: bp-forums/deprecated/1.7.php:88 bp-forums/deprecated/1.7.php:106 +#: bp-forums/deprecated/1.7.php:225 bp-forums/deprecated/1.7.php:244 +msgid "Features" msgstr "" -#: bp-friends/bp-friends-actions.php:70 bp-themes/bp-default/_inc/ajax.php:600 -msgid "Friendship could not be canceled." +#: bp-forums/deprecated/1.6.php:52 bp-forums/deprecated/1.6.php:152 +#: bp-forums/deprecated/1.7.php:90 bp-forums/deprecated/1.7.php:227 +msgid "Group Integration" msgstr "" -#: bp-friends/bp-friends-actions.php:72 -msgid "Friendship canceled" +#: bp-forums/deprecated/1.6.php:53 bp-forums/deprecated/1.6.php:153 +#: bp-forums/deprecated/1.7.php:91 bp-forums/deprecated/1.7.php:228 +msgid "Member Profile Integration" msgstr "" -#: bp-friends/bp-friends-actions.php:76 -msgid "You are not yet friends with this user" +#: bp-forums/deprecated/1.6.php:54 bp-forums/deprecated/1.6.php:154 +#: bp-forums/deprecated/1.7.php:92 bp-forums/deprecated/1.7.php:110 +#: bp-forums/deprecated/1.7.php:229 bp-forums/deprecated/1.7.php:248 +msgid "Activity Stream Integration" msgstr "" -#: bp-friends/bp-friends-actions.php:78 -msgid "You have a pending friendship request with this user" +#: bp-forums/deprecated/1.6.php:55 bp-forums/deprecated/1.6.php:155 +#: bp-forums/deprecated/1.7.php:93 bp-forums/deprecated/1.7.php:111 +#: bp-forums/deprecated/1.7.php:230 bp-forums/deprecated/1.7.php:249 +msgid "@ Mention Integration" msgstr "" -#: bp-friends/bp-friends-activity.php:57 -msgid "Friendships accepted" +#: bp-forums/deprecated/1.6.php:59 +msgid "Reinstall Group Forums" msgstr "" -#: bp-friends/bp-friends-activity.php:58 -msgid "New friendships" +#: bp-forums/deprecated/1.6.php:78 bp-forums/deprecated/1.7.php:153 +msgid "The bb-config.php file was not found at that location, please try again." msgstr "" -#: bp-friends/bp-friends-activity.php:61 -msgid "New friendship created" +#: bp-forums/deprecated/1.6.php:81 bp-forums/deprecated/1.7.php:156 +msgid "Forums were set up correctly using your existing bbPress install!" msgstr "" -#: bp-friends/bp-friends-activity.php:86 -msgid "%d friends accepted your friendship requests" +#: bp-forums/deprecated/1.6.php:82 bp-forums/deprecated/1.7.php:157 +msgid "BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location." msgstr "" -#: bp-friends/bp-friends-activity.php:89 -#: bp-friends/bp-friends-notifications.php:71 -msgid "%s accepted your friendship request" +#: bp-forums/deprecated/1.6.php:87 bp-forums/deprecated/1.7.php:162 +msgid "Existing bbPress Installation" msgstr "" -#: bp-friends/bp-friends-activity.php:100 -msgid "You have %d pending friendship requests" +#: bp-forums/deprecated/1.6.php:88 bp-forums/deprecated/1.7.php:163 +msgid "BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest." msgstr "" -#: bp-friends/bp-friends-activity.php:103 +#: bp-forums/deprecated/1.6.php:90 bp-forums/deprecated/1.6.php:122 +#: bp-forums/deprecated/1.7.php:165 bp-forums/deprecated/1.7.php:197 +msgid "Complete Installation" +msgstr "" + +#: bp-forums/deprecated/1.6.php:106 bp-forums/deprecated/1.7.php:181 +msgid "<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>" +msgstr "" + +#: bp-forums/deprecated/1.6.php:110 bp-forums/deprecated/1.7.php:185 +msgid "<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>" +msgstr "" + +#: bp-forums/deprecated/1.6.php:119 bp-forums/deprecated/1.7.php:194 +msgid "New bbPress Installation" +msgstr "" + +#: bp-forums/deprecated/1.6.php:120 bp-forums/deprecated/1.7.php:195 +msgid "" +"You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click\n" +"\t\t\t\tprocess. When you're ready, hit the link below." +msgstr "" + +#: bp-forums/deprecated/1.6.php:132 bp-forums/deprecated/1.7.php:207 +msgid "bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: \"%s\"" +msgstr "" + +#: bp-forums/deprecated/1.6.php:159 bp-forums/deprecated/1.7.php:234 +msgid "Install Group Forums" +msgstr "" + +#: bp-forums/deprecated/1.6.php:160 bp-forums/deprecated/1.7.php:235 +msgid "Use Existing Installation" +msgstr "" + +#: bp-forums/deprecated/1.7.php:46 bp-forums/deprecated/1.7.php:143 +msgid "Configure Site Wide Forums" +msgstr "" + +#: bp-forums/deprecated/1.7.php:49 bp-forums/deprecated/1.7.php:146 +msgid "Install Site Wide Forums" +msgstr "" + +#: bp-forums/deprecated/1.7.php:83 +msgid "(Installed)" +msgstr "" + +#: bp-forums/deprecated/1.7.php:97 +msgid "Uninstall Group Forums" +msgstr "" + +#: bp-forums/deprecated/1.7.php:102 bp-forums/deprecated/1.7.php:240 +msgid "New! Site Wide Forums" +msgstr "" + +#: bp-forums/deprecated/1.7.php:103 bp-forums/deprecated/1.7.php:241 +msgid "Your site will have central forums that are not isolated to any specific group. Choose this if you'd like to have a central forum area for your members." +msgstr "" + +#: bp-forums/deprecated/1.7.php:104 bp-forums/deprecated/1.7.php:242 +msgid "You may activate both Group and Site Wide forums, but this may create a poor experience for your members." +msgstr "" + +#: bp-forums/deprecated/1.7.php:108 bp-forums/deprecated/1.7.php:246 +msgid "Central Discussion Area" +msgstr "" + +#: bp-forums/deprecated/1.7.php:109 bp-forums/deprecated/1.7.php:247 +msgid "Forum Plugins Available" +msgstr "" + +#: bp-forums/deprecated/1.7.php:121 +msgid "Need help deciding between Group Forums and Site Wide Forums? Visit <a href=\"%s\">the BuddyPress codex</a> for more information." +msgstr "" + +#: bp-friends/bp-friends-actions.php:35 +msgid "Friendship could not be requested." +msgstr "" + +#: bp-friends/bp-friends-actions.php:37 +msgid "Friendship requested" +msgstr "" + +#: bp-friends/bp-friends-actions.php:41 +msgid "You are already friends with this user" +msgstr "" + +#: bp-friends/bp-friends-actions.php:43 +msgid "You already have a pending friendship request with this user" +msgstr "" + +#: bp-friends/bp-friends-actions.php:70 +#: bp-templates/bp-legacy/buddypress-functions.php:889 +#: bp-themes/bp-default/_inc/ajax.php:605 +msgid "Friendship could not be canceled." +msgstr "" + +#: bp-friends/bp-friends-actions.php:72 +msgid "Friendship canceled" +msgstr "" + +#: bp-friends/bp-friends-actions.php:76 +msgid "You are not yet friends with this user" +msgstr "" + +#: bp-friends/bp-friends-actions.php:78 +msgid "You have a pending friendship request with this user" +msgstr "" + +#: bp-friends/bp-friends-activity.php:57 +msgid "Friendships accepted" +msgstr "" + +#: bp-friends/bp-friends-activity.php:58 +msgid "New friendships" +msgstr "" + +#: bp-friends/bp-friends-activity.php:61 +msgid "New friendship created" +msgstr "" + +#: bp-friends/bp-friends-activity.php:86 +msgid "%d friends accepted your friendship requests" +msgstr "" + +#: bp-friends/bp-friends-activity.php:89 +#: bp-friends/bp-friends-notifications.php:71 +msgid "%s accepted your friendship request" +msgstr "" + +#: bp-friends/bp-friends-activity.php:100 +msgid "You have %d pending friendship requests" +msgstr "" + +#: bp-friends/bp-friends-activity.php:103 msgid "You have a friendship request from %s" msgstr "" @@ -2473,34 +2504,36 @@ msgstr "" msgid "Friends <span>%d</span>" msgstr "" -#: bp-friends/bp-friends-loader.php:109 bp-friends/bp-friends-loader.php:171 -#: bp-friends/bp-friends-loader.php:198 +#: bp-friends/bp-friends-loader.php:118 bp-friends/bp-friends-loader.php:180 +#: bp-friends/bp-friends-loader.php:207 +#: bp-templates/bp-legacy/buddypress/activity/index.php:100 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:35 #: bp-themes/bp-default/activity/index.php:120 #: bp-themes/bp-default/members/single/activity.php:35 msgid "Friendships" msgstr "" -#: bp-friends/bp-friends-loader.php:119 bp-groups/bp-groups-template.php:1288 +#: bp-friends/bp-friends-loader.php:128 bp-groups/bp-groups-template.php:1458 msgid "Requests" msgstr "" -#: bp-friends/bp-friends-loader.php:152 +#: bp-friends/bp-friends-loader.php:161 msgid "Friends <span class=\"count\">%s</span>" msgstr "" -#: bp-friends/bp-friends-loader.php:153 +#: bp-friends/bp-friends-loader.php:162 msgid "Pending Requests <span class=\"count\">%s</span>" msgstr "" -#: bp-friends/bp-friends-loader.php:156 +#: bp-friends/bp-friends-loader.php:165 msgid "No Pending Requests" msgstr "" -#: bp-friends/bp-friends-notifications.php:32 +#: bp-friends/bp-friends-notifications.php:31 msgid "New friendship request from %s" msgstr "" -#: bp-friends/bp-friends-notifications.php:34 +#: bp-friends/bp-friends-notifications.php:32 msgid "" "%1$s wants to add you as a friend.\n" "\n" @@ -2511,7 +2544,7 @@ msgid "" "---------------------\n" msgstr "" -#: bp-friends/bp-friends-notifications.php:73 +#: bp-friends/bp-friends-notifications.php:72 msgid "" "%1$s accepted your friend request.\n" "\n" @@ -2552,7 +2585,7 @@ msgstr "" msgid "A member accepts your friendship request" msgstr "" -#: bp-friends/bp-friends-template.php:69 bp-xprofile/bp-xprofile-loader.php:117 +#: bp-friends/bp-friends-template.php:69 bp-xprofile/bp-xprofile-loader.php:121 msgid "My Friends" msgstr "" @@ -2589,7 +2622,8 @@ msgid "%d friends" msgstr "" #: bp-friends/bp-friends-template.php:285 -#: bp-themes/bp-default/_inc/ajax.php:610 +#: bp-templates/bp-legacy/buddypress-functions.php:901 +#: bp-themes/bp-default/_inc/ajax.php:617 msgid "Cancel Friendship Request" msgstr "" @@ -2604,8 +2638,10 @@ msgstr "" #: bp-friends/bp-friends-template.php:319 #: bp-friends/bp-friends-template.php:320 -#: bp-themes/bp-default/_inc/ajax.php:602 -#: bp-themes/bp-default/_inc/ajax.php:616 +#: bp-templates/bp-legacy/buddypress-functions.php:891 +#: bp-templates/bp-legacy/buddypress-functions.php:909 +#: bp-themes/bp-default/_inc/ajax.php:607 +#: bp-themes/bp-default/_inc/ajax.php:625 msgid "Add Friend" msgstr "" @@ -2629,31 +2665,31 @@ msgstr "" msgid "%1$s created the group %2$s" msgstr "" -#: bp-groups/bp-groups-actions.php:193 +#: bp-groups/bp-groups-actions.php:197 msgid "There was an error saving the group avatar, please try uploading again." msgstr "" -#: bp-groups/bp-groups-actions.php:195 +#: bp-groups/bp-groups-actions.php:199 msgid "The group avatar was uploaded successfully!" msgstr "" -#: bp-groups/bp-groups-actions.php:219 bp-groups/bp-groups-actions.php:226 +#: bp-groups/bp-groups-actions.php:223 bp-groups/bp-groups-actions.php:230 msgid "There was an error joining the group." msgstr "" -#: bp-groups/bp-groups-actions.php:228 +#: bp-groups/bp-groups-actions.php:232 msgid "You joined the group!" msgstr "" -#: bp-groups/bp-groups-actions.php:254 bp-groups/bp-groups-screens.php:660 +#: bp-groups/bp-groups-actions.php:258 bp-groups/bp-groups-screens.php:709 msgid "This group must have at least one admin" msgstr "" -#: bp-groups/bp-groups-actions.php:257 +#: bp-groups/bp-groups-actions.php:261 msgid "There was an error leaving the group." msgstr "" -#: bp-groups/bp-groups-actions.php:259 bp-groups/bp-groups-functions.php:313 +#: bp-groups/bp-groups-actions.php:263 bp-groups/bp-groups-functions.php:313 msgid "You successfully left the group." msgstr "" @@ -2729,669 +2765,995 @@ msgstr "" msgid "You have an invitation to the group: %s" msgstr "" -#: bp-groups/bp-groups-adminbar.php:40 bp-xprofile/bp-xprofile-admin.php:114 -msgid "Edit Group" +#: bp-groups/bp-groups-admin.php:109 +msgid "This page is a convenient way to edit the details associated with one of your groups." msgstr "" -#: bp-groups/bp-groups-adminbar.php:48 bp-groups/bp-groups-buddybar.php:34 -msgid "Edit Details" +#: bp-groups/bp-groups-admin.php:110 +msgid "The Name and Description box is fixed in place, but you can reposition all the other boxes using drag and drop, and can minimize or expand them by clicking the title bar of each box. Use the Screen Options tab to hide or unhide, or to choose a 1- or 2-column layout for this screen." msgstr "" -#: bp-groups/bp-groups-adminbar.php:56 -msgid "Edit Settings" +#: bp-groups/bp-groups-admin.php:116 +msgid "Support Forums" msgstr "" -#: bp-groups/bp-groups-adminbar.php:65 bp-members/bp-members-adminbar.php:107 -msgid "Edit Avatar" +#: bp-groups/bp-groups-admin.php:120 +msgctxt "group admin edit screen" +msgid "Save" msgstr "" -#: bp-groups/bp-groups-adminbar.php:75 bp-groups/bp-groups-buddybar.php:46 -msgid "Manage Invitations" +#: bp-groups/bp-groups-admin.php:121 +msgctxt "group admin edit screen" +msgid "Settings" msgstr "" -#: bp-groups/bp-groups-adminbar.php:84 bp-groups/bp-groups-buddybar.php:50 -msgid "Manage Members" +#: bp-groups/bp-groups-admin.php:122 +msgctxt "group admin edit screen" +msgid "Add New Members" msgstr "" -#: bp-groups/bp-groups-adminbar.php:93 bp-groups/bp-groups-buddybar.php:54 -msgid "Membership Requests" +#: bp-groups/bp-groups-admin.php:123 +msgctxt "group admin edit screen" +msgid "Manage Members" msgstr "" -#: bp-groups/bp-groups-adminbar.php:102 bp-groups/bp-groups-buddybar.php:58 -#: bp-themes/bp-default/groups/single/admin.php:360 -#: bp-xprofile/bp-xprofile-admin.php:118 -msgid "Delete Group" +#: bp-groups/bp-groups-admin.php:138 +msgctxt "Groups per page (screen options)" +msgid "Groups" msgstr "" -#: bp-groups/bp-groups-buddybar.php:31 bp-members/bp-members-buddybar.php:120 -msgid "Admin Options" +#: bp-groups/bp-groups-admin.php:145 +msgid "You can manage groups much like you can manage comments and other content. This screen is customizable in the same ways as other management screens, and you can act on groups by using the on-hover action links or the Bulk Actions." msgstr "" -#: bp-groups/bp-groups-buddybar.php:36 -msgid "Group Settings" +#: bp-groups/bp-groups-admin.php:150 +msgid "Group Actions" msgstr "" -#: bp-groups/bp-groups-buddybar.php:40 bp-groups/bp-groups-loader.php:570 -#: bp-groups/bp-groups-template.php:2395 -msgid "Group Avatar" +#: bp-groups/bp-groups-admin.php:152 +msgid "Clicking \"Visit\" will take you to the group’s public page. Use this link to see what the group looks like on the front end of your site." msgstr "" -#: bp-groups/bp-groups-classes.php:832 -msgid "Group Mod" +#: bp-groups/bp-groups-admin.php:153 +msgid "Clicking \"Edit\" will take you to a Dashboard panel where you can manage various details about the group, such as its name and description, its members, and other settings." msgstr "" -#: bp-groups/bp-groups-classes.php:838 bp-groups/bp-groups-functions.php:121 -msgid "Group Admin" +#: bp-groups/bp-groups-admin.php:154 +msgid "If you click \"Delete\" under a specific group, or select a number of groups and then choose Delete from the Bulk Actions menu, you will be led to a page where you’ll be asked to confirm the permanent deletion of the group(s)." msgstr "" -#: bp-groups/bp-groups-forums.php:104 bp-groups/bp-groups-forums.php:253 -msgid "%1$s replied to the forum topic %2$s in the group %3$s" +#: bp-groups/bp-groups-admin.php:169 +msgid "Start typing a username to add a new member." msgstr "" -#: bp-groups/bp-groups-forums.php:154 bp-groups/bp-groups-forums.php:206 -msgid "%1$s started the forum topic %2$s in the group %3$s" +#: bp-groups/bp-groups-admin.php:443 +msgid "You cannot remove all administrators from a group." msgstr "" -#: bp-groups/bp-groups-functions.php:288 -msgid "As the only Admin, you cannot leave the group." +#: bp-groups/bp-groups-admin.php:447 +msgid "An error occurred when trying to update your group details." msgstr "" -#: bp-groups/bp-groups-functions.php:357 bp-groups/bp-groups-functions.php:848 -#: bp-groups/bp-groups-screens.php:61 -msgid "%1$s joined the group %2$s" +#: bp-groups/bp-groups-admin.php:449 +msgid "The group has been updated successfully." msgstr "" -#: bp-groups/bp-groups-functions.php:538 -msgid "%1$s posted an update in the group %2$s" +#: bp-groups/bp-groups-admin.php:453 +msgid "The following users could not be added to the group: <em>%s</em>" msgstr "" -#: bp-groups/bp-groups-loader.php:140 -msgid "Search Groups..." +#: bp-groups/bp-groups-admin.php:457 +msgid "The following users were successfully added to the group: <em>%s</em>" msgstr "" -#: bp-groups/bp-groups-loader.php:269 -msgid "You do not have access to this group." +#: bp-groups/bp-groups-admin.php:462 +msgid "An error occurred when trying to modify the following members: <em>%s</em>" msgstr "" -#: bp-groups/bp-groups-loader.php:284 -msgid "You are not an admin of this group." +#: bp-groups/bp-groups-admin.php:467 +msgid "The following members were successfully modified: <em>%s</em>" msgstr "" -#: bp-groups/bp-groups-loader.php:294 bp-groups/bp-groups-template.php:1269 -msgid "Details" +#: bp-groups/bp-groups-admin.php:486 bp-groups/bp-groups-adminbar.php:40 +#: bp-xprofile/bp-xprofile-admin.php:114 +msgid "Edit Group" msgstr "" -#: bp-groups/bp-groups-loader.php:306 bp-groups/bp-groups-template.php:1280 -msgid "Avatar" +#: bp-groups/bp-groups-admin.php:489 +msgid "Add New" msgstr "" -#: bp-groups/bp-groups-loader.php:314 -msgid "Invites" +#: bp-groups/bp-groups-admin.php:508 +msgid "Name and Description" msgstr "" -#: bp-groups/bp-groups-loader.php:342 -msgid "Groups <span>%d</span>" +#: bp-groups/bp-groups-admin.php:535 +msgid "No group found with this ID. <a href=\"%s\">Go back and try again</a>." msgstr "" -#: bp-groups/bp-groups-loader.php:354 bp-groups/bp-groups-loader.php:383 -#: bp-groups/bp-groups-loader.php:522 bp-groups/bp-groups-loader.php:550 -msgid "Memberships" +#: bp-groups/bp-groups-admin.php:573 +msgid "Delete Groups" msgstr "" -#: bp-groups/bp-groups-loader.php:365 -msgid "Invitations" +#: bp-groups/bp-groups-admin.php:574 +msgid "You are about to delete the following groups:" msgstr "" -#: bp-groups/bp-groups-loader.php:395 -msgctxt "Group home navigation title" -msgid "Home" +#: bp-groups/bp-groups-admin.php:582 +msgid "This action cannot be undone." msgstr "" -#: bp-groups/bp-groups-loader.php:412 bp-groups/bp-groups-template.php:1580 -#: bp-groups/bp-groups-template.php:1581 bp-themes/bp-default/_inc/ajax.php:708 -msgid "Request Membership" -msgstr "" +#: bp-groups/bp-groups-admin.php:609 +msgid "%s group has been permanently deleted." +msgid_plural "%s groups have been permanently deleted." +msgstr[0] "" +msgstr[1] "" -#: bp-groups/bp-groups-loader.php:424 -msgid "Forum" +#: bp-groups/bp-groups-admin.php:638 +msgid "Search all Groups" msgstr "" -#: bp-groups/bp-groups-loader.php:436 -msgid "Members <span>%s</span>" +#: bp-groups/bp-groups-admin.php:660 +#: bp-templates/bp-legacy/buddypress/groups/create.php:112 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:47 +#: bp-themes/bp-default/groups/create.php:119 +#: bp-themes/bp-default/groups/single/admin.php:47 +msgid "Enable discussion forum" msgstr "" -#: bp-groups/bp-groups-loader.php:448 -#: bp-themes/bp-default/groups/single/send-invites.php:60 -msgid "Send Invites" +#: bp-groups/bp-groups-admin.php:665 +msgid "Privacy" msgstr "" -#: bp-groups/bp-groups-loader.php:462 -msgid "Admin" +#: bp-groups/bp-groups-admin.php:668 bp-groups/bp-groups-admin.php:1295 +#: bp-groups/bp-groups-template.php:625 +msgid "Public" msgstr "" -#: bp-groups/bp-groups-loader.php:503 -msgid "No Pending Invites" +#: bp-groups/bp-groups-admin.php:669 bp-groups/bp-groups-admin.php:1298 +#: bp-groups/bp-groups-template.php:627 +msgid "Private" msgstr "" -#: bp-groups/bp-groups-loader.php:506 -msgid "Groups <span class=\"count\">%s</span>" +#: bp-groups/bp-groups-admin.php:670 bp-groups/bp-groups-admin.php:1301 +msgid "Hidden" msgstr "" -#: bp-groups/bp-groups-loader.php:507 -msgid "Pending Invites <span class=\"count\">%s</span>" +#: bp-groups/bp-groups-admin.php:674 +msgid "Who can invite others to this group?" msgstr "" -#: bp-groups/bp-groups-notifications.php:20 -msgid "Group Details Updated" +#: bp-groups/bp-groups-admin.php:677 +#: bp-templates/bp-legacy/buddypress/groups/create.php:89 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:99 +#: bp-themes/bp-default/groups/create.php:96 +#: bp-themes/bp-default/groups/single/admin.php:99 +msgid "All group members" msgstr "" -#: bp-groups/bp-groups-notifications.php:35 -msgid "" -"Group details for the group \"%1$s\" were updated:\n" -"\n" -"To view the group: %2$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-admin.php:678 +#: bp-templates/bp-legacy/buddypress/groups/create.php:94 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:104 +#: bp-themes/bp-default/groups/create.php:101 +#: bp-themes/bp-default/groups/single/admin.php:104 +msgid "Group admins and mods only" msgstr "" -#: bp-groups/bp-groups-notifications.php:77 -msgid "Membership request for group: %s" +#: bp-groups/bp-groups-admin.php:679 +#: bp-templates/bp-legacy/buddypress/groups/create.php:99 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:109 +#: bp-themes/bp-default/groups/create.php:106 +#: bp-themes/bp-default/groups/single/admin.php:109 +msgid "Group admins only" msgstr "" -#: bp-groups/bp-groups-notifications.php:79 -msgid "" -"%1$s wants to join the group \"%2$s\".\n" -"\n" -"Because you are the administrator of this group, you must either accept or reject the membership request.\n" -"\n" -"To view all pending membership requests for this group, please visit:\n" -"%3$s\n" -"\n" -"To view %4$s's profile: %5$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-admin.php:694 +msgid "Enter a comma-separated list of user logins." msgstr "" -#: bp-groups/bp-groups-notifications.php:128 -msgid "Membership request for group \"%s\" accepted" +#: bp-groups/bp-groups-admin.php:762 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:177 +#: bp-themes/bp-default/groups/single/admin.php:177 +msgid "Administrators" msgstr "" -#: bp-groups/bp-groups-notifications.php:129 -msgid "" -"Your membership request for the group \"%1$s\" has been accepted.\n" -"\n" -"To view the group please login and visit: %2$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-admin.php:763 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:205 +#: bp-themes/bp-default/groups/single/admin.php:205 +msgid "Moderators" msgstr "" -#: bp-groups/bp-groups-notifications.php:138 -msgid "Membership request for group \"%s\" rejected" +#: bp-groups/bp-groups-admin.php:765 +msgid "Banned Users" msgstr "" -#: bp-groups/bp-groups-notifications.php:139 -msgid "" -"Your membership request for the group \"%1$s\" has been rejected.\n" -"\n" -"To submit another request please log in and visit: %2$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-admin.php:774 +msgctxt "Group member user_id in group admin" +msgid "ID" msgstr "" -#: bp-groups/bp-groups-notifications.php:163 -msgid "an administrator" +#: bp-groups/bp-groups-admin.php:775 +msgctxt "Group member name in group admin" +msgid "Name" msgstr "" -#: bp-groups/bp-groups-notifications.php:166 -msgid "a moderator" +#: bp-groups/bp-groups-admin.php:776 +msgctxt "Group member role in group admin" +msgid "Group Role" msgstr "" -#: bp-groups/bp-groups-notifications.php:185 -msgid "You have been promoted in the group: \"%s\"" +#: bp-groups/bp-groups-admin.php:799 +msgid "Administrator" msgstr "" -#: bp-groups/bp-groups-notifications.php:187 -msgid "" -"You have been promoted to %1$s for the group: \"%2$s\".\n" -"\n" -"To view the group please visit: %3$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-admin.php:800 +msgid "Moderator" msgstr "" -#: bp-groups/bp-groups-notifications.php:235 -msgid "You have an invitation to the group: \"%s\"" +#: bp-groups/bp-groups-admin.php:801 +msgid "Member" msgstr "" -#: bp-groups/bp-groups-notifications.php:237 -msgid "" -"One of your friends %1$s has invited you to the group: \"%2$s\".\n" -"\n" -"To view your group invites visit: %3$s\n" -"\n" -"To view the group visit: %4$s\n" -"\n" -"To view %5$s's profile visit: %6$s\n" -"\n" -"---------------------\n" +#: bp-groups/bp-groups-admin.php:802 +msgid "Banned" msgstr "" -#: bp-groups/bp-groups-screens.php:53 -msgid "Group invite could not be accepted" +#: bp-groups/bp-groups-admin.php:803 +msgid "Remove From Group" msgstr "" -#: bp-groups/bp-groups-screens.php:55 -msgid "Group invite accepted" +#: bp-groups/bp-groups-admin.php:824 +msgid "No members of this type" msgstr "" -#: bp-groups/bp-groups-screens.php:75 -msgid "Group invite could not be rejected" -msgstr "" +#: bp-groups/bp-groups-admin.php:849 bp-groups/bp-groups-adminbar.php:102 +#: bp-groups/bp-groups-buddybar.php:58 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:360 +#: bp-themes/bp-default/groups/single/admin.php:360 +#: bp-xprofile/bp-xprofile-admin.php:118 +msgid "Delete Group" +msgstr "" + +#: bp-groups/bp-groups-admin.php:853 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:32 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:117 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:58 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:74 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:148 +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:30 +#: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:19 +#: bp-themes/bp-default/groups/single/admin.php:32 +#: bp-themes/bp-default/groups/single/admin.php:117 +#: bp-themes/bp-default/groups/single/forum/edit.php:58 +#: bp-themes/bp-default/groups/single/forum/edit.php:74 +#: bp-themes/bp-default/members/single/profile/edit.php:148 +#: bp-themes/bp-default/members/single/settings/general.php:72 +#: bp-themes/bp-default/members/single/settings/notifications.php:61 +#: bp-xprofile/bp-xprofile-classes.php:360 +msgid "Save Changes" +msgstr "" + +#. translators: 1: user_login, 2: user_email + +#: bp-groups/bp-groups-admin.php:906 +msgid "%1$s (%2$s)" +msgstr "" + +#: bp-groups/bp-groups-admin.php:1075 +msgid "No groups found." +msgstr "" + +#: bp-groups/bp-groups-admin.php:1139 +msgid "Public <span class=\"count\">(%s)</span>" +msgstr "" + +#: bp-groups/bp-groups-admin.php:1140 +msgid "Private <span class=\"count\">(%s)</span>" +msgstr "" + +#: bp-groups/bp-groups-admin.php:1141 +msgid "Hidden <span class=\"count\">(%s)</span>" +msgstr "" + +#: bp-groups/bp-groups-admin.php:1170 +msgctxt "Groups admin Group Name column header" +msgid "Name" +msgstr "" + +#: bp-groups/bp-groups-admin.php:1171 +msgctxt "Groups admin Group Description column header" +msgid "Description" +msgstr "" + +#: bp-groups/bp-groups-admin.php:1172 +msgctxt "Groups admin Privacy Status column header" +msgid "Status" +msgstr "" + +#: bp-groups/bp-groups-admin.php:1173 +msgctxt "Groups admin Members column header" +msgid "# Members" +msgstr "" + +#: bp-groups/bp-groups-admin.php:1174 +msgctxt "Groups admin Last Active column header" +msgid "Last Active" +msgstr "" + +#: bp-groups/bp-groups-adminbar.php:48 bp-groups/bp-groups-buddybar.php:34 +msgid "Edit Details" +msgstr "" + +#: bp-groups/bp-groups-adminbar.php:56 +msgid "Edit Settings" +msgstr "" + +#: bp-groups/bp-groups-adminbar.php:65 bp-members/bp-members-adminbar.php:107 +msgid "Edit Avatar" +msgstr "" + +#: bp-groups/bp-groups-adminbar.php:75 bp-groups/bp-groups-buddybar.php:46 +msgid "Manage Invitations" +msgstr "" + +#: bp-groups/bp-groups-adminbar.php:84 bp-groups/bp-groups-buddybar.php:50 +msgid "Manage Members" +msgstr "" + +#: bp-groups/bp-groups-adminbar.php:93 bp-groups/bp-groups-buddybar.php:54 +msgid "Membership Requests" +msgstr "" + +#: bp-groups/bp-groups-buddybar.php:31 bp-members/bp-members-buddybar.php:120 +msgid "Admin Options" +msgstr "" + +#: bp-groups/bp-groups-buddybar.php:36 +msgid "Group Settings" +msgstr "" + +#: bp-groups/bp-groups-buddybar.php:40 bp-groups/bp-groups-loader.php:585 +#: bp-groups/bp-groups-template.php:2586 +msgid "Group Avatar" +msgstr "" + +#: bp-groups/bp-groups-classes.php:878 +msgid "Group Mod" +msgstr "" + +#: bp-groups/bp-groups-classes.php:884 bp-groups/bp-groups-functions.php:121 +msgid "Group Admin" +msgstr "" + +#: bp-groups/bp-groups-forums.php:104 bp-groups/bp-groups-forums.php:253 +msgid "%1$s replied to the forum topic %2$s in the group %3$s" +msgstr "" + +#: bp-groups/bp-groups-forums.php:154 +msgid "%1$s started the forum topic %2$s in the group %3$s" +msgstr "" + +#: bp-groups/bp-groups-forums.php:206 +msgid "%1$s edited the forum topic %2$s in the group %3$s" +msgstr "" + +#: bp-groups/bp-groups-functions.php:288 +msgid "As the only Admin, you cannot leave the group." +msgstr "" + +#: bp-groups/bp-groups-functions.php:357 bp-groups/bp-groups-functions.php:878 +#: bp-groups/bp-groups-screens.php:62 +msgid "%1$s joined the group %2$s" +msgstr "" + +#: bp-groups/bp-groups-functions.php:568 +msgid "%1$s posted an update in the group %2$s" +msgstr "" + +#: bp-groups/bp-groups-loader.php:144 +msgid "Search Groups..." +msgstr "" + +#: bp-groups/bp-groups-loader.php:273 +msgid "You do not have access to this group." +msgstr "" + +#: bp-groups/bp-groups-loader.php:288 +msgid "You are not an admin of this group." +msgstr "" + +#: bp-groups/bp-groups-loader.php:298 bp-groups/bp-groups-template.php:1439 +msgid "Details" +msgstr "" + +#: bp-groups/bp-groups-loader.php:310 bp-groups/bp-groups-template.php:1450 +msgid "Avatar" +msgstr "" + +#: bp-groups/bp-groups-loader.php:318 +msgid "Invites" +msgstr "" + +#: bp-groups/bp-groups-loader.php:346 +msgid "Groups <span>%d</span>" +msgstr "" + +#: bp-groups/bp-groups-loader.php:368 bp-groups/bp-groups-loader.php:398 +#: bp-groups/bp-groups-loader.php:537 bp-groups/bp-groups-loader.php:565 +msgid "Memberships" +msgstr "" + +#: bp-groups/bp-groups-loader.php:379 +msgid "Invitations" +msgstr "" + +#: bp-groups/bp-groups-loader.php:410 +msgctxt "Group home navigation title" +msgid "Home" +msgstr "" + +#: bp-groups/bp-groups-loader.php:427 bp-groups/bp-groups-template.php:1771 +#: bp-groups/bp-groups-template.php:1772 +#: bp-templates/bp-legacy/buddypress-functions.php:1008 +#: bp-themes/bp-default/_inc/ajax.php:724 +msgid "Request Membership" +msgstr "" + +#: bp-groups/bp-groups-loader.php:439 +msgid "Forum" +msgstr "" + +#: bp-groups/bp-groups-loader.php:451 +msgid "Members <span>%s</span>" +msgstr "" + +#: bp-groups/bp-groups-loader.php:463 +#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:60 +#: bp-themes/bp-default/groups/single/send-invites.php:60 +msgid "Send Invites" +msgstr "" + +#: bp-groups/bp-groups-loader.php:477 +msgid "Admin" +msgstr "" + +#: bp-groups/bp-groups-loader.php:518 +msgid "No Pending Invites" +msgstr "" + +#: bp-groups/bp-groups-loader.php:521 +msgid "Groups <span class=\"count\">%s</span>" +msgstr "" + +#: bp-groups/bp-groups-loader.php:522 +msgid "Pending Invites <span class=\"count\">%s</span>" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:19 +msgid "Group Details Updated" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:34 +msgid "" +"Group details for the group \"%1$s\" were updated:\n" +"\n" +"To view the group: %2$s\n" +"\n" +"---------------------\n" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:75 +msgid "Membership request for group: %s" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:77 +msgid "" +"%1$s wants to join the group \"%2$s\".\n" +"\n" +"Because you are the administrator of this group, you must either accept or reject the membership request.\n" +"\n" +"To view all pending membership requests for this group, please visit:\n" +"%3$s\n" +"\n" +"To view %4$s's profile: %5$s\n" +"\n" +"---------------------\n" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:128 +msgid "Membership request for group \"%s\" accepted" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:129 +msgid "" +"Your membership request for the group \"%1$s\" has been accepted.\n" +"\n" +"To view the group please login and visit: %2$s\n" +"\n" +"---------------------\n" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:138 +msgid "Membership request for group \"%s\" rejected" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:139 +msgid "" +"Your membership request for the group \"%1$s\" has been rejected.\n" +"\n" +"To submit another request please log in and visit: %2$s\n" +"\n" +"---------------------\n" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:166 +msgid "an administrator" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:169 +msgid "a moderator" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:187 +msgid "You have been promoted in the group: \"%s\"" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:188 +msgid "" +"You have been promoted to %1$s for the group: \"%2$s\".\n" +"\n" +"To view the group please visit: %3$s\n" +"\n" +"---------------------\n" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:238 +msgid "You have an invitation to the group: \"%s\"" +msgstr "" + +#: bp-groups/bp-groups-notifications.php:240 +msgid "" +"One of your friends %1$s has invited you to the group: \"%2$s\".\n" +"\n" +"To view your group invites visit: %3$s\n" +"\n" +"To view the group visit: %4$s\n" +"\n" +"To view %5$s's profile visit: %6$s\n" +"\n" +"---------------------\n" +msgstr "" + +#: bp-groups/bp-groups-screens.php:54 +msgid "Group invite could not be accepted" +msgstr "" + +#: bp-groups/bp-groups-screens.php:56 +msgid "Group invite accepted" +msgstr "" -#: bp-groups/bp-groups-screens.php:77 +#: bp-groups/bp-groups-screens.php:76 +msgid "Group invite could not be rejected" +msgstr "" + +#: bp-groups/bp-groups-screens.php:78 msgid "Group invite rejected" msgstr "" -#: bp-groups/bp-groups-screens.php:154 +#: bp-groups/bp-groups-screens.php:161 msgid "It looks like you've already said that!" msgstr "" -#: bp-groups/bp-groups-screens.php:157 +#: bp-groups/bp-groups-screens.php:164 msgid "There was an error when replying to that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:159 +#: bp-groups/bp-groups-screens.php:166 msgid "Your reply was posted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:179 +#: bp-groups/bp-groups-screens.php:187 msgid "There was an error when making that topic a sticky" msgstr "" -#: bp-groups/bp-groups-screens.php:181 +#: bp-groups/bp-groups-screens.php:189 msgid "The topic was made sticky successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:193 +#: bp-groups/bp-groups-screens.php:202 msgid "There was an error when unsticking that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:195 +#: bp-groups/bp-groups-screens.php:204 msgid "The topic was unstuck successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:207 +#: bp-groups/bp-groups-screens.php:217 msgid "There was an error when closing that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:209 +#: bp-groups/bp-groups-screens.php:219 msgid "The topic was closed successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:221 +#: bp-groups/bp-groups-screens.php:232 msgid "There was an error when opening that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:223 +#: bp-groups/bp-groups-screens.php:234 msgid "The topic was opened successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:244 +#: bp-groups/bp-groups-screens.php:257 msgid "There was an error deleting the topic" msgstr "" -#: bp-groups/bp-groups-screens.php:246 +#: bp-groups/bp-groups-screens.php:259 msgid "The topic was deleted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:268 +#: bp-groups/bp-groups-screens.php:283 msgid "There was an error when editing that topic" msgstr "" -#: bp-groups/bp-groups-screens.php:270 +#: bp-groups/bp-groups-screens.php:285 msgid "The topic was edited successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:294 +#: bp-groups/bp-groups-screens.php:310 msgid "There was an error deleting that post" msgstr "" -#: bp-groups/bp-groups-screens.php:296 +#: bp-groups/bp-groups-screens.php:312 msgid "The post was deleted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:318 +#: bp-groups/bp-groups-screens.php:336 msgid "There was an error when editing that post" msgstr "" -#: bp-groups/bp-groups-screens.php:320 +#: bp-groups/bp-groups-screens.php:338 msgid "The post was edited successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:335 bp-groups/bp-groups-screens.php:352 +#: bp-groups/bp-groups-screens.php:354 bp-groups/bp-groups-screens.php:373 msgid "You have been banned from this group." msgstr "" -#: bp-groups/bp-groups-screens.php:365 +#: bp-groups/bp-groups-screens.php:387 msgid "This group does not have a forum setup yet." msgstr "" -#: bp-groups/bp-groups-screens.php:419 +#: bp-groups/bp-groups-screens.php:446 msgid "Group invites sent." msgstr "" -#: bp-groups/bp-groups-screens.php:447 +#: bp-groups/bp-groups-screens.php:478 msgid "There was an error sending your group membership request, please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:449 +#: bp-groups/bp-groups-screens.php:480 msgid "Your membership request was sent to the group administrator successfully. You will be notified when the group administrator responds to your request." msgstr "" -#: bp-groups/bp-groups-screens.php:496 +#: bp-groups/bp-groups-screens.php:527 msgid "There was an error updating group details, please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:498 +#: bp-groups/bp-groups-screens.php:529 msgid "Group details were successfully updated." msgstr "" -#: bp-groups/bp-groups-screens.php:539 +#: bp-groups/bp-groups-screens.php:571 msgid "There was an error updating group settings, please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:541 +#: bp-groups/bp-groups-screens.php:573 msgid "Group settings were successfully updated." msgstr "" -#: bp-groups/bp-groups-screens.php:572 bp-xprofile/bp-xprofile-actions.php:40 +#: bp-groups/bp-groups-screens.php:605 bp-xprofile/bp-xprofile-actions.php:39 msgid "Your avatar was deleted successfully!" msgstr "" -#: bp-groups/bp-groups-screens.php:574 bp-xprofile/bp-xprofile-actions.php:42 +#: bp-groups/bp-groups-screens.php:607 bp-xprofile/bp-xprofile-actions.php:41 msgid "There was a problem deleting that avatar, please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:602 -msgid "There was a problem cropping the avatar, please try uploading it again" +#: bp-groups/bp-groups-screens.php:650 +msgid "There was a problem cropping the avatar." msgstr "" -#: bp-groups/bp-groups-screens.php:604 -msgid "The new group avatar was uploaded successfully!" +#: bp-groups/bp-groups-screens.php:652 +msgid "The new group avatar was uploaded successfully." msgstr "" -#: bp-groups/bp-groups-screens.php:639 +#: bp-groups/bp-groups-screens.php:688 msgid "There was an error when promoting that user, please try again" msgstr "" -#: bp-groups/bp-groups-screens.php:641 +#: bp-groups/bp-groups-screens.php:690 msgid "User promoted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:664 +#: bp-groups/bp-groups-screens.php:713 msgid "There was an error when demoting that user, please try again" msgstr "" -#: bp-groups/bp-groups-screens.php:666 +#: bp-groups/bp-groups-screens.php:715 msgid "User demoted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:682 +#: bp-groups/bp-groups-screens.php:731 msgid "There was an error when banning that user, please try again" msgstr "" -#: bp-groups/bp-groups-screens.php:684 +#: bp-groups/bp-groups-screens.php:733 msgid "User banned successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:700 +#: bp-groups/bp-groups-screens.php:749 msgid "There was an error when unbanning that user, please try again" msgstr "" -#: bp-groups/bp-groups-screens.php:702 +#: bp-groups/bp-groups-screens.php:751 msgid "User ban removed successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:718 +#: bp-groups/bp-groups-screens.php:767 msgid "There was an error removing that user from the group, please try again" msgstr "" -#: bp-groups/bp-groups-screens.php:720 +#: bp-groups/bp-groups-screens.php:769 msgid "User removed successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:758 +#: bp-groups/bp-groups-screens.php:807 msgid "There was an error accepting the membership request, please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:760 +#: bp-groups/bp-groups-screens.php:809 msgid "Group membership request accepted" msgstr "" -#: bp-groups/bp-groups-screens.php:769 +#: bp-groups/bp-groups-screens.php:818 msgid "There was an error rejecting the membership request, please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:771 +#: bp-groups/bp-groups-screens.php:820 msgid "Group membership request rejected" msgstr "" -#: bp-groups/bp-groups-screens.php:801 +#: bp-groups/bp-groups-screens.php:852 msgid "There was an error deleting the group, please try again." msgstr "" -#: bp-groups/bp-groups-screens.php:803 +#: bp-groups/bp-groups-screens.php:854 msgid "The group was deleted successfully" msgstr "" -#: bp-groups/bp-groups-screens.php:853 +#: bp-groups/bp-groups-screens.php:902 msgid "A member invites you to join a group" msgstr "" -#: bp-groups/bp-groups-screens.php:859 +#: bp-groups/bp-groups-screens.php:908 msgid "Group information is updated" msgstr "" -#: bp-groups/bp-groups-screens.php:865 +#: bp-groups/bp-groups-screens.php:914 msgid "You are promoted to a group administrator or moderator" msgstr "" -#: bp-groups/bp-groups-screens.php:871 +#: bp-groups/bp-groups-screens.php:920 msgid "A member requests to join a private group for which you are an admin" msgstr "" -#: bp-groups/bp-groups-template.php:173 +#: bp-groups/bp-groups-template.php:214 msgctxt "Group pagination previous text" msgid "←" msgstr "" -#: bp-groups/bp-groups-template.php:174 +#: bp-groups/bp-groups-template.php:215 msgctxt "Group pagination next text" msgid "→" msgstr "" -#: bp-groups/bp-groups-template.php:355 +#: bp-groups/bp-groups-template.php:458 msgid "Public Group" msgstr "" -#: bp-groups/bp-groups-template.php:357 +#: bp-groups/bp-groups-template.php:460 msgid "Hidden Group" msgstr "" -#: bp-groups/bp-groups-template.php:359 +#: bp-groups/bp-groups-template.php:462 msgid "Private Group" msgstr "" -#: bp-groups/bp-groups-template.php:361 +#: bp-groups/bp-groups-template.php:464 msgid "Group" msgstr "" -#: bp-groups/bp-groups-template.php:433 +#: bp-groups/bp-groups-template.php:536 msgid "not yet active" msgstr "" -#: bp-groups/bp-groups-template.php:524 -msgid "Private" +#: bp-groups/bp-groups-template.php:718 +msgid "Group creator avatar of %s" msgstr "" -#: bp-groups/bp-groups-template.php:575 +#: bp-groups/bp-groups-template.php:753 msgid "No Admins" msgstr "" -#: bp-groups/bp-groups-template.php:602 +#: bp-groups/bp-groups-template.php:780 msgid "No Mods" msgstr "" -#: bp-groups/bp-groups-template.php:684 +#: bp-groups/bp-groups-template.php:862 msgid "Filter Groups" msgstr "" -#: bp-groups/bp-groups-template.php:732 +#: bp-groups/bp-groups-template.php:910 msgid "Viewing group %1$s to %2$s (of %3$s groups)" msgstr "" -#: bp-groups/bp-groups-template.php:760 +#: bp-groups/bp-groups-template.php:938 msgid "%s member" msgstr "" -#: bp-groups/bp-groups-template.php:762 +#: bp-groups/bp-groups-template.php:940 +#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:14 #: bp-themes/bp-default/members/single/groups/invites.php:14 msgid "%s members" msgstr "" -#: bp-groups/bp-groups-template.php:801 +#: bp-groups/bp-groups-template.php:979 msgid "%d topic" msgstr "" -#: bp-groups/bp-groups-template.php:803 +#: bp-groups/bp-groups-template.php:981 msgid "%d topics" msgstr "" -#: bp-groups/bp-groups-template.php:1037 bp-groups/bp-groups-template.php:1102 +#: bp-groups/bp-groups-template.php:1207 bp-groups/bp-groups-template.php:1272 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:190 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:217 #: bp-themes/bp-default/groups/single/admin.php:190 #: bp-themes/bp-default/groups/single/admin.php:217 msgid "Demote to Member" msgstr "" -#: bp-groups/bp-groups-template.php:1050 bp-groups/bp-groups-template.php:1115 -#: bp-groups/bp-groups-template.php:1894 +#: bp-groups/bp-groups-template.php:1220 bp-groups/bp-groups-template.php:1285 +#: bp-groups/bp-groups-template.php:2085 msgid "joined %s" msgstr "" -#: bp-groups/bp-groups-template.php:1073 +#: bp-groups/bp-groups-template.php:1243 msgid "This group has no administrators" msgstr "" -#: bp-groups/bp-groups-template.php:1101 +#: bp-groups/bp-groups-template.php:1271 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:216 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:272 #: bp-themes/bp-default/groups/single/admin.php:216 #: bp-themes/bp-default/groups/single/admin.php:272 msgid "Promote to Admin" msgstr "" -#: bp-groups/bp-groups-template.php:1135 +#: bp-groups/bp-groups-template.php:1305 msgid "This group has no moderators" msgstr "" -#: bp-groups/bp-groups-template.php:1499 bp-groups/bp-groups-template.php:1500 -#: bp-themes/bp-default/forums/index.php:23 -#: bp-themes/bp-default/groups/single/forum.php:19 -msgid "New Topic" -msgstr "" - -#: bp-groups/bp-groups-template.php:1539 bp-groups/bp-groups-template.php:1540 -#: bp-themes/bp-default/_inc/ajax.php:689 +#: bp-groups/bp-groups-template.php:1730 bp-groups/bp-groups-template.php:1731 +#: bp-templates/bp-legacy/buddypress-functions.php:987 +#: bp-themes/bp-default/_inc/ajax.php:703 msgid "Leave Group" msgstr "" -#: bp-groups/bp-groups-template.php:1562 bp-groups/bp-groups-template.php:1563 -#: bp-themes/bp-default/_inc/ajax.php:706 +#: bp-groups/bp-groups-template.php:1753 bp-groups/bp-groups-template.php:1754 +#: bp-templates/bp-legacy/buddypress-functions.php:1006 +#: bp-themes/bp-default/_inc/ajax.php:722 msgid "Join Group" msgstr "" -#: bp-groups/bp-groups-template.php:1595 bp-groups/bp-groups-template.php:1596 +#: bp-groups/bp-groups-template.php:1786 bp-groups/bp-groups-template.php:1787 msgid "Request Sent" msgstr "" -#: bp-groups/bp-groups-template.php:1626 +#: bp-groups/bp-groups-template.php:1817 msgid "This is a private group and you must request group membership in order to join." msgstr "" -#: bp-groups/bp-groups-template.php:1628 +#: bp-groups/bp-groups-template.php:1819 msgid "This is a private group. To join you must be a registered site member and request group membership." msgstr "" -#: bp-groups/bp-groups-template.php:1631 +#: bp-groups/bp-groups-template.php:1822 msgid "This is a private group. Your membership request is awaiting approval from the group administrator." msgstr "" -#: bp-groups/bp-groups-template.php:1635 +#: bp-groups/bp-groups-template.php:1826 msgid "This is a hidden group and only invited members can join." msgstr "" -#: bp-groups/bp-groups-template.php:1942 +#: bp-groups/bp-groups-template.php:2133 msgid "Viewing members %1$s to %2$s (of %3$s members)" msgstr "" -#: bp-groups/bp-groups-template.php:2168 +#: bp-groups/bp-groups-template.php:2359 msgid "Group avatar" msgstr "" -#: bp-groups/bp-groups-template.php:2308 bp-groups/bp-groups-template.php:2332 +#: bp-groups/bp-groups-template.php:2499 bp-groups/bp-groups-template.php:2523 msgid "Recently Joined" msgstr "" -#: bp-groups/bp-groups-template.php:2309 bp-groups/bp-groups-template.php:2335 +#: bp-groups/bp-groups-template.php:2500 bp-groups/bp-groups-template.php:2526 msgid "Most Popular" msgstr "" -#: bp-groups/bp-groups-template.php:2310 bp-groups/bp-groups-template.php:2338 +#: bp-groups/bp-groups-template.php:2501 bp-groups/bp-groups-template.php:2529 msgid "Administrator Of" msgstr "" -#: bp-groups/bp-groups-template.php:2311 bp-groups/bp-groups-template.php:2341 +#: bp-groups/bp-groups-template.php:2502 bp-groups/bp-groups-template.php:2532 msgid "Moderator Of" msgstr "" -#: bp-groups/bp-groups-template.php:2399 +#: bp-groups/bp-groups-template.php:2590 msgid "No Group Avatar" msgstr "" -#: bp-groups/bp-groups-template.php:2600 +#: bp-groups/bp-groups-template.php:2791 msgid "requested %s" msgstr "" -#: bp-groups/bp-groups-template.php:2775 +#: bp-groups/bp-groups-template.php:2966 msgid "Group Activity RSS Feed" msgstr "" -#: bp-groups/bp-groups-widgets.php:27 +#: bp-groups/bp-groups-widgets.php:28 msgid "A dynamic list of recently active, popular, and newest groups" msgstr "" -#: bp-groups/bp-groups-widgets.php:78 bp-groups/bp-groups-widgets.php:183 +#: bp-groups/bp-groups-widgets.php:31 +msgctxt "widget name" +msgid "(BuddyPress) Groups" +msgstr "" + +#: bp-groups/bp-groups-widgets.php:76 bp-groups/bp-groups-widgets.php:179 msgid "created %s" msgstr "" -#: bp-groups/bp-groups-widgets.php:97 +#: bp-groups/bp-groups-widgets.php:95 msgid "There are no groups to display." msgstr "" -#: bp-groups/bp-groups-widgets.php:134 +#: bp-groups/bp-groups-widgets.php:132 msgid "Link widget title to Groups directory" msgstr "" -#: bp-groups/bp-groups-widgets.php:136 +#: bp-groups/bp-groups-widgets.php:134 msgid "Max groups to show:" msgstr "" -#: bp-groups/bp-groups-widgets.php:139 +#: bp-groups/bp-groups-widgets.php:137 msgid "Default groups to show:" msgstr "" -#: bp-groups/bp-groups-widgets.php:202 +#: bp-groups/bp-groups-widgets.php:197 msgid "No groups matched the current filter." msgstr "" +#: bp-loader.php:162 bp-loader.php:169 +msgid "Cheatin’ huh?" +msgstr "" + +#: bp-loader.php:530 +msgid "BuddyPress Default" +msgstr "" + #: bp-members/bp-members-actions.php:45 msgid "User marked as spammer. Spam users are visible only to site admins." msgstr "" @@ -3421,18 +3783,20 @@ msgid "Edit Member" msgstr "" #: bp-members/bp-members-adminbar.php:99 -#: bp-xprofile/bp-xprofile-template.php:899 -#: bp-xprofile/bp-xprofile-template.php:900 +#: bp-xprofile/bp-xprofile-template.php:895 +#: bp-xprofile/bp-xprofile-template.php:896 msgid "Edit Profile" msgstr "" #: bp-members/bp-members-adminbar.php:115 +#: bp-members/bp-members-buddybar.php:131 msgid "User Capabilities" msgstr "" #: bp-members/bp-members-adminbar.php:123 -#: bp-settings/bp-settings-loader.php:134 -#: bp-settings/bp-settings-loader.php:194 +#: bp-settings/bp-settings-loader.php:130 +#: bp-settings/bp-settings-loader.php:190 +#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:33 #: bp-themes/bp-default/members/single/settings/delete-account.php:50 #: bp-themes/bp-default/members/single/settings/delete-account.php:76 msgid "Delete Account" @@ -3442,8 +3806,8 @@ msgstr "" msgid "No new notifications" msgstr "" -#: bp-members/bp-members-buddybar.php:24 bp-settings/bp-settings-loader.php:109 -#: bp-settings/bp-settings-loader.php:185 +#: bp-members/bp-members-buddybar.php:24 bp-settings/bp-settings-loader.php:105 +#: bp-settings/bp-settings-loader.php:181 msgid "Notifications" msgstr "" @@ -3464,72 +3828,64 @@ msgid "Edit %s's Avatar" msgstr "" #: bp-members/bp-members-buddybar.php:133 -msgid "Mark as Spammer" +msgid "Delete %s's Account" msgstr "" -#: bp-members/bp-members-buddybar.php:137 -msgid "Not a Spammer" +#: bp-members/bp-members-functions.php:897 +msgid "<strong>ERROR</strong>: Your account has been marked as a spammer." msgstr "" -#: bp-members/bp-members-buddybar.php:141 -msgid "Delete %s's Account" +#: bp-members/bp-members-functions.php:1071 +msgid "Please check your email address." msgstr "" -#: bp-members/bp-members-functions.php:862 -msgid "<strong>ERROR</strong>: Your account has been marked as a spammer." +#: bp-members/bp-members-functions.php:1074 +#: bp-members/bp-members-functions.php:1077 +msgid "Sorry, that email address is not allowed!" +msgstr "" + +#: bp-members/bp-members-functions.php:1080 +msgid "Sorry, that email address is already used!" msgstr "" -#: bp-members/bp-members-functions.php:1038 +#: bp-members/bp-members-functions.php:1098 msgid "Please enter a username" msgstr "" -#: bp-members/bp-members-functions.php:1046 +#: bp-members/bp-members-functions.php:1106 msgid "Only lowercase letters and numbers allowed" msgstr "" -#: bp-members/bp-members-functions.php:1049 +#: bp-members/bp-members-functions.php:1109 msgid "Username must be at least 4 characters" msgstr "" -#: bp-members/bp-members-functions.php:1052 +#: bp-members/bp-members-functions.php:1112 msgid "Sorry, usernames may not contain the character \"_\"!" msgstr "" -#: bp-members/bp-members-functions.php:1059 +#: bp-members/bp-members-functions.php:1119 msgid "Sorry, usernames must have letters too!" msgstr "" -#: bp-members/bp-members-functions.php:1062 -msgid "Please check your email address." -msgstr "" - -#: bp-members/bp-members-functions.php:1065 -#: bp-members/bp-members-functions.php:1073 -msgid "Sorry, that email address is not allowed!" -msgstr "" - -#: bp-members/bp-members-functions.php:1078 +#: bp-members/bp-members-functions.php:1123 msgid "Sorry, that username already exists!" msgstr "" -#: bp-members/bp-members-functions.php:1082 -msgid "Sorry, that email address is already used!" -msgstr "" - -#: bp-members/bp-members-functions.php:1121 +#: bp-members/bp-members-functions.php:1168 msgid "<strong>ERROR</strong>: Couldn’t register you... please contact the <a href=\"mailto:%s\">webmaster</a> !" msgstr "" -#: bp-members/bp-members-functions.php:1219 -#: bp-members/bp-members-functions.php:1223 +#: bp-members/bp-members-functions.php:1266 +#: bp-members/bp-members-functions.php:1270 msgid "Invalid activation key" msgstr "" -#: bp-members/bp-members-functions.php:1260 +#: bp-members/bp-members-functions.php:1307 msgid "%s became a registered member" msgstr "" -#: bp-members/bp-members-functions.php:1346 +#: bp-members/bp-members-functions.php:1391 msgid "<strong>ERROR</strong>: Your account has not been activated. Check your email for the activation link." msgstr "" @@ -3537,7 +3893,7 @@ msgstr "" msgid "Search Members..." msgstr "" -#: bp-members/bp-members-loader.php:192 +#: bp-members/bp-members-loader.php:193 msgid "You" msgstr "" @@ -3553,10 +3909,20 @@ msgstr "" msgid "This is a required field" msgstr "" -#: bp-members/bp-members-screens.php:251 +#: bp-members/bp-members-screens.php:254 msgid "Your account is now active!" msgstr "" +#: bp-members/bp-members-screens.php:431 +#: bp-themes/bp-default/registration/register.php:253 +msgid "Sign Up Complete!" +msgstr "" + +#: bp-members/bp-members-screens.php:439 +#: bp-themes/bp-default/registration/activate.php:11 +msgid "Account Activated" +msgstr "" + #: bp-members/bp-members-template.php:206 msgctxt "Member pagination previous text" msgid "←" @@ -3583,58 +3949,51 @@ msgstr "" msgid "Viewing member %1$s to %2$s (of %3$s members)" msgstr "" -#: bp-members/bp-members-template.php:556 +#: bp-members/bp-members-template.php:597 msgid "Never active" msgstr "" -#: bp-members/bp-members-template.php:578 +#: bp-members/bp-members-template.php:619 msgctxt "member latest update in member directory" msgid "- "%s "" msgstr "" -#: bp-members/bp-members-template.php:635 +#: bp-members/bp-members-template.php:676 +msgctxt "Records the timestamp that the user registered into the activy stream" msgid "registered %s" msgstr "" -#: bp-members/bp-members-template.php:1077 +#: bp-members/bp-members-template.php:1145 msgid "Your Avatar" msgstr "" -#: bp-members/bp-members-template.php:1147 +#: bp-members/bp-members-template.php:1215 msgid "Activity RSS Feed" msgstr "" -#: bp-messages/bp-messages-actions.php:36 +#: bp-messages/bp-messages-actions.php:35 msgid "Your reply was sent successfully" msgstr "" -#: bp-messages/bp-messages-actions.php:38 +#: bp-messages/bp-messages-actions.php:37 msgid "There was a problem sending your reply, please try again" msgstr "" -#: bp-messages/bp-messages-actions.php:47 -#: bp-messages/bp-messages-loader.php:104 -msgid "Messages <span>%s</span>" -msgstr "" - -#: bp-messages/bp-messages-actions.php:54 -msgid "From: %s" -msgstr "" - -#: bp-messages/bp-messages-actions.php:84 +#: bp-messages/bp-messages-actions.php:65 msgid "There was an error deleting that message." msgstr "" -#: bp-messages/bp-messages-actions.php:86 +#: bp-messages/bp-messages-actions.php:67 msgid "Message deleted." msgstr "" -#: bp-messages/bp-messages-actions.php:108 +#: bp-messages/bp-messages-actions.php:89 msgid "There was an error deleting messages." msgstr "" -#: bp-messages/bp-messages-actions.php:110 -#: bp-themes/bp-default/_inc/ajax.php:853 +#: bp-messages/bp-messages-actions.php:91 +#: bp-templates/bp-legacy/buddypress-functions.php:1167 +#: bp-themes/bp-default/_inc/ajax.php:871 msgid "Messages deleted." msgstr "" @@ -3650,17 +4009,17 @@ msgstr "" msgid "No Subject" msgstr "" -#: bp-messages/bp-messages-functions.php:233 -#: bp-messages/bp-messages-loader.php:122 -#: bp-messages/bp-messages-loader.php:191 +#: bp-messages/bp-messages-functions.php:246 +#: bp-messages/bp-messages-loader.php:131 +#: bp-messages/bp-messages-loader.php:200 msgid "Inbox" msgstr "" -#: bp-messages/bp-messages-functions.php:236 +#: bp-messages/bp-messages-functions.php:249 msgid "You have %d new messages" msgstr "" -#: bp-messages/bp-messages-functions.php:239 +#: bp-messages/bp-messages-functions.php:252 msgid "You have %d new message" msgstr "" @@ -3672,46 +4031,51 @@ msgstr "" msgid "Search Messages..." msgstr "" -#: bp-messages/bp-messages-loader.php:132 -#: bp-messages/bp-messages-loader.php:214 +#: bp-messages/bp-messages-loader.php:104 +#: bp-messages/bp-messages-screens.php:104 +msgid "Messages <span>%s</span>" +msgstr "" + +#: bp-messages/bp-messages-loader.php:141 +#: bp-messages/bp-messages-loader.php:223 msgid "Sent" msgstr "" -#: bp-messages/bp-messages-loader.php:142 -#: bp-messages/bp-messages-loader.php:222 +#: bp-messages/bp-messages-loader.php:151 +#: bp-messages/bp-messages-loader.php:231 msgid "Compose" msgstr "" -#: bp-messages/bp-messages-loader.php:153 +#: bp-messages/bp-messages-loader.php:162 msgid "Notices" msgstr "" -#: bp-messages/bp-messages-loader.php:187 +#: bp-messages/bp-messages-loader.php:196 msgid "Messages <span class=\"count\">%s</span>" msgstr "" -#: bp-messages/bp-messages-loader.php:188 +#: bp-messages/bp-messages-loader.php:197 msgid "Inbox <span class=\"count\">%s</span>" msgstr "" -#: bp-messages/bp-messages-loader.php:190 -#: bp-messages/bp-messages-screens.php:148 +#: bp-messages/bp-messages-loader.php:199 +#: bp-messages/bp-messages-screens.php:168 msgid "Messages" msgstr "" -#: bp-messages/bp-messages-loader.php:231 +#: bp-messages/bp-messages-loader.php:240 msgid "All Member Notices" msgstr "" -#: bp-messages/bp-messages-loader.php:250 +#: bp-messages/bp-messages-loader.php:259 msgid "My Messages" msgstr "" -#: bp-messages/bp-messages-notifications.php:46 +#: bp-messages/bp-messages-notifications.php:50 msgid "New message from %s" msgstr "" -#: bp-messages/bp-messages-notifications.php:48 +#: bp-messages/bp-messages-notifications.php:52 msgid "" "%1$s sent you a new message:\n" "\n" @@ -3741,38 +4105,34 @@ msgstr "" msgid "Message sent successfully!" msgstr "" -#: bp-messages/bp-messages-screens.php:102 +#: bp-messages/bp-messages-screens.php:125 msgid "There was a problem deactivating that notice." msgstr "" -#: bp-messages/bp-messages-screens.php:104 +#: bp-messages/bp-messages-screens.php:127 msgid "Notice deactivated." msgstr "" -#: bp-messages/bp-messages-screens.php:108 +#: bp-messages/bp-messages-screens.php:131 msgid "There was a problem activating that notice." msgstr "" -#: bp-messages/bp-messages-screens.php:110 +#: bp-messages/bp-messages-screens.php:133 msgid "Notice activated." msgstr "" -#: bp-messages/bp-messages-screens.php:114 +#: bp-messages/bp-messages-screens.php:137 msgid "There was a problem deleting that notice." msgstr "" -#: bp-messages/bp-messages-screens.php:116 +#: bp-messages/bp-messages-screens.php:139 msgid "Notice deleted." msgstr "" -#: bp-messages/bp-messages-screens.php:157 +#: bp-messages/bp-messages-screens.php:177 msgid "A member sends you a new message" msgstr "" -#: bp-messages/bp-messages-screens.php:163 -msgid "A new site notice is posted" -msgstr "" - #: bp-messages/bp-messages-template.php:84 msgctxt "Message pagination previous text" msgid "←" @@ -3783,224 +4143,137 @@ msgctxt "Message pagination next text" msgid "→" msgstr "" -#: bp-messages/bp-messages-template.php:358 +#: bp-messages/bp-messages-template.php:352 msgid "Viewing message %1$s to %2$s (of %3$s messages)" msgstr "" -#: bp-messages/bp-messages-template.php:434 +#: bp-messages/bp-messages-template.php:428 msgid "Select:" msgstr "" -#: bp-messages/bp-messages-template.php:438 +#: bp-messages/bp-messages-template.php:432 msgid "Read" msgstr "" -#: bp-messages/bp-messages-template.php:439 +#: bp-messages/bp-messages-template.php:433 msgid "Unread" msgstr "" -#: bp-messages/bp-messages-template.php:445 +#: bp-messages/bp-messages-template.php:439 msgid "Mark as Read" msgstr "" -#: bp-messages/bp-messages-template.php:446 +#: bp-messages/bp-messages-template.php:440 msgid "Mark as Unread" msgstr "" -#: bp-messages/bp-messages-template.php:450 +#: bp-messages/bp-messages-template.php:444 msgid "Delete Selected" msgstr "" -#: bp-messages/bp-messages-template.php:495 +#: bp-messages/bp-messages-template.php:489 msgid "Currently Active" msgstr "" -#: bp-messages/bp-messages-template.php:562 +#: bp-messages/bp-messages-template.php:556 msgid "Deactivate" msgstr "" -#: bp-messages/bp-messages-template.php:613 +#: bp-messages/bp-messages-template.php:607 +#: bp-templates/bp-legacy/buddypress/members/register.php:166 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:130 +#: bp-templates/bp-legacy/buddypress-functions.php:257 #: bp-themes/bp-default/functions.php:164 -#: bp-themes/bp-default/members/single/profile/edit.php:128 -#: bp-themes/bp-default/registration/register.php:169 +#: bp-themes/bp-default/members/single/profile/edit.php:130 +#: bp-themes/bp-default/registration/register.php:171 msgid "Close" msgstr "" -#: bp-messages/bp-messages-template.php:656 +#: bp-messages/bp-messages-template.php:650 msgid "Send a private message to this user." msgstr "" -#: bp-messages/bp-messages-template.php:657 +#: bp-messages/bp-messages-template.php:651 msgid "Private Message" msgstr "" -#: bp-messages/bp-messages-template.php:840 +#: bp-messages/bp-messages-template.php:834 msgid "%d Recipients" msgstr "" #: bp-messages/bp-messages-template.php:922 -#: bp-themes/bp-default/_inc/ajax.php:760 +#: bp-templates/bp-legacy/buddypress-functions.php:1073 +#: bp-themes/bp-default/_inc/ajax.php:777 msgid "Sent %s" msgstr "" -#: bp-settings/bp-settings-actions.php:157 +#: bp-settings/bp-settings-actions.php:158 msgid "That email address is invalid. Check the formatting and try again." msgstr "" -#: bp-settings/bp-settings-actions.php:160 +#: bp-settings/bp-settings-actions.php:161 msgid "That email address is currently unavailable for use." msgstr "" -#: bp-settings/bp-settings-actions.php:163 +#: bp-settings/bp-settings-actions.php:164 msgid "That email address is already taken." msgstr "" -#: bp-settings/bp-settings-actions.php:166 +#: bp-settings/bp-settings-actions.php:167 msgid "Email address cannot be empty." msgstr "" -#: bp-settings/bp-settings-actions.php:176 +#: bp-settings/bp-settings-actions.php:177 msgid "Your current password is invalid." msgstr "" -#: bp-settings/bp-settings-actions.php:179 +#: bp-settings/bp-settings-actions.php:180 msgid "The new password fields did not match." msgstr "" -#: bp-settings/bp-settings-actions.php:182 +#: bp-settings/bp-settings-actions.php:183 msgid "One of the password fields was empty." msgstr "" -#: bp-settings/bp-settings-actions.php:191 +#: bp-settings/bp-settings-actions.php:192 msgid "Your settings have been saved." msgstr "" -#: bp-settings/bp-settings-actions.php:197 +#: bp-settings/bp-settings-actions.php:198 msgid "No changes were made to your account." msgstr "" -#: bp-settings/bp-settings-actions.php:199 +#: bp-settings/bp-settings-actions.php:200 msgid "No changes were made to this account." msgstr "" -#: bp-settings/bp-settings-actions.php:247 +#: bp-settings/bp-settings-actions.php:250 msgid "Your notification settings have been saved." msgstr "" -#: bp-settings/bp-settings-actions.php:249 +#: bp-settings/bp-settings-actions.php:252 msgid "This user's notification settings have been saved." msgstr "" -#: bp-settings/bp-settings-actions.php:340 +#: bp-settings/bp-settings-actions.php:345 msgid "%s was successfully deleted." msgstr "" -#: bp-settings/bp-settings-loader.php:98 bp-settings/bp-settings-loader.php:177 +#: bp-settings/bp-settings-loader.php:94 bp-settings/bp-settings-loader.php:173 msgid "General" msgstr "" -#: bp-settings/bp-settings-loader.php:121 +#: bp-settings/bp-settings-loader.php:117 #: bp-themes/bp-default/members/single/settings/capabilities.php:49 msgid "Capabilities" msgstr "" -#: bp-themes/bp-default/404.php:7 -msgid "Page not found" -msgstr "" - -#: bp-themes/bp-default/404.php:9 -msgid "We're sorry, but we can't find the page that you're looking for. Perhaps searching will help." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:278 -msgid "There was a problem posting your update, please try again." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:379 -#: bp-themes/bp-default/_inc/ajax.php:415 -msgid "There was a problem when deleting. Please try again." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:478 -#: bp-themes/bp-default/_inc/ajax.php:499 -#: bp-themes/bp-default/activity/entry.php:72 -#: bp-themes/bp-default/functions.php:167 -msgid "Remove Favorite" -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:480 -#: bp-themes/bp-default/_inc/ajax.php:497 -#: bp-themes/bp-default/activity/entry.php:68 -#: bp-themes/bp-default/functions.php:166 -msgid "Favorite" -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:569 -#: bp-themes/bp-default/groups/create.php:229 -#: bp-themes/bp-default/groups/single/send-invites.php:42 -msgid "Remove Invite" -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:608 -msgid " Friendship could not be requested." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:618 -msgid "Friendship request could not be cancelled." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:621 -msgid "Request Pending" -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:641 -msgid "There was a problem accepting that request. Please try again." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:660 -msgid "There was a problem rejecting that request. Please try again." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:687 -msgid "Error joining group" -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:695 -msgid "Error requesting membership" -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:697 -msgid "Membership Requested" -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:704 -msgid "Error leaving group" -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:726 -msgid "There was a problem closing the notice." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:777 -msgid "There was a problem sending that reply. Please try again." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:795 -msgid "There was a problem marking messages as unread." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:820 -msgid "There was a problem marking messages as read." -msgstr "" - -#: bp-themes/bp-default/_inc/ajax.php:845 -msgid "There was a problem deleting messages." -msgstr "" - +#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:28 #: bp-themes/bp-default/activity/activity-loop.php:41 msgid "Load More" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/activity-loop.php:42 #: bp-themes/bp-default/activity/activity-loop.php:55 msgid "Sorry, there was no activity found. Please try a different filter." msgstr "" @@ -4008,250 +4281,244 @@ msgstr "" #. translators: 1: user profile link, 2: user name, 3: activity permalink, 4: #. activity timestamp -#: bp-themes/bp-default/activity/comment.php:27 +#: bp-templates/bp-legacy/buddypress/activity/comment.php:27 +#: bp-themes/bp-default/activity/comment.php:30 msgid "<a href=\"%1$s\">%2$s</a> replied <a href=\"%3$s\" class=\"activity-time-since\"><span class=\"time-since\">%4$s</span></a>" msgstr "" -#: bp-themes/bp-default/activity/entry.php:37 -msgid "In reply to: " -msgstr "" - -#: bp-themes/bp-default/activity/entry.php:37 -msgid "View Thread / Permalink" +#: bp-templates/bp-legacy/buddypress/activity/entry.php:50 +msgid "View Conversation" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/entry.php:58 #: bp-themes/bp-default/activity/entry.php:60 msgid "Comment <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/entry.php:66 #: bp-themes/bp-default/activity/entry.php:68 msgid "Mark as Favorite" msgstr "" -#: bp-themes/bp-default/activity/entry.php:104 -msgid "Post" +#: bp-templates/bp-legacy/buddypress/activity/entry.php:66 +#: bp-templates/bp-legacy/buddypress-functions.php:259 +#: bp-templates/bp-legacy/buddypress-functions.php:764 +#: bp-templates/bp-legacy/buddypress-functions.php:781 +#: bp-themes/bp-default/_inc/ajax.php:481 +#: bp-themes/bp-default/_inc/ajax.php:498 +#: bp-themes/bp-default/activity/entry.php:68 +#: bp-themes/bp-default/functions.php:166 +msgid "Favorite" msgstr "" -#: bp-themes/bp-default/activity/entry.php:104 -msgid "or press esc to cancel." +#: bp-templates/bp-legacy/buddypress/activity/entry.php:70 +#: bp-templates/bp-legacy/buddypress-functions.php:260 +#: bp-templates/bp-legacy/buddypress-functions.php:762 +#: bp-templates/bp-legacy/buddypress-functions.php:783 +#: bp-themes/bp-default/_inc/ajax.php:479 +#: bp-themes/bp-default/_inc/ajax.php:500 +#: bp-themes/bp-default/activity/entry.php:72 +#: bp-themes/bp-default/functions.php:167 +msgid "Remove Favorite" msgstr "" -#: bp-themes/bp-default/activity/index.php:21 -msgid "Site Activity" +#: bp-templates/bp-legacy/buddypress/activity/entry.php:102 +#: bp-themes/bp-default/activity/entry.php:104 +msgid "Post" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:19 #: bp-themes/bp-default/activity/index.php:39 msgid "The public activity for everyone on this site." msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:19 +#: bp-templates/bp-legacy/buddypress/members/index.php:17 #: bp-themes/bp-default/activity/index.php:39 #: bp-themes/bp-default/members/index.php:33 msgid "All Members <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:29 #: bp-themes/bp-default/activity/index.php:49 msgid "The activity of my friends only." msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:29 +#: bp-templates/bp-legacy/buddypress/members/index.php:20 #: bp-themes/bp-default/activity/index.php:49 #: bp-themes/bp-default/members/index.php:37 msgid "My Friends <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:41 #: bp-themes/bp-default/activity/index.php:61 msgid "The activity of groups I am a member of." msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:41 +#: bp-templates/bp-legacy/buddypress/groups/index.php:22 #: bp-themes/bp-default/activity/index.php:61 #: bp-themes/bp-default/groups/index.php:39 msgid "My Groups <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:51 #: bp-themes/bp-default/activity/index.php:71 msgid "The activity I've marked as a favorite." msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:51 #: bp-themes/bp-default/activity/index.php:71 msgid "My Favorites <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:57 #: bp-themes/bp-default/activity/index.php:77 msgid "Activity that I have been mentioned in." msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:57 #: bp-themes/bp-default/activity/index.php:77 msgid "<span>%s new</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:67 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3 #: bp-themes/bp-default/activity/index.php:87 #: bp-themes/bp-default/groups/single/activity.php:3 msgid "RSS Feed" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:67 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:3 #: bp-themes/bp-default/activity/index.php:87 #: bp-themes/bp-default/groups/single/activity.php:3 msgid "RSS" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:72 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:8 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:18 #: bp-themes/bp-default/activity/index.php:92 #: bp-themes/bp-default/groups/single/activity.php:8 #: bp-themes/bp-default/members/single/activity.php:18 msgid "Show:" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:74 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:10 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:20 #: bp-themes/bp-default/activity/index.php:94 #: bp-themes/bp-default/groups/single/activity.php:10 #: bp-themes/bp-default/members/single/activity.php:20 msgid "Everything" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:75 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:11 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:21 #: bp-themes/bp-default/activity/index.php:95 #: bp-themes/bp-default/groups/single/activity.php:11 #: bp-themes/bp-default/members/single/activity.php:21 msgid "Updates" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:80 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:28 #: bp-themes/bp-default/activity/index.php:100 #: bp-themes/bp-default/members/single/activity.php:28 msgid "Comments" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:86 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:14 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:43 #: bp-themes/bp-default/activity/index.php:106 #: bp-themes/bp-default/groups/single/activity.php:14 #: bp-themes/bp-default/members/single/activity.php:43 msgid "Forum Topics" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:87 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:15 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:44 #: bp-themes/bp-default/activity/index.php:107 #: bp-themes/bp-default/groups/single/activity.php:15 #: bp-themes/bp-default/members/single/activity.php:44 msgid "Forum Replies" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:93 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:50 #: bp-themes/bp-default/activity/index.php:113 #: bp-themes/bp-default/members/single/activity.php:50 msgid "New Groups" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:94 +#: bp-templates/bp-legacy/buddypress/groups/single/activity.php:18 +#: bp-templates/bp-legacy/buddypress/members/single/activity.php:51 #: bp-themes/bp-default/activity/index.php:114 #: bp-themes/bp-default/groups/single/activity.php:18 #: bp-themes/bp-default/members/single/activity.php:51 msgid "Group Memberships" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/index.php:104 #: bp-themes/bp-default/activity/index.php:124 msgid "New Members" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:23 #: bp-themes/bp-default/activity/post-form.php:23 msgid "What's new in %s, %s?" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:25 #: bp-themes/bp-default/activity/post-form.php:25 msgid "What's new, %s?" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:35 #: bp-themes/bp-default/activity/post-form.php:35 msgid "Post Update" msgstr "" +#: bp-templates/bp-legacy/buddypress/activity/post-form.php:42 #: bp-themes/bp-default/activity/post-form.php:42 msgid "Post in" msgstr "" -#: bp-themes/bp-default/archive.php:10 -msgid "You are browsing the archive for %1$s." -msgstr "" - -#: bp-themes/bp-default/archive.php:24 bp-themes/bp-default/attachment.php:18 -#: bp-themes/bp-default/index.php:24 bp-themes/bp-default/search.php:26 -#: bp-themes/bp-default/single.php:16 -msgctxt "Post written by..." -msgid "by %s" -msgstr "" - -#: bp-themes/bp-default/archive.php:28 bp-themes/bp-default/attachment.php:22 -#: bp-themes/bp-default/index.php:32 bp-themes/bp-default/search.php:30 -msgid "Permanent Link to" -msgstr "" - -#: bp-themes/bp-default/archive.php:30 bp-themes/bp-default/index.php:34 -#: bp-themes/bp-default/search.php:32 bp-themes/bp-default/single.php:23 -msgid "%1$s <span>in %2$s</span>" -msgstr "" - -#: bp-themes/bp-default/archive.php:33 bp-themes/bp-default/index.php:37 -#: bp-themes/bp-default/search.php:35 bp-themes/bp-default/single.php:28 -msgid "Read the rest of this entry →" -msgstr "" - -#: bp-themes/bp-default/archive.php:34 bp-themes/bp-default/index.php:38 -#: bp-themes/bp-default/onecolumn-page.php:31 bp-themes/bp-default/page.php:20 -#: bp-themes/bp-default/single.php:30 -msgid "Pages: " -msgstr "" - -#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41 -#: bp-themes/bp-default/search.php:38 bp-themes/bp-default/single.php:33 -msgid "Tags: " -msgstr "" - -#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41 -#: bp-themes/bp-default/search.php:38 -msgid "No Comments »" -msgstr "" - -#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41 -#: bp-themes/bp-default/search.php:38 -msgid "1 Comment »" -msgstr "" - -#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41 -#: bp-themes/bp-default/search.php:38 -msgid "% Comments »" -msgstr "" - -#: bp-themes/bp-default/archive.php:50 bp-themes/bp-default/index.php:54 -msgid "Not Found" -msgstr "" - -#: bp-themes/bp-default/attachment.php:26 bp-themes/bp-default/single.php:24 -msgid "Edit this entry" -msgstr "" - -#: bp-themes/bp-default/attachment.php:40 -msgid "Full size is %s pixels" -msgstr "" - -#: bp-themes/bp-default/attachment.php:43 -msgid "Link to full size image" -msgstr "" - -#: bp-themes/bp-default/attachment.php:62 -msgid "Sorry, no attachments matched your criteria." -msgstr "" - +#: bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php:90 #: bp-themes/bp-default/blogs/blogs-loop.php:90 msgid "Sorry, there were no sites found." msgstr "" -#: bp-themes/bp-default/blogs/create.php:21 -#: bp-themes/bp-default/blogs/index.php:21 -msgid "Site Directory" -msgstr "" - +#: bp-templates/bp-legacy/buddypress/blogs/create.php:14 #: bp-themes/bp-default/blogs/create.php:32 msgid "Site registration is currently disabled" msgstr "" +#: bp-templates/bp-legacy/buddypress/blogs/index.php:16 #: bp-themes/bp-default/blogs/index.php:33 msgid "All Sites <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/blogs/index.php:20 #: bp-themes/bp-default/blogs/index.php:37 msgid "My Sites <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/blogs/index.php:36 +#: bp-templates/bp-legacy/buddypress/forums/index.php:42 +#: bp-templates/bp-legacy/buddypress/groups/index.php:36 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:36 +#: bp-templates/bp-legacy/buddypress/members/index.php:33 +#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:19 +#: bp-templates/bp-legacy/buddypress/members/single/forums.php:18 +#: bp-templates/bp-legacy/buddypress/members/single/friends.php:20 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:20 #: bp-themes/bp-default/blogs/index.php:53 #: bp-themes/bp-default/forums/index.php:60 #: bp-themes/bp-default/groups/index.php:55 @@ -4261,10 +4528,18 @@ msgstr "" #: bp-themes/bp-default/members/single/forums.php:18 #: bp-themes/bp-default/members/single/friends.php:20 #: bp-themes/bp-default/members/single/groups.php:20 -#: bp-xprofile/bp-xprofile-classes.php:741 msgid "Order By:" msgstr "" +#: bp-templates/bp-legacy/buddypress/blogs/index.php:38 +#: bp-templates/bp-legacy/buddypress/forums/index.php:44 +#: bp-templates/bp-legacy/buddypress/groups/index.php:39 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:38 +#: bp-templates/bp-legacy/buddypress/members/index.php:35 +#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:21 +#: bp-templates/bp-legacy/buddypress/members/single/forums.php:20 +#: bp-templates/bp-legacy/buddypress/members/single/friends.php:22 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:22 #: bp-themes/bp-default/blogs/index.php:55 #: bp-themes/bp-default/forums/index.php:62 #: bp-themes/bp-default/groups/index.php:57 @@ -4277,6 +4552,12 @@ msgstr "" msgid "Last Active" msgstr "" +#: bp-templates/bp-legacy/buddypress/blogs/index.php:40 +#: bp-templates/bp-legacy/buddypress/groups/index.php:42 +#: bp-templates/bp-legacy/buddypress/members/index.php:39 +#: bp-templates/bp-legacy/buddypress/members/single/blogs.php:23 +#: bp-templates/bp-legacy/buddypress/members/single/friends.php:24 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:25 #: bp-themes/bp-default/blogs/index.php:57 #: bp-themes/bp-default/groups/index.php:60 #: bp-themes/bp-default/members/index.php:60 @@ -4286,259 +4567,157 @@ msgstr "" msgid "Alphabetical" msgstr "" -#: bp-themes/bp-default/comments.php:3 -msgid "Password Protected" -msgstr "" - -#: bp-themes/bp-default/comments.php:4 -msgid "Enter the password to view comments." -msgstr "" - -#: bp-themes/bp-default/comments.php:24 -msgid "1 response to %2$s" -msgid_plural "%1$s responses to %2$s" -msgstr[0] "" -msgstr[1] "" - -#: bp-themes/bp-default/comments.php:46 -msgid "Comments are closed, but <a href=\"%1$s\" title=\"Trackback URL for this post\">trackbacks</a> and pingbacks are open." -msgstr "" - -#: bp-themes/bp-default/comments.php:50 -msgid "Comments are closed." -msgstr "" - -#: bp-themes/bp-default/comments.php:62 -msgid "1 trackback" -msgid_plural "%d trackbacks" -msgstr[0] "" -msgstr[1] "" - -#: bp-themes/bp-default/footer.php:15 -msgid "Proudly powered by <a href=\"%1$s\">WordPress</a> and <a href=\"%2$s\">BuddyPress</a>." -msgstr "" - +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:39 #: bp-themes/bp-default/forums/forums-loop.php:39 msgid "Topic" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:41 #: bp-themes/bp-default/forums/forums-loop.php:41 msgid "Freshness" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:54 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:95 #: bp-themes/bp-default/forums/forums-loop.php:54 -msgid "Permalink" +#: bp-themes/bp-default/groups/single/forum/topic.php:95 +msgid "Permanent link to this post" msgstr "" #. translators: "started by [poster] in [forum]" +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:61 #: bp-themes/bp-default/forums/forums-loop.php:61 msgid "Started by %1$s" msgstr "" #. translators: "started by [poster] in [forum]" +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:72 #: bp-themes/bp-default/forums/forums-loop.php:72 msgid "in %1$s" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/forums-loop.php:122 #: bp-themes/bp-default/forums/forums-loop.php:122 msgid "Sorry, there were no forum topics found." msgstr "" -#: bp-themes/bp-default/forums/index.php:23 -msgid "Forums Directory" -msgstr "" - +#: bp-templates/bp-legacy/buddypress/forums/index.php:22 #: bp-themes/bp-default/forums/index.php:40 msgid "All Topics <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/index.php:26 #: bp-themes/bp-default/forums/index.php:44 msgid "My Topics <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/index.php:45 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:39 +#: bp-templates/bp-legacy/buddypress/members/single/forums.php:21 #: bp-themes/bp-default/forums/index.php:63 #: bp-themes/bp-default/groups/single/forum.php:39 #: bp-themes/bp-default/members/single/forums.php:21 msgid "Most Posts" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/index.php:46 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:40 +#: bp-templates/bp-legacy/buddypress/members/single/forums.php:22 #: bp-themes/bp-default/forums/index.php:64 #: bp-themes/bp-default/groups/single/forum.php:40 #: bp-themes/bp-default/members/single/forums.php:22 msgid "Unreplied" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/index.php:82 #: bp-themes/bp-default/forums/index.php:100 msgid "Create New Topic:" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/index.php:89 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:50 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:78 #: bp-themes/bp-default/forums/index.php:107 #: bp-themes/bp-default/groups/single/forum/edit.php:50 #: bp-themes/bp-default/groups/single/forum.php:78 msgid "Content:" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/index.php:92 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:53 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:81 #: bp-themes/bp-default/forums/index.php:110 #: bp-themes/bp-default/groups/single/forum/edit.php:53 #: bp-themes/bp-default/groups/single/forum.php:81 msgid "Tags (comma separated):" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/index.php:95 #: bp-themes/bp-default/forums/index.php:113 msgid "Post In Group Forum:" msgstr "" #. translators: no option picked in select box +#: bp-templates/bp-legacy/buddypress/forums/index.php:98 #: bp-themes/bp-default/forums/index.php:116 -#: bp-xprofile/bp-xprofile-template.php:463 +#: bp-xprofile/bp-xprofile-template.php:459 msgid "----" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/index.php:115 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:87 #: bp-themes/bp-default/forums/index.php:133 #: bp-themes/bp-default/groups/single/forum.php:87 msgid "Post Topic" msgstr "" +#: bp-templates/bp-legacy/buddypress/forums/index.php:127 #: bp-themes/bp-default/forums/index.php:145 msgid "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum." msgstr "" -#: bp-themes/bp-default/functions.php:85 -msgid "Primary Navigation" -msgstr "" - -#: bp-themes/bp-default/functions.php:158 -msgid "My Favorites" -msgstr "" - -#: bp-themes/bp-default/functions.php:159 -msgid "Accepted" -msgstr "" - -#: bp-themes/bp-default/functions.php:160 -msgid "Rejected" -msgstr "" - -#: bp-themes/bp-default/functions.php:161 -msgid "Show all comments for this thread" -msgstr "" - -#: bp-themes/bp-default/functions.php:162 -msgid "Show all" -msgstr "" - -#: bp-themes/bp-default/functions.php:163 -msgid "comments" -msgstr "" - -#: bp-themes/bp-default/functions.php:389 -msgid "The sidebar widget area" -msgstr "" - -#: bp-themes/bp-default/functions.php:398 -msgid "First Footer Widget Area" -msgstr "" - -#: bp-themes/bp-default/functions.php:400 -msgid "The first footer widget area" -msgstr "" - -#: bp-themes/bp-default/functions.php:409 -msgid "Second Footer Widget Area" -msgstr "" - -#: bp-themes/bp-default/functions.php:411 -msgid "The second footer widget area" -msgstr "" - -#: bp-themes/bp-default/functions.php:420 -msgid "Third Footer Widget Area" -msgstr "" - -#: bp-themes/bp-default/functions.php:422 -msgid "The third footer widget area" -msgstr "" - -#: bp-themes/bp-default/functions.php:431 -msgid "Fourth Footer Widget Area" -msgstr "" - -#: bp-themes/bp-default/functions.php:433 -msgid "The fourth footer widget area" -msgstr "" - -#. translators: 1: comment author url, 2: comment author name, 3: comment -#. permalink, 4: comment date/timestamp - -#: bp-themes/bp-default/functions.php:488 -msgid "<a href=\"%1$s\" rel=\"nofollow\">%2$s</a> said on <a href=\"%3$s\"><span class=\"time-since\">%4$s</span></a>" -msgstr "" - -#: bp-themes/bp-default/functions.php:495 -msgid "Your comment is awaiting moderation." -msgstr "" - -#: bp-themes/bp-default/functions.php:507 -msgid "Edit comment" -msgstr "" - -#: bp-themes/bp-default/functions.php:577 -msgid "Theme activated! This theme contains <a href=\"%s\">custom header image</a> support and <a href=\"%s\">sidebar widgets</a>." -msgstr "" - -#: bp-themes/bp-default/functions.php:643 -msgid "Email" -msgstr "" - -#: bp-themes/bp-default/functions.php:653 -msgid "You must be <a href=\"%1$s\">logged in</a> to post a comment." -msgstr "" - -#: bp-themes/bp-default/functions.php:654 -msgid "Leave a reply" -msgstr "" - -#: bp-themes/bp-default/functions.php:741 -msgid "← Previous Entries" -msgstr "" - -#: bp-themes/bp-default/functions.php:742 -msgid "Next Entries →" -msgstr "" - -#: bp-themes/bp-default/groups/create.php:18 -#: bp-themes/bp-default/groups/index.php:21 -msgid "Groups Directory" -msgstr "" - +#: bp-templates/bp-legacy/buddypress/groups/create.php:29 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:16 #: bp-themes/bp-default/groups/create.php:39 #: bp-themes/bp-default/groups/single/admin.php:16 msgid "Group Name (required)" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:34 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:19 #: bp-themes/bp-default/groups/create.php:42 #: bp-themes/bp-default/groups/single/admin.php:19 msgid "Group Description (required)" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:51 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:56 #: bp-themes/bp-default/groups/create.php:58 #: bp-themes/bp-default/groups/single/admin.php:56 msgid "Privacy Options" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:55 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:61 #: bp-themes/bp-default/groups/create.php:62 #: bp-themes/bp-default/groups/single/admin.php:61 msgid "This is a public group" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:57 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:63 #: bp-themes/bp-default/groups/create.php:64 #: bp-themes/bp-default/groups/single/admin.php:63 msgid "Any site member can join this group." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:58 +#: bp-templates/bp-legacy/buddypress/groups/create.php:67 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:64 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:74 #: bp-themes/bp-default/groups/create.php:65 #: bp-themes/bp-default/groups/create.php:74 #: bp-themes/bp-default/groups/single/admin.php:64 @@ -4546,21 +4725,31 @@ msgstr "" msgid "This group will be listed in the groups directory and in search results." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:59 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:65 #: bp-themes/bp-default/groups/create.php:66 #: bp-themes/bp-default/groups/single/admin.php:65 msgid "Group content and activity will be visible to any site member." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:64 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:71 #: bp-themes/bp-default/groups/create.php:71 #: bp-themes/bp-default/groups/single/admin.php:71 msgid "This is a private group" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:66 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:73 #: bp-themes/bp-default/groups/create.php:73 #: bp-themes/bp-default/groups/single/admin.php:73 msgid "Only users who request membership and are accepted can join the group." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:68 +#: bp-templates/bp-legacy/buddypress/groups/create.php:77 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:75 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:85 #: bp-themes/bp-default/groups/create.php:75 #: bp-themes/bp-default/groups/create.php:84 #: bp-themes/bp-default/groups/single/admin.php:75 @@ -4568,644 +4757,1135 @@ msgstr "" msgid "Group content and activity will only be visible to members of the group." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:73 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:81 #: bp-themes/bp-default/groups/create.php:80 #: bp-themes/bp-default/groups/single/admin.php:81 msgid "This is a hidden group" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:75 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:83 #: bp-themes/bp-default/groups/create.php:82 #: bp-themes/bp-default/groups/single/admin.php:83 msgid "Only users who are invited can join the group." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:76 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:84 #: bp-themes/bp-default/groups/create.php:83 #: bp-themes/bp-default/groups/single/admin.php:84 msgid "This group will not be listed in the groups directory or search results." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:82 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:92 #: bp-themes/bp-default/groups/create.php:89 #: bp-themes/bp-default/groups/single/admin.php:92 msgid "Group Invitations" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:84 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:94 #: bp-themes/bp-default/groups/create.php:91 #: bp-themes/bp-default/groups/single/admin.php:94 msgid "Which members of this group are allowed to invite others?" msgstr "" -#: bp-themes/bp-default/groups/create.php:96 -#: bp-themes/bp-default/groups/single/admin.php:99 -msgid "All group members" -msgstr "" - -#: bp-themes/bp-default/groups/create.php:101 -#: bp-themes/bp-default/groups/single/admin.php:104 -msgid "Group admins and mods only" -msgstr "" - -#: bp-themes/bp-default/groups/create.php:106 -#: bp-themes/bp-default/groups/single/admin.php:109 -msgid "Group admins only" -msgstr "" - -#: bp-themes/bp-default/groups/create.php:112 -msgid "Group Forums" -msgstr "" - +#: bp-templates/bp-legacy/buddypress/groups/create.php:109 #: bp-themes/bp-default/groups/create.php:116 msgid "Should this group have a forum?" msgstr "" -#: bp-themes/bp-default/groups/create.php:119 -#: bp-themes/bp-default/groups/single/admin.php:47 -msgid "Enable discussion forum" -msgstr "" - +#: bp-templates/bp-legacy/buddypress/groups/create.php:116 #: bp-themes/bp-default/groups/create.php:123 msgid "<strong>Attention Site Admin:</strong> Group forums require the <a href=\"%s\">correct setup and configuration</a> of a bbPress installation." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:142 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:127 #: bp-themes/bp-default/groups/create.php:149 #: bp-themes/bp-default/groups/single/admin.php:127 msgid "Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:146 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:131 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:18 #: bp-themes/bp-default/groups/create.php:153 #: bp-themes/bp-default/groups/single/admin.php:131 #: bp-themes/bp-default/members/single/profile/change-avatar.php:18 msgid "Upload Image" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:150 #: bp-themes/bp-default/groups/create.php:157 msgid "To skip the avatar upload process, hit the \"Next Step\" button." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:157 #: bp-themes/bp-default/groups/create.php:164 msgid "Crop Group Avatar" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:159 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:151 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:33 #: bp-themes/bp-default/groups/create.php:166 #: bp-themes/bp-default/groups/single/admin.php:151 #: bp-themes/bp-default/members/single/profile/change-avatar.php:33 msgid "Avatar to crop" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:162 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:154 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:36 #: bp-themes/bp-default/groups/create.php:169 #: bp-themes/bp-default/groups/single/admin.php:154 #: bp-themes/bp-default/members/single/profile/change-avatar.php:36 msgid "Avatar preview" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:165 +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:157 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:39 #: bp-themes/bp-default/groups/create.php:172 #: bp-themes/bp-default/groups/single/admin.php:157 #: bp-themes/bp-default/members/single/profile/change-avatar.php:39 msgid "Crop Image" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:204 +#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:22 #: bp-themes/bp-default/groups/create.php:211 #: bp-themes/bp-default/groups/single/send-invites.php:22 msgid "Select people to invite from your friends list." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:222 +#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:42 +#: bp-templates/bp-legacy/buddypress-functions.php:853 +#: bp-themes/bp-default/_inc/ajax.php:570 +#: bp-themes/bp-default/groups/create.php:229 +#: bp-themes/bp-default/groups/single/send-invites.php:42 +msgid "Remove Invite" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/groups/create.php:239 +#: bp-templates/bp-legacy/buddypress/groups/single/send-invites.php:73 #: bp-themes/bp-default/groups/create.php:246 #: bp-themes/bp-default/groups/single/send-invites.php:73 -msgid "Once you have built up friend connections you will be able to invite others to your group. You can send invites any time in the future by selecting the \"Send Invites\" option when viewing your new group." +msgid "Once you have built up friend connections you will be able to invite others to your group." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:261 #: bp-themes/bp-default/groups/create.php:268 msgid "Back to Previous Step" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:268 #: bp-themes/bp-default/groups/create.php:275 msgid "Next Step" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:275 #: bp-themes/bp-default/groups/create.php:282 msgid "Create Group and Continue" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/create.php:282 +#: bp-themes/bp-default/groups/create.php:289 +msgid "Finish" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/groups/groups-loop.php:95 #: bp-themes/bp-default/groups/groups-loop.php:95 msgid "There were no groups found." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/index.php:19 #: bp-themes/bp-default/groups/index.php:35 msgid "All Groups <span>%s</span>" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/index.php:40 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:23 #: bp-themes/bp-default/groups/index.php:58 #: bp-themes/bp-default/members/single/groups.php:23 msgid "Most Members" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/index.php:41 +#: bp-templates/bp-legacy/buddypress/members/single/groups.php:24 #: bp-themes/bp-default/groups/index.php:59 #: bp-themes/bp-default/members/single/groups.php:24 msgid "Newly Created" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:25 #: bp-themes/bp-default/groups/single/admin.php:25 msgid "Notify group members of changes via email" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:137 #: bp-themes/bp-default/groups/single/admin.php:137 msgid "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:139 +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:24 #: bp-themes/bp-default/groups/single/admin.php:139 #: bp-themes/bp-default/members/single/profile/change-avatar.php:24 msgid "Delete Avatar" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:149 #: bp-themes/bp-default/groups/single/admin.php:149 msgid "Crop Avatar" msgstr "" -#: bp-themes/bp-default/groups/single/admin.php:177 -msgid "Administrators" -msgstr "" - -#: bp-themes/bp-default/groups/single/admin.php:205 -msgid "Moderators" -msgstr "" - +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:260 #: bp-themes/bp-default/groups/single/admin.php:260 msgid "(banned)" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:266 #: bp-themes/bp-default/groups/single/admin.php:266 msgid "Unban this member" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:266 #: bp-themes/bp-default/groups/single/admin.php:266 msgid "Remove Ban" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:270 #: bp-themes/bp-default/groups/single/admin.php:270 msgid "Kick and ban this member" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:270 #: bp-themes/bp-default/groups/single/admin.php:270 msgid "Kick & Ban" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:271 #: bp-themes/bp-default/groups/single/admin.php:271 msgid "Promote to Mod" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:276 #: bp-themes/bp-default/groups/single/admin.php:276 msgid "Remove this member" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:276 #: bp-themes/bp-default/groups/single/admin.php:276 msgid "Remove from group" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:290 +#: bp-templates/bp-legacy/buddypress/groups/single/members.php:87 #: bp-themes/bp-default/groups/single/admin.php:290 #: bp-themes/bp-default/groups/single/members.php:87 msgid "This group has no members." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:320 +#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:37 +#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:23 #: bp-themes/bp-default/groups/single/admin.php:320 #: bp-themes/bp-default/members/single/friends/requests.php:37 #: bp-themes/bp-default/members/single/groups/invites.php:23 msgid "Accept" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:322 +#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:38 +#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:24 #: bp-themes/bp-default/groups/single/admin.php:322 #: bp-themes/bp-default/members/single/friends/requests.php:38 #: bp-themes/bp-default/members/single/groups/invites.php:24 msgid "Reject" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:335 #: bp-themes/bp-default/groups/single/admin.php:335 msgid "There are no pending membership requests." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:352 #: bp-themes/bp-default/groups/single/admin.php:352 msgid "WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/admin.php:355 #: bp-themes/bp-default/groups/single/admin.php:355 msgid "I understand the consequences of deleting this group." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:16 +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:17 +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:27 #: bp-themes/bp-default/groups/single/forum/edit.php:16 #: bp-themes/bp-default/groups/single/forum/topic.php:17 #: bp-themes/bp-default/groups/single/forum.php:27 msgid "Forum Directory" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:25 #: bp-themes/bp-default/groups/single/forum/edit.php:25 msgid "Edit:" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php:87 #: bp-themes/bp-default/groups/single/forum/edit.php:87 msgid "This topic does not exist." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:9 #: bp-themes/bp-default/groups/single/forum/topic.php:9 msgid "New Reply" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:32 #: bp-themes/bp-default/groups/single/forum/topic.php:32 msgid "Topic tags:" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:81 #: bp-themes/bp-default/groups/single/forum/topic.php:81 msgid "%1$s said %2$s:" msgstr "" -#: bp-themes/bp-default/groups/single/forum/topic.php:95 -msgid "Permanent link to this post" -msgstr "" - +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:119 #: bp-themes/bp-default/groups/single/forum/topic.php:119 msgid "There are no posts for this topic." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:134 #: bp-themes/bp-default/groups/single/forum/topic.php:134 msgid "You will auto join this group when you reply to this topic." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:139 #: bp-themes/bp-default/groups/single/forum/topic.php:139 msgid "Add a reply:" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:144 #: bp-themes/bp-default/groups/single/forum/topic.php:144 msgid "Post Reply" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php:155 #: bp-themes/bp-default/groups/single/forum/topic.php:155 msgid "This topic is closed, replies are no longer accepted." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:69 #: bp-themes/bp-default/groups/single/forum.php:69 msgid "You will auto join this group when you start a new topic." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/forum.php:73 #: bp-themes/bp-default/groups/single/forum.php:73 msgid "Post a New Topic:" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:11 #: bp-themes/bp-default/groups/single/group-header.php:11 msgid "Group Admins" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/group-header.php:20 #: bp-themes/bp-default/groups/single/group-header.php:20 msgid "Group Mods" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:4 #: bp-themes/bp-default/groups/single/request-membership.php:4 msgid "You are requesting to become a member of the group '%s'." msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:7 #: bp-themes/bp-default/groups/single/request-membership.php:7 msgid "Comments (optional)" msgstr "" +#: bp-templates/bp-legacy/buddypress/groups/single/request-membership.php:12 #: bp-themes/bp-default/groups/single/request-membership.php:12 msgid "Send Request" msgstr "" -#: bp-themes/bp-default/header.php:22 -msgctxt "Home page banner link title" -msgid "Home" -msgstr "" - -#: bp-themes/bp-default/header.php:25 -msgid "Search for:" -msgstr "" - -#: bp-themes/bp-default/index.php:27 -msgctxt "Sticky post" -msgid "Featured" +#: bp-templates/bp-legacy/buddypress/members/activate.php:14 +#: bp-themes/bp-default/registration/activate.php:23 +msgid "Your account was activated successfully! Your account details have been sent to you in a separate email." msgstr "" -#: bp-themes/bp-default/index.php:55 -msgid "Sorry, but you are looking for something that isn't here." +#: bp-templates/bp-legacy/buddypress/members/activate.php:16 +#: bp-themes/bp-default/registration/activate.php:25 +msgid "Your account was activated successfully! You can now log in with the username and password you provided when you signed up." msgstr "" -#: bp-themes/bp-default/links.php:16 -msgid "Links" +#: bp-templates/bp-legacy/buddypress/members/activate.php:21 +#: bp-themes/bp-default/registration/activate.php:30 +msgid "Please provide a valid activation key." msgstr "" -#: bp-themes/bp-default/members/index.php:21 -msgid "Members Directory" +#: bp-templates/bp-legacy/buddypress/members/activate.php:25 +#: bp-themes/bp-default/registration/activate.php:34 +msgid "Activation Key:" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/index.php:36 +#: bp-templates/bp-legacy/buddypress/members/single/friends.php:23 #: bp-themes/bp-default/members/index.php:56 #: bp-themes/bp-default/members/single/friends.php:23 msgid "Newest Registered" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/members-loop.php:108 #: bp-themes/bp-default/members/members-loop.php:108 msgid "Sorry, no members were found." msgstr "" +#: bp-templates/bp-legacy/buddypress/members/register.php:13 +#: bp-themes/bp-default/registration/register.php:16 +msgid "User registration is currently not allowed." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:22 +#: bp-themes/bp-default/registration/register.php:27 +msgid "Registering for this site is easy, just fill in the fields below and we'll get a new account set up for you in no time." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:30 +#: bp-themes/bp-default/registration/register.php:35 +msgid "Account Details" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:32 +#: bp-themes/bp-default/registration/register.php:37 +#: bp-themes/bp-default/sidebar.php:44 +msgid "Username" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:32 +#: bp-templates/bp-legacy/buddypress/members/register.php:36 +#: bp-templates/bp-legacy/buddypress/members/register.php:40 +#: bp-templates/bp-legacy/buddypress/members/register.php:44 +#: bp-templates/bp-legacy/buddypress/members/register.php:71 +#: bp-templates/bp-legacy/buddypress/members/register.php:79 +#: bp-templates/bp-legacy/buddypress/members/register.php:87 +#: bp-templates/bp-legacy/buddypress/members/register.php:97 +#: bp-templates/bp-legacy/buddypress/members/register.php:108 +#: bp-templates/bp-legacy/buddypress/members/register.php:123 +#: bp-templates/bp-legacy/buddypress/members/register.php:134 +#: bp-templates/bp-legacy/buddypress/members/register.php:207 +#: bp-templates/bp-legacy/buddypress/members/register.php:216 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:26 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:33 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:40 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:49 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:67 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:83 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:93 +#: bp-themes/bp-default/members/single/profile/edit.php:26 +#: bp-themes/bp-default/members/single/profile/edit.php:33 +#: bp-themes/bp-default/members/single/profile/edit.php:40 +#: bp-themes/bp-default/members/single/profile/edit.php:49 +#: bp-themes/bp-default/members/single/profile/edit.php:67 +#: bp-themes/bp-default/members/single/profile/edit.php:83 +#: bp-themes/bp-default/members/single/profile/edit.php:93 +#: bp-themes/bp-default/registration/register.php:37 +#: bp-themes/bp-default/registration/register.php:41 +#: bp-themes/bp-default/registration/register.php:45 +#: bp-themes/bp-default/registration/register.php:49 +#: bp-themes/bp-default/registration/register.php:76 +#: bp-themes/bp-default/registration/register.php:84 +#: bp-themes/bp-default/registration/register.php:92 +#: bp-themes/bp-default/registration/register.php:102 +#: bp-themes/bp-default/registration/register.php:113 +#: bp-themes/bp-default/registration/register.php:128 +#: bp-themes/bp-default/registration/register.php:139 +#: bp-themes/bp-default/registration/register.php:212 +#: bp-themes/bp-default/registration/register.php:221 +msgid "(required)" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:36 +#: bp-themes/bp-default/registration/register.php:41 +msgid "Email Address" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:40 +#: bp-themes/bp-default/registration/register.php:45 +msgid "Choose a Password" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:44 +#: bp-themes/bp-default/registration/register.php:49 +msgid "Confirm Password" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:60 +#: bp-themes/bp-default/registration/register.php:65 +msgid "Profile Details" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:114 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:58 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:73 +#: bp-themes/bp-default/members/single/profile/edit.php:58 +#: bp-themes/bp-default/members/single/profile/edit.php:73 +#: bp-themes/bp-default/registration/register.php:119 +#: bp-xprofile/bp-xprofile-admin.php:415 +msgid "Clear" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:156 +#: bp-templates/bp-legacy/buddypress/members/register.php:171 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:120 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:134 +#: bp-themes/bp-default/members/single/profile/edit.php:120 +#: bp-themes/bp-default/members/single/profile/edit.php:134 +#: bp-themes/bp-default/registration/register.php:161 +#: bp-themes/bp-default/registration/register.php:176 +msgid "This field can be seen by: <span class=\"current-visibility-level\">%s</span>" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:156 +#: bp-themes/bp-default/registration/register.php:161 +msgctxt "Change profile field visibility level" +msgid "Change" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:161 +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:125 +#: bp-themes/bp-default/members/single/profile/edit.php:125 +#: bp-themes/bp-default/registration/register.php:166 +msgid "Who can see this field?" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:201 +#: bp-themes/bp-default/registration/register.php:206 +msgid "Blog Details" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:203 +#: bp-themes/bp-default/registration/register.php:208 +msgid "Yes, I'd like to create a new site" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:207 +#: bp-themes/bp-default/registration/register.php:212 +msgid "Blog URL" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:216 +#: bp-themes/bp-default/registration/register.php:221 +msgid "Site Title" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:237 +#: bp-themes/bp-default/registration/register.php:242 +msgid "Complete Sign Up" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:252 +#: bp-themes/bp-default/registration/register.php:259 +msgid "You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/register.php:254 +#: bp-themes/bp-default/registration/register.php:261 +msgid "You have successfully created your account! Please log in using the username and password you have just created." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/friends/requests.php:68 #: bp-themes/bp-default/members/single/friends/requests.php:68 msgid "You have no pending friendship requests." msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/groups/invites.php:37 #: bp-themes/bp-default/members/single/groups/invites.php:37 msgid "You have no outstanding group invites." msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:5 #: bp-themes/bp-default/members/single/messages/compose.php:5 msgid "Send To (Username or Friend's Name)" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:14 #: bp-themes/bp-default/members/single/messages/compose.php:14 msgid "This is a notice to all users." msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:17 #: bp-themes/bp-default/members/single/messages/compose.php:17 msgid "Subject" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:20 #: bp-themes/bp-default/members/single/messages/compose.php:20 msgid "Message" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/compose.php:28 #: bp-themes/bp-default/members/single/messages/compose.php:28 msgid "Send Message" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:32 #: bp-themes/bp-default/members/single/messages/messages-loop.php:32 msgid "From:" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:37 #: bp-themes/bp-default/members/single/messages/messages-loop.php:37 msgid "To:" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:43 #: bp-themes/bp-default/members/single/messages/messages-loop.php:43 msgid "View Message" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:51 +#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:43 +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:24 #: bp-themes/bp-default/members/single/messages/messages-loop.php:51 #: bp-themes/bp-default/members/single/messages/notices-loop.php:43 #: bp-themes/bp-default/members/single/messages/single.php:24 msgid "Delete Message" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:69 #: bp-themes/bp-default/members/single/messages/messages-loop.php:69 msgid "Sorry, no messages were found." msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:36 #: bp-themes/bp-default/members/single/messages/notices-loop.php:36 msgid "Sent:" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php:54 #: bp-themes/bp-default/members/single/messages/notices-loop.php:54 msgid "Sorry, no notices were found." msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:14 #: bp-themes/bp-default/members/single/messages/single.php:14 msgid "You are alone in this conversation." msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:18 #: bp-themes/bp-default/members/single/messages/single.php:18 msgid "Conversation between %s and you." msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:86 #: bp-themes/bp-default/members/single/messages/single.php:75 msgid "Send a Reply" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/messages/single.php:102 #: bp-themes/bp-default/members/single/messages/single.php:91 msgid "Send Reply" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:1 #: bp-themes/bp-default/members/single/profile/change-avatar.php:1 -#: bp-xprofile/bp-xprofile-loader.php:182 -#: bp-xprofile/bp-xprofile-loader.php:238 +#: bp-xprofile/bp-xprofile-loader.php:196 +#: bp-xprofile/bp-xprofile-loader.php:253 msgid "Change Avatar" msgstr "" +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:7 #: bp-themes/bp-default/members/single/profile/change-avatar.php:7 msgid "Your avatar will be used on your profile and throughout the site. If there is a <a href=\"http://gravatar.com\">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer." msgstr "" -#: bp-themes/bp-default/members/single/profile/change-avatar.php:14 -msgid "Click below to select a JPG, GIF or PNG format photo from your computer and then click 'Upload Image' to proceed." +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:14 +#: bp-themes/bp-default/members/single/profile/change-avatar.php:14 +msgid "Click below to select a JPG, GIF or PNG format photo from your computer and then click 'Upload Image' to proceed." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:23 +#: bp-themes/bp-default/members/single/profile/change-avatar.php:23 +msgid "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:24 +#: bp-themes/bp-default/members/single/profile/change-avatar.php:24 +msgid "Delete My Avatar" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:31 +#: bp-themes/bp-default/members/single/profile/change-avatar.php:31 +msgid "Crop Your New Avatar" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php:55 +#: bp-themes/bp-default/members/single/profile/change-avatar.php:55 +msgid "Your avatar will be used on your profile and throughout the site. To change your avatar, please create an account with <a href=\"http://gravatar.com\">Gravatar</a> using the same email address as you used to register with this site." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:10 +#: bp-themes/bp-default/members/single/profile/edit.php:10 +msgid "Editing '%s' Profile Group" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/profile/edit.php:120 +#: bp-themes/bp-default/members/single/profile/edit.php:120 +msgid "Change" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php:8 +#: bp-themes/bp-default/members/single/profile/profile-wp.php:8 +msgid "%s's Profile" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php:15 +#: bp-themes/bp-default/members/single/settings/capabilities.php:57 +msgid "This user is a spammer." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:13 +#: bp-themes/bp-default/members/single/settings/delete-account.php:56 +msgid "Deleting your account will delete all of the content you have created. It will be completely irrecoverable." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:17 +#: bp-themes/bp-default/members/single/settings/delete-account.php:60 +msgid "Deleting this account will delete all of the content it has created. It will be completely irrecoverable." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php:29 +#: bp-themes/bp-default/members/single/settings/delete-account.php:72 +msgid "I understand the consequences." +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:15 +#: bp-themes/bp-default/members/single/settings/general.php:57 +msgid "Current Password <span>(required to update email or change current password)</span>" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:16 +#: bp-themes/bp-default/members/single/settings/general.php:58 +msgid "Password Lost and Found" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:16 +#: bp-themes/bp-default/members/single/settings/general.php:58 +msgid "Lost your password?" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:20 +#: bp-themes/bp-default/members/single/settings/general.php:62 +msgid "Account Email" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:23 +#: bp-themes/bp-default/members/single/settings/general.php:65 +msgid "Change Password <span>(leave blank for no change)</span>" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:24 +#: bp-themes/bp-default/members/single/settings/general.php:66 +msgid "New Password" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/general.php:25 +#: bp-themes/bp-default/members/single/settings/general.php:67 +msgid "Repeat New Password" +msgstr "" + +#: bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php:12 +#: bp-themes/bp-default/members/single/settings/notifications.php:54 +msgid "Send a notification by email when:" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:63 +msgid "BuddyPress Legacy" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:251 +#: bp-themes/bp-default/functions.php:158 +msgid "My Favorites" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:252 +#: bp-themes/bp-default/functions.php:159 +msgid "Accepted" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:253 +#: bp-themes/bp-default/functions.php:160 +msgid "Rejected" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:254 +#: bp-themes/bp-default/functions.php:161 +msgid "Show all comments for this thread" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:255 +#: bp-themes/bp-default/functions.php:162 +msgid "Show all" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:256 +#: bp-themes/bp-default/functions.php:163 +msgid "comments" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:569 +#: bp-themes/bp-default/_inc/ajax.php:278 +msgid "There was a problem posting your update, please try again." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:663 +#: bp-templates/bp-legacy/buddypress-functions.php:699 +#: bp-themes/bp-default/_inc/ajax.php:380 +#: bp-themes/bp-default/_inc/ajax.php:416 +msgid "There was a problem when deleting. Please try again." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:899 +#: bp-themes/bp-default/_inc/ajax.php:615 +msgid " Friendship could not be requested." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:911 +#: bp-themes/bp-default/_inc/ajax.php:627 +msgid "Friendship request could not be cancelled." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:916 +#: bp-themes/bp-default/_inc/ajax.php:632 +msgid "Request Pending" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:936 +#: bp-themes/bp-default/_inc/ajax.php:652 +msgid "There was a problem accepting that request. Please try again." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:955 +#: bp-themes/bp-default/_inc/ajax.php:671 +msgid "There was a problem rejecting that request. Please try again." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:985 +#: bp-themes/bp-default/_inc/ajax.php:701 +msgid "Error joining group" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:994 +#: bp-themes/bp-default/_inc/ajax.php:710 +msgid "Error requesting membership" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:996 +#: bp-themes/bp-default/_inc/ajax.php:712 +msgid "Membership Requested" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:1004 +#: bp-themes/bp-default/_inc/ajax.php:720 +msgid "Error leaving group" +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:1027 +#: bp-themes/bp-default/_inc/ajax.php:743 +msgid "There was a problem closing the notice." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:1090 +#: bp-themes/bp-default/_inc/ajax.php:794 +msgid "There was a problem sending that reply. Please try again." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:1108 +#: bp-themes/bp-default/_inc/ajax.php:812 +msgid "There was a problem marking messages as unread." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:1133 +#: bp-themes/bp-default/_inc/ajax.php:837 +msgid "There was a problem marking messages as read." +msgstr "" + +#: bp-templates/bp-legacy/buddypress-functions.php:1158 +#: bp-themes/bp-default/_inc/ajax.php:862 +msgid "There was a problem deleting messages." +msgstr "" + +#: bp-themes/bp-default/404.php:7 +msgid "Page not found" +msgstr "" + +#: bp-themes/bp-default/404.php:9 +msgid "We're sorry, but we can't find the page that you're looking for. Perhaps searching will help." +msgstr "" + +#: bp-themes/bp-default/activity/entry.php:37 +msgid "In reply to: " +msgstr "" + +#: bp-themes/bp-default/activity/entry.php:37 +msgid "View Thread / Permalink" +msgstr "" + +#: bp-themes/bp-default/activity/entry.php:104 +msgid "or press esc to cancel." +msgstr "" + +#: bp-themes/bp-default/activity/index.php:21 +msgid "Site Activity" +msgstr "" + +#: bp-themes/bp-default/archive.php:10 +msgid "You are browsing the archive for %1$s." +msgstr "" + +#: bp-themes/bp-default/archive.php:24 bp-themes/bp-default/attachment.php:18 +#: bp-themes/bp-default/index.php:24 bp-themes/bp-default/search.php:26 +#: bp-themes/bp-default/single.php:16 +msgctxt "Post written by..." +msgid "by %s" +msgstr "" + +#: bp-themes/bp-default/archive.php:28 bp-themes/bp-default/attachment.php:22 +#: bp-themes/bp-default/index.php:32 bp-themes/bp-default/search.php:30 +msgid "Permanent Link to" +msgstr "" + +#: bp-themes/bp-default/archive.php:30 bp-themes/bp-default/index.php:34 +#: bp-themes/bp-default/search.php:32 bp-themes/bp-default/single.php:23 +msgid "%1$s <span>in %2$s</span>" +msgstr "" + +#: bp-themes/bp-default/archive.php:33 bp-themes/bp-default/index.php:37 +#: bp-themes/bp-default/search.php:35 bp-themes/bp-default/single.php:28 +msgid "Read the rest of this entry →" msgstr "" -#: bp-themes/bp-default/members/single/profile/change-avatar.php:23 -msgid "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button." +#: bp-themes/bp-default/archive.php:34 bp-themes/bp-default/index.php:38 +#: bp-themes/bp-default/onecolumn-page.php:31 bp-themes/bp-default/page.php:20 +#: bp-themes/bp-default/single.php:30 +msgid "Pages: " msgstr "" -#: bp-themes/bp-default/members/single/profile/change-avatar.php:24 -msgid "Delete My Avatar" +#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41 +#: bp-themes/bp-default/search.php:38 bp-themes/bp-default/single.php:33 +msgid "Tags: " msgstr "" -#: bp-themes/bp-default/members/single/profile/change-avatar.php:31 -msgid "Crop Your New Avatar" +#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41 +#: bp-themes/bp-default/search.php:38 +msgid "No Comments »" msgstr "" -#: bp-themes/bp-default/members/single/profile/change-avatar.php:55 -msgid "Your avatar will be used on your profile and throughout the site. To change your avatar, please create an account with <a href=\"http://gravatar.com\">Gravatar</a> using the same email address as you used to register with this site." +#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41 +#: bp-themes/bp-default/search.php:38 +msgid "1 Comment »" msgstr "" -#: bp-themes/bp-default/members/single/profile/edit.php:10 -msgid "Editing '%s' Profile Group" +#: bp-themes/bp-default/archive.php:37 bp-themes/bp-default/index.php:41 +#: bp-themes/bp-default/search.php:38 +msgid "% Comments »" msgstr "" -#: bp-themes/bp-default/members/single/profile/edit.php:26 -#: bp-themes/bp-default/members/single/profile/edit.php:33 -#: bp-themes/bp-default/members/single/profile/edit.php:40 -#: bp-themes/bp-default/members/single/profile/edit.php:49 -#: bp-themes/bp-default/members/single/profile/edit.php:67 -#: bp-themes/bp-default/members/single/profile/edit.php:83 -#: bp-themes/bp-default/members/single/profile/edit.php:93 -#: bp-themes/bp-default/registration/register.php:37 -#: bp-themes/bp-default/registration/register.php:41 -#: bp-themes/bp-default/registration/register.php:45 -#: bp-themes/bp-default/registration/register.php:49 -#: bp-themes/bp-default/registration/register.php:76 -#: bp-themes/bp-default/registration/register.php:84 -#: bp-themes/bp-default/registration/register.php:92 -#: bp-themes/bp-default/registration/register.php:102 -#: bp-themes/bp-default/registration/register.php:113 -#: bp-themes/bp-default/registration/register.php:128 -#: bp-themes/bp-default/registration/register.php:139 -#: bp-themes/bp-default/registration/register.php:211 -#: bp-themes/bp-default/registration/register.php:220 -msgid "(required)" +#: bp-themes/bp-default/archive.php:50 bp-themes/bp-default/index.php:54 +msgid "Not Found" msgstr "" -#: bp-themes/bp-default/members/single/profile/edit.php:58 -#: bp-themes/bp-default/members/single/profile/edit.php:73 -#: bp-themes/bp-default/registration/register.php:119 -#: bp-xprofile/bp-xprofile-admin.php:415 -msgid "Clear" +#: bp-themes/bp-default/attachment.php:26 bp-themes/bp-default/single.php:24 +msgid "Edit this entry" msgstr "" -#: bp-themes/bp-default/members/single/profile/edit.php:118 -#: bp-themes/bp-default/members/single/profile/edit.php:132 -#: bp-themes/bp-default/registration/register.php:159 -#: bp-themes/bp-default/registration/register.php:174 -msgid "This field can be seen by: <span class=\"current-visibility-level\">%s</span>" +#: bp-themes/bp-default/attachment.php:40 +msgid "Full size is %s pixels" msgstr "" -#: bp-themes/bp-default/members/single/profile/edit.php:118 -msgid "Change" +#: bp-themes/bp-default/attachment.php:43 +msgid "Link to full size image" msgstr "" -#: bp-themes/bp-default/members/single/profile/edit.php:123 -#: bp-themes/bp-default/registration/register.php:164 -msgid "Who can see this field?" +#: bp-themes/bp-default/attachment.php:62 +msgid "Sorry, no attachments matched your criteria." msgstr "" -#: bp-themes/bp-default/members/single/profile/profile-wp.php:8 -msgid "%s's Profile" +#: bp-themes/bp-default/blogs/create.php:21 +#: bp-themes/bp-default/blogs/index.php:21 +msgid "Site Directory" msgstr "" -#: bp-themes/bp-default/members/single/settings/capabilities.php:57 -msgid "This user is a spammer." +#: bp-themes/bp-default/comments.php:12 +msgid "Password Protected" msgstr "" -#: bp-themes/bp-default/members/single/settings/delete-account.php:56 -msgid "Deleting your account will delete all of the content you have created. It will be completely irrecoverable." +#: bp-themes/bp-default/comments.php:13 +msgid "Enter the password to view comments." msgstr "" -#: bp-themes/bp-default/members/single/settings/delete-account.php:60 -msgid "Deleting this account will delete all of the content it has created. It will be completely irrecoverable." -msgstr "" +#: bp-themes/bp-default/comments.php:31 +msgid "1 response to %2$s" +msgid_plural "%1$s responses to %2$s" +msgstr[0] "" +msgstr[1] "" -#: bp-themes/bp-default/members/single/settings/delete-account.php:72 -msgid "I understand the consequences." +#: bp-themes/bp-default/comments.php:55 +msgid "Comments are closed, but <a href=\"%1$s\" title=\"Trackback URL for this post\">trackbacks</a> and pingbacks are open." msgstr "" -#: bp-themes/bp-default/members/single/settings/general.php:49 -msgid "General Settings" +#: bp-themes/bp-default/comments.php:59 +msgid "Comments are closed." msgstr "" -#: bp-themes/bp-default/members/single/settings/general.php:57 -msgid "Current Password <span>(required to update email or change current password)</span>" +#: bp-themes/bp-default/comments.php:70 +msgid "1 trackback" +msgid_plural "%d trackbacks" +msgstr[0] "" +msgstr[1] "" + +#: bp-themes/bp-default/footer.php:15 +msgid "Proudly powered by <a href=\"%1$s\">WordPress</a> and <a href=\"%2$s\">BuddyPress</a>." msgstr "" -#: bp-themes/bp-default/members/single/settings/general.php:58 -msgid "Password Lost and Found" +#: bp-themes/bp-default/forums/index.php:23 +msgid "Forums Directory" msgstr "" -#: bp-themes/bp-default/members/single/settings/general.php:58 -msgid "Lost your password?" +#: bp-themes/bp-default/functions.php:85 +msgid "Primary Navigation" msgstr "" -#: bp-themes/bp-default/members/single/settings/general.php:62 -msgid "Account Email" +#: bp-themes/bp-default/functions.php:389 +msgid "The sidebar widget area" msgstr "" -#: bp-themes/bp-default/members/single/settings/general.php:65 -msgid "Change Password <span>(leave blank for no change)</span>" +#: bp-themes/bp-default/functions.php:398 +msgid "First Footer Widget Area" msgstr "" -#: bp-themes/bp-default/members/single/settings/general.php:66 -msgid "New Password" +#: bp-themes/bp-default/functions.php:400 +msgid "The first footer widget area" msgstr "" -#: bp-themes/bp-default/members/single/settings/general.php:67 -msgid "Repeat New Password" +#: bp-themes/bp-default/functions.php:409 +msgid "Second Footer Widget Area" msgstr "" -#: bp-themes/bp-default/members/single/settings/notifications.php:49 -msgid "Email Notification" +#: bp-themes/bp-default/functions.php:411 +msgid "The second footer widget area" msgstr "" -#: bp-themes/bp-default/members/single/settings/notifications.php:54 -msgid "Send a notification by email when:" +#: bp-themes/bp-default/functions.php:420 +msgid "Third Footer Widget Area" msgstr "" -#: bp-themes/bp-default/onecolumn-page.php:29 bp-themes/bp-default/page.php:18 -msgid "<p class=\"serif\">Read the rest of this page →</p>" +#: bp-themes/bp-default/functions.php:422 +msgid "The third footer widget area" msgstr "" -#: bp-themes/bp-default/onecolumn-page.php:32 bp-themes/bp-default/page.php:21 -msgid "Edit this page." +#: bp-themes/bp-default/functions.php:431 +msgid "Fourth Footer Widget Area" msgstr "" -#: bp-themes/bp-default/registration/activate.php:12 -msgid "Account Activated" +#: bp-themes/bp-default/functions.php:433 +msgid "The fourth footer widget area" msgstr "" -#: bp-themes/bp-default/registration/activate.php:17 -msgid "Your account was activated successfully! Your account details have been sent to you in a separate email." +#. translators: 1: comment author url, 2: comment author name, 3: comment +#. permalink, 4: comment date/timestamp + +#: bp-themes/bp-default/functions.php:488 +msgid "<a href=\"%1$s\" rel=\"nofollow\">%2$s</a> said on <a href=\"%3$s\"><span class=\"time-since\">%4$s</span></a>" msgstr "" -#: bp-themes/bp-default/registration/activate.php:19 -msgid "Your account was activated successfully! You can now log in with the username and password you provided when you signed up." +#: bp-themes/bp-default/functions.php:495 +msgid "Your comment is awaiting moderation." msgstr "" -#: bp-themes/bp-default/registration/activate.php:28 -msgid "Please provide a valid activation key." +#: bp-themes/bp-default/functions.php:507 +msgid "Edit comment" msgstr "" -#: bp-themes/bp-default/registration/activate.php:32 -msgid "Activation Key:" +#: bp-themes/bp-default/functions.php:577 +msgid "Theme activated! This theme contains <a href=\"%s\">custom header image</a> support and <a href=\"%s\">sidebar widgets</a>." msgstr "" -#: bp-themes/bp-default/registration/register.php:16 -msgid "User registration is currently not allowed." +#: bp-themes/bp-default/functions.php:643 +msgid "Email" msgstr "" -#: bp-themes/bp-default/registration/register.php:27 -msgid "Registering for this site is easy, just fill in the fields below and we'll get a new account set up for you in no time." +#: bp-themes/bp-default/functions.php:653 +msgid "You must be <a href=\"%1$s\">logged in</a> to post a comment." msgstr "" -#: bp-themes/bp-default/registration/register.php:35 -msgid "Account Details" +#: bp-themes/bp-default/functions.php:654 +msgid "Leave a reply" msgstr "" -#: bp-themes/bp-default/registration/register.php:37 -#: bp-themes/bp-default/sidebar.php:44 -msgid "Username" +#: bp-themes/bp-default/functions.php:741 +msgid "← Previous Entries" msgstr "" -#: bp-themes/bp-default/registration/register.php:41 -msgid "Email Address" +#: bp-themes/bp-default/functions.php:742 +msgid "Next Entries →" msgstr "" -#: bp-themes/bp-default/registration/register.php:45 -msgid "Choose a Password" +#: bp-themes/bp-default/groups/create.php:18 +#: bp-themes/bp-default/groups/index.php:21 +msgid "Groups Directory" msgstr "" -#: bp-themes/bp-default/registration/register.php:49 -msgid "Confirm Password" +#: bp-themes/bp-default/header.php:22 +msgctxt "Home page banner link title" +msgid "Home" msgstr "" -#: bp-themes/bp-default/registration/register.php:65 -msgid "Profile Details" +#: bp-themes/bp-default/header.php:25 +msgid "Search for:" msgstr "" -#: bp-themes/bp-default/registration/register.php:205 -msgid "Blog Details" +#: bp-themes/bp-default/index.php:27 +msgctxt "Sticky post" +msgid "Featured" msgstr "" -#: bp-themes/bp-default/registration/register.php:207 -msgid "Yes, I'd like to create a new site" +#: bp-themes/bp-default/index.php:55 +msgid "Sorry, but you are looking for something that isn't here." msgstr "" -#: bp-themes/bp-default/registration/register.php:211 -msgid "Blog URL" +#: bp-themes/bp-default/links.php:16 +msgid "Links" msgstr "" -#: bp-themes/bp-default/registration/register.php:220 -msgid "Site Title" +#: bp-themes/bp-default/members/index.php:21 +msgid "Members Directory" msgstr "" -#: bp-themes/bp-default/registration/register.php:241 -msgid "Complete Sign Up" +#: bp-themes/bp-default/members/single/settings/general.php:49 +msgid "General Settings" msgstr "" -#: bp-themes/bp-default/registration/register.php:252 -msgid "Sign Up Complete!" +#: bp-themes/bp-default/members/single/settings/notifications.php:49 +msgid "Email Notification" msgstr "" -#: bp-themes/bp-default/registration/register.php:258 -msgid "You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address." +#: bp-themes/bp-default/onecolumn-page.php:29 bp-themes/bp-default/page.php:18 +msgid "<p class=\"serif\">Read the rest of this page →</p>" msgstr "" -#: bp-themes/bp-default/registration/register.php:260 -msgid "You have successfully created your account! Please log in using the username and password you have just created." +#: bp-themes/bp-default/onecolumn-page.php:32 bp-themes/bp-default/page.php:21 +msgid "Edit this page." msgstr "" #: bp-themes/bp-default/search.php:10 @@ -5270,7 +5950,7 @@ msgstr "" msgid "Profile Fields" msgstr "" -#: bp-xprofile/bp-xprofile-admin.php:72 bp-xprofile/bp-xprofile-classes.php:357 +#: bp-xprofile/bp-xprofile-admin.php:72 bp-xprofile/bp-xprofile-classes.php:354 msgid "Add New Field Group" msgstr "" @@ -5346,152 +6026,149 @@ msgstr "" msgid "Please make sure you give the group a name." msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:359 +#: bp-xprofile/bp-xprofile-classes.php:356 msgid "Create Field Group" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:361 +#: bp-xprofile/bp-xprofile-classes.php:358 msgid "Edit Field Group" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:371 -#: bp-xprofile/bp-xprofile-classes.php:824 -msgid "Fields marked * are required" -msgstr "" - -#: bp-xprofile/bp-xprofile-classes.php:385 +#: bp-xprofile/bp-xprofile-classes.php:384 msgid "Field Group Title" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:394 +#: bp-xprofile/bp-xprofile-classes.php:391 msgid "Group Description" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:405 -#: bp-xprofile/bp-xprofile-classes.php:913 -msgid "or" -msgstr "" - -#: bp-xprofile/bp-xprofile-classes.php:740 +#: bp-xprofile/bp-xprofile-classes.php:753 msgid "Please enter options for this Field:" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:743 -msgid "Order Entered" +#: bp-xprofile/bp-xprofile-classes.php:755 +msgid "Sort Order:" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:744 -msgid "Name - Ascending" +#: bp-xprofile/bp-xprofile-classes.php:757 +msgid "Custom" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:745 -msgid "Name - Descending" +#: bp-xprofile/bp-xprofile-classes.php:758 +msgid "Ascending" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:769 -#: bp-xprofile/bp-xprofile-classes.php:790 -msgid "Option" +#: bp-xprofile/bp-xprofile-classes.php:759 +msgid "Descending" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:771 -#: bp-xprofile/bp-xprofile-classes.php:791 +#: bp-xprofile/bp-xprofile-classes.php:787 +#: bp-xprofile/bp-xprofile-classes.php:804 msgid "Default Value" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:797 +#: bp-xprofile/bp-xprofile-classes.php:811 msgid "Add Another Option" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:805 +#: bp-xprofile/bp-xprofile-classes.php:819 msgid "Add Field" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:817 +#: bp-xprofile/bp-xprofile-classes.php:831 msgid "Edit Field" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:837 +#: bp-xprofile/bp-xprofile-classes.php:838 +msgid "Fields marked * are required" +msgstr "" + +#: bp-xprofile/bp-xprofile-classes.php:851 msgid "Field Title" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:844 +#: bp-xprofile/bp-xprofile-classes.php:858 msgid "Field Description" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:853 +#: bp-xprofile/bp-xprofile-classes.php:867 msgid "Is This Field Required?" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:855 +#: bp-xprofile/bp-xprofile-classes.php:869 msgid "Not Required" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:856 +#: bp-xprofile/bp-xprofile-classes.php:870 msgid "Required" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:861 +#: bp-xprofile/bp-xprofile-classes.php:875 msgid "Field Type" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:863 +#: bp-xprofile/bp-xprofile-classes.php:877 msgid "Text Box" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:864 +#: bp-xprofile/bp-xprofile-classes.php:878 msgid "Multi-line Text Box" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:865 +#: bp-xprofile/bp-xprofile-classes.php:879 msgid "Date Selector" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:866 +#: bp-xprofile/bp-xprofile-classes.php:880 msgid "Radio Buttons" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:867 +#: bp-xprofile/bp-xprofile-classes.php:881 msgid "Drop Down Select Box" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:868 +#: bp-xprofile/bp-xprofile-classes.php:882 msgid "Multi Select Box" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:869 +#: bp-xprofile/bp-xprofile-classes.php:883 msgid "Checkboxes" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:890 +#: bp-xprofile/bp-xprofile-classes.php:903 msgid "Default Visibility" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:899 +#: bp-xprofile/bp-xprofile-classes.php:916 msgid "Per-Member Visibility" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:901 -msgid "Let members change the this field's visibility" +#: bp-xprofile/bp-xprofile-classes.php:918 +msgid "Let members change this field's visibility" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:903 +#: bp-xprofile/bp-xprofile-classes.php:919 msgid "Enforce the default visibility for all members" msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:931 +#: bp-xprofile/bp-xprofile-classes.php:929 +msgid "or" +msgstr "" + +#: bp-xprofile/bp-xprofile-classes.php:947 msgid "Please make sure you fill out all required fields." msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:934 +#: bp-xprofile/bp-xprofile-classes.php:950 msgid "Radio button field types require at least one option. Please add options below." msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:937 -#: bp-xprofile/bp-xprofile-classes.php:940 +#: bp-xprofile/bp-xprofile-classes.php:953 +#: bp-xprofile/bp-xprofile-classes.php:956 msgid "Select box field types require at least one option. Please add options below." msgstr "" -#: bp-xprofile/bp-xprofile-classes.php:943 +#: bp-xprofile/bp-xprofile-classes.php:959 msgid "Checkbox field types require at least one option. Please add options below." msgstr "" @@ -5503,82 +6180,86 @@ msgstr "" msgid "Logged In Users" msgstr "" -#: bp-xprofile/bp-xprofile-screens.php:95 +#: bp-xprofile/bp-xprofile-loader.php:114 +msgid "Admins Only" +msgstr "" + +#: bp-xprofile/bp-xprofile-screens.php:96 msgid "Please make sure you fill in all required fields in this profile field group before saving." msgstr "" -#: bp-xprofile/bp-xprofile-screens.php:126 +#: bp-xprofile/bp-xprofile-screens.php:129 msgid "There was a problem updating some of your profile information, please try again." msgstr "" -#: bp-xprofile/bp-xprofile-screens.php:128 +#: bp-xprofile/bp-xprofile-screens.php:131 msgid "Changes saved." msgstr "" -#: bp-xprofile/bp-xprofile-screens.php:180 -msgid "There was a problem cropping your avatar, please try uploading it again" +#: bp-xprofile/bp-xprofile-screens.php:199 +msgid "There was a problem cropping your avatar." msgstr "" -#: bp-xprofile/bp-xprofile-screens.php:182 -msgid "Your new avatar was uploaded successfully!" +#: bp-xprofile/bp-xprofile-screens.php:201 +msgid "Your new avatar was uploaded successfully." msgstr "" -#: bp-xprofile/bp-xprofile-template.php:668 +#: bp-xprofile/bp-xprofile-template.php:664 msgid "January" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:669 +#: bp-xprofile/bp-xprofile-template.php:665 msgid "February" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:670 +#: bp-xprofile/bp-xprofile-template.php:666 msgid "March" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:671 +#: bp-xprofile/bp-xprofile-template.php:667 msgid "April" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:672 +#: bp-xprofile/bp-xprofile-template.php:668 msgid "May" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:673 +#: bp-xprofile/bp-xprofile-template.php:669 msgid "June" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:674 +#: bp-xprofile/bp-xprofile-template.php:670 msgid "July" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:675 +#: bp-xprofile/bp-xprofile-template.php:671 msgid "August" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:676 +#: bp-xprofile/bp-xprofile-template.php:672 msgid "September" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:677 +#: bp-xprofile/bp-xprofile-template.php:673 msgid "October" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:678 +#: bp-xprofile/bp-xprofile-template.php:674 msgid "November" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:679 +#: bp-xprofile/bp-xprofile-template.php:675 msgid "December" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:847 +#: bp-xprofile/bp-xprofile-template.php:843 msgid "Avatar uploads are currently disabled. Why not use a <a href=\"http://gravatar.com\" target=\"_blank\">gravatar</a> instead?" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:855 +#: bp-xprofile/bp-xprofile-template.php:851 msgid "Profile not recently updated" msgstr "" -#: bp-xprofile/bp-xprofile-template.php:865 +#: bp-xprofile/bp-xprofile-template.php:861 msgid "Profile updated %s" msgstr "" \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-loader.php b/wp-content/plugins/buddypress/bp-loader.php index a2086450546ff893e9a2192d8e8d4f66340f1adc..70cf5b08635d2a6a3aaf35b2a56e96ee1ea868d6 100644 --- a/wp-content/plugins/buddypress/bp-loader.php +++ b/wp-content/plugins/buddypress/bp-loader.php @@ -4,6 +4,8 @@ * * BuddyPress is social networking software with a twist from the creators of WordPress. * + * $Id$ + * * @package BuddyPress * @subpackage Main */ @@ -14,9 +16,10 @@ * Description: Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress. * Author: The BuddyPress Community * Author URI: http://buddypress.org/community/members/ - * Version: 1.6.2 + * Version: 1.7.1 * Text Domain: buddypress * Domain Path: /bp-languages/ + * License: GPLv2 or later (license.txt) */ // Exit if accessed directly @@ -34,211 +37,177 @@ if ( !class_exists( 'BuddyPress' ) ) : */ class BuddyPress { - /** - * Note to Plugin and Theme authors: - * - * Do not directly reference the variables below in your code. Their names - * and locations in the BuddyPress class are subject to change at any time. - * - * Most of them have reference functions located in bp-core-functions.php. - * The ones that don't can be accessed via their respective WordPress API's. - * - * Components are encouraged to store their data in the $bp global rather - * than new globals to keep all BuddyPress data in one place. - */ - - /** Version ***************************************************************/ - - /** - * @var string BuddyPress version - */ - public $version = '1.6.2'; - - /** - * @var int Database version of current BuddyPress files - */ - public $db_version = 6066; - - /** - * @var int Database version raw from database connection - */ - public $db_version_raw = 0; - - /** - * @var string State of BuddyPress installation - */ - public $maintenance_mode = ''; - - /** - * @var bool Include deprecated BuddyPress files or not - */ - public $load_deprecated = true; - - /** Root ******************************************************************/ - - /** - * @var int The root blog ID - */ - public $root_blog_id = 1; - - /** Paths *****************************************************************/ + /** Magic *****************************************************************/ /** - * The absolute path and filename of this file. + * BuddyPress uses many variables, most of which can be filtered to customize + * the way that it works. To prevent unauthorized access, these variables + * are stored in a private array that is magically updated using PHP 5.2+ + * methods. This is to prevent third party plugins from tampering with + * essential information indirectly, which would cause issues later. * - * @since BuddyPress (1.6) - * @var string + * @see BuddyPress::setup_globals() + * @var array */ - public $file; + private $data; - /** - * @var string Basename of the BuddyPress plugin directory - */ - public $basename = ''; + /** Not Magic *************************************************************/ /** - * @var string Absolute path to the BuddyPress plugin directory - */ - public $plugin_dir = ''; - - /** - * @var string Absolute path to the BuddyPress themes directory + * @var array Primary BuddyPress navigation */ - public $themes_dir = ''; + public $bp_nav = array(); /** - * @var string Absolute path to the BuddyPress language directory + * @var array Secondary BuddyPress navigation to $bp_nav */ - public $lang_dir = ''; - - /** URLs ******************************************************************/ + public $bp_options_nav = array(); /** - * @var string URL to the BuddyPress plugin directory + * @var array The unfiltered URI broken down into chunks + * @see bp_core_set_uri_globals() */ - public $plugin_url = ''; + public $unfiltered_uri = array(); /** - * @var string URL to the BuddyPress themes directory + * @var array The canonical URI stack + * @see bp_redirect_canonical() + * @see bp_core_new_nav_item() */ - public $themes_url = ''; - - /** Users *****************************************************************/ + public $canonical_stack = array(); /** - * @var object Current user + * @var array Additional navigation elements (supplemental) */ - public $current_user = null; + public $action_variables = array(); /** - * @var object Displayed user + * @var array Required components (core, members) */ - public $displayed_user = null; - - /** Navigation ************************************************************/ + public $required_components = array(); /** - * @var array Primary BuddyPress navigation + * @var array Additional active components */ - public $bp_nav = array(); + public $loaded_components = array(); /** - * @var array Secondary BuddyPress navigation to $bp_nav + * @var array Active components */ - public $bp_options_nav = array(); + public $active_components = array(); - /** Toolbar ***************************************************************/ + /** Option Overload *******************************************************/ /** - * @var string The primary toolbar ID + * @var array Optional Overloads default options retrieved from get_option() */ - public $my_account_menu_id = ''; + public $options = array(); - /** URI's *****************************************************************/ + /** Singleton *************************************************************/ /** - * @var array The unfiltered URI broken down into chunks - * @see bp_core_set_uri_globals() + * @var BuddyPress The one true BuddyPress */ - public $unfiltered_uri = array(); + private static $instance; /** - * @var int The current offset of the URI - * @see bp_core_set_uri_globals() - */ - public $unfiltered_uri_offset = 0; + * Main BuddyPress Instance + * + * BuddyPress is great + * Please load it only one time + * For this, we thank you + * + * Insures that only one instance of BuddyPress exists in memory at any one + * time. Also prevents needing to define globals all over the place. + * + * @since BuddyPress (1.7) + * + * @staticvar array $instance + * @uses BuddyPress::constants() Setup the constants (mostly deprecated) + * @uses BuddyPress::setup_globals() Setup the globals needed + * @uses BuddyPress::includes() Include the required files + * @uses BuddyPress::setup_actions() Setup the hooks and actions + * @see buddypress() + * + * @return The one true BuddyPress + */ + public static function instance() { + if ( ! isset( self::$instance ) ) { + self::$instance = new BuddyPress; + self::$instance->constants(); + self::$instance->setup_globals(); + self::$instance->legacy_constants(); + self::$instance->includes(); + self::$instance->setup_actions(); + } + return self::$instance; + } - /** - * @var bool Are status headers already sent? - */ - public $no_status_set = false; + /** Magic Methods *********************************************************/ /** - * @var array The canonical URI stack - * @see bp_redirect_canonical() - * @see bp_core_new_nav_item() + * A dummy constructor to prevent BuddyPress from being loaded more than once. + * + * @since BuddyPress (1.7) + * @see BuddyPress::instance() + * @see buddypress() */ - public $canonical_stack = array(); - - /** Components ************************************************************/ + private function __construct() { /* Do nothing here */ } /** - * @var string Name of the current BuddyPress component (primary) + * A dummy magic method to prevent BuddyPress from being cloned + * + * @since BuddyPress (1.7) */ - public $current_component = ''; + public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'buddypress' ), '1.7' ); } /** - * @var string Name of the current BuddyPress item (secondary) + * A dummy magic method to prevent BuddyPress from being unserialized + * + * @since BuddyPress (1.7) */ - public $current_item = ''; + public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'buddypress' ), '1.7' ); } /** - * @var string Name of the current BuddyPress action (tertiary) + * Magic method for checking the existence of a certain custom field + * + * @since BuddyPress (1.7) */ - public $current_action = ''; + public function __isset( $key ) { return isset( $this->data[$key] ); } /** - * @var array Additional navigation elements (supplemental) + * Magic method for getting BuddyPress varibles + * + * @since BuddyPress (1.7) */ - public $action_variables = array(); + public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; } /** - * @var bool Displaying custom 2nd level navigation menu (I.E a group) + * Magic method for setting BuddyPress varibles + * + * @since BuddyPress (1.7) */ - public $is_single_item = false; - - /** Option Overload *******************************************************/ + public function __set( $key, $value ) { $this->data[$key] = $value; } /** - * @var array Optional Overloads default options retrieved from get_option() + * Magic method for unsetting BuddyPress variables + * + * @since BuddyPress (1.7) */ - public $options = array(); - - /** Functions *************************************************************/ + public function __unset( $key ) { if ( isset( $this->data[$key] ) ) unset( $this->data[$key] ); } /** - * The main BuddyPress loader - * - * @since BuddyPress (1.6) + * Magic method to prevent notices and errors from invalid method calls * - * @uses BuddyPress::constants() Setup legacy constants - * @uses BuddyPress::setup_globals() Setup globals needed - * @uses BuddyPress::includes() Includ required files - * @uses BuddyPress::setup_actions() Setup hooks and actions + * @since BuddyPress (1.7) */ - public function __construct() { - $this->constants(); - $this->setup_globals(); - $this->includes(); - $this->setup_actions(); - } + public function __call( $name = '', $args = array() ) { unset( $name, $args ); return null; } + + /** Private Methods *******************************************************/ /** - * Legacy BuddyPress constants - * - * Try to avoid using these. Their values have been moved into variables - * in the $bp global, and have matching functions to get/set their value. - * + * Bootstrap constants + * * @since BuddyPress (1.6) * * @uses is_multisite() @@ -249,14 +218,6 @@ class BuddyPress { */ private function constants() { - // Define the BuddyPress version - if ( !defined( 'BP_VERSION' ) ) - define( 'BP_VERSION', $this->version ); - - // Define the database version - if ( !defined( 'BP_DB_VERSION' ) ) - define( 'BP_DB_VERSION', $this->db_version ); - // Place your custom code (actions/filters) in a file called // '/plugins/bp-custom.php' and it will be loaded before anything else. if ( file_exists( WP_PLUGIN_DIR . '/bp-custom.php' ) ) @@ -315,6 +276,57 @@ class BuddyPress { */ private function setup_globals() { + /** Versions **********************************************************/ + + $this->version = '1.7.1'; + $this->db_version = 6080; + + /** Loading ***********************************************************/ + + $this->load_deprecated = true; + + /** Toolbar ***********************************************************/ + + /** + * @var string The primary toolbar ID + */ + $this->my_account_menu_id = ''; + + /** URI's *************************************************************/ + + /** + * @var int The current offset of the URI + * @see bp_core_set_uri_globals() + */ + $this->unfiltered_uri_offset = 0; + + /** + * @var bool Are status headers already sent? + */ + $this->no_status_set = false; + + /** Components ********************************************************/ + + /** + * @var string Name of the current BuddyPress component (primary) + */ + $this->current_component = ''; + + /** + * @var string Name of the current BuddyPress item (secondary) + */ + $this->current_item = ''; + + /** + * @var string Name of the current BuddyPress action (tertiary) + */ + $this->current_action = ''; + + /** + * @var bool Displaying custom 2nd level navigation menu (I.E a group) + */ + $this->is_single_item = false; + /** Root **************************************************************/ // BuddyPress Root blog ID @@ -323,22 +335,48 @@ class BuddyPress { /** Paths *************************************************************/ // BuddyPress root directory - $this->file = __FILE__; - $this->basename = plugin_basename( $this->file ); - $this->plugin_dir = BP_PLUGIN_DIR; - $this->plugin_url = BP_PLUGIN_URL; - - // Themes - $this->themes_dir = $this->plugin_dir . 'bp-themes'; - $this->themes_url = $this->plugin_url . 'bp-themes'; + $this->file = __FILE__; + $this->basename = plugin_basename( $this->file ); + $this->plugin_dir = BP_PLUGIN_DIR; + $this->plugin_url = BP_PLUGIN_URL; // Languages - $this->lang_dir = $this->plugin_dir . 'bp-languages'; + $this->lang_dir = $this->plugin_dir . 'bp-languages'; + + // Templates (theme compatability) + $this->themes_dir = $this->plugin_dir . 'bp-templates'; + $this->themes_url = $this->plugin_url . 'bp-templates'; + + // Themes (for bp-default) + $this->old_themes_dir = $this->plugin_dir . 'bp-themes'; + $this->old_themes_url = $this->plugin_url . 'bp-themes'; + + /** Theme Compat ******************************************************/ + + $this->theme_compat = new stdClass(); // Base theme compatibility class + $this->filters = new stdClass(); // Used when adding/removing filters /** Users *************************************************************/ - $this->current_user = new stdClass(); - $this->displayed_user = new stdClass(); + $this->current_user = new stdClass(); + $this->displayed_user = new stdClass(); + } + + /** + * Legacy BuddyPress constants + * + * Try to avoid using these. Their values have been moved into variables + * in the instance, and have matching functions to get/set their values. + * + * @since BuddyPress (1.7) + */ + private function legacy_constants() { + + // Define the BuddyPress version + if ( !defined( 'BP_VERSION' ) ) define( 'BP_VERSION', $this->version ); + + // Define the database version + if ( !defined( 'BP_DB_VERSION' ) ) define( 'BP_DB_VERSION', $this->db_version ); } /** @@ -354,88 +392,41 @@ class BuddyPress { // Load the WP abstraction file so BuddyPress can run on all WordPress setups. require( BP_PLUGIN_DIR . '/bp-core/bp-core-wpabstraction.php' ); - // Get the possible DB versions (boy is this gross) - $versions = array(); - $versions['1.6-single'] = get_blog_option( $this->root_blog_id, '_bp_db_version' ); - - // 1.6-single exists, so trust it - if ( !empty( $versions['1.6-single'] ) ) { - $this->db_version_raw = (int) $versions['1.6-single']; - - // If no 1.6-single exists, use the max of the others - } else { - $versions['1.2'] = get_site_option( 'bp-core-db-version' ); - $versions['1.5-multi'] = get_site_option( 'bp-db-version' ); - $versions['1.6-multi'] = get_site_option( '_bp_db_version' ); - $versions['1.5-single'] = get_blog_option( $this->root_blog_id, 'bp-db-version' ); - - // Remove empty array items - $versions = array_filter( $versions ); - $this->db_version_raw = (int) ( !empty( $versions ) ) ? (int) max( $versions ) : 0; - } + // Setup the versions (after we include multisite abstraction above) + $this->versions(); /** Update/Install ****************************************************/ - // This is a new installation - if ( is_admin() ) { - - // New installation - if ( empty( $this->db_version_raw ) ) { - $this->maintenance_mode = 'install'; - - // Update - } elseif ( (int) $this->db_version_raw < (int) $this->db_version ) { - $this->maintenance_mode = 'update'; - } - - // The installation process requires a few BuddyPress core libraries - if ( !empty( $this->maintenance_mode ) ) { - require( $this->plugin_dir . 'bp-core/bp-core-admin.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-functions.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-template.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-update.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-caps.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-options.php' ); - - /** - * Textdomain is usually loaded via the bp_core_loaded action, but - * that action isn't available when BP is in maintenance mode. - */ - add_action( 'plugins_loaded', 'bp_core_load_buddypress_textdomain', 9 ); - - // Load up BuddyPress's admin - add_action( 'plugins_loaded', 'bp_admin' ); - } - } - - // Not in maintenance mode - if ( empty( $this->maintenance_mode ) ) { - - // Require all of the BuddyPress core libraries - require( $this->plugin_dir . 'bp-core/bp-core-actions.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-caps.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-cache.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-cssjs.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-update.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-options.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-classes.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-filters.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-avatars.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-widgets.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-template.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-adminbar.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-buddybar.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-catchuri.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-component.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-functions.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-moderation.php' ); - require( $this->plugin_dir . 'bp-core/bp-core-loader.php' ); - - // Skip or load deprecated content - if ( false !== $this->load_deprecated ) { - require( $this->plugin_dir . 'bp-core/deprecated/1.5.php' ); - require( $this->plugin_dir . 'bp-core/deprecated/1.6.php' ); - } + // Theme compatability + require( $this->plugin_dir . 'bp-core/bp-core-template-loader.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-theme-compatibility.php' ); + + // Require all of the BuddyPress core libraries + require( $this->plugin_dir . 'bp-core/bp-core-dependency.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-actions.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-caps.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-cache.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-cssjs.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-update.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-options.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-classes.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-filters.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-avatars.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-widgets.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-template.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-adminbar.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-buddybar.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-catchuri.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-component.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-functions.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-moderation.php' ); + require( $this->plugin_dir . 'bp-core/bp-core-loader.php' ); + + // Skip or load deprecated content + if ( false !== $this->load_deprecated ) { + require( $this->plugin_dir . 'bp-core/deprecated/1.5.php' ); + require( $this->plugin_dir . 'bp-core/deprecated/1.6.php' ); + require( $this->plugin_dir . 'bp-core/deprecated/1.7.php' ); } } @@ -461,12 +452,14 @@ class BuddyPress { // Array of BuddyPress core actions $actions = array( + 'setup_theme', // Setup the default theme compat 'setup_current_user', // Setup currently logged in user 'register_post_types', // Register post types 'register_post_statuses', // Register post statuses 'register_taxonomies', // Register taxonomies 'register_views', // Register the views 'register_theme_directory', // Register the theme directory + 'register_theme_packages', // Register bundled theme packages (bp-themes) 'load_textdomain', // Load textdomain 'add_rewrite_tags', // Add rewrite tags 'generate_rewrite_rules' // Generate rewrite rules @@ -476,12 +469,120 @@ class BuddyPress { foreach( $actions as $class_action ) add_action( 'bp_' . $class_action, array( $this, $class_action ), 5 ); - // Setup the BuddyPress theme directory - register_theme_directory( $this->themes_dir ); + // All BuddyPress actions are setup (includes bbp-core-hooks.php) + do_action_ref_array( 'bp_after_setup_actions', array( &$this ) ); + } + + /** + * Private method to align the active and database versions + * + * @since BuddyPress (1.7) + */ + private function versions() { + + // Get the possible DB versions (boy is this gross) + $versions = array(); + $versions['1.6-single'] = get_blog_option( $this->root_blog_id, '_bp_db_version' ); + + // 1.6-single exists, so trust it + if ( !empty( $versions['1.6-single'] ) ) { + $this->db_version_raw = (int) $versions['1.6-single']; + + // If no 1.6-single exists, use the max of the others + } else { + $versions['1.2'] = get_site_option( 'bp-core-db-version' ); + $versions['1.5-multi'] = get_site_option( 'bp-db-version' ); + $versions['1.6-multi'] = get_site_option( '_bp_db_version' ); + $versions['1.5-single'] = get_blog_option( $this->root_blog_id, 'bp-db-version' ); + + // Remove empty array items + $versions = array_filter( $versions ); + $this->db_version_raw = (int) ( !empty( $versions ) ) ? (int) max( $versions ) : 0; + } + } + + /** Public Methods ********************************************************/ + + /** + * Setup the BuddyPress theme directory + * + * @since BuddyPress (1.5) + * @todo Move bp-default to wordpress.org/extend/themes and remove this + */ + public function register_theme_directory() { + register_theme_directory( $this->old_themes_dir ); + } + + /** + * Register bundled theme packages + * + * Note that since we currently have complete control over bp-themes and + * the bp-legacy folders, it's fine to hardcode these here. If at a + * later date we need to automate this, an API will need to be built. + * + * @since BuddyPress (1.7) + */ + public function register_theme_packages() { + + // Register the default theme compatibility package + bp_register_theme_package( array( + 'id' => 'legacy', + 'name' => __( 'BuddyPress Default', 'buddypress' ), + 'version' => bp_get_version(), + 'dir' => trailingslashit( $this->themes_dir . '/bp-legacy' ), + 'url' => trailingslashit( $this->themes_url . '/bp-legacy' ) + ) ); + + // Register the basic theme stack. This is really dope. + bp_register_template_stack( 'get_stylesheet_directory', 10 ); + bp_register_template_stack( 'get_template_directory', 12 ); + bp_register_template_stack( 'bp_get_theme_compat_dir', 14 ); + } + + /** + * Setup the default BuddyPress theme compatability location. + * + * @since BuddyPress (1.7) + */ + public function setup_theme() { + + // Bail if something already has this under control + if ( ! empty( $this->theme_compat->theme ) ) + return; + + // Setup the theme package to use for compatibility + bp_setup_theme_compat( bp_get_theme_package_id() ); } } -// "And now for something completely different" -$GLOBALS['bp'] = new BuddyPress; +/** + * The main function responsible for returning the one true BuddyPress Instance + * to functions everywhere. + * + * Use this function like you would a global variable, except without needing + * to declare the global. + * + * Example: <?php $bp = buddypress(); ?> + * + * @return The one true BuddyPress Instance + */ +function buddypress() { + return buddypress::instance(); +} + +/** + * Hook BuddyPress early onto the 'plugins_loaded' action. + * + * This gives all other plugins the chance to load before BuddyPress, to get + * their actions, filters, and overrides setup without BuddyPress being in the + * way. + */ +if ( defined( 'BUDDYPRESS_LATE_LOAD' ) ) { + add_action( 'plugins_loaded', 'buddypress', (int) BUDDYPRESS_LATE_LOAD ); + +// "And now here's something we hope you'll really like!" +} else { + $GLOBALS['bp'] = &buddypress(); +} endif; diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-actions.php b/wp-content/plugins/buddypress/bp-members/bp-members-actions.php index 44360814a26e6934ec26007292e13b25c9746f78..9f85b3cfd1dfab9bd0c7b2446f947000dc72b4a6 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-actions.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-actions.php @@ -110,5 +110,3 @@ function bp_core_get_random_member() { bp_core_redirect( bp_core_get_user_domain( $user['users'][0]->id ) ); } add_action( 'bp_actions', 'bp_core_get_random_member' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php b/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php index 7d78bbb28c5c1927583bb5ff418e40209f1d4731..7641acd8a04752e865cbf490415318aa343fb2f6 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-adminbar.php @@ -129,7 +129,7 @@ add_action( 'admin_bar_menu', 'bp_members_admin_bar_user_admin_menu', 99 ); /** * Build the "Notifications" dropdown * - * @package Buddypress + * @package BuddyPress * @since BuddyPress (1.5) */ function bp_members_admin_bar_notifications_menu() { @@ -184,5 +184,3 @@ function bp_members_remove_edit_page_menu() { } } add_action( 'bp_init', 'bp_members_remove_edit_page_menu', 99 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-buddybar.php b/wp-content/plugins/buddypress/bp-members/bp-members-buddybar.php index fac547b1f2027e9da5081852dac3554b4b4f72ce..613d08775ada1b89db971fca3b47037f09b25889 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-buddybar.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-buddybar.php @@ -82,11 +82,11 @@ function bp_adminbar_authors_menu() { echo '<li>'; echo '<a href="' . bp_core_get_user_domain( $author->user_id, $author->user_nicename, $author->user_login ) . '">'; - echo bp_core_fetch_avatar( array( - 'item_id' => $author->user_id, - 'email' => $author->user_email, - 'width' => 15, - 'height' => 15, + echo bp_core_fetch_avatar( array( + 'item_id' => $author->user_id, + 'email' => $author->user_email, + 'width' => 15, + 'height' => 15, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $author->display_name ) ) ); echo ' ' . $author->display_name . '</a>'; @@ -128,17 +128,9 @@ function bp_members_adminbar_admin_menu() { <li><a href="<?php bp_members_component_link( 'profile', 'change-avatar' ); ?>"><?php printf( __( "Edit %s's Avatar", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ) ?></a></li> - <?php if ( !bp_is_user_spammer( bp_displayed_user_id() ) ) : ?> + <li><a href="<?php bp_members_component_link( 'settings', 'capabilities' ); ?>"><?php _e( 'User Capabilities', 'buddypress' ); ?></a></li> - <li><a href="<?php echo wp_nonce_url( bp_displayed_user_domain() . 'admin/mark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php printf( __( "Mark as Spammer", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); ?></a></li> - - <?php else : ?> - - <li><a href="<?php echo wp_nonce_url( bp_displayed_user_domain() . 'admin/unmark-spammer/', 'mark-unmark-spammer' ) ?>" class="confirm"><?php _e( "Not a Spammer", 'buddypress' ) ?></a></li> - - <?php endif; ?> - - <li><a href="<?php echo wp_nonce_url( bp_displayed_user_domain() . 'admin/delete-user/', 'delete-user' ) ?>" class="confirm"><?php printf( __( "Delete %s's Account", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); ?></a></li> + <li><a href="<?php bp_members_component_link( 'settings', 'delete-account' ); ?>"><?php printf( __( "Delete %s's Account", 'buddypress' ), esc_attr( bp_get_displayed_user_fullname() ) ); ?></a></li> <?php do_action( 'bp_members_adminbar_admin_menu' ) ?> @@ -148,5 +140,3 @@ function bp_members_adminbar_admin_menu() { <?php } add_action( 'bp_adminbar_menus', 'bp_members_adminbar_admin_menu', 20 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-filters.php b/wp-content/plugins/buddypress/bp-members/bp-members-filters.php index 7d4e5847bf5373d08ed5ed8b0726831739153098..58891648839ca78ff7dd2b21acdcb33e081278ad 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-filters.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-filters.php @@ -57,26 +57,22 @@ add_action( 'bp_loaded', 'bp_members_signup_sanitization' ); * * @since BuddyPress 1.6 * - * @global BuddyPress $bp * @param string $url * @param int $user_id * @param string $scheme * @return string */ function bp_members_edit_profile_url( $url, $user_id, $scheme = 'admin' ) { - global $bp; - - // Default to $url - $profile_link = $url; // If xprofile is active, use profile domain link - if ( bp_is_active( 'xprofile' ) ) { - $user_domain = bp_core_get_user_domain( $user_id ); - $profile_link = trailingslashit( $user_domain . $bp->profile->slug . '/edit' ); + if ( ! is_admin() && bp_is_active( 'xprofile' ) ) { + $profile_link = trailingslashit( bp_core_get_user_domain( $user_id ) . buddypress()->profile->slug . '/edit' ); + + // Default to $url + } else { + $profile_link = $url; } - + return apply_filters( 'bp_members_edit_profile_url', $profile_link, $url, $user_id, $scheme ); } add_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-functions.php b/wp-content/plugins/buddypress/bp-members/bp-members-functions.php index 65d3a65eabbb4aed25bfdbfe8fd823e064548d16..2f2385be4f80eb18cc06c71c5208116540d5df39 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-functions.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-functions.php @@ -71,28 +71,48 @@ add_action( 'bp_setup_globals', 'bp_core_define_slugs', 11 ); /** * Return an array of users IDs based on the parameters passed. * + * Since BuddyPress 1.7, bp_core_get_users() uses BP_User_Query. If you + * need backward compatibility with BP_Core_User::get_users(), filter the + * bp_use_legacy_user_query value, returning true. + * * @package BuddyPress Core */ function bp_core_get_users( $args = '' ) { - $defaults = array( - 'type' => 'active', // active, newest, alphabetical, random or popular - 'user_id' => false, // Pass a user_id to limit to only friend connections for this user - 'exclude' => false, // Users to exclude from results - 'search_terms' => false, // Limit to users that match these search terms - 'meta_key' => false, // Limit to users who have this piece of usermeta - 'meta_value' => false, // With meta_key, limit to users where usermeta matches this value - - '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 - 'populate_extras' => true, // Fetch the last active, where the user is a friend, total friend count, latest update - ); + // Parse the user query arguments + $params = wp_parse_args( $args, array( + 'type' => 'active', // active, newest, alphabetical, random or popular + 'user_id' => false, // Pass a user_id to limit to only friend connections for this user + 'exclude' => false, // Users to exclude from results + 'search_terms' => false, // Limit to users that match these search terms + 'meta_key' => false, // Limit to users who have this piece of usermeta + 'meta_value' => false, // With meta_key, limit to users where usermeta matches this value + '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 + 'populate_extras' => true, // Fetch the last active, where the user is a friend, total friend count, latest update + 'count_total' => 'count_query' // What kind of total user count to do, if any. 'count_query', 'sql_calc_found_rows', or false + ) ); + + // For legacy users. Use of BP_Core_User::get_users() is deprecated. + if ( apply_filters( 'bp_use_legacy_user_query', false, __FUNCTION__, $params ) ) { + extract( $params, EXTR_SKIP ); + $retval = BP_Core_User::get_users( $type, $per_page, $page, $user_id, $include, $search_terms, $populate_extras, $exclude, $meta_key, $meta_value ); + + // Default behavior as of BuddyPress 1.7 + } else { - $params = wp_parse_args( $args, $defaults ); - extract( $params, EXTR_SKIP ); + // Get users like we were asked to do... + $users = new BP_User_Query( $params ); - return apply_filters( 'bp_core_get_users', BP_Core_User::get_users( $type, $per_page, $page, $user_id, $include, $search_terms, $populate_extras, $exclude, $meta_key, $meta_value ), $params ); + // ...but reformat the results to match bp_core_get_users() behavior. + $retval = array( + 'users' => array_values( $users->results ), + 'total' => $users->total_users + ); + } + + return apply_filters( 'bp_core_get_users', $retval, $params ); } /** @@ -171,7 +191,7 @@ function bp_core_get_userid( $username ) { if ( empty( $username ) ) return false; - return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_login = %s", $username ) ) ); + return apply_filters( 'bp_core_get_userid', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->users} WHERE user_login = %s", $username ) ), $username ); } /** @@ -189,7 +209,7 @@ function bp_core_get_userid_from_nicename( $user_nicename ) { if ( empty( $user_nicename ) ) return false; - return apply_filters( 'bp_core_get_userid_from_nicename', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_nicename = %s", $user_nicename ) ) ); + return apply_filters( 'bp_core_get_userid_from_nicename', $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM {$wpdb->users} WHERE user_nicename = %s", $user_nicename ) ) ); } /** @@ -478,7 +498,7 @@ function bp_core_get_total_member_count() { if ( !$count = wp_cache_get( 'bp_total_member_count', 'bp' ) ) { $status_sql = bp_core_get_status_sql(); - $count = $wpdb->get_var( "SELECT COUNT(ID) FROM $wpdb->users WHERE {$status_sql}" ); + $count = $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->users} WHERE {$status_sql}" ); wp_cache_set( 'bp_total_member_count', $count, 'bp' ); } @@ -496,15 +516,15 @@ function bp_core_get_active_member_count() { if ( !$count = get_transient( 'bp_active_member_count' ) ) { // Avoid a costly join by splitting the lookup if ( is_multisite() ) { - $sql = "SELECT ID FROM $wpdb->users WHERE (user_status != 0 OR deleted != 0 OR user_status != 0)"; + $sql = "SELECT ID FROM {$wpdb->users} WHERE (user_status != 0 OR deleted != 0 OR user_status != 0)"; } else { - $sql = "SELECT ID FROM $wpdb->users WHERE user_status != 0"; + $sql = "SELECT ID FROM {$wpdb->users} WHERE user_status != 0"; } - $exclude_users = $wpdb->get_col( $sql ); + $exclude_users = $wpdb->get_col( $sql ); $exclude_users_sql = !empty( $exclude_users ) ? "AND user_id NOT IN (" . implode( ',', wp_parse_id_list( $exclude_users ) ) . ")" : ''; + $count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(user_id) FROM {$wpdb->usermeta} WHERE meta_key = %s {$exclude_users_sql}", bp_get_user_meta_key( 'last_activity' ) ) ); - $count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(user_id) FROM {$wpdb->usermeta} WHERE meta_key = %s {$exclude_users_sql}", bp_get_user_meta_key( 'last_activity' ) ) ); set_transient( 'bp_active_member_count', $count ); } @@ -782,29 +802,44 @@ function bp_core_get_all_posts_for_user( $user_id = 0 ) { */ function bp_core_delete_account( $user_id = 0 ) { + // Use logged in user ID if none is passed if ( empty( $user_id ) ) $user_id = bp_loggedin_user_id(); - // Make sure account deletion is not disabled - if ( !bp_current_user_can( 'delete_users' ) && bp_disable_account_deletion() ) + // Bail if account deletion is disabled + if ( bp_disable_account_deletion() ) return false; // Site admins cannot be deleted if ( is_super_admin( $user_id ) ) return false; + // Extra checks if user is not deleting themselves + if ( bp_loggedin_user_id() !== absint( $user_id ) ) { + + // Bail if current user cannot delete any users + if ( ! bp_current_user_can( 'delete_users' ) ) { + return false; + } + + // Bail if current user cannot delete this user + if ( ! current_user_can_for_blog( bp_get_root_blog_id(), 'delete_user', $user_id ) ) { + return false; + } + } + do_action( 'bp_core_pre_delete_account', $user_id ); // Specifically handle multi-site environment if ( is_multisite() ) { - require( ABSPATH . '/wp-admin/includes/ms.php' ); - require( ABSPATH . '/wp-admin/includes/user.php' ); + require_once( ABSPATH . '/wp-admin/includes/ms.php' ); + require_once( ABSPATH . '/wp-admin/includes/user.php' ); $retval = wpmu_delete_user( $user_id ); // Single site user deletion } else { - require( ABSPATH . '/wp-admin/includes/user.php' ); + require_once( ABSPATH . '/wp-admin/includes/user.php' ); $retval = wp_delete_user( $user_id ); } @@ -849,7 +884,7 @@ add_action( 'pre_user_login', 'bp_core_strip_username_spaces' ); * @param obj $user Either the WP_User object or the WP_Error object * @return obj If the user is not a spammer, return the WP_User object. Otherwise a new WP_Error object. * - * @since 1.1.2 + * @since BuddyPress (1.1.2) */ function bp_core_boot_spammer( $user ) { // check to see if the $user has already failed logging in, if so return $user as-is @@ -978,7 +1013,7 @@ add_filter( 'pre_update_site_option_illegal_names', 'bp_core_get_illegal_names', * - If there's an email domain blacklist, is the current domain on it? * - If there's an email domain whitelest, is the current domain on it? * - * @since 1.6.2 + * @since BuddyPress (1.6.2) * * @param string $user_email The email being checked * @return bool|array True if the address passes all checks; otherwise an array @@ -1014,13 +1049,39 @@ function bp_core_validate_email_address( $user_email ) { $retval = ! empty( $errors ) ? $errors : true; - return apply_filters( 'bp_core_validate_email_address', $retval, $user_email ); + return $retval; } /** - * Validate a user name and email address when creating a new user. + * Add the appropriate errors to a WP_Error object, given results of a validation test + * + * Functions like bp_core_validate_email_address() return a structured array + * of error codes. bp_core_add_validation_error_messages() takes this array and + * parses, adding the appropriate error messages to the WP_Error object. + * + * @since BuddyPress (1.7) + * @see bp_core_validate_email_address() * - * @todo Refactor to use bp_core_validate_email_address() + * @param obj $errors WP_Error object + * @param array $validation_results The return value of a validation function + * like bp_core_validate_email_address() + */ +function bp_core_add_validation_error_messages( WP_Error $errors, $validation_results ) { + if ( ! empty( $validation_results['invalid'] ) ) + $errors->add( 'user_email', __( 'Please check your email address.', 'buddypress' ) ); + + if ( ! empty( $validation_results['domain_banned'] ) ) + $errors->add( 'user_email', __( 'Sorry, that email address is not allowed!', 'buddypress' ) ); + + if ( ! empty( $validation_results['domain_not_allowed'] ) ) + $errors->add( 'user_email', __( 'Sorry, that email address is not allowed!', 'buddypress' ) ); + + if ( ! empty( $validation_results['in_use'] ) ) + $errors->add( 'user_email', __( 'Sorry, that email address is already used!', 'buddypress' ) ); +} + +/** + * Validate a user name and email address when creating a new user. * * @param string $user_name Username to validate * @param string $user_email Email address to validate @@ -1029,7 +1090,6 @@ function bp_core_validate_email_address( $user_email ) { function bp_core_validate_user_signup( $user_name, $user_email ) { $errors = new WP_Error(); - $user_email = sanitize_email( $user_email ); // Apply any user_login filters added by BP or other plugins before validating $user_name = apply_filters( 'pre_user_login', $user_name ); @@ -1058,29 +1118,16 @@ function bp_core_validate_user_signup( $user_name, $user_email ) { if ( $match[0] == $user_name ) $errors->add( 'user_name', __( 'Sorry, usernames must have letters too!', 'buddypress' ) ); - if ( !is_email( $user_email ) ) - $errors->add( 'user_email', __( 'Please check your email address.', 'buddypress' ) ); - - if ( function_exists( 'is_email_address_unsafe' ) && is_email_address_unsafe( $user_email ) ) - $errors->add( 'user_email', __( 'Sorry, that email address is not allowed!', 'buddypress' ) ); - - $limited_email_domains = get_site_option( 'limited_email_domains', 'buddypress' ); - - if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) { - $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); - - if ( in_array( $emaildomain, (array) $limited_email_domains ) == false ) - $errors->add( 'user_email', __( 'Sorry, that email address is not allowed!', 'buddypress' ) ); - } - // Check if the username has been used already. if ( username_exists( $user_name ) ) $errors->add( 'user_name', __( 'Sorry, that username already exists!', 'buddypress' ) ); - // Check if the email address has been used already. - if ( email_exists( $user_email ) ) - $errors->add( 'user_email', __( 'Sorry, that email address is already used!', 'buddypress' ) ); + // Validate the email address and process the validation results into + // error messages + $validate_email = bp_core_validate_email_address( $user_email ); + bp_core_add_validation_error_messages( $errors, $validate_email ); + // Assemble the return array $result = array( 'user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors ); // Apply WPMU legacy filter @@ -1307,10 +1354,8 @@ function bp_core_signup_send_validation_email( $user_id, $user_email, $key ) { $activate_url = bp_get_activation_page() ."?key=$key"; $activate_url = esc_url( $activate_url ); - $from_name = ( '' == bp_get_option( 'blogname' ) ) ? __( 'BuddyPress', 'buddypress' ) : esc_html( bp_get_option( 'blogname' ) ); - $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%1\$s\n\n", 'buddypress' ), $activate_url ); - $subject = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' ); + $subject = bp_get_email_subject( array( 'text' => __( 'Activate Your Account', 'buddypress' ) ) ); // Send the message $to = apply_filters( 'bp_core_signup_send_validation_email_to', $user_email, $user_id ); @@ -1332,7 +1377,7 @@ function bp_core_signup_send_validation_email( $user_id, $user_email, $key ) { * @param obj $user Either the WP_User object or the WP_Error object * @return obj If the user is not a spammer, return the WP_User object. Otherwise a new WP_Error object. * - * @since 1.2.2 + * @since BuddyPress (1.2.2) */ function bp_core_signup_disable_inactive( $user ) { // check to see if the $user has already failed logging in, if so return $user as-is @@ -1354,19 +1399,17 @@ add_filter( 'authenticate', 'bp_core_signup_disable_inactive', 30 ); * Kill the wp-signup.php if custom registration signup templates are present */ function bp_core_wpsignup_redirect() { - $action = !empty( $_GET['action'] ) ? $_GET['action'] : ''; - if ( is_admin() || is_network_admin() ) + // Bail in admin or if custom signup page is broken + if ( is_admin() || ! bp_has_custom_signup_page() ) return; + $action = !empty( $_GET['action'] ) ? $_GET['action'] : ''; + // Not at the WP core signup page and action is not register if ( ! empty( $_SERVER['SCRIPT_NAME'] ) && false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) && ( 'register' != $action ) ) return; - // Redirect to sign-up page - if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) ) - bp_core_redirect( bp_get_signup_page() ); + bp_core_redirect( bp_get_signup_page() ); } add_action( 'bp_init', 'bp_core_wpsignup_redirect' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-loader.php b/wp-content/plugins/buddypress/bp-members/bp-members-loader.php index 339a9696d7c373a874d63055126c76ed75b8e13f..a8132b2c8de3b3057f4c36736fffeb49e753f822 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-loader.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-loader.php @@ -98,6 +98,7 @@ class BP_Members_Component extends BP_Component { /** Profiles Fallback *************************************************/ if ( !bp_is_active( 'xprofile' ) ) { + $bp->profile = new stdClass; $bp->profile->slug = 'profile'; $bp->profile->id = 'profile'; } @@ -112,25 +113,25 @@ class BP_Members_Component extends BP_Component { } else { $bp->default_component = BP_DEFAULT_COMPONENT; } - + if ( bp_displayed_user_id() ) { $bp->canonical_stack['base_url'] = bp_displayed_user_domain(); - + if ( bp_current_component() ) { $bp->canonical_stack['component'] = bp_current_component(); } - + if ( bp_current_action() ) { $bp->canonical_stack['action'] = bp_current_action(); } - + if ( !empty( $bp->action_variables ) ) { $bp->canonical_stack['action_variables'] = bp_action_variables(); } if ( !bp_current_component() ) { $bp->current_component = $bp->default_component; - } else if ( bp_is_current_component( $bp->default_component ) && !bp_current_action() ) { + } else if ( bp_is_current_component( $bp->default_component ) && !bp_current_action() ) { // The canonical URL will not contain the default component unset( $bp->canonical_stack['component'] ); } @@ -168,7 +169,7 @@ class BP_Members_Component extends BP_Component { // Add the subnav items to the profile $sub_nav[] = array( - 'name' => __( 'Public', 'buddypress' ), + 'name' => __( 'View', 'buddypress' ), 'slug' => 'public', 'parent_url' => $profile_link, 'parent_slug' => $bp->profile->slug, @@ -208,5 +209,3 @@ function bp_setup_members() { $bp->members = new BP_Members_Component(); } add_action( 'bp_setup_components', 'bp_setup_members', 1 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-notifications.php b/wp-content/plugins/buddypress/bp-members/bp-members-notifications.php index a7bad54977c6d1aa3a64f3f1ff875483c7a0d0e5..0819254b1b1552efd6a57440740c86c36e24138c 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-notifications.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-notifications.php @@ -62,10 +62,10 @@ function bp_core_delete_notification( $id ) { /** * Get a specific notification by its ID - * + * * @since BuddyPress (1.0) * @param int $id - * @return BP_Core_Notification + * @return BP_Core_Notification */ function bp_core_get_notification( $id ) { return new BP_Core_Notification( $id ); @@ -73,7 +73,7 @@ function bp_core_get_notification( $id ) { /** * Get notifications for a specific user - * + * * @since BuddyPress (1.0) * @global BuddyPress $bp * @param int $user_id @@ -173,7 +173,7 @@ function bp_core_get_notifications_for_user( $user_id, $format = 'simple' ) { /** * Delete notifications for a user by type - * + * * Used when clearing out notifications for a specific component when the user * has visited that component. * @@ -189,7 +189,7 @@ function bp_core_delete_notifications_by_type( $user_id, $component_name, $compo /** * Delete notifications for an item ID - * + * * Used when clearing out notifications for a specific component when the user * has visited that component. * @@ -249,5 +249,3 @@ function bp_core_check_notification_access( $user_id, $notification_id ) { return true; } - -?> diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-screens.php b/wp-content/plugins/buddypress/bp-members/bp-members-screens.php index dfb5cc139aeab703430a21857bfcee5ec9d62c26..a47ba2647fa99fb07d4db4168b122abf6ca2598e 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-screens.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-screens.php @@ -160,32 +160,35 @@ function bp_core_screen_signup() { if ( 'none' != $active_signup ) { - // Let's compact any profile field info into usermeta - $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] ); - - // Loop through the posted fields formatting any datebox values then add to usermeta - @todo This logic should be shared with the same in xprofile_screen_edit_profile() - foreach ( (array) $profile_field_ids as $field_id ) { - if ( ! isset( $_POST['field_' . $field_id] ) ) { + // Make sure the extended profiles module is enabled + if ( bp_is_active( 'xprofile' ) ) { + // Let's compact any profile field info into usermeta + $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] ); + + // Loop through the posted fields formatting any datebox values then add to usermeta - @todo This logic should be shared with the same in xprofile_screen_edit_profile() + foreach ( (array) $profile_field_ids as $field_id ) { + if ( ! isset( $_POST['field_' . $field_id] ) ) { + + if ( ! empty( $_POST['field_' . $field_id . '_day'] ) && ! empty( $_POST['field_' . $field_id . '_month'] ) && ! empty( $_POST['field_' . $field_id . '_year'] ) ) { + // Concatenate the values + $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year']; + + // Turn the concatenated value into a timestamp + $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) ); + } + } - if ( ! empty( $_POST['field_' . $field_id . '_day'] ) && ! empty( $_POST['field_' . $field_id . '_month'] ) && ! empty( $_POST['field_' . $field_id . '_year'] ) ) { - // Concatenate the values - $date_value = $_POST['field_' . $field_id . '_day'] . ' ' . $_POST['field_' . $field_id . '_month'] . ' ' . $_POST['field_' . $field_id . '_year']; + if ( !empty( $_POST['field_' . $field_id] ) ) + $usermeta['field_' . $field_id] = $_POST['field_' . $field_id]; - // Turn the concatenated value into a timestamp - $_POST['field_' . $field_id] = date( 'Y-m-d H:i:s', strtotime( $date_value ) ); - } + if ( !empty( $_POST['field_' . $field_id . '_visibility'] ) ) + $usermeta['field_' . $field_id . '_visibility'] = $_POST['field_' . $field_id . '_visibility']; } - if ( !empty( $_POST['field_' . $field_id] ) ) - $usermeta['field_' . $field_id] = $_POST['field_' . $field_id]; - - if ( !empty( $_POST['field_' . $field_id . '_visibility'] ) ) - $usermeta['field_' . $field_id . '_visibility'] = $_POST['field_' . $field_id . '_visibility']; + // Store the profile field ID's in usermeta + $usermeta['profile_field_ids'] = $_POST['signup_profile_field_ids']; } - // Store the profile field ID's in usermeta - $usermeta['profile_field_ids'] = $_POST['signup_profile_field_ids']; - // Hash and store the password $usermeta['password'] = wp_hash_password( $_POST['signup_password'] ); @@ -203,7 +206,7 @@ function bp_core_screen_signup() { if ( is_wp_error( $wp_user_id ) ) { $bp->signup->step = 'request-details'; - bp_core_add_message( $wp_user_id->get_error_message(), 'error' ); + bp_core_add_message( $wp_user_id->get_error_message(), 'error' ); } else { $bp->signup->step = 'completed-confirmation'; } @@ -215,7 +218,7 @@ function bp_core_screen_signup() { } do_action( 'bp_core_screen_signup' ); - bp_core_load_template( apply_filters( 'bp_core_template_register', 'registration/register' ) ); + bp_core_load_template( apply_filters( 'bp_core_template_register', array( 'register', 'registration/register' ) ) ); } add_action( 'bp_screens', 'bp_core_screen_signup' ); @@ -253,11 +256,216 @@ function bp_core_screen_activation() { $bp->activation_complete = true; } - if ( '' != locate_template( array( 'registration/activate' ), false ) ) - bp_core_load_template( apply_filters( 'bp_core_template_activate', 'activate' ) ); - else - bp_core_load_template( apply_filters( 'bp_core_template_activate', 'registration/activate' ) ); + bp_core_load_template( apply_filters( 'bp_core_template_activate', array( 'activate', 'registration/activate' ) ) ); } add_action( 'bp_screens', 'bp_core_screen_activation' ); -?> +/** Theme Compatability *******************************************************/ + +/** + * The main theme compat class for BuddyPress Members. + * + * This class sets up the necessary theme compatability actions to safely output + * group template parts to the_title and the_content areas of a theme. + * + * @since BuddyPress (1.7) + */ +class BP_Members_Theme_Compat { + + /** + * Setup the members component theme compatibility + * + * @since BuddyPress (1.7) + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_members' ) ); + } + + /** + * Are we looking at something that needs members theme compatability? + * + * @since BuddyPress (1.7) + */ + public function is_members() { + + // Bail if not looking at the members component or a user's page + if ( ! bp_is_members_component() && ! bp_is_user() ) + return; + + // Members Directory + if ( ! bp_current_action() && ! bp_current_item() ) { + bp_update_is_directory( true, 'members' ); + + do_action( 'bp_members_screen_index' ); + + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'directory_content' ) ); + + // User page + } elseif ( bp_is_user() ) { + // If we're on a single activity permalink page, we shouldn't use the members + // template, so stop here! + if ( bp_is_active( 'activity' ) && bp_is_single_activity() ) + return; + + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'single_dummy_content' ) ); + + } + } + + /** Directory *************************************************************/ + + /** + * Update the global $post with directory data + * + * @since BuddyPress (1.7) + */ + public function directory_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => __( 'Members', 'buddypress' ), + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_members', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the members index template part + * + * @since BuddyPress (1.7) + */ + public function directory_content() { + bp_buffer_template_part( 'members/index' ); + } + + /** Single ****************************************************************/ + + /** + * Update the global $post with the displayed user's data + * + * @since BuddyPress (1.7) + */ + public function single_dummy_post() { + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => '<a href="' . bp_get_displayed_user_link() . '">' . bp_get_displayed_user_fullname() . '</a>', + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => 'bp_members', + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with the members' single home template part + * + * @since BuddyPress (1.7) + */ + public function single_dummy_content() { + bp_buffer_template_part( 'members/single/home' ); + } +} +new BP_Members_Theme_Compat(); + +/** + * The main theme compat class for BuddyPress Registration. + * + * This class sets up the necessary theme compatability actions to safely output + * registration template parts to the_title and the_content areas of a theme. + * + * @since BuddyPress (1.7) + */ +class BP_Registration_Theme_Compat { + + /** + * Setup the groups component theme compatibility + * + * @since BuddyPress (1.7) + */ + public function __construct() { + add_action( 'bp_setup_theme_compat', array( $this, 'is_registration' ) ); + } + + /** + * Are we looking at either the registration or activation pages? + * + * @since BuddyPress (1.7) + */ + public function is_registration() { + + // Bail if not looking at the registration or activation page + if ( ! bp_is_register_page() && ! bp_is_activation_page() ) { + return; + } + + // Not a directory + bp_update_is_directory( false, 'register' ); + + // Setup actions + add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'dummy_post' ) ); + add_filter( 'bp_replace_the_content', array( $this, 'dummy_content' ) ); + } + + /** Template ***********************************************************/ + + /** + * Update the global $post with dummy data + * + * @since BuddyPress (1.7) + */ + public function dummy_post() { + // Registration page + if ( bp_is_register_page() ) { + $title = __( 'Create an Account', 'buddypress' ); + + if ( 'completed-confirmation' == bp_get_current_signup_step() ) { + $title = __( 'Sign Up Complete!', 'buddypress' ); + } + + // Activation page + } else { + $title = __( 'Activate your Account', 'buddypress' ); + + if ( bp_account_was_activated() ) { + $title = __( 'Account Activated', 'buddypress' ); + } + } + + $post_type = bp_is_register_page() ? 'bp_register' : 'bp_activate'; + + bp_theme_compat_reset_post( array( + 'ID' => 0, + 'post_title' => $title, + 'post_author' => 0, + 'post_date' => 0, + 'post_content' => '', + 'post_type' => $post_type, + 'post_status' => 'publish', + 'is_archive' => true, + 'comment_status' => 'closed' + ) ); + } + + /** + * Filter the_content with either the register or activate templates. + * + * @since BuddyPress (1.7) + */ + public function dummy_content() { + if ( bp_is_register_page() ) { + bp_buffer_template_part( 'members/register' ); + } else { + bp_buffer_template_part( 'members/activate' ); + } + } +} +new BP_Registration_Theme_Compat(); diff --git a/wp-content/plugins/buddypress/bp-members/bp-members-template.php b/wp-content/plugins/buddypress/bp-members/bp-members-template.php index c7927cb959c76e380f3421e49d61158fd58b06c0..cfc3a72224ee7202547e851e1d9f3a7d728b5699 100644 --- a/wp-content/plugins/buddypress/bp-members/bp-members-template.php +++ b/wp-content/plugins/buddypress/bp-members/bp-members-template.php @@ -107,7 +107,7 @@ function bp_signup_slug() { * @since BuddyPress (1.5) */ function bp_get_signup_slug() { - global $bp; + $bp = buddypress(); if ( !empty( $bp->pages->register->slug ) ) $slug = $bp->pages->register->slug; @@ -387,6 +387,47 @@ function bp_member_user_id() { return apply_filters( 'bp_get_member_user_id', $members_template->member->id ); } +/** + * Output the row class of a member + * + * @since BuddyPress (1.7) + */ +function bp_member_class() { + echo bp_get_member_class(); +} + /** + * Return the row class of a member + * + * @global BP_Core_Members_Template $members_template + * @return string Row class of the member + * @since BuddyPress (1.7) + */ + function bp_get_member_class() { + global $members_template; + + $classes = array(); + $current_time = bp_core_current_time(); + $pos_in_loop = (int) $members_template->current_member; + + // If we've only one group in the loop, don't both with odd and even. + if ( $members_template->member_count > 1 ) + $classes[] = ( $pos_in_loop % 2 ) ? 'even' : 'odd'; + else + $classes[] = 'bp-single-member'; + + // Has the user been active recently? + if ( ! empty( $members_template->member->last_activity ) ) { + if ( strtotime( $current_time ) <= strtotime( '+5 minutes', strtotime( $members_template->member->last_activity ) ) ) + $classes[] = 'is-online'; + } + + $classes = apply_filters( 'bp_get_member_class', $classes ); + $classes = array_merge( $classes, array() ); + $retval = 'class="' . join( ' ', $classes ) . '"'; + + return $retval; + } + /** * bp_member_user_nicename() * @@ -632,7 +673,7 @@ function bp_member_registered() { function bp_get_member_registered() { global $members_template; - $registered = esc_attr( bp_core_get_last_activity( $members_template->member->user_registered, __( 'registered %s', 'buddypress' ) ) ); + $registered = esc_attr( bp_core_get_last_activity( $members_template->member->user_registered, _x( 'registered %s', 'Records the timestamp that the user registered into the activy stream', 'buddypress' ) ) ); return apply_filters( 'bp_member_last_active', $registered ); } @@ -926,11 +967,22 @@ function bp_loggedin_user_username() { /** Signup Form ***************************************************************/ +/** + * Do we have a working custom sign up page? + * + * @since BuddyPress (1.5) + * + * @uses bp_get_signup_slug() To make sure there is a slug assigned to the page + * @uses bp_locate_template() To make sure a template exists to provide output + * @return boolean True if page and template exist, false if not + */ function bp_has_custom_signup_page() { - if ( locate_template( array( 'register.php' ), false ) || locate_template( array( '/registration/register.php' ), false ) ) - return true; + static $has_page = false; - return false; + if ( empty( $has_page ) ) + $has_page = bp_get_signup_slug() && bp_locate_template( array( 'registration/register.php', 'members/register.php', 'register.php' ), false ); + + return (bool) $has_page; } /** @@ -954,17 +1006,33 @@ function bp_signup_page() { return apply_filters( 'bp_get_signup_page', $page ); } +/** + * Do we have a working custom activation page? + * + * @since BuddyPress (1.5) + * + * @uses bp_get_activate_slug() To make sure there is a slug assigned to the page + * @uses bp_locate_template() To make sure a template exists to provide output + * @return boolean True if page and template exist, false if not + */ +function bp_has_custom_activation_page() { + static $has_page = false; + + if ( empty( $has_page ) ) + $has_page = bp_get_activate_slug() && bp_locate_template( array( 'registration/activate.php', 'members/activate.php', 'activate.php' ), false ); + + return (bool) $has_page; +} + function bp_activation_page() { echo bp_get_activation_page(); } function bp_get_activation_page() { - global $bp; - - // Check the global directly to make sure the WP page exists in $bp->pages - if ( !empty( $bp->pages->activate->slug ) ) - $page = trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug ); - else + if ( bp_has_custom_activation_page() ) { + $page = trailingslashit( bp_get_root_domain() . '/' . bp_get_activate_slug() ); + } else { $page = trailingslashit( bp_get_root_domain() ) . 'wp-activate.php'; + } return apply_filters( 'bp_get_activation_page', $page ); } @@ -1184,5 +1252,3 @@ function bp_members_component_link( $component, $action = '', $query_args = '', if ( !empty( $url ) ) return $url; } - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php index 6d00051cd85bb15175b568d4c7a8fa71fc9d20cd..85cc0a41b79b199575dbe364a1aad455241c3dc0 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-actions.php @@ -14,8 +14,7 @@ // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; -function messages_action_view_message() { - global $thread_id, $bp; +function messages_action_conversation() { if ( !bp_is_messages_component() || !bp_is_current_action( 'view' ) ) return false; @@ -32,10 +31,11 @@ function messages_action_view_message() { check_admin_referer( 'messages_send_message', 'send_message_nonce' ); // Send the reply - if ( messages_new_message( array( 'thread_id' => $thread_id, 'subject' => ! empty( $_POST['subject'] ) ? $_POST['subject'] : false, 'content' => $_POST['content'] ) ) ) + if ( messages_new_message( array( 'thread_id' => $thread_id, 'subject' => ! empty( $_POST['subject'] ) ? $_POST['subject'] : false, 'content' => $_POST['content'] ) ) ) { bp_core_add_message( __( 'Your reply was sent successfully', 'buddypress' ) ); - else + } else { bp_core_add_message( __( 'There was a problem sending your reply, please try again', 'buddypress' ), 'error' ); + } bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . $thread_id . '/' ); } @@ -43,30 +43,11 @@ function messages_action_view_message() { // Mark message read messages_mark_thread_read( $thread_id ); - // Decrease the unread count in the nav before it's rendered - $name = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() ); - - $bp->bp_nav[$bp->messages->slug]['name'] = $name; - - do_action( 'messages_action_view_message' ); - - bp_core_new_subnav_item( array( - 'name' => sprintf( __( 'From: %s', 'buddypress' ), BP_Messages_Thread::get_last_sender( $thread_id ) ), - 'slug' => 'view', - 'parent_url' => trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ), - 'parent_slug' => bp_get_messages_slug(), - 'screen_function' => true, - 'position' => 40, - 'user_has_access' => bp_is_my_profile(), - 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . (int) $thread_id ) - ) ); - - bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/home' ) ); + do_action( 'messages_action_conversation' ); } -add_action( 'bp_actions', 'messages_action_view_message' ); +add_action( 'bp_actions', 'messages_action_conversation' ); function messages_action_delete_message() { - global $thread_id; if ( !bp_is_messages_component() || bp_is_current_action( 'notices' ) || !bp_is_action_variable( 'delete', 0 ) ) return false; @@ -91,7 +72,6 @@ function messages_action_delete_message() { add_action( 'bp_actions', 'messages_action_delete_message' ); function messages_action_bulk_delete() { - global $thread_ids; if ( !bp_is_messages_component() || !bp_is_action_variable( 'bulk-delete', 0 ) ) return false; @@ -101,17 +81,17 @@ function messages_action_bulk_delete() { if ( !$thread_ids || !messages_check_thread_access( $thread_ids ) ) { bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) ); } else { - if ( !check_admin_referer( 'messages_delete_thread' ) ) + if ( !check_admin_referer( 'messages_delete_thread' ) ) { return false; + } - if ( !messages_delete_thread( $thread_ids ) ) + if ( !messages_delete_thread( $thread_ids ) ) { bp_core_add_message( __('There was an error deleting messages.', 'buddypress'), 'error' ); - else + } else { bp_core_add_message( __('Messages deleted.', 'buddypress') ); + } bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) ); } } add_action( 'bp_actions', 'messages_action_bulk_delete' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php index 485792a028dffa670666e59877c41b86c1ffbbba..c50b0282b2ce096c4f0150da7ea3d97dae793827 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-cache.php @@ -22,5 +22,3 @@ add_action( 'messages_message_sent', 'bp_core_clear_cache' ); add_action( 'messages_screen_compose', 'bp_core_clear_cache' ); add_action( 'messages_screen_sentbox', 'bp_core_clear_cache' ); add_action( 'messages_screen_inbox', 'bp_core_clear_cache' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php index 9374ecb574fdac95f054ef91a3962fa406039ac0..dbdd5c05a598bf8748d8edf4d4ab19297c8af64f 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-classes.php @@ -203,7 +203,7 @@ class BP_Messages_Thread { else if ( $type == 'read' ) $type_sql = " AND unread_count = 0 "; - return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0$exclude_sender $type_sql", $user_id ) ); + return (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(thread_id) FROM {$bp->messages->table_name_recipients} WHERE user_id = %d AND is_deleted = 0{$exclude_sender} {$type_sql}", $user_id ) ); } function user_is_sender( $thread_id ) { @@ -365,6 +365,8 @@ class BP_Messages_Message { if ( !$wpdb->query( $wpdb->prepare( "INSERT INTO {$bp->messages->table_name_messages} ( thread_id, sender_id, subject, message, date_sent ) VALUES ( %d, %d, %s, %s, %s )", $this->thread_id, $this->sender_id, $this->subject, $this->message, $this->date_sent ) ) ) return false; + $this->id = $wpdb->insert_id; + $recipient_ids = array(); if ( $new_thread ) { @@ -382,7 +384,6 @@ class BP_Messages_Message { $wpdb->query( $wpdb->prepare( "UPDATE {$bp->messages->table_name_recipients} SET unread_count = unread_count + 1, sender_only = 0, is_deleted = 0 WHERE thread_id = %d AND user_id != %d", $this->thread_id, $this->sender_id ) ); } - $this->id = $wpdb->insert_id; messages_remove_callback_values(); do_action_ref_array( 'messages_message_after_save', array( &$this ) ); @@ -555,8 +556,7 @@ class BP_Messages_Notice { global $wpdb, $bp; $notice_id = $wpdb->get_var( "SELECT id FROM {$bp->messages->table_name_notices} WHERE is_active = 1" ); + return new BP_Messages_Notice( $notice_id ); } } - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php index bbfe6c2a363485ed27266fab9f14e375be11dd83..e423793aa58fed76c08502ea60e20b8ee345078b 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-cssjs.php @@ -18,18 +18,11 @@ function messages_add_autocomplete_js() { if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) { add_action( 'wp_head', 'messages_autocomplete_init_jsblock' ); - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { - wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocomplete.dev.js', array( 'jquery' ), bp_get_version() ); - wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocompletefb.dev.js', array(), bp_get_version() ); - wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.bgiframe.dev.js', array(), bp_get_version() ); - wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.dimensions.dev.js', array(), bp_get_version() ); - - } else { - wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocomplete.js', array( 'jquery' ), bp_get_version() ); - wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.autocompletefb.js', array(), bp_get_version() ); - wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.bgiframe.js', array(), bp_get_version() ); - wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . 'bp-messages/js/autocomplete/jquery.dimensions.js', array(), bp_get_version() ); - } + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + wp_enqueue_script( 'bp-jquery-autocomplete', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.autocomplete{$min}.js", array( 'jquery' ), bp_get_version() ); + wp_enqueue_script( 'bp-jquery-autocomplete-fb', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.autocompletefb{$min}.js", array(), bp_get_version() ); + wp_enqueue_script( 'bp-jquery-bgiframe', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.bgiframe{$min}.js", array(), bp_get_version() ); + wp_enqueue_script( 'bp-jquery-dimensions', BP_PLUGIN_URL . "bp-messages/js/autocomplete/jquery.dimensions{$min}.js", array(), bp_get_version() ); } } add_action( 'bp_actions', 'messages_add_autocomplete_js' ); @@ -37,11 +30,8 @@ add_action( 'bp_actions', 'messages_add_autocomplete_js' ); function messages_add_autocomplete_css() { if ( bp_is_messages_component() && bp_is_current_action( 'compose' ) ) { - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { - wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.dev.css', array(), bp_get_version() ); - } else { - wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . 'bp-messages/css/autocomplete/jquery.autocompletefb.css', array(), bp_get_version() ); - } + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + wp_enqueue_style( 'bp-messages-autocomplete', BP_PLUGIN_URL . "bp-messages/css/autocomplete/jquery.autocompletefb{$min}.css", array(), bp_get_version() ); wp_print_styles(); } @@ -64,5 +54,3 @@ function messages_autocomplete_init_jsblock() { <?php } - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php index fffbc240a28e87fc574f01b05fbfd22b4f1cdfba..9a0ee55517ba10f44626160284bb16108490181c 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-filters.php @@ -66,5 +66,3 @@ add_filter( 'bp_get_messages_subject_value', 'stripslashes_deep' ); add_filter( 'bp_get_messages_content_value', 'stripslashes_deep' ); add_filter( 'bp_get_the_thread_message_content', 'stripslashes_deep' ); add_filter( 'bp_get_the_thread_subject', 'stripslashes_deep' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php index 5ba6284a8c37ed86f860a20a27ce6c6db94d13ff..49b9937e6171de9f1ea4194eecd862b203fb9110 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-functions.php @@ -68,13 +68,26 @@ function messages_new_message( $args = '' ) { // Loop the recipients and convert all usernames to user_ids where needed foreach( (array) $recipients as $recipient ) { $recipient = trim( $recipient ); + if ( empty( $recipient ) ) continue; + $recipient_id = false; + + // input was numeric if ( is_numeric( $recipient ) ) { + // do a check against the user ID column first if ( bp_core_get_core_userdata( (int) $recipient ) ) $recipient_id = (int) $recipient; + // if that fails, check against the user_login / user_nicename column + else { + if ( bp_is_username_compatibility_mode() ) + $recipient_id = bp_core_get_userid( (int) $recipient ); + else + $recipient_id = bp_core_get_userid_from_nicename( (int) $recipient ); + } + } else { if ( bp_is_username_compatibility_mode() ) $recipient_id = bp_core_get_userid( $recipient ); @@ -254,5 +267,3 @@ function messages_format_notifications( $action, $item_id, $secondary_item_id, $ return $return; } - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php index b94b007ed19118a837ba9dc359e539cc4477db12..6879556683a1cb7d9b5aa7a617d868f7056639e3 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-loader.php @@ -114,8 +114,17 @@ class BP_Messages_Component extends BP_Component { 'item_css_id' => $this->id ); + // Determine user to use + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + // Link to user messages - $messages_link = trailingslashit( bp_loggedin_user_domain() . $this->slug ); + $messages_link = trailingslashit( $user_domain . $this->slug ); // Add the subnav items to the profile $sub_nav[] = array( @@ -125,7 +134,7 @@ class BP_Messages_Component extends BP_Component { 'parent_slug' => $this->slug, 'screen_function' => 'messages_screen_inbox', 'position' => 10, - 'user_has_access' => bp_is_my_profile() + 'user_has_access' => bp_core_can_edit_settings() ); $sub_nav[] = array( @@ -135,7 +144,7 @@ class BP_Messages_Component extends BP_Component { 'parent_slug' => $this->slug, 'screen_function' => 'messages_screen_sentbox', 'position' => 20, - 'user_has_access' => bp_is_my_profile() + 'user_has_access' => bp_core_can_edit_settings() ); $sub_nav[] = array( @@ -145,7 +154,7 @@ class BP_Messages_Component extends BP_Component { 'parent_slug' => $this->slug, 'screen_function' => 'messages_screen_compose', 'position' => 30, - 'user_has_access' => bp_is_my_profile() + 'user_has_access' => bp_core_can_edit_settings() ); if ( bp_current_user_can( 'bp_moderate' ) ) { @@ -267,5 +276,3 @@ function bp_setup_messages() { $bp->messages = new BP_Messages_Component(); } add_action( 'bp_setup_components', 'bp_setup_messages', 6 ); - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php index d709c1c3c5e09020735f0ec0e1688a6ef0ffba0d..a55d0d1b7fa805081df29147122cc0cdec1e72fb 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-notifications.php @@ -31,6 +31,11 @@ function messages_notification_new_message( $args = array() ) { // User data and links $ud = get_userdata( $recipient->user_id ); + + // Bail if user cannot be found + if ( empty( $ud ) ) + continue; + $message_link = bp_core_get_user_domain( $recipient->user_id ) . bp_get_messages_slug() .'/'; $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings'; $settings_link = bp_core_get_user_domain( $recipient->user_id ) . $settings_slug . '/notifications/'; @@ -42,8 +47,7 @@ function messages_notification_new_message( $args = array() ) { // Set up and send the message $email_to = $ud->user_email; - $sitename = wp_specialchars_decode( get_blog_option( bp_get_root_blog_id(), 'blogname' ), ENT_QUOTES ); - $email_subject = '[' . $sitename . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), $sender_name ); + $email_subject = bp_get_email_subject( array( 'text' => sprintf( __( 'New message from %s', 'buddypress' ), $sender_name ) ) ); $email_content = sprintf( __( '%1$s sent you a new message: @@ -57,7 +61,10 @@ To view and read your messages please log in and visit: %4$s --------------------- ', 'buddypress' ), $sender_name, $subject, $content, $message_link ); - $email_content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + // Only show the disable notifications line if the settings component is enabled + if ( bp_is_active( 'settings' ) ) { + $email_content .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); + } // Send the message $email_to = apply_filters( 'messages_notification_new_message_to', $email_to ); @@ -70,5 +77,3 @@ To view and read your messages please log in and visit: %4$s do_action( 'bp_messages_sent_notification_email', $recipients, $email_subject, $email_content, $args ); } - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php index 85a10f1d2cc16e1d80524df2871099d68527c98d..897d61bfeff42aac1e80d3e2ec6b58e3ca23212d 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-screens.php @@ -86,6 +86,29 @@ function messages_screen_compose() { bp_core_load_template( apply_filters( 'messages_template_compose', 'members/single/home' ) ); } +function messages_screen_conversation() { + + // Bail if not viewing a single message + if ( !bp_is_messages_component() || !bp_is_current_action( 'view' ) ) + return false; + + $thread_id = (int) bp_action_variable( 0 ); + + if ( empty( $thread_id ) || !messages_is_valid_thread( $thread_id ) || ( !messages_check_thread_access( $thread_id ) && !bp_current_user_can( 'bp_moderate' ) ) ) + bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ) ); + + // Load up BuddyPress one time + $bp = buddypress(); + + // Decrease the unread count in the nav before it's rendered + $bp->bp_nav[$bp->messages->slug]['name'] = sprintf( __( 'Messages <span>%s</span>', 'buddypress' ), bp_get_total_unread_messages_count() ); + + do_action( 'messages_screen_conversation' ); + + bp_core_load_template( apply_filters( 'messages_template_view_message', 'members/single/home' ) ); +} +add_action( 'bp_screens', 'messages_screen_conversation' ); + function messages_screen_notices() { global $notice_id; @@ -136,10 +159,7 @@ function messages_screen_notification_settings() { } if ( !$new_messages = bp_get_user_meta( bp_displayed_user_id(), 'notification_messages_new_message', true ) ) - $new_messages = 'yes'; - - if ( !$new_notices = bp_get_user_meta( bp_displayed_user_id(), 'notification_messages_new_notice', true ) ) - $new_notices = 'yes'; ?> + $new_messages = 'yes'; ?> <table class="notification-settings" id="messages-notification-settings"> <thead> @@ -158,12 +178,6 @@ function messages_screen_notification_settings() { <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php checked( $new_messages, 'yes', true ) ?>/></td> <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php checked( $new_messages, 'no', true ) ?>/></td> </tr> - <tr id="messages-notification-settings-new-site-notice"> - <td></td> - <td><?php _e( 'A new site notice is posted', 'buddypress' ) ?></td> - <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php checked( $new_notices, 'yes', true ) ?>/></td> - <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php checked( $new_notices, 'no', true ) ?>/></td> - </tr> <?php do_action( 'messages_screen_notification_settings' ) ?> </tbody> @@ -172,5 +186,3 @@ function messages_screen_notification_settings() { <?php } add_action( 'bp_notification_settings', 'messages_screen_notification_settings', 2 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php b/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php index 0d0ec8f4a0c096cdfcd66bf12dbe412982a66135..2c0889f0fcbda6011a70b3473247837e31ad8c2f 100644 --- a/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php +++ b/wp-content/plugins/buddypress/bp-messages/bp-messages-template.php @@ -326,12 +326,6 @@ function bp_message_thread_avatar() { return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $messages_template->thread->last_sender_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $messages_template->thread->last_sender_id ) ) ) ) ); } -function bp_message_thread_view() { - global $thread_id; - - messages_view_thread($thread_id); -} - function bp_total_unread_messages_count() { echo bp_get_total_unread_messages_count(); } @@ -635,7 +629,7 @@ function bp_send_private_message_link() { * Explicitly named function to avoid confusion with public messages. * * @uses bp_get_send_message_button() - * @since 1.2.6 + * @since BuddyPress (1.2.6) */ function bp_send_private_message_button() { echo bp_get_send_message_button(); @@ -860,10 +854,11 @@ function bp_the_thread_message_alt_class() { function bp_get_the_thread_message_alt_class() { global $thread_template; - if ( $thread_template->current_message % 2 == 1 ) - $class = ' alt'; - else - $class = ''; + if ( $thread_template->current_message % 2 == 1 ) { + $class = 'even alt'; + } else { + $class = 'odd'; + } return apply_filters( 'bp_get_the_thread_message_alt_class', $class ); } @@ -901,7 +896,12 @@ function bp_the_thread_message_sender_name() { function bp_get_the_thread_message_sender_name() { global $thread_template; - return apply_filters( 'bp_get_the_thread_message_sender_name', bp_core_get_user_displayname( $thread_template->message->sender_id ) ); + $display_name = bp_core_get_user_displayname( $thread_template->message->sender_id ); + + if ( empty( $display_name ) ) + $display_name = __( 'Deleted User', 'buddypress' ); + + return apply_filters( 'bp_get_the_thread_message_sender_name', $display_name ); } function bp_the_thread_delete_link() { @@ -946,5 +946,3 @@ function bp_messages_embed() { add_filter( 'embed_post_id', 'bp_get_message_thread_id' ); } add_action( 'messages_box_loop_start', 'bp_messages_embed' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css index 77388d0dd9051c6987c0699d321aababc5fdc746..8006cc12c0dfc96363f0bb049bf7ab9c53520e04 100644 --- a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css +++ b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.css @@ -1 +1,85 @@ -.ac_results{padding:0;overflow:hidden;z-index:99999;background:#fff;border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.ac_results ul{width:100%;list-style-position:outside;list-style:none;padding:0;margin:0}.ac_results li{margin:0;padding:5px 10px;cursor:pointer;display:block;font-size:1em;line-height:16px;overflow:hidden}.ac_results li img{margin-right:5px}.ac_loading{background:url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat}.ac_odd{background-color:#f0f0f0}.ac_over{background-color:#888;color:#fff}ul.acfb-holder{margin:0;height:auto!important;height:1%;overflow:hidden;padding:0;list-style:none}ul.acfb-holder li{float:left;margin:0 5px 4px 0;list-style-type:none}ul.acfb-holder li.friend-tab{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #ffe7c7;padding:2px 7px 2px;background:#fff9df;font-size:1em}li.friend-tab img.avatar{border-width:2px!important;vertical-align:middle}li.friend-tab span.p{padding-left:5px;font-size:.8em;cursor:pointer}input#send-to-input{width:275px} \ No newline at end of file +.ac_results { + padding: 0px; + overflow: hidden; + z-index: 99999; + background: #fff; + border: 1px solid #ccc; + -moz-border-radius-bottomleft: 3px; + -khtml-border-bottom-left-radius: 3px; + -webkit-border-bottom-left-radius: 3px; + border-bottom-left-radius: 3px; + -moz-border-radius-bottomright: 3px; + -khtml-border-bottom-right-radius: 3px; + -webkit-border-bottom-right-radius: 3px; + border-bottom-right-radius: 3px; +} + .ac_results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; + } + + .ac_results li { + margin: 0px; + padding: 5px 10px; + cursor: pointer; + display: block; + font-size: 1em; + line-height: 16px; + overflow: hidden; + } + .ac_results li img { + margin-right: 5px; + } + +.ac_loading { + background : url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat; +} + +.ac_odd { + background-color: #f0f0f0; +} + +.ac_over { + background-color: #888; + color: #fff; +} + +ul.acfb-holder { + margin : 0; + height : auto !important; + height : 1%; + overflow: hidden; + padding: 0; + list-style: none; +} + ul.acfb-holder li { + float : left; + margin : 0 5px 4px 0; + list-style-type: none; + } + + ul.acfb-holder li.friend-tab { + border-radius : 3px; + -moz-border-radius : 3px; + -webkit-border-radius : 3px; + border : 1px solid #ffe7c7; + padding : 2px 7px 2px; + background : #FFF9DF; + font-size: 1em; + } + li.friend-tab img.avatar { + border-width: 2px !important; + vertical-align: middle; + } + + li.friend-tab span.p { + padding-left: 5px; + font-size: 0.8em; + cursor: pointer; + } + +input#send-to-input { width: 275px; } + diff --git a/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.min.css b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.min.css new file mode 100644 index 0000000000000000000000000000000000000000..77388d0dd9051c6987c0699d321aababc5fdc746 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/css/autocomplete/jquery.autocompletefb.min.css @@ -0,0 +1 @@ +.ac_results{padding:0;overflow:hidden;z-index:99999;background:#fff;border:1px solid #ccc;-moz-border-radius-bottomleft:3px;-khtml-border-bottom-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-moz-border-radius-bottomright:3px;-khtml-border-bottom-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.ac_results ul{width:100%;list-style-position:outside;list-style:none;padding:0;margin:0}.ac_results li{margin:0;padding:5px 10px;cursor:pointer;display:block;font-size:1em;line-height:16px;overflow:hidden}.ac_results li img{margin-right:5px}.ac_loading{background:url('../../../bp-themes/bp-default/_inc/images/ajax-loader.gif') right center no-repeat}.ac_odd{background-color:#f0f0f0}.ac_over{background-color:#888;color:#fff}ul.acfb-holder{margin:0;height:auto!important;height:1%;overflow:hidden;padding:0;list-style:none}ul.acfb-holder li{float:left;margin:0 5px 4px 0;list-style-type:none}ul.acfb-holder li.friend-tab{border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;border:1px solid #ffe7c7;padding:2px 7px 2px;background:#fff9df;font-size:1em}li.friend-tab img.avatar{border-width:2px!important;vertical-align:middle}li.friend-tab span.p{padding-left:5px;font-size:.8em;cursor:pointer}input#send-to-input{width:275px} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js index 42a07995ae8953717263bfb4c2c4999492b4ac06..b3116293773e1e0a970c57eeca41fb8b3b6b659c 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.js @@ -10,4 +10,721 @@ * Revision: $Id: jquery.autocomplete.js 4485 2008-01-20 13:52:47Z joern.zaefferer $ * */ -(function(a){a.fn.extend({autocomplete:function(b,c){var d=typeof b=="string";c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c);c.highlight=c.highlight||function(e){return e};return this.each(function(){new a.Autocompleter(this,c)})},result:function(b){return this.bind("result",b)},search:function(b){return this.trigger("search",[b])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(b){return this.trigger("setOptions",[b])},unautocomplete:function(){return this.trigger("unautocomplete")}});a.Autocompleter=function(l,g){var c={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34};var b=a(l).attr("autocomplete","off").addClass(g.inputClass);var j;var p="";var m=a.Autocompleter.Cache(g);var e=0;var u;var w={mouseDownOnSelect:false};var r=a.Autocompleter.Select(g,l,d,w);b.keydown(function(x){u=x.keyCode;switch(x.keyCode){case c.UP:x.preventDefault();if(r.visible()){r.prev()}else{t(0,true)}break;case c.DOWN:x.preventDefault();if(r.visible()){r.next()}else{t(0,true)}break;case c.PAGEUP:x.preventDefault();if(r.visible()){r.pageUp()}else{t(0,true)}break;case c.PAGEDOWN:x.preventDefault();if(r.visible()){r.pageDown()}else{t(0,true)}break;case g.multiple&&a.trim(g.multipleSeparator)==","&&c.COMMA:case c.TAB:case c.RETURN:if(d()){if(!g.multiple){b.blur()}x.preventDefault();b.focus()}break;case c.ESC:r.hide();break;default:clearTimeout(j);j=setTimeout(t,g.delay);break}}).keypress(function(){}).focus(function(){e++}).blur(function(){e=0;if(!w.mouseDownOnSelect){s()}}).click(function(){if(e++>1&&!r.visible()){t(0,true)}}).bind("search",function(){var x=(arguments.length>1)?arguments[1]:null;function y(C,B){var z;if(B&&B.length){for(var A=0;A<B.length;A++){if(B[A].result.toLowerCase()==C.toLowerCase()){z=B[A];break}}}if(typeof x=="function"){x(z)}else{b.trigger("result",z&&[z.data,z.value])}}a.each(h(b.val()),function(z,A){f(A,y,y)})}).bind("flushCache",function(){m.flush()}).bind("setOptions",function(){a.extend(g,arguments[1]);if("data" in arguments[1]){m.populate()}}).bind("unautocomplete",function(){r.unbind();b.unbind()});function d(){var y=r.selected();if(!y){return false}var x=y.result;p=x;if(g.multiple){var z=h(b.val());if(z.length>1){x=z.slice(0,z.length-1).join(g.multipleSeparator)+g.multipleSeparator+x}x+=g.multipleSeparator}b.val(x);v();b.trigger("result",[y.data,y.value]);return true}function t(z,y){if(u==c.DEL){r.hide();return}var x=b.val();if(!y&&x==p){return}p=x;x=i(x);if(x.length>=g.minChars){b.addClass(g.loadingClass);jQuery("#send-to-input").addClass("loading");if(!g.matchCase){x=x.toLowerCase()}f(x,k,v)}else{n();r.hide()}}function h(y){if(!y){return[""]}var z=y.split(a.trim(g.multipleSeparator));var x=[];a.each(z,function(A,B){if(a.trim(B)){x[A]=a.trim(B)}});return x}function i(x){if(!g.multiple){return x}var y=h(x);return y[y.length-1]}function q(x,y){if(g.autoFill&&(i(b.val()).toLowerCase()==x.toLowerCase())&&u!=8){b.val(b.val()+y.substring(i(p).length));a.Autocompleter.Selection(l,p.length,p.length+y.length)}}function s(){clearTimeout(j);j=setTimeout(v,200)}function v(){r.hide();clearTimeout(j);n();if(g.mustMatch){b.search(function(x){if(!x){b.val("")}})}}function k(z,y){if(y&&y.length&&e){n();r.display(y,z);var x=y[0].value.split(";");y.value=x[0];q(z,y.value);r.show()}else{v()}}function f(y,A,x){if(!g.matchCase){y=y.toLowerCase()}var z=m.load(y);if(z&&z.length){A(y,z)}else{if((typeof g.url=="string")&&(g.url.length>0)){var B={};a.each(g.extraParams,function(C,D){B[C]=typeof D=="function"?D():D});a.ajax({mode:"abort",port:"autocomplete"+l.name,dataType:g.dataType,url:g.url,data:a.extend({q:i(y),limit:g.max,action:"messages_autocomplete_results",cookie:encodeURIComponent(document.cookie)},B),success:function(D){var C=g.parse&&g.parse(D)||o(D);m.add(y,C);A(y,C)}})}else{x(y)}}}function o(A){var x=[];var z=A.split("\n");for(var y=0;y<z.length;y++){var B=a.trim(z[y]);if(B){B=B.split("|");x[x.length]={data:B,value:B[0],result:g.formatResult&&g.formatResult(B,B[0])||B[0]}}}return x}function n(){b.removeClass(g.loadingClass);jQuery("#send-to-input").removeClass("loading")}};a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(b){return b[0]},autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(c,b){return c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:250,attachTo:"body"};a.Autocompleter.Cache=function(c){var f={};var d=0;function h(l,k){if(!c.matchCase){l=l.toLowerCase()}var j=l.indexOf(k);if(j==-1){return false}return j==0||c.matchContains}function g(j,i){if(d>c.cacheLength){b()}if(!f[j]){d++}f[j]=i}function e(){if(!c.data){return false}var k={},j=0;if(!c.url){c.cacheLength=1}k[""]=[];for(var m=0,l=c.data.length;m<l;m++){var p=c.data[m];p=(typeof p=="string")?[p]:p;var o=c.formatItem(p,m+1,c.data.length);if(o===false){continue}var n=o.charAt(0).toLowerCase();if(!k[n]){k[n]=[]}var q={value:o,data:p,result:c.formatResult&&c.formatResult(p)||o};k[n].push(q);if(j++<c.max){k[""].push(q)}}a.each(k,function(r,s){c.cacheLength++;g(r,s)})}setTimeout(e,25);function b(){f={};d=0}return{flush:b,add:g,populate:e,load:function(n){if(!c.cacheLength||!d){return null}if(!c.url&&c.matchContains){var m=[];for(var j in f){if(j.length>0){var o=f[j];a.each(o,function(p,k){if(h(k.value,n)){m.push(k)}})}}return m}else{if(f[n]){return f[n]}else{if(c.matchSubset){for(var l=n.length-1;l>=c.minChars;l--){var o=f[n.substr(0,l)];if(o){var m=[];a.each(o,function(p,k){if(h(k.value,n)){m[m.length]=k}});return m}}}}}return null}}};a.Autocompleter.Select=function(e,j,l,p){var i={ACTIVE:"ac_over"};var k,f=-1,r,m="",s=true,c,o;function n(){if(!s){return}c=a("<div/>").hide().addClass(e.resultsClass).css("position","absolute").appendTo(e.attachTo);o=a("<ul>").appendTo(c).mouseover(function(t){if(q(t).nodeName&&q(t).nodeName.toUpperCase()=="LI"){f=a("li",o).removeClass(i.ACTIVE).index(q(t));a(q(t)).addClass(i.ACTIVE)}}).click(function(t){a(q(t)).addClass(i.ACTIVE);l();j.focus();return false}).mousedown(function(){p.mouseDownOnSelect=true}).mouseup(function(){p.mouseDownOnSelect=false});if(e.width>0){c.css("width",e.width)}s=false}function q(u){var t=u.target;while(t&&t.tagName!="LI"){t=t.parentNode}if(!t){return[]}return t}function h(t){k.slice(f,f+1).removeClass();g(t);var v=k.slice(f,f+1).addClass(i.ACTIVE);if(e.scroll){var u=0;k.slice(0,f).each(function(){u+=this.offsetHeight});if((u+v[0].offsetHeight-o.scrollTop())>o[0].clientHeight){o.scrollTop(u+v[0].offsetHeight-o.innerHeight())}else{if(u<o.scrollTop()){o.scrollTop(u)}}}}function g(t){f+=t;if(f<0){f=k.size()-1}else{if(f>=k.size()){f=0}}}function b(t){return e.max&&e.max<t?e.max:t}function d(){o.empty();var u=b(r.length);for(var v=0;v<u;v++){if(!r[v]){continue}var w=e.formatItem(r[v].data,v+1,u,r[v].value,m);if(w===false){continue}var t=a("<li>").html(e.highlight(w,m)).addClass(v%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(t,"ac_data",r[v])}k=o.find("li");if(e.selectFirst){k.slice(0,1).addClass(i.ACTIVE);f=0}o.bgiframe()}return{display:function(u,t){n();r=u;m=t;d()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){if(f!=0&&f-8<0){h(-f)}else{h(-8)}},pageDown:function(){if(f!=k.size()-1&&f+8>k.size()){h(k.size()-1-f)}else{h(8)}},hide:function(){c&&c.hide();f=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(k.filter("."+i.ACTIVE)[0]||e.selectFirst&&k[0])},show:function(){var v=a(j).offset();c.css({width:typeof e.width=="string"||e.width>0?e.width:a(j).width(),top:v.top+j.offsetHeight,left:v.left}).show();if(e.scroll){o.scrollTop(0);o.css({maxHeight:e.scrollHeight,overflow:"auto"});if(a.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var t=0;k.each(function(){t+=this.offsetHeight});var u=t>e.scrollHeight;o.css("height",u?e.scrollHeight:t);if(!u){k.width(o.width()-parseInt(k.css("padding-left"))-parseInt(k.css("padding-right")))}}}},selected:function(){var t=k&&k.filter("."+i.ACTIVE).removeClass(i.ACTIVE);return t&&t.length&&a.data(t[0],"ac_data")},unbind:function(){c&&c.remove()}}};a.Autocompleter.Selection=function(d,e,c){if(d.createTextRange){var b=d.createTextRange();b.collapse(true);b.moveStart("character",e);b.moveEnd("character",c);b.select()}else{if(d.setSelectionRange){d.setSelectionRange(e,c)}else{if(d.selectionStart){d.selectionStart=e;d.selectionEnd=c}}}d.focus()}})(jQuery); \ No newline at end of file + +;(function($) { + +$.fn.extend({ + autocomplete: function(urlOrData, options) { + var isUrl = typeof urlOrData == "string"; + options = $.extend({}, $.Autocompleter.defaults, { + url: isUrl ? urlOrData : null, + data: isUrl ? null : urlOrData, + delay: isUrl ? $.Autocompleter.defaults.delay : 10, + max: options && !options.scroll ? 10 : 150 + }, options); + + // if highlight is set to false, replace it with a do-nothing function + options.highlight = options.highlight || function(value) { return value; }; + + return this.each(function() { + new $.Autocompleter(this, options); + }); + }, + result: function(handler) { + return this.bind("result", handler); + }, + search: function(handler) { + return this.trigger("search", [handler]); + }, + flushCache: function() { + return this.trigger("flushCache"); + }, + setOptions: function(options){ + return this.trigger("setOptions", [options]); + }, + unautocomplete: function() { + return this.trigger("unautocomplete"); + } +}); + +$.Autocompleter = function(input, options) { + + var KEY = { + UP: 38, + DOWN: 40, + DEL: 46, + TAB: 9, + RETURN: 13, + ESC: 27, + COMMA: 188, + PAGEUP: 33, + PAGEDOWN: 34 + }; + + // Create $ object for input element + var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass); + + var timeout; + var previousValue = ""; + var cache = $.Autocompleter.Cache(options); + var hasFocus = 0; + var lastKeyPressCode; + var config = { + mouseDownOnSelect: false + }; + var select = $.Autocompleter.Select(options, input, selectCurrent, config); + + $input.keydown(function(event) { + // track last key pressed + lastKeyPressCode = event.keyCode; + switch(event.keyCode) { + + case KEY.UP: + event.preventDefault(); + if ( select.visible() ) { + select.prev(); + } else { + onChange(0, true); + } + break; + + case KEY.DOWN: + event.preventDefault(); + if ( select.visible() ) { + select.next(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEUP: + event.preventDefault(); + if ( select.visible() ) { + select.pageUp(); + } else { + onChange(0, true); + } + break; + + case KEY.PAGEDOWN: + event.preventDefault(); + if ( select.visible() ) { + select.pageDown(); + } else { + onChange(0, true); + } + break; + + // matches also semicolon + case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA: + case KEY.TAB: + case KEY.RETURN: + if( selectCurrent() ){ + // make sure to blur off the current field + if( !options.multiple ) + $input.blur(); + event.preventDefault(); + $input.focus(); + } + break; + + case KEY.ESC: + select.hide(); + break; + + default: + clearTimeout(timeout); + timeout = setTimeout(onChange, options.delay); + break; + } + }).keypress(function() { + // having fun with opera - remove this binding and Opera submits the form when we select an entry via return + }).focus(function(){ + // track whether the field has focus, we shouldn't process any + // results if the field no longer has focus + hasFocus++; + }).blur(function() { + hasFocus = 0; + if (!config.mouseDownOnSelect) { + hideResults(); + } + }).click(function() { + // show select when clicking in a focused field + if ( hasFocus++ > 1 && !select.visible() ) { + onChange(0, true); + } + }).bind("search", function() { + // TODO why not just specifying both arguments? + var fn = (arguments.length > 1) ? arguments[1] : null; + function findValueCallback(q, data) { + var result; + if( data && data.length ) { + for (var i=0; i < data.length; i++) { + if( data[i].result.toLowerCase() == q.toLowerCase() ) { + result = data[i]; + break; + } + } + } + if( typeof fn == "function" ) fn(result); + else $input.trigger("result", result && [result.data, result.value]); + } + $.each(trimWords($input.val()), function(i, value) { + request(value, findValueCallback, findValueCallback); + }); + }).bind("flushCache", function() { + cache.flush(); + }).bind("setOptions", function() { + $.extend(options, arguments[1]); + // if we've updated the data, repopulate + if ( "data" in arguments[1] ) + cache.populate(); + }).bind("unautocomplete", function() { + select.unbind(); + $input.unbind(); + }); + + + function selectCurrent() { + var selected = select.selected(); + if( !selected ) + return false; + + var v = selected.result; + previousValue = v; + + if ( options.multiple ) { + var words = trimWords($input.val()); + if ( words.length > 1 ) { + v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v; + } + v += options.multipleSeparator; + } + + $input.val(v); + hideResultsNow(); + $input.trigger("result", [selected.data, selected.value]); + return true; + } + + function onChange(crap, skipPrevCheck) { + if( lastKeyPressCode == KEY.DEL ) { + select.hide(); + return; + } + + var currentValue = $input.val(); + + if ( !skipPrevCheck && currentValue == previousValue ) + return; + + previousValue = currentValue; + + currentValue = lastWord(currentValue); + if ( currentValue.length >= options.minChars) { + $input.addClass(options.loadingClass); + jQuery('#send-to-input').addClass('loading'); + if (!options.matchCase) + currentValue = currentValue.toLowerCase(); + request(currentValue, receiveData, hideResultsNow); + } else { + stopLoading(); + select.hide(); + } + }; + + function trimWords(value) { + if ( !value ) { + return [""]; + } + var words = value.split( $.trim( options.multipleSeparator ) ); + var result = []; + $.each(words, function(i, value) { + if ( $.trim(value) ) + result[i] = $.trim(value); + }); + return result; + } + + function lastWord(value) { + if ( !options.multiple ) + return value; + var words = trimWords(value); + return words[words.length - 1]; + } + + // fills in the input box w/the first match (assumed to be the best match) + function autoFill(q, sValue){ + // autofill in the complete box w/the first match as long as the user hasn't entered in more data + // if the last user key pressed was backspace, don't autofill + if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != 8 ) { + // fill in the value (keep the case the user has typed) + $input.val($input.val() + sValue.substring(lastWord(previousValue).length)); + // select the portion of the value not typed by the user (so the next character will erase) + $.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length); + } + }; + + function hideResults() { + clearTimeout(timeout); + timeout = setTimeout(hideResultsNow, 200); + }; + + function hideResultsNow() { + select.hide(); + clearTimeout(timeout); + stopLoading(); + if (options.mustMatch) { + // call search and run callback + $input.search( + function (result){ + // if no value found, clear the input box + if( !result ) $input.val(""); + } + ); + } + }; + + function receiveData(q, data) { + if ( data && data.length && hasFocus ) { + stopLoading(); + select.display(data, q); + + var newData = data[0].value.split(';'); + data.value = newData[0]; + + autoFill(q, data.value); + select.show(); + } else { + hideResultsNow(); + } + }; + + function request(term, success, failure) { + if (!options.matchCase) + term = term.toLowerCase(); + var data = cache.load(term); + // recieve the cached data + if (data && data.length) { + success(term, data); + // if an AJAX url has been supplied, try loading the data now + } else if( (typeof options.url == "string") && (options.url.length > 0) ){ + + var extraParams = {}; + $.each(options.extraParams, function(key, param) { + extraParams[key] = typeof param == "function" ? param() : param; + }); + + $.ajax({ + // try to leverage ajaxQueue plugin to abort previous requests + mode: "abort", + // limit abortion to this input + port: "autocomplete" + input.name, + dataType: options.dataType, + url: options.url, + data: $.extend({ + q: lastWord(term), + limit: options.max, + action: 'messages_autocomplete_results', + 'cookie': encodeURIComponent(document.cookie) + }, extraParams), + success: function(data) { + var parsed = options.parse && options.parse(data) || parse(data); + cache.add(term, parsed); + success(term, parsed); + } + }); + } else { + failure(term); + } + }; + + function parse(data) { + var parsed = []; + var rows = data.split("\n"); + for (var i=0; i < rows.length; i++) { + var row = $.trim(rows[i]); + if (row) { + row = row.split("|"); + parsed[parsed.length] = { + data: row, + value: row[0], + result: options.formatResult && options.formatResult(row, row[0]) || row[0] + }; + } + } + return parsed; + }; + + function stopLoading() { + $input.removeClass(options.loadingClass); + jQuery('#send-to-input').removeClass('loading'); + }; + +}; + +$.Autocompleter.defaults = { + inputClass: "ac_input", + resultsClass: "ac_results", + loadingClass: "ac_loading", + minChars: 1, + delay: 400, + matchCase: false, + matchSubset: true, + matchContains: false, + cacheLength: 10, + max: 100, + mustMatch: false, + extraParams: {}, + selectFirst: true, + formatItem: function(row) { return row[0]; }, + autoFill: false, + width: 0, + multiple: false, + multipleSeparator: ", ", + highlight: function(value, term) { + return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"); + }, + scroll: true, + scrollHeight: 250, + attachTo: 'body' +}; + +$.Autocompleter.Cache = function(options) { + + var data = {}; + var length = 0; + + function matchSubset(s, sub) { + if (!options.matchCase) + s = s.toLowerCase(); + var i = s.indexOf(sub); + if (i == -1) return false; + return i == 0 || options.matchContains; + }; + + function add(q, value) { + if (length > options.cacheLength){ + flush(); + } + if (!data[q]){ + length++; + } + data[q] = value; + } + + function populate(){ + if( !options.data ) return false; + // track the matches + var stMatchSets = {}, + nullData = 0; + + // no url was specified, we need to adjust the cache length to make sure it fits the local data store + if( !options.url ) options.cacheLength = 1; + + // track all options for minChars = 0 + stMatchSets[""] = []; + + // loop through the array and create a lookup structure + for ( var i = 0, ol = options.data.length; i < ol; i++ ) { + var rawValue = options.data[i]; + // if rawValue is a string, make an array otherwise just reference the array + rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue; + + var value = options.formatItem(rawValue, i+1, options.data.length); + if ( value === false ) + continue; + + var firstChar = value.charAt(0).toLowerCase(); + // if no lookup array for this character exists, look it up now + if( !stMatchSets[firstChar] ) + stMatchSets[firstChar] = []; + + // if the match is a string + var row = { + value: value, + data: rawValue, + result: options.formatResult && options.formatResult(rawValue) || value + }; + + // push the current match into the set list + stMatchSets[firstChar].push(row); + + // keep track of minChars zero items + if ( nullData++ < options.max ) { + stMatchSets[""].push(row); + } + }; + + // add the data items to the cache + $.each(stMatchSets, function(i, value) { + // increase the cache size + options.cacheLength++; + // add to the cache + add(i, value); + }); + } + + // populate any existing data + setTimeout(populate, 25); + + function flush(){ + data = {}; + length = 0; + } + + return { + flush: flush, + add: add, + populate: populate, + load: function(q) { + if (!options.cacheLength || !length) + return null; + /* + * if dealing w/local data and matchContains than we must make sure + * to loop through all the data collections looking for matches + */ + if( !options.url && options.matchContains ){ + // track all matches + var csub = []; + // loop through all the data grids for matches + for( var k in data ){ + // don't search through the stMatchSets[""] (minChars: 0) cache + // this prevents duplicates + if( k.length > 0 ){ + var c = data[k]; + $.each(c, function(i, x) { + // if we've got a match, add it to the array + if (matchSubset(x.value, q)) { + csub.push(x); + } + }); + } + } + return csub; + } else + // if the exact item exists, use it + if (data[q]){ + return data[q]; + } else + if (options.matchSubset) { + for (var i = q.length - 1; i >= options.minChars; i--) { + var c = data[q.substr(0, i)]; + if (c) { + var csub = []; + $.each(c, function(i, x) { + if (matchSubset(x.value, q)) { + csub[csub.length] = x; + } + }); + return csub; + } + } + } + return null; + } + }; +}; + +$.Autocompleter.Select = function (options, input, select, config) { + var CLASSES = { + ACTIVE: "ac_over" + }; + + var listItems, + active = -1, + data, + term = "", + needsInit = true, + element, + list; + + // Create results + function init() { + if (!needsInit) + return; + element = $("<div/>") + .hide() + .addClass(options.resultsClass) + .css("position", "absolute") + .appendTo(options.attachTo); + + list = $("<ul>").appendTo(element).mouseover( function(event) { + if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') { + active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event)); + $(target(event)).addClass(CLASSES.ACTIVE); + } + }).click(function(event) { + $(target(event)).addClass(CLASSES.ACTIVE); + select(); + input.focus(); + return false; + }).mousedown(function() { + config.mouseDownOnSelect = true; + }).mouseup(function() { + config.mouseDownOnSelect = false; + }); + + if( options.width > 0 ) + element.css("width", options.width); + + needsInit = false; + } + + function target(event) { + var element = event.target; + while(element && element.tagName != "LI") + element = element.parentNode; + // more fun with IE, sometimes event.target is empty, just ignore it then + if(!element) + return []; + return element; + } + + function moveSelect(step) { + listItems.slice(active, active + 1).removeClass(); + movePosition(step); + var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE); + if(options.scroll) { + var offset = 0; + listItems.slice(0, active).each(function() { + offset += this.offsetHeight; + }); + if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) { + list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight()); + } else if(offset < list.scrollTop()) { + list.scrollTop(offset); + } + } + }; + + function movePosition(step) { + active += step; + if (active < 0) { + active = listItems.size() - 1; + } else if (active >= listItems.size()) { + active = 0; + } + } + + function limitNumberOfItems(available) { + return options.max && options.max < available + ? options.max + : available; + } + + function fillList() { + list.empty(); + var max = limitNumberOfItems(data.length); + for (var i=0; i < max; i++) { + if (!data[i]) + continue; + var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term); + if ( formatted === false ) + continue; + var li = $("<li>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_event" : "ac_odd").appendTo(list)[0]; + $.data(li, "ac_data", data[i]); + } + listItems = list.find("li"); + if ( options.selectFirst ) { + listItems.slice(0, 1).addClass(CLASSES.ACTIVE); + active = 0; + } + list.bgiframe(); + } + + return { + display: function(d, q) { + init(); + data = d; + term = q; + fillList(); + }, + next: function() { + moveSelect(1); + }, + prev: function() { + moveSelect(-1); + }, + pageUp: function() { + if (active != 0 && active - 8 < 0) { + moveSelect( -active ); + } else { + moveSelect(-8); + } + }, + pageDown: function() { + if (active != listItems.size() - 1 && active + 8 > listItems.size()) { + moveSelect( listItems.size() - 1 - active ); + } else { + moveSelect(8); + } + }, + hide: function() { + element && element.hide(); + active = -1; + }, + visible : function() { + return element && element.is(":visible"); + }, + current: function() { + return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]); + }, + show: function() { + var offset = $(input).offset(); + element.css({ + width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(), + top: offset.top + input.offsetHeight, + left: offset.left + }).show(); + if(options.scroll) { + list.scrollTop(0); + list.css({ + maxHeight: options.scrollHeight, + overflow: 'auto' + }); + + if($.browser.msie && typeof document.body.style.maxHeight === "undefined") { + var listHeight = 0; + listItems.each(function() { + listHeight += this.offsetHeight; + }); + var scrollbarsVisible = listHeight > options.scrollHeight; + list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight ); + if (!scrollbarsVisible) { + // IE doesn't recalculate width when scrollbar disappears + listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) ); + } + } + + } + }, + selected: function() { + var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE); + return selected && selected.length && $.data(selected[0], "ac_data"); + }, + unbind: function() { + element && element.remove(); + } + }; +}; + +$.Autocompleter.Selection = function(field, start, end) { + if( field.createTextRange ){ + var selRange = field.createTextRange(); + selRange.collapse(true); + selRange.moveStart("character", start); + selRange.moveEnd("character", end); + selRange.select(); + } else if( field.setSelectionRange ){ + field.setSelectionRange(start, end); + } else { + if( field.selectionStart ){ + field.selectionStart = start; + field.selectionEnd = end; + } + } + field.focus(); +}; + +})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.min.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.min.js new file mode 100644 index 0000000000000000000000000000000000000000..42a07995ae8953717263bfb4c2c4999492b4ac06 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocomplete.min.js @@ -0,0 +1,13 @@ +/*! + * Autocomplete - jQuery plugin 1.0 Beta + * + * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Revision: $Id: jquery.autocomplete.js 4485 2008-01-20 13:52:47Z joern.zaefferer $ + * + */ +(function(a){a.fn.extend({autocomplete:function(b,c){var d=typeof b=="string";c=a.extend({},a.Autocompleter.defaults,{url:d?b:null,data:d?null:b,delay:d?a.Autocompleter.defaults.delay:10,max:c&&!c.scroll?10:150},c);c.highlight=c.highlight||function(e){return e};return this.each(function(){new a.Autocompleter(this,c)})},result:function(b){return this.bind("result",b)},search:function(b){return this.trigger("search",[b])},flushCache:function(){return this.trigger("flushCache")},setOptions:function(b){return this.trigger("setOptions",[b])},unautocomplete:function(){return this.trigger("unautocomplete")}});a.Autocompleter=function(l,g){var c={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34};var b=a(l).attr("autocomplete","off").addClass(g.inputClass);var j;var p="";var m=a.Autocompleter.Cache(g);var e=0;var u;var w={mouseDownOnSelect:false};var r=a.Autocompleter.Select(g,l,d,w);b.keydown(function(x){u=x.keyCode;switch(x.keyCode){case c.UP:x.preventDefault();if(r.visible()){r.prev()}else{t(0,true)}break;case c.DOWN:x.preventDefault();if(r.visible()){r.next()}else{t(0,true)}break;case c.PAGEUP:x.preventDefault();if(r.visible()){r.pageUp()}else{t(0,true)}break;case c.PAGEDOWN:x.preventDefault();if(r.visible()){r.pageDown()}else{t(0,true)}break;case g.multiple&&a.trim(g.multipleSeparator)==","&&c.COMMA:case c.TAB:case c.RETURN:if(d()){if(!g.multiple){b.blur()}x.preventDefault();b.focus()}break;case c.ESC:r.hide();break;default:clearTimeout(j);j=setTimeout(t,g.delay);break}}).keypress(function(){}).focus(function(){e++}).blur(function(){e=0;if(!w.mouseDownOnSelect){s()}}).click(function(){if(e++>1&&!r.visible()){t(0,true)}}).bind("search",function(){var x=(arguments.length>1)?arguments[1]:null;function y(C,B){var z;if(B&&B.length){for(var A=0;A<B.length;A++){if(B[A].result.toLowerCase()==C.toLowerCase()){z=B[A];break}}}if(typeof x=="function"){x(z)}else{b.trigger("result",z&&[z.data,z.value])}}a.each(h(b.val()),function(z,A){f(A,y,y)})}).bind("flushCache",function(){m.flush()}).bind("setOptions",function(){a.extend(g,arguments[1]);if("data" in arguments[1]){m.populate()}}).bind("unautocomplete",function(){r.unbind();b.unbind()});function d(){var y=r.selected();if(!y){return false}var x=y.result;p=x;if(g.multiple){var z=h(b.val());if(z.length>1){x=z.slice(0,z.length-1).join(g.multipleSeparator)+g.multipleSeparator+x}x+=g.multipleSeparator}b.val(x);v();b.trigger("result",[y.data,y.value]);return true}function t(z,y){if(u==c.DEL){r.hide();return}var x=b.val();if(!y&&x==p){return}p=x;x=i(x);if(x.length>=g.minChars){b.addClass(g.loadingClass);jQuery("#send-to-input").addClass("loading");if(!g.matchCase){x=x.toLowerCase()}f(x,k,v)}else{n();r.hide()}}function h(y){if(!y){return[""]}var z=y.split(a.trim(g.multipleSeparator));var x=[];a.each(z,function(A,B){if(a.trim(B)){x[A]=a.trim(B)}});return x}function i(x){if(!g.multiple){return x}var y=h(x);return y[y.length-1]}function q(x,y){if(g.autoFill&&(i(b.val()).toLowerCase()==x.toLowerCase())&&u!=8){b.val(b.val()+y.substring(i(p).length));a.Autocompleter.Selection(l,p.length,p.length+y.length)}}function s(){clearTimeout(j);j=setTimeout(v,200)}function v(){r.hide();clearTimeout(j);n();if(g.mustMatch){b.search(function(x){if(!x){b.val("")}})}}function k(z,y){if(y&&y.length&&e){n();r.display(y,z);var x=y[0].value.split(";");y.value=x[0];q(z,y.value);r.show()}else{v()}}function f(y,A,x){if(!g.matchCase){y=y.toLowerCase()}var z=m.load(y);if(z&&z.length){A(y,z)}else{if((typeof g.url=="string")&&(g.url.length>0)){var B={};a.each(g.extraParams,function(C,D){B[C]=typeof D=="function"?D():D});a.ajax({mode:"abort",port:"autocomplete"+l.name,dataType:g.dataType,url:g.url,data:a.extend({q:i(y),limit:g.max,action:"messages_autocomplete_results",cookie:encodeURIComponent(document.cookie)},B),success:function(D){var C=g.parse&&g.parse(D)||o(D);m.add(y,C);A(y,C)}})}else{x(y)}}}function o(A){var x=[];var z=A.split("\n");for(var y=0;y<z.length;y++){var B=a.trim(z[y]);if(B){B=B.split("|");x[x.length]={data:B,value:B[0],result:g.formatResult&&g.formatResult(B,B[0])||B[0]}}}return x}function n(){b.removeClass(g.loadingClass);jQuery("#send-to-input").removeClass("loading")}};a.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(b){return b[0]},autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(c,b){return c.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+b.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")},scroll:true,scrollHeight:250,attachTo:"body"};a.Autocompleter.Cache=function(c){var f={};var d=0;function h(l,k){if(!c.matchCase){l=l.toLowerCase()}var j=l.indexOf(k);if(j==-1){return false}return j==0||c.matchContains}function g(j,i){if(d>c.cacheLength){b()}if(!f[j]){d++}f[j]=i}function e(){if(!c.data){return false}var k={},j=0;if(!c.url){c.cacheLength=1}k[""]=[];for(var m=0,l=c.data.length;m<l;m++){var p=c.data[m];p=(typeof p=="string")?[p]:p;var o=c.formatItem(p,m+1,c.data.length);if(o===false){continue}var n=o.charAt(0).toLowerCase();if(!k[n]){k[n]=[]}var q={value:o,data:p,result:c.formatResult&&c.formatResult(p)||o};k[n].push(q);if(j++<c.max){k[""].push(q)}}a.each(k,function(r,s){c.cacheLength++;g(r,s)})}setTimeout(e,25);function b(){f={};d=0}return{flush:b,add:g,populate:e,load:function(n){if(!c.cacheLength||!d){return null}if(!c.url&&c.matchContains){var m=[];for(var j in f){if(j.length>0){var o=f[j];a.each(o,function(p,k){if(h(k.value,n)){m.push(k)}})}}return m}else{if(f[n]){return f[n]}else{if(c.matchSubset){for(var l=n.length-1;l>=c.minChars;l--){var o=f[n.substr(0,l)];if(o){var m=[];a.each(o,function(p,k){if(h(k.value,n)){m[m.length]=k}});return m}}}}}return null}}};a.Autocompleter.Select=function(e,j,l,p){var i={ACTIVE:"ac_over"};var k,f=-1,r,m="",s=true,c,o;function n(){if(!s){return}c=a("<div/>").hide().addClass(e.resultsClass).css("position","absolute").appendTo(e.attachTo);o=a("<ul>").appendTo(c).mouseover(function(t){if(q(t).nodeName&&q(t).nodeName.toUpperCase()=="LI"){f=a("li",o).removeClass(i.ACTIVE).index(q(t));a(q(t)).addClass(i.ACTIVE)}}).click(function(t){a(q(t)).addClass(i.ACTIVE);l();j.focus();return false}).mousedown(function(){p.mouseDownOnSelect=true}).mouseup(function(){p.mouseDownOnSelect=false});if(e.width>0){c.css("width",e.width)}s=false}function q(u){var t=u.target;while(t&&t.tagName!="LI"){t=t.parentNode}if(!t){return[]}return t}function h(t){k.slice(f,f+1).removeClass();g(t);var v=k.slice(f,f+1).addClass(i.ACTIVE);if(e.scroll){var u=0;k.slice(0,f).each(function(){u+=this.offsetHeight});if((u+v[0].offsetHeight-o.scrollTop())>o[0].clientHeight){o.scrollTop(u+v[0].offsetHeight-o.innerHeight())}else{if(u<o.scrollTop()){o.scrollTop(u)}}}}function g(t){f+=t;if(f<0){f=k.size()-1}else{if(f>=k.size()){f=0}}}function b(t){return e.max&&e.max<t?e.max:t}function d(){o.empty();var u=b(r.length);for(var v=0;v<u;v++){if(!r[v]){continue}var w=e.formatItem(r[v].data,v+1,u,r[v].value,m);if(w===false){continue}var t=a("<li>").html(e.highlight(w,m)).addClass(v%2==0?"ac_event":"ac_odd").appendTo(o)[0];a.data(t,"ac_data",r[v])}k=o.find("li");if(e.selectFirst){k.slice(0,1).addClass(i.ACTIVE);f=0}o.bgiframe()}return{display:function(u,t){n();r=u;m=t;d()},next:function(){h(1)},prev:function(){h(-1)},pageUp:function(){if(f!=0&&f-8<0){h(-f)}else{h(-8)}},pageDown:function(){if(f!=k.size()-1&&f+8>k.size()){h(k.size()-1-f)}else{h(8)}},hide:function(){c&&c.hide();f=-1},visible:function(){return c&&c.is(":visible")},current:function(){return this.visible()&&(k.filter("."+i.ACTIVE)[0]||e.selectFirst&&k[0])},show:function(){var v=a(j).offset();c.css({width:typeof e.width=="string"||e.width>0?e.width:a(j).width(),top:v.top+j.offsetHeight,left:v.left}).show();if(e.scroll){o.scrollTop(0);o.css({maxHeight:e.scrollHeight,overflow:"auto"});if(a.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var t=0;k.each(function(){t+=this.offsetHeight});var u=t>e.scrollHeight;o.css("height",u?e.scrollHeight:t);if(!u){k.width(o.width()-parseInt(k.css("padding-left"))-parseInt(k.css("padding-right")))}}}},selected:function(){var t=k&&k.filter("."+i.ACTIVE).removeClass(i.ACTIVE);return t&&t.length&&a.data(t[0],"ac_data")},unbind:function(){c&&c.remove()}}};a.Autocompleter.Selection=function(d,e,c){if(d.createTextRange){var b=d.createTextRange();b.collapse(true);b.moveStart("character",e);b.moveEnd("character",c);b.select()}else{if(d.setSelectionRange){d.setSelectionRange(e,c)}else{if(d.selectionStart){d.selectionStart=e;d.selectionEnd=c}}}d.focus()}})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js index 119449e1043441e5930a8c431870d9509e0827c0..df125ea39e3892e74bb3b9e9b528c925411c3651 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.js @@ -13,4 +13,64 @@ * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ -jQuery.fn.autoCompletefb=function(b){var c=this;var d={ul:c,urlLookup:[""],acOptions:{},foundClass:".friend-tab",inputClass:".send-to-input"};if(b){jQuery.extend(d,b)}var a={params:d,removeFind:function(e){a.removeUsername(e);jQuery(e).unbind("click").parent().remove();jQuery(d.inputClass,c).focus();return c.acfb},removeUsername:function(f){var e=f.parentNode.id.split("-");jQuery("#send-to-usernames").removeClass(e[1])}};jQuery(d.foundClass+" img.p").click(function(){a.removeFind(this)});jQuery(d.inputClass,c).autocomplete(d.urlLookup,d.acOptions);jQuery(d.inputClass,c).result(function(n,o,m){var m=d.foundClass.replace(/\./,"");var o=String(o).split(" (");var j=o[1].substr(0,o[1].length-1);if(0===jQuery(d.inputClass).siblings("#un-"+j).length){var k="#link-"+j;var h=jQuery(k).attr("href");var i='<li class="'+m+'" id="un-'+j+'"><span><a href="'+h+'">'+o[0]+'</a></span> <span class="p">X</span></li>';var g=jQuery(d.inputClass,c).before(i);jQuery("#send-to-usernames").addClass(j);jQuery(".p",g[0].previousSibling).click(function(){a.removeFind(this)})}jQuery(d.inputClass,c).val("")});jQuery(d.inputClass,c).focus();return a}; \ No newline at end of file + +jQuery.fn.autoCompletefb = function(options) +{ + var tmp = this; + var settings = + { + ul : tmp, + urlLookup : [""], + acOptions : {}, + foundClass : ".friend-tab", + inputClass : ".send-to-input" + } + + if(options) jQuery.extend(settings, options); + + var acfb = + { + params : settings, + removeFind : function(o){ + acfb.removeUsername(o); + jQuery(o).unbind('click').parent().remove(); + jQuery(settings.inputClass,tmp).focus(); + return tmp.acfb; + }, + removeUsername: function(o){ + var newID = o.parentNode.id.split('-'); + jQuery('#send-to-usernames').removeClass(newID[1]); + } + } + + jQuery(settings.foundClass+" img.p").click(function(){ + acfb.removeFind(this); + }); + + jQuery(settings.inputClass,tmp).autocomplete(settings.urlLookup,settings.acOptions); + jQuery(settings.inputClass,tmp).result(function(e,d,f){ + var f = settings.foundClass.replace(/\./,''); + var d = String(d).split(' ('); + var un = d[1].substr(0, d[1].length-1); + + /* Don't add the same user multiple times */ + if( 0 === jQuery(settings.inputClass).siblings('#un-' + un).length ) { + var ln = '#link-' + un; + var l = jQuery(ln).attr('href'); + var v = '<li class="'+f+'" id="un-'+un+'"><span><a href="'+l+'">'+d[0]+'</a></span> <span class="p">X</span></li>'; + + var x = jQuery(settings.inputClass,tmp).before(v); + jQuery('#send-to-usernames').addClass(un); + + jQuery('.p',x[0].previousSibling).click(function(){ + acfb.removeFind(this); + }); + } + + jQuery(settings.inputClass,tmp).val(''); + + }); + + jQuery(settings.inputClass,tmp).focus(); + return acfb; +} diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.min.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.min.js new file mode 100644 index 0000000000000000000000000000000000000000..119449e1043441e5930a8c431870d9509e0827c0 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.autocompletefb.min.js @@ -0,0 +1,16 @@ +/*! + * jQuery plugin: autoCompletefb(AutoComplete Facebook) + * @requires jQuery v1.2.2 or later + * using plugin:jquery.autocomplete.js + * + * Credits: + * - Idea: Facebook + * - Guillermo Rauch: Original MooTools script + * - InteRiders <http://interiders.com/> + * + * Copyright (c) 2008 Widi Harsojo <wharsojo@gmail.com>, http://wharsojo.wordpress.com/ + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +jQuery.fn.autoCompletefb=function(b){var c=this;var d={ul:c,urlLookup:[""],acOptions:{},foundClass:".friend-tab",inputClass:".send-to-input"};if(b){jQuery.extend(d,b)}var a={params:d,removeFind:function(e){a.removeUsername(e);jQuery(e).unbind("click").parent().remove();jQuery(d.inputClass,c).focus();return c.acfb},removeUsername:function(f){var e=f.parentNode.id.split("-");jQuery("#send-to-usernames").removeClass(e[1])}};jQuery(d.foundClass+" img.p").click(function(){a.removeFind(this)});jQuery(d.inputClass,c).autocomplete(d.urlLookup,d.acOptions);jQuery(d.inputClass,c).result(function(n,o,m){var m=d.foundClass.replace(/\./,"");var o=String(o).split(" (");var j=o[1].substr(0,o[1].length-1);if(0===jQuery(d.inputClass).siblings("#un-"+j).length){var k="#link-"+j;var h=jQuery(k).attr("href");var i='<li class="'+m+'" id="un-'+j+'"><span><a href="'+h+'">'+o[0]+'</a></span> <span class="p">X</span></li>';var g=jQuery(d.inputClass,c).before(i);jQuery("#send-to-usernames").addClass(j);jQuery(".p",g[0].previousSibling).click(function(){a.removeFind(this)})}jQuery(d.inputClass,c).val("")});jQuery(d.inputClass,c).focus();return a}; \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.js index 690f3e1ad8d34c509aa0203ee4ea740e0b7e5c6f..ef2a9e218f0ecd6257af54fb0a0f854be0b95be9 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.js @@ -3,4 +3,37 @@ * * Version 2.1.2 */ -(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery); \ No newline at end of file + +(function($){ + +$.fn.bgiframe = ($.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ? function(s) { + s = $.extend({ + top : 'auto', // auto == .currentStyle.borderTopWidth + left : 'auto', // auto == .currentStyle.borderLeftWidth + width : 'auto', // auto == offsetWidth + height : 'auto', // auto == offsetHeight + opacity : true, + src : 'javascript:false;' + }, s); + var html = '<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+ + 'style="display:block;position:absolute;z-index:-1;'+ + (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+ + 'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+ + 'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+ + 'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+ + 'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+ + '"/>'; + return this.each(function() { + if ( $(this).children('iframe.bgiframe').length === 0 ) + this.insertBefore( document.createElement(html), this.firstChild ); + }); +} : function() { return this; }); + +// old alias +$.fn.bgIframe = $.fn.bgiframe; + +function prop(n) { + return n && n.constructor === Number ? n + 'px' : n; +} + +})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.min.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.min.js index 7faef4b33506062dd1d931743a880880fa3093d3..690f3e1ad8d34c509aa0203ee4ea740e0b7e5c6f 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.min.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.bgiframe.min.js @@ -1,10 +1,6 @@ -/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. +/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) + * Licensed under the MIT License (license.bgiframe.txt). * - * $LastChangedDate: 2007-07-22 01:45:56 +0200 (Son, 22 Jul 2007) $ - * $Rev: 2447 $ - * - * Version 2.1.1 + * Version 2.1.2 */ -(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&/6.0/.test(navigator.userAgent)){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n;},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"'+'style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';'+'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';'+'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+'"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild);});}return this;};})(jQuery); \ No newline at end of file +(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0){this.insertBefore(document.createElement(c),this.firstChild)}})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe;function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.js index 20c46bc948d9f57afefb3385caf93c857128fd36..544c918b53ff22cf97d7604f93f950bfafcfa540 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.js +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.js @@ -10,4 +10,108 @@ * * Requires: jQuery 1.2+ */ -(function(b){b.dimensions={version:"@VERSION"};b.each(["Height","Width"],function(d,c){b.fn["inner"+c]=function(){if(!this[0]){return}var f=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";return this[c.toLowerCase()]()+a(this,"padding"+f)+a(this,"padding"+e)};b.fn["outer"+c]=function(f){if(!this[0]){return}var g=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";f=b.extend({margin:false},f||{});return this[c.toLowerCase()]()+a(this,"border"+g+"Width")+a(this,"border"+e+"Width")+a(this,"padding"+g)+a(this,"padding"+e)+(f.margin?(a(this,"margin"+g)+a(this,"margin"+e)):0)}});b.each(["Left","Top"],function(d,c){b.fn["scroll"+c]=function(e){if(!this[0]){return}return e!=undefined?this.each(function(){this==window||this==document?window.scrollTo(c=="Left"?e:b(window)["scrollLeft"](),c=="Top"?e:b(window)["scrollTop"]()):this["scroll"+c]=e}):this[0]==window||this[0]==document?self[(c=="Left"?"pageXOffset":"pageYOffset")]||b.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]}});b.fn.extend({position:function(){var h=0,g=0,f=this[0],i,c,e,d;if(f){e=this.offsetParent();i=this.offset();c=e.offset();i.top-=a(f,"marginTop");i.left-=a(f,"marginLeft");c.top+=a(e,"borderTopWidth");c.left+=a(e,"borderLeftWidth");d={top:i.top-c.top,left:i.left-c.left}}return d},offsetParent:function(){var c=this[0].offsetParent;while(c&&(!/^body|html$/i.test(c.tagName)&&b.css(c,"position")=="static")){c=c.offsetParent}return b(c)}});var a=function(c,d){return parseInt(b.css(c.jquery?c[0]:c,d))||0}})(jQuery); \ No newline at end of file + +(function($){ + +$.dimensions = { + version: '@VERSION' +}; + +// Create innerHeight, innerWidth, outerHeight and outerWidth methods +$.each( [ 'Height', 'Width' ], function(i, name){ + + // innerHeight and innerWidth + $.fn[ 'inner' + name ] = function() { + if (!this[0]) return; + + var torl = name == 'Height' ? 'Top' : 'Left', // top or left + borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right + + return this[ name.toLowerCase() ]() + num(this, 'padding' + torl) + num(this, 'padding' + borr); + }; + + // outerHeight and outerWidth + $.fn[ 'outer' + name ] = function(options) { + if (!this[0]) return; + + var torl = name == 'Height' ? 'Top' : 'Left', // top or left + borr = name == 'Height' ? 'Bottom' : 'Right'; // bottom or right + + options = $.extend({ margin: false }, options || {}); + + return this[ name.toLowerCase() ]() + + num(this, 'border' + torl + 'Width') + num(this, 'border' + borr + 'Width') + + num(this, 'padding' + torl) + num(this, 'padding' + borr) + + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0); + }; +}); + +// Create scrollLeft and scrollTop methods +$.each( ['Left', 'Top'], function(i, name) { + $.fn[ 'scroll' + name ] = function(val) { + if (!this[0]) return; + + return val != undefined ? + + // Set the scroll offset + this.each(function() { + this == window || this == document ? + window.scrollTo( + name == 'Left' ? val : $(window)[ 'scrollLeft' ](), + name == 'Top' ? val : $(window)[ 'scrollTop' ]() + ) : + this[ 'scroll' + name ] = val; + }) : + + // Return the scroll offset + this[0] == window || this[0] == document ? + self[ (name == 'Left' ? 'pageXOffset' : 'pageYOffset') ] || + $.boxModel && document.documentElement[ 'scroll' + name ] || + document.body[ 'scroll' + name ] : + this[0][ 'scroll' + name ]; + }; +}); + +$.fn.extend({ + position: function() { + var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results; + + if (elem) { + // Get *real* offsetParent + offsetParent = this.offsetParent(); + + // Get correct offsets + offset = this.offset(); + parentOffset = offsetParent.offset(); + + // Subtract element margins + offset.top -= num(elem, 'marginTop'); + offset.left -= num(elem, 'marginLeft'); + + // Add offsetParent borders + parentOffset.top += num(offsetParent, 'borderTopWidth'); + parentOffset.left += num(offsetParent, 'borderLeftWidth'); + + // Subtract the two offsets + results = { + top: offset.top - parentOffset.top, + left: offset.left - parentOffset.left + }; + } + + return results; + }, + + offsetParent: function() { + var offsetParent = this[0].offsetParent; + while ( offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && $.css(offsetParent, 'position') == 'static') ) + offsetParent = offsetParent.offsetParent; + return $(offsetParent); + } +}); + +var num = function(el, prop) { + return parseInt($.css(el.jquery?el[0]:el,prop))||0; +}; + +})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.min.js b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.min.js new file mode 100644 index 0000000000000000000000000000000000000000..20c46bc948d9f57afefb3385caf93c857128fd36 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/jquery.dimensions.min.js @@ -0,0 +1,13 @@ +/*! + * Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + * + * $LastChangedDate: 2007-09-11 05:38:31 +0300 (Вт, 11 сен 2007) $ + * $Rev: 3238 $ + * + * Version: @VERSION + * + * Requires: jQuery 1.2+ + */ +(function(b){b.dimensions={version:"@VERSION"};b.each(["Height","Width"],function(d,c){b.fn["inner"+c]=function(){if(!this[0]){return}var f=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";return this[c.toLowerCase()]()+a(this,"padding"+f)+a(this,"padding"+e)};b.fn["outer"+c]=function(f){if(!this[0]){return}var g=c=="Height"?"Top":"Left",e=c=="Height"?"Bottom":"Right";f=b.extend({margin:false},f||{});return this[c.toLowerCase()]()+a(this,"border"+g+"Width")+a(this,"border"+e+"Width")+a(this,"padding"+g)+a(this,"padding"+e)+(f.margin?(a(this,"margin"+g)+a(this,"margin"+e)):0)}});b.each(["Left","Top"],function(d,c){b.fn["scroll"+c]=function(e){if(!this[0]){return}return e!=undefined?this.each(function(){this==window||this==document?window.scrollTo(c=="Left"?e:b(window)["scrollLeft"](),c=="Top"?e:b(window)["scrollTop"]()):this["scroll"+c]=e}):this[0]==window||this[0]==document?self[(c=="Left"?"pageXOffset":"pageYOffset")]||b.boxModel&&document.documentElement["scroll"+c]||document.body["scroll"+c]:this[0]["scroll"+c]}});b.fn.extend({position:function(){var h=0,g=0,f=this[0],i,c,e,d;if(f){e=this.offsetParent();i=this.offset();c=e.offset();i.top-=a(f,"marginTop");i.left-=a(f,"marginLeft");c.top+=a(e,"borderTopWidth");c.left+=a(e,"borderLeftWidth");d={top:i.top-c.top,left:i.left-c.left}}return d},offsetParent:function(){var c=this[0].offsetParent;while(c&&(!/^body|html$/i.test(c.tagName)&&b.css(c,"position")=="static")){c=c.offsetParent}return b(c)}});var a=function(c,d){return parseInt(b.css(c.jquery?c[0]:c,d))||0}})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/license.bgiframe.txt b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/license.bgiframe.txt index 74c597096986d6a2dbc21f4c8f9b7700b36b97b7..21f87ae7a5ff34c4bb9584be4b84fbd315e805cb 100644 --- a/wp-content/plugins/buddypress/bp-messages/js/autocomplete/license.bgiframe.txt +++ b/wp-content/plugins/buddypress/bp-messages/js/autocomplete/license.bgiframe.txt @@ -1,20 +1,20 @@ -Copyright 2010, Brandon Aaron (http://brandonaaron.net/) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +Copyright 2010, Brandon Aaron (http://brandonaaron.net/) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php index 3fc310f0e2ee26ea1a43d948957407a050edf52b..fd107dedfce05428eb55955a5fe26658b5a8f3be 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-actions.php @@ -26,12 +26,15 @@ if ( !defined( 'ABSPATH' ) ) exit; * @return If no reason to proceed */ function bp_settings_action_general() { - global $bp; // Bail if not a POST action if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; + // Bail if no submit action + if ( ! isset( $_POST['submit'] ) ) + return; + // Bail if not in settings if ( ! bp_is_settings_component() || ! bp_is_current_action( 'general' ) ) return; @@ -43,172 +46,169 @@ function bp_settings_action_general() { } // Define local defaults - $email_error = false; // invalid|blocked|taken|empty|nochange - $pass_error = false; // invalid|mismatch|empty|nochange - $pass_changed = false; // true if the user changes their password - $email_changed = false; // true if the user changes their email - $feedback_type = 'error'; // success|error - $feedback = array(); // array of strings for feedback - - - if ( isset( $_POST['submit'] ) ) { + $bp = buddypress(); // The instance + $email_error = false; // invalid|blocked|taken|empty|nochange + $pass_error = false; // invalid|mismatch|empty|nochange + $pass_changed = false; // true if the user changes their password + $email_changed = false; // true if the user changes their email + $feedback_type = 'error'; // success|error + $feedback = array(); // array of strings for feedback - // Nonce check - check_admin_referer('bp_settings_general'); + // Nonce check + check_admin_referer('bp_settings_general'); - // Validate the user again for the current password when making a big change - if ( ( is_super_admin() ) || ( !empty( $_POST['pwd'] ) && wp_check_password( $_POST['pwd'], $bp->displayed_user->userdata->user_pass, bp_displayed_user_id() ) ) ) { + // Validate the user again for the current password when making a big change + if ( ( is_super_admin() ) || ( !empty( $_POST['pwd'] ) && wp_check_password( $_POST['pwd'], $bp->displayed_user->userdata->user_pass, bp_displayed_user_id() ) ) ) { - $update_user = get_userdata( bp_displayed_user_id() ); + $update_user = get_userdata( bp_displayed_user_id() ); - /** Email Change Attempt ******************************************/ + /** Email Change Attempt ******************************************/ - if ( !empty( $_POST['email'] ) ) { + if ( !empty( $_POST['email'] ) ) { - // What is missing from the profile page vs signup - lets double check the goodies - $user_email = sanitize_email( esc_html( trim( $_POST['email'] ) ) ); + // What is missing from the profile page vs signup - lets double check the goodies + $user_email = sanitize_email( esc_html( trim( $_POST['email'] ) ) ); - // User is changing email address - if ( $bp->displayed_user->userdata->user_email != $user_email ) { + // User is changing email address + if ( $bp->displayed_user->userdata->user_email != $user_email ) { - // Run some tests on the email address - $email_checks = bp_core_validate_email_address( $user_email ); + // Run some tests on the email address + $email_checks = bp_core_validate_email_address( $user_email ); - if ( true !== $email_checks ) { - if ( isset( $email_checks['invalid'] ) ) { - $email_error = 'invalid'; - } - - if ( isset( $email_checks['domain_banned'] ) || isset( $email_checks['domain_not_allowed'] ) ) { - $email_error = 'blocked'; - } + if ( true !== $email_checks ) { + if ( isset( $email_checks['invalid'] ) ) { + $email_error = 'invalid'; + } - if ( isset( $email_checks['in_use'] ) ) { - $email_error = 'taken'; - } + if ( isset( $email_checks['domain_banned'] ) || isset( $email_checks['domain_not_allowed'] ) ) { + $email_error = 'blocked'; } - // Yay we made it! - if ( false === $email_error ) { - $update_user->user_email = $user_email; - $email_changed = true; + if ( isset( $email_checks['in_use'] ) ) { + $email_error = 'taken'; } + } - // No change - } else { - $email_error = false; + // Yay we made it! + if ( false === $email_error ) { + $update_user->user_email = $user_email; + $email_changed = true; } - // Email address cannot be empty + // No change } else { - $email_error = 'empty'; + $email_error = false; } - /** Password Change Attempt ***************************************/ - - if ( !empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) { - - // Password change attempt is successful - if ( ( $_POST['pass1'] == $_POST['pass2'] ) && !strpos( " " . $_POST['pass1'], "\\" ) ) { - $update_user->user_pass = $_POST['pass1']; - $pass_changed = true; + // Email address cannot be empty + } else { + $email_error = 'empty'; + } - // Password change attempt was unsuccessful - } else { - $pass_error = 'mismatch'; - } + /** Password Change Attempt ***************************************/ - // Both password fields were empty - } elseif ( empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) { - $pass_error = false; + if ( !empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) { - // One of the password boxes was left empty - } elseif ( ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) || ( !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) ) { - $pass_error = 'empty'; - } + // Password change attempt is successful + if ( ( $_POST['pass1'] == $_POST['pass2'] ) && !strpos( " " . $_POST['pass1'], "\\" ) ) { + $update_user->user_pass = $_POST['pass1']; + $pass_changed = true; - // The structure of the $update_user object changed in WP 3.3, but - // wp_update_user() still expects the old format - if ( isset( $update_user->data ) && is_object( $update_user->data ) ) { - $update_user = $update_user->data; - $update_user = get_object_vars( $update_user ); - - // Unset the password field to prevent it from emptying out the - // user's user_pass field in the database. - // @see wp_update_user() - if ( false === $pass_changed ) { - unset( $update_user['user_pass'] ); - } + // Password change attempt was unsuccessful + } else { + $pass_error = 'mismatch'; } - // Make sure these changes are in $bp for the current page load - if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( $update_user ) ) ) { - $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() ); - } + // Both password fields were empty + } elseif ( empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) { + $pass_error = false; - // Password Error - } else { - $pass_error = 'invalid'; + // One of the password boxes was left empty + } elseif ( ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) || ( !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) ) { + $pass_error = 'empty'; } - // Email feedback - switch ( $email_error ) { - case 'invalid' : - $feedback['email_invalid'] = __( 'That email address is invalid. Check the formatting and try again.', 'buddypress' ); - break; - case 'blocked' : - $feedback['email_blocked'] = __( 'That email address is currently unavailable for use.', 'buddypress' ); - break; - case 'taken' : - $feedback['email_taken'] = __( 'That email address is already taken.', 'buddypress' ); - break; - case 'empty' : - $feedback['email_empty'] = __( 'Email address cannot be empty.', 'buddypress' ); - break; - case false : - // No change - break; + // The structure of the $update_user object changed in WP 3.3, but + // wp_update_user() still expects the old format + if ( isset( $update_user->data ) && is_object( $update_user->data ) ) { + $update_user = $update_user->data; + $update_user = get_object_vars( $update_user ); + + // Unset the password field to prevent it from emptying out the + // user's user_pass field in the database. + // @see wp_update_user() + if ( false === $pass_changed ) { + unset( $update_user['user_pass'] ); + } } - // Password feedback - switch ( $pass_error ) { - case 'invalid' : - $feedback['pass_error'] = __( 'Your current password is invalid.', 'buddypress' ); - break; - case 'mismatch' : - $feedback['pass_mismatch'] = __( 'The new password fields did not match.', 'buddypress' ); - break; - case 'empty' : - $feedback['pass_empty'] = __( 'One of the password fields was empty.', 'buddypress' ); - break; - case false : - // No change - break; + // Make sure these changes are in $bp for the current page load + if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( $update_user ) ) ) { + $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() ); } - // No errors so show a simple success message - if ( ( ( false === $email_error ) || ( false == $pass_error ) ) && ( ( true === $pass_changed ) || ( true === $email_changed ) ) ) { - $feedback[] = __( 'Your settings have been saved.', 'buddypress' ); - $feedback_type = 'success'; + // Password Error + } else { + $pass_error = 'invalid'; + } - // Some kind of errors occurred - } elseif ( ( ( false === $email_error ) || ( false === $pass_error ) ) && ( ( false === $pass_changed ) || ( false === $email_changed ) ) ) { - if ( bp_is_my_profile() ) { - $feedback['nochange'] = __( 'No changes were made to your account.', 'buddypress' ); - } else { - $feedback['nochange'] = __( 'No changes were made to this account.', 'buddypress' ); - } - } + // Email feedback + switch ( $email_error ) { + case 'invalid' : + $feedback['email_invalid'] = __( 'That email address is invalid. Check the formatting and try again.', 'buddypress' ); + break; + case 'blocked' : + $feedback['email_blocked'] = __( 'That email address is currently unavailable for use.', 'buddypress' ); + break; + case 'taken' : + $feedback['email_taken'] = __( 'That email address is already taken.', 'buddypress' ); + break; + case 'empty' : + $feedback['email_empty'] = __( 'Email address cannot be empty.', 'buddypress' ); + break; + case false : + // No change + break; + } - // Set the feedback - bp_core_add_message( implode( '</p><p>', $feedback ), $feedback_type ); + // Password feedback + switch ( $pass_error ) { + case 'invalid' : + $feedback['pass_error'] = __( 'Your current password is invalid.', 'buddypress' ); + break; + case 'mismatch' : + $feedback['pass_mismatch'] = __( 'The new password fields did not match.', 'buddypress' ); + break; + case 'empty' : + $feedback['pass_empty'] = __( 'One of the password fields was empty.', 'buddypress' ); + break; + case false : + // No change + break; + } - // Execute additional code - do_action( 'bp_core_general_settings_after_save' ); + // No errors so show a simple success message + if ( ( ( false === $email_error ) || ( false == $pass_error ) ) && ( ( true === $pass_changed ) || ( true === $email_changed ) ) ) { + $feedback[] = __( 'Your settings have been saved.', 'buddypress' ); + $feedback_type = 'success'; - // Redirect to prevent issues with browser back button - bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ) ); + // Some kind of errors occurred + } elseif ( ( ( false === $email_error ) || ( false === $pass_error ) ) && ( ( false === $pass_changed ) || ( false === $email_changed ) ) ) { + if ( bp_is_my_profile() ) { + $feedback['nochange'] = __( 'No changes were made to your account.', 'buddypress' ); + } else { + $feedback['nochange'] = __( 'No changes were made to this account.', 'buddypress' ); + } } + + // Set the feedback + bp_core_add_message( implode( '</p><p>', $feedback ), $feedback_type ); + + // Execute additional code + do_action( 'bp_core_general_settings_after_save' ); + + // Redirect to prevent issues with browser back button + bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ) ); } add_action( 'bp_actions', 'bp_settings_action_general' ); @@ -223,6 +223,10 @@ function bp_settings_action_notifications() { if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; + // Bail if no submit action + if ( ! isset( $_POST['submit'] ) ) + return; + // Bail if not in settings if ( ! bp_is_settings_component() || ! bp_is_current_action( 'notifications' ) ) return false; @@ -233,26 +237,24 @@ function bp_settings_action_notifications() { return; } - if ( isset( $_POST['submit'] ) ) { - check_admin_referer( 'bp_settings_notifications' ); + check_admin_referer( 'bp_settings_notifications' ); - if ( isset( $_POST['notifications'] ) ) { - foreach ( (array) $_POST['notifications'] as $key => $value ) { - bp_update_user_meta( (int) bp_displayed_user_id(), $key, $value ); - } + if ( isset( $_POST['notifications'] ) ) { + foreach ( (array) $_POST['notifications'] as $key => $value ) { + bp_update_user_meta( (int) bp_displayed_user_id(), $key, $value ); } + } - // Switch feedback for super admins - if ( bp_is_my_profile() ) { - bp_core_add_message( __( 'Your notification settings have been saved.', 'buddypress' ), 'success' ); - } else { - bp_core_add_message( __( "This user's notification settings have been saved.", 'buddypress' ), 'success' ); - } + // Switch feedback for super admins + if ( bp_is_my_profile() ) { + bp_core_add_message( __( 'Your notification settings have been saved.', 'buddypress' ), 'success' ); + } else { + bp_core_add_message( __( "This user's notification settings have been saved.", 'buddypress' ), 'success' ); + } - do_action( 'bp_core_notification_settings_after_save' ); + do_action( 'bp_core_notification_settings_after_save' ); - bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications/' ); - } + bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications/' ); } add_action( 'bp_actions', 'bp_settings_action_notifications' ); @@ -267,6 +269,10 @@ function bp_settings_action_capabilities() { if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; + // Bail if no submit action + if ( ! isset( $_POST['capabilities-submit'] ) ) + return; + // Bail if not in settings if ( ! bp_is_settings_component() || ! bp_is_current_action( 'capabilities' ) ) return false; @@ -277,30 +283,27 @@ function bp_settings_action_capabilities() { return; } - if ( isset( $_POST['capabilities-submit'] ) ) { + // Nonce check + check_admin_referer( 'capabilities' ); - // Nonce check - check_admin_referer( 'capabilities' ); + do_action( 'bp_settings_capabilities_before_save' ); - do_action( 'bp_settings_capabilities_before_save' ); + /** Spam **************************************************************/ - /** Spam **************************************************************/ + $is_spammer = !empty( $_POST['user-spammer'] ) ? true : false; - $is_spammer = !empty( $_POST['user-spammer'] ) ? true : false; - - if ( bp_is_user_spammer( bp_displayed_user_id() ) != $is_spammer ) { - $status = ( true == $is_spammer ) ? 'spam' : 'ham'; - bp_core_process_spammer_status( bp_displayed_user_id(), $status ); - do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $status ); - } + if ( bp_is_user_spammer( bp_displayed_user_id() ) != $is_spammer ) { + $status = ( true == $is_spammer ) ? 'spam' : 'ham'; + bp_core_process_spammer_status( bp_displayed_user_id(), $status ); + do_action( 'bp_core_action_set_spammer_status', bp_displayed_user_id(), $status ); + } - /** Other *************************************************************/ + /** Other *************************************************************/ - do_action( 'bp_settings_capabilities_after_save' ); + do_action( 'bp_settings_capabilities_after_save' ); - // Redirect to the root domain - bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/' ); - } + // Redirect to the root domain + bp_core_redirect( bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/' ); } add_action( 'bp_actions', 'bp_settings_action_capabilities' ); @@ -315,6 +318,10 @@ function bp_settings_action_delete_account() { if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; + // Bail if no submit action + if ( ! isset( $_POST['delete-account-understand'] ) ) + return; + // Bail if not in settings if ( ! bp_is_settings_component() || ! bp_is_current_action( 'delete-account' ) ) return false; @@ -325,25 +332,20 @@ function bp_settings_action_delete_account() { return; } - if ( isset( $_POST['delete-account-understand'] ) ) { - - // Nonce check - check_admin_referer( 'delete-account' ); + // Nonce check + check_admin_referer( 'delete-account' ); - // Get username now because it might be gone soon! - $username = bp_get_displayed_user_fullname(); + // Get username now because it might be gone soon! + $username = bp_get_displayed_user_fullname(); - // delete the users account - if ( bp_core_delete_account( bp_displayed_user_id() ) ) { + // delete the users account + if ( bp_core_delete_account( bp_displayed_user_id() ) ) { - // Add feedback ater deleting a user - bp_core_add_message( sprintf( __( '%s was successfully deleted.', 'buddypress' ), $username ), 'success' ); + // Add feedback ater deleting a user + bp_core_add_message( sprintf( __( '%s was successfully deleted.', 'buddypress' ), $username ), 'success' ); - // Redirect to the root domain - bp_core_redirect( bp_get_root_domain() ); - } + // Redirect to the root domain + bp_core_redirect( bp_get_root_domain() ); } } add_action( 'bp_actions', 'bp_settings_action_delete_account' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php index c17a35eab877d7050b5037de026685fb14367ef4..510fd7854b1f0798e1048e979ea41386b4327b1b 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-functions.php @@ -9,5 +9,3 @@ // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php index b1c7589d6ee620f3908b815077a4ab3dac3edbd6..68d50880955257f1179f7ccfadc43dda1b807a57 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-loader.php @@ -17,7 +17,7 @@ class BP_Settings_Component extends BP_Component { * * @since BuddyPress (1.5) */ - function __construct() { + public function __construct() { parent::start( 'settings', __( 'Settings', 'buddypress' ), @@ -30,16 +30,13 @@ class BP_Settings_Component extends BP_Component { * * @global BuddyPress $bp The one true BuddyPress instance */ - function includes() { - // Files to include - $includes = array( + public function includes() { + parent::includes( array( 'actions', 'screens', 'template', 'functions', - ); - - parent::includes( $includes ); + ) ); } /** @@ -50,25 +47,23 @@ class BP_Settings_Component extends BP_Component { * * @since BuddyPress (1.5) */ - function setup_globals() { + public function setup_globals() { // Define a slug, if necessary if ( !defined( 'BP_SETTINGS_SLUG' ) ) define( 'BP_SETTINGS_SLUG', $this->id ); // All globals for settings component. - $globals = array( + parent::setup_globals( array( 'slug' => BP_SETTINGS_SLUG, 'has_directory' => false, - ); - - parent::setup_globals( $globals ); + ) ); } /** * Setup BuddyBar navigation */ - function setup_nav() { + public function setup_nav() { // Define local variable $sub_nav = array(); @@ -84,12 +79,13 @@ class BP_Settings_Component extends BP_Component { ); // Determine user to use - if ( bp_displayed_user_domain() ) + if ( bp_displayed_user_domain() ) { $user_domain = bp_displayed_user_domain(); - elseif ( bp_loggedin_user_domain() ) + } elseif ( bp_loggedin_user_domain() ) { $user_domain = bp_loggedin_user_domain(); - else + } else { return; + } $settings_link = trailingslashit( $user_domain . $this->slug ); @@ -129,7 +125,7 @@ class BP_Settings_Component extends BP_Component { } // Add Delete Account nav item - if ( ! bp_disable_account_deletion() || bp_current_user_can( 'delete_users' ) ) { + if ( ( ! bp_disable_account_deletion() && bp_is_my_profile() ) || bp_current_user_can( 'delete_users' ) ) { $sub_nav[] = array( 'name' => __( 'Delete Account', 'buddypress' ), 'slug' => 'delete-account', @@ -137,7 +133,7 @@ class BP_Settings_Component extends BP_Component { 'parent_slug' => $this->slug, 'screen_function' => 'bp_settings_screen_delete_account', 'position' => 90, - 'user_has_access' => bp_is_my_profile() || !is_super_admin( bp_displayed_user_id() ) + 'user_has_access' => ! is_super_admin( bp_displayed_user_id() ) ); } @@ -146,11 +142,11 @@ class BP_Settings_Component extends BP_Component { /** * Set up the Toolbar - * - * @global BuddyPress $bp The one true BuddyPress instance */ - function setup_admin_bar() { - global $bp; + public function setup_admin_bar() { + + // The instance + $bp = buddypress(); // Prevent debug notices $wp_admin_nav = array(); @@ -202,9 +198,6 @@ class BP_Settings_Component extends BP_Component { } function bp_setup_settings() { - global $bp; - $bp->settings = new BP_Settings_Component(); + buddypress()->settings = new BP_Settings_Component(); } add_action( 'bp_setup_components', 'bp_setup_settings', 6 ); - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php index 96a15132ff9dbd1de45fa0443477418630118a28..1cc092e1fcb09305a943b281c56ae76cb363659f 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-screens.php @@ -79,5 +79,3 @@ function bp_settings_screen_capabilities() { // Load the template bp_core_load_template( apply_filters( 'bp_settings_screen_capabilities', 'members/single/settings/capabilities' ) ); } - -?> diff --git a/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php b/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php index 36f72e23932053d2cb30176f313f2f6e806b22e1..965e30164dea709e59c243bc55b1790a5c6187a6 100644 --- a/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php +++ b/wp-content/plugins/buddypress/bp-settings/bp-settings-template.php @@ -30,8 +30,7 @@ function bp_settings_slug() { * @since BuddyPress (1.5) */ function bp_get_settings_slug() { - global $bp; - return apply_filters( 'bp_get_settings_slug', $bp->settings->slug ); + return apply_filters( 'bp_get_settings_slug', buddypress()->settings->slug ); } /** @@ -54,8 +53,5 @@ function bp_settings_root_slug() { * @since BuddyPress (1.5) */ function bp_get_settings_root_slug() { - global $bp; - return apply_filters( 'bp_get_settings_root_slug', $bp->settings->root_slug ); + return apply_filters( 'bp_get_settings_root_slug', buddypress()->settings->root_slug ); } - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress-functions.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress-functions.php new file mode 100644 index 0000000000000000000000000000000000000000..4d75061fc5027b53b47b54a03d21b1d1b1a95916 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress-functions.php @@ -0,0 +1,1238 @@ +<?php + +/** + * Functions of BuddyPress's Legacy theme + * + * @package BuddyPress + * @subpackage BP_Theme_Compat + * @since BuddyPress (1.7) + */ + +// Exit if accessed directly +if ( !defined( 'ABSPATH' ) ) exit; + +/** Theme Setup ***************************************************************/ + +if ( !class_exists( 'BP_Legacy' ) ) : + +/** + * Loads BuddyPress Legacy Theme functionality + * + * This is not a real theme by WordPress standards, and is instead used as the + * fallback for any WordPress theme that does not have BuddyPress templates in it. + * + * To make your custom theme BuddyPress compatible and customize the templates, you + * can copy these files into your theme without needing to merge anything + * together; BuddyPress should safely handle the rest. + * + * See @link BP_Theme_Compat() for more. + * + * @since BuddyPress (1.7) + * + * @package BuddyPress + * @subpackage BP_Theme_Compat + */ +class BP_Legacy extends BP_Theme_Compat { + + /** Functions *************************************************************/ + + /** + * The main BuddyPress (Legacy) Loader + * + * @since BuddyPress (1.7) + * + * @uses BP_Legacy::setup_globals() + * @uses BP_Legacy::setup_actions() + */ + public function __construct() { + parent::start(); + } + + /** + * Component global variables + * + * You'll want to customize the values in here, so they match whatever your + * needs are. + * + * @since BuddyPress (1.7) + * @access private + */ + protected function setup_globals() { + $bp = buddypress(); + $this->id = 'legacy'; + $this->name = __( 'BuddyPress Legacy', 'buddypress' ); + $this->version = bp_get_version(); + $this->dir = trailingslashit( $bp->themes_dir . '/bp-legacy' ); + $this->url = trailingslashit( $bp->themes_url . '/bp-legacy' ); + } + + /** + * Setup the theme hooks + * + * @since BuddyPress (1.7) + * @access private + * + * @uses add_filter() To add various filters + * @uses add_action() To add various actions + */ + protected function setup_actions() { + + // Template Output + add_filter( 'bp_get_activity_action_pre_meta', array( $this, 'secondary_avatars' ), 10, 2 ); + + /** Scripts ***********************************************************/ + + add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS + add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS + add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization + add_action( 'bp_head', array( $this, 'head_scripts' ) ); // Output some extra JS in the <head> + + /** Body no-js Class ********************************************************/ + add_filter( 'body_class', array( $this, 'add_nojs_body_class' ), 20, 1 ); + + /** Buttons ***********************************************************/ + + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { + // Register buttons for the relevant component templates + // Friends button + if ( bp_is_active( 'friends' ) ) + add_action( 'bp_member_header_actions', 'bp_add_friend_button', 5 ); + + // Activity button + if ( bp_is_active( 'activity' ) ) + add_action( 'bp_member_header_actions', 'bp_send_public_message_button', 20 ); + + // Messages button + if ( bp_is_active( 'messages' ) ) + add_action( 'bp_member_header_actions', 'bp_send_private_message_button', 20 ); + + // Group buttons + if ( bp_is_active( 'groups' ) ) { + add_action( 'bp_group_header_actions', 'bp_group_join_button', 5 ); + add_action( 'bp_group_header_actions', 'bp_group_new_topic_button', 20 ); + add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); + } + + // Blog button + if ( bp_is_active( 'blogs' ) ) + add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); + + } + + /** Notices ***********************************************************/ + + if ( bp_is_active( 'messages' ) ) { + add_action( 'wp_footer', array( $this, 'sitewide_notices' ), 9999 ); + } + + /** Ajax **************************************************************/ + + $actions = array( + + // Directory filters + 'blogs_filter' => 'bp_legacy_theme_object_template_loader', + 'forums_filter' => 'bp_legacy_theme_object_template_loader', + 'groups_filter' => 'bp_legacy_theme_object_template_loader', + 'members_filter' => 'bp_legacy_theme_object_template_loader', + 'messages_filter' => 'bp_legacy_theme_messages_template_loader', + + // Friends + 'accept_friendship' => 'bp_legacy_theme_ajax_accept_friendship', + 'addremove_friend' => 'bp_legacy_theme_ajax_addremove_friend', + 'reject_friendship' => 'bp_legacy_theme_ajax_reject_friendship', + + // Activity + 'activity_get_older_updates' => 'bp_legacy_theme_activity_template_loader', + 'activity_mark_fav' => 'bp_legacy_theme_mark_activity_favorite', + 'activity_mark_unfav' => 'bp_legacy_theme_unmark_activity_favorite', + 'activity_widget_filter' => 'bp_legacy_theme_activity_template_loader', + 'delete_activity' => 'bp_legacy_theme_delete_activity', + 'delete_activity_comment' => 'bp_legacy_theme_delete_activity_comment', + 'get_single_activity_content' => 'bp_legacy_theme_get_single_activity_content', + 'new_activity_comment' => 'bp_legacy_theme_new_activity_comment', + 'post_update' => 'bp_legacy_theme_post_update', + 'bp_spam_activity' => 'bp_legacy_theme_spam_activity', + 'bp_spam_activity_comment' => 'bp_legacy_theme_spam_activity', + + // Groups + 'groups_invite_user' => 'bp_legacy_theme_ajax_invite_user', + 'joinleave_group' => 'bp_legacy_theme_ajax_joinleave_group', + + // Messages + 'messages_autocomplete_results' => 'bp_legacy_theme_ajax_messages_autocomplete_results', + 'messages_close_notice' => 'bp_legacy_theme_ajax_close_notice', + 'messages_delete' => 'bp_legacy_theme_ajax_messages_delete', + 'messages_markread' => 'bp_legacy_theme_ajax_message_markread', + 'messages_markunread' => 'bp_legacy_theme_ajax_message_markunread', + 'messages_send_reply' => 'bp_legacy_theme_ajax_messages_send_reply', + ); + + /** + * Register all of these AJAX handlers + * + * The "wp_ajax_" action is used for logged in users, and "wp_ajax_nopriv_" + * executes for users that aren't logged in. This is for backpat with BP <1.6. + */ + foreach( $actions as $name => $function ) { + add_action( 'wp_ajax_' . $name, $function ); + add_action( 'wp_ajax_nopriv_' . $name, $function ); + } + + add_filter( 'bp_ajax_querystring', 'bp_legacy_theme_ajax_querystring', 10, 2 ); + + /** Override **********************************************************/ + + do_action_ref_array( 'bp_theme_compat_actions', array( &$this ) ); + } + + /** + * Load the theme CSS + * + * @since BuddyPress (1.7) + * + * @uses wp_enqueue_style() To enqueue the styles + */ + public function enqueue_styles() { + + // LTR or RTL + $file = is_rtl() ? 'css/buddypress-rtl.css' : 'css/buddypress.css'; + + // Check child theme + if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) { + $location = trailingslashit( get_stylesheet_directory_uri() ); + $handle = 'bp-child-css'; + + // Check parent theme + } elseif ( file_exists( trailingslashit( get_template_directory() ) . $file ) ) { + $location = trailingslashit( get_template_directory_uri() ); + $handle = 'bp-parent-css'; + + // BuddyPress Theme Compatibility + } else { + $location = trailingslashit( $this->url ); + $handle = 'bp-legacy-css'; + } + + // Enqueue the BuddyPress styling + wp_enqueue_style( $handle, $location . $file, array(), $this->version, 'screen' ); + } + + /** + * Enqueue the required Javascript files + * + * @since BuddyPress (1.7) + */ + public function enqueue_scripts() { + + // LTR or RTL + $file = 'js/buddypress.js'; + + // Check child theme + if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) { + $location = trailingslashit( get_stylesheet_directory_uri() ); + $handle = 'bp-child-js'; + + // Check parent theme + } elseif ( file_exists( trailingslashit( get_template_directory() ) . $file ) ) { + $location = trailingslashit( get_template_directory_uri() ); + $handle = 'bp-parent-js'; + + // BuddyPress Theme Compatibility + } else { + $location = trailingslashit( $this->url ); + $handle = 'bp-legacy-js'; + } + + // Enqueue the global JS - Ajax will not work without it + wp_enqueue_script( $handle, $location . $file, array( 'jquery' ), $this->version ); + + // Add words that we need to use in JS to the end of the page so they can be translated and still used. + $params = array( + 'my_favs' => __( 'My Favorites', 'buddypress' ), + 'accepted' => __( 'Accepted', 'buddypress' ), + 'rejected' => __( 'Rejected', 'buddypress' ), + 'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ), + 'show_all' => __( 'Show all', 'buddypress' ), + 'comments' => __( 'comments', 'buddypress' ), + 'close' => __( 'Close', 'buddypress' ), + 'view' => __( 'View', 'buddypress' ), + 'mark_as_fav' => __( 'Favorite', 'buddypress' ), + 'remove_fav' => __( 'Remove Favorite', 'buddypress' ) + ); + wp_localize_script( $handle, 'BP_DTheme', $params ); + + // Maybe enqueue comment reply JS + if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) ) { + wp_enqueue_script( 'comment-reply' ); + } + } + + /** + * Put some scripts in the header, like AJAX url for wp-lists + * + * @since BuddyPress (1.7) + */ + public function head_scripts() { + ?> + + <script type="text/javascript" charset="utf-8"> + /* <![CDATA[ */ + var ajaxurl = '<?php echo bp_core_ajax_url(); ?>'; + /* ]]> */ + </script> + + <?php + } + + /** + * Adds the no-js class to the body tag. + * + * This function ensures that the <body> element will have the 'no-js' class by default. If you're + * using JavaScript for some visual functionality in your theme, and you want to provide noscript + * support, apply those styles to body.no-js. + * + * The no-js class is removed by the JavaScript created in buddypress.js. + * + * @since BuddyPress (1.7) + */ + public function add_nojs_body_class( $classes ) { + if ( ! in_array( 'no-js', $classes ) ) + $classes[] = 'no-js'; + + return array_unique( $classes ); + } + + /** + * Load localizations for topic script + * + * These localizations require information that may not be loaded even by init. + * + * @since BuddyPress (1.7) + */ + public function localize_scripts() { + } + + /** + * Outputs sitewide notices markup in the footer. + * + * @since BuddyPress (1.7) + * + * @see https://buddypress.trac.wordpress.org/ticket/4802 + */ + public function sitewide_notices() { + // Do not show notices if user is not logged in + if ( ! is_user_logged_in() ) + return; + + // add a class to determine if the admin bar is on or not + $class = did_action( 'admin_bar_menu' ) ? 'admin-bar-on' : 'admin-bar-off'; + + echo '<div id="sitewide-notice" class="' . $class . '">'; + bp_message_get_notices(); + echo '</div>'; + } + + /** + * Add secondary avatar image to this activity stream's record, if supported. + * + * @since BuddyPress (1.7) + * + * @param string $action The text of this activity + * @param BP_Activity_Activity $activity Activity object + * @package BuddyPress Theme + * @return string + */ + function secondary_avatars( $action, $activity ) { + switch ( $activity->component ) { + case 'groups' : + case 'friends' : + // Only insert avatar if one exists + if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) { + $reverse_content = strrev( $action ); + $position = strpos( $reverse_content, 'a<' ); + $action = substr_replace( $action, $secondary_avatar, -$position - 2, 0 ); + } + break; + } + + return $action; + } +} +new BP_Legacy(); +endif; + +/** + * This function looks scarier than it actually is. :) + * Each object loop (activity/members/groups/blogs/forums) contains default + * parameters to show specific information based on the page we are currently + * looking at. + * + * The following function will take into account any cookies set in the JS and + * allow us to override the parameters sent. That way we can change the results + * returned without reloading the page. + * + * By using cookies we can also make sure that user settings are retained + * across page loads. + * + * @return string Query string for the component loops + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_querystring( $query_string, $object ) { + if ( empty( $object ) ) + return ''; + + // Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts + if ( ! empty( $_POST['cookie'] ) ) { + $_BP_COOKIE = wp_parse_args( str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) ); + } else { + $_BP_COOKIE = &$_COOKIE; + } + + $qs = array(); + + /** + * Check if any cookie values are set. If there are then override the + * default params passed to the template loop. + */ + + // Activity stream filtering on action + if ( ! empty( $_BP_COOKIE['bp-' . $object . '-filter'] ) && '-1' != $_BP_COOKIE['bp-' . $object . '-filter'] ) { + $qs[] = 'type=' . $_BP_COOKIE['bp-' . $object . '-filter']; + $qs[] = 'action=' . $_BP_COOKIE['bp-' . $object . '-filter']; + } + + if ( ! empty( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) { + if ( 'personal' == $_BP_COOKIE['bp-' . $object . '-scope'] ) { + $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); + $qs[] = 'user_id=' . $user_id; + } + + // Activity stream scope only on activity directory. + if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && ! bp_displayed_user_id() && ! bp_is_single_item() ) + $qs[] = 'scope=' . $_BP_COOKIE['bp-' . $object . '-scope']; + } + + // If page and search_terms have been passed via the AJAX post request, use those. + if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] ) + $qs[] = 'page=' . $_POST['page']; + + $object_search_text = bp_get_search_default_text( $object ); + if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] ) + $qs[] = 'search_terms=' . $_POST['search_terms']; + + // Now pass the querystring to override default values. + $query_string = empty( $qs ) ? '' : join( '&', (array) $qs ); + + $object_filter = ''; + if ( isset( $_BP_COOKIE['bp-' . $object . '-filter'] ) ) + $object_filter = $_BP_COOKIE['bp-' . $object . '-filter']; + + $object_scope = ''; + if ( isset( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) + $object_scope = $_BP_COOKIE['bp-' . $object . '-scope']; + + $object_page = ''; + if ( isset( $_BP_COOKIE['bp-' . $object . '-page'] ) ) + $object_page = $_BP_COOKIE['bp-' . $object . '-page']; + + $object_search_terms = ''; + if ( isset( $_BP_COOKIE['bp-' . $object . '-search-terms'] ) ) + $object_search_terms = $_BP_COOKIE['bp-' . $object . '-search-terms']; + + $object_extras = ''; + if ( isset( $_BP_COOKIE['bp-' . $object . '-extras'] ) ) + $object_extras = $_BP_COOKIE['bp-' . $object . '-extras']; + + return apply_filters( 'bp_legacy_theme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras ); +} + +/** + * Load the template loop for the current object. + * + * @return string Prints template loop for the specified object + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_object_template_loader() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + /** + * AJAX requests happen too early to be seen by bp_update_is_directory() + * so we do it manually here to ensure templates load with the correct + * context. Without this check, templates will load the 'single' version + * of themselves rather than the directory version. + */ + + if ( ! bp_current_action() ) + bp_update_is_directory( true, bp_current_component() ); + + // Sanitize the post object + $object = esc_attr( $_POST['object'] ); + + // Locate the object template + bp_get_template_part( "$object/$object-loop" ); + exit(); +} + +/** + * Load messages template loop when searched on the private message page + * + * @return string Prints template loop for the Messages component + * @since BuddyPress (1.6) + */ +function bp_legacy_theme_messages_template_loader() { + bp_get_template_part( 'members/single/messages/messages-loop' ); + exit(); +} + +/** + * Load the activity loop template when activity is requested via AJAX, + * + * @return string JSON object containing 'contents' (output of the template loop + * for the Activity component) and 'feed_url' (URL to the relevant RSS feed). + * + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_activity_template_loader() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + $scope = ''; + if ( ! empty( $_POST['scope'] ) ) + $scope = $_POST['scope']; + + // We need to calculate and return the feed URL for each scope + switch ( $scope ) { + case 'friends': + $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/friends/feed/'; + break; + case 'groups': + $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/groups/feed/'; + break; + case 'favorites': + $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/feed/'; + break; + case 'mentions': + $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/feed/'; + bp_activity_clear_new_mentions( bp_loggedin_user_id() ); + break; + default: + $feed_url = home_url( bp_get_activity_root_slug() . '/feed/' ); + break; + } + + // Buffer the loop in the template to a var for JS to spit out. + ob_start(); + bp_get_template_part( 'activity/activity-loop' ); + $result['contents'] = ob_get_contents(); + $result['feed_url'] = apply_filters( 'bp_legacy_theme_activity_feed_url', $feed_url, $scope ); + ob_end_clean(); + + exit( json_encode( $result ) ); +} + +/** + * Processes Activity updates received via a POST request. + * + * @return string HTML + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_post_update() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + // Check the nonce + check_admin_referer( 'post_update', '_wpnonce_post_update' ); + + if ( ! is_user_logged_in() ) + exit( '-1' ); + + if ( empty( $_POST['content'] ) ) + exit( '-1<div id="message" class="error"><p>' . __( 'Please enter some content to post.', 'buddypress' ) . '</p></div>' ); + + $activity_id = 0; + if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) { + $activity_id = bp_activity_post_update( array( 'content' => $_POST['content'] ) ); + + } elseif ( $_POST['object'] == 'groups' ) { + if ( ! empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) ) + $activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) ); + + } else { + $activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] ); + } + + if ( empty( $activity_id ) ) + exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'buddypress' ) . '</p></div>' ); + + if ( bp_has_activities ( 'include=' . $activity_id ) ) { + while ( bp_activities() ) { + bp_the_activity(); + bp_get_template_part( 'activity/entry' ); + } + } + + exit; +} + +/** + * Posts new Activity comments received via a POST request. + * + * @global BP_Activity_Template $activities_template + * @return string HTML + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_new_activity_comment() { + global $activities_template; + + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + // Check the nonce + check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' ); + + if ( ! is_user_logged_in() ) + exit( '-1' ); + + if ( empty( $_POST['content'] ) ) + exit( '-1<div id="message" class="error"><p>' . __( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>' ); + + if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || ! is_numeric( $_POST['form_id'] ) || ! is_numeric( $_POST['comment_id'] ) ) + exit( '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>' ); + + $comment_id = bp_activity_new_comment( array( + 'activity_id' => $_POST['form_id'], + 'content' => $_POST['content'], + 'parent_id' => $_POST['comment_id'], + ) ); + + if ( ! $comment_id ) + exit( '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>' ); + + // Load the new activity item into the $activities_template global + bp_has_activities( 'display_comments=stream&hide_spam=false&include=' . $comment_id ); + + // Swap the current comment with the activity item we just loaded + if ( isset( $activities_template->activities[0] ) ) { + $activities_template->activity = new stdClass(); + $activities_template->activity->id = $activities_template->activities[0]->item_id; + $activities_template->activity->current_comment = $activities_template->activities[0]; + } + + // get activity comment template part + bp_get_template_part( 'activity/comment' ); + + unset( $activities_template ); + exit; +} + +/** + * Deletes an Activity item received via a POST request. + * + * @return mixed String on error, void on success + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_delete_activity() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + // Check the nonce + check_admin_referer( 'bp_activity_delete_link' ); + + if ( ! is_user_logged_in() ) + exit( '-1' ); + + if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) ) + exit( '-1' ); + + $activity = new BP_Activity_Activity( (int) $_POST['id'] ); + + // Check access + if ( ! bp_activity_user_can_delete( $activity ) ) + exit( '-1' ); + + // Call the action before the delete so plugins can still fetch information about it + do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id ); + + if ( ! bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) ) + exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' ); + + do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id ); + exit; +} + +/** + * Deletes an Activity comment received via a POST request + * + * @return mixed String on error, void on success + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_delete_activity_comment() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + // Check the nonce + check_admin_referer( 'bp_activity_delete_link' ); + + if ( ! is_user_logged_in() ) + exit( '-1' ); + + $comment = new BP_Activity_Activity( $_POST['id'] ); + + // Check access + if ( ! bp_current_user_can( 'bp_moderate' ) && $comment->user_id != bp_loggedin_user_id() ) + exit( '-1' ); + + if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) ) + exit( '-1' ); + + // Call the action before the delete so plugins can still fetch information about it + do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id ); + + if ( ! bp_activity_delete_comment( $comment->item_id, $comment->id ) ) + exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' ); + + do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id ); + exit; +} + +/** + * AJAX spam an activity item or comment + * + * @global BuddyPress $bp The one true BuddyPress instance + * @return mixed String on error, void on success + * @since BuddyPress (1.6) + */ +function bp_legacy_theme_spam_activity() { + global $bp; + + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + // Check that user is logged in, Activity Streams are enabled, and Akismet is present. + if ( ! is_user_logged_in() || ! bp_is_active( 'activity' ) || empty( $bp->activity->akismet ) ) + exit( '-1' ); + + // Check an item ID was passed + if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) ) + exit( '-1' ); + + // Is the current user allowed to spam items? + if ( ! bp_activity_user_can_mark_spam() ) + exit( '-1' ); + + // Load up the activity item + $activity = new BP_Activity_Activity( (int) $_POST['id'] ); + if ( empty( $activity->component ) ) + exit( '-1' ); + + // Check nonce + check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id ); + + // Call an action before the spamming so plugins can modify things if they want to + do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity ); + + // Mark as spam + bp_activity_mark_as_spam( $activity ); + $activity->save(); + + do_action( 'bp_activity_action_spam_activity', $activity->id, $activity->user_id ); + exit; +} + +/** + * Mark an activity as a favourite via a POST request. + * + * @return string HTML + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_mark_activity_favorite() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + if ( bp_activity_add_user_favorite( $_POST['id'] ) ) + _e( 'Remove Favorite', 'buddypress' ); + else + _e( 'Favorite', 'buddypress' ); + + exit; +} + +/** + * Un-favourite an activity via a POST request. + * + * @return string HTML + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_unmark_activity_favorite() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + if ( bp_activity_remove_user_favorite( $_POST['id'] ) ) + _e( 'Favorite', 'buddypress' ); + else + _e( 'Remove Favorite', 'buddypress' ); + + exit; +} + +/** + * Fetches full an activity's full, non-excerpted content via a POST request. + * Used for the 'Read More' link on long activity items. + * + * @return string HTML + * @since BuddyPress (1.5) + */ +function bp_legacy_theme_get_single_activity_content() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + $activity_array = bp_activity_get_specific( array( + 'activity_ids' => $_POST['activity_id'], + 'display_comments' => 'stream' + ) ); + + $activity = ! empty( $activity_array['activities'][0] ) ? $activity_array['activities'][0] : false; + + if ( empty( $activity ) ) + exit; // @todo: error? + + do_action_ref_array( 'bp_legacy_theme_get_single_activity_content', array( &$activity ) ); + + // Activity content retrieved through AJAX should run through normal filters, but not be truncated + remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); + $content = apply_filters( 'bp_get_activity_content_body', $activity->content ); + + exit( $content ); +} + +/** + * Invites a friend to join a group via a POST request. + * + * @return unknown + * @since BuddyPress (1.2) + * @todo Audit return types + */ +function bp_legacy_theme_ajax_invite_user() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + check_ajax_referer( 'groups_invite_uninvite_user' ); + + if ( ! $_POST['friend_id'] || ! $_POST['friend_action'] || ! $_POST['group_id'] ) + return; + + if ( ! bp_groups_user_can_send_invites( $_POST['group_id'] ) ) + return; + + if ( ! friends_check_friendship( bp_loggedin_user_id(), $_POST['friend_id'] ) ) + return; + + if ( 'invite' == $_POST['friend_action'] ) { + if ( ! groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) ) + return; + + $user = new BP_Core_User( $_POST['friend_id'] ); + + echo '<li id="uid-' . $user->id . '">'; + echo $user->avatar_thumb; + echo '<h4>' . $user->user_link . '</h4>'; + echo '<span class="activity">' . esc_attr( $user->last_active ) . '</span>'; + echo '<div class="action"> + <a class="button remove" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . $_POST['group_id'] . '/invites/remove/' . $user->id, 'groups_invite_uninvite_user' ) . '" id="uid-' . esc_attr( $user->id ) . '">' . __( 'Remove Invite', 'buddypress' ) . '</a> + </div>'; + echo '</li>'; + exit; + + } elseif ( 'uninvite' == $_POST['friend_action'] ) { + if ( ! groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ) ) + return; + + exit; + + } else { + return; + } +} + +/** + * Friend/un-friend a user via a POST request. + * + * @return string HTML + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_addremove_friend() { + + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + // Cast fid as an integer + $friend_id = (int) $_POST['fid']; + + // Trying to cancel friendship + if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { + check_ajax_referer( 'friends_remove_friend' ); + + if ( ! friends_remove_friend( bp_loggedin_user_id(), $friend_id ) ) { + echo __( 'Friendship could not be canceled.', 'buddypress' ); + } else { + echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; + } + + // Trying to request friendship + } elseif ( 'not_friends' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { + check_ajax_referer( 'friends_add_friend' ); + + if ( ! friends_add_friend( bp_loggedin_user_id(), $friend_id ) ) { + echo __(' Friendship could not be requested.', 'buddypress' ); + } else { + echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="remove" rel="remove" title="' . __( 'Cancel Friendship Request', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $friend_id . '/', 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>'; + } + + // Trying to cancel pending request + } elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { + check_ajax_referer( 'friends_withdraw_friendship' ); + + if ( friends_withdraw_friendship( bp_loggedin_user_id(), $friend_id ) ) { + echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; + } else { + echo __("Friendship request could not be cancelled.", 'buddypress'); + } + + // Request already pending + } else { + echo __( 'Request Pending', 'buddypress' ); + } + + exit; +} + +/** + * Accept a user friendship request via a POST request. + * + * @return mixed String on error, void on success + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_accept_friendship() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + check_admin_referer( 'friends_accept_friendship' ); + + if ( ! friends_accept_friendship( (int) $_POST['id'] ) ) + echo "-1<div id='message' class='error'><p>" . __( 'There was a problem accepting that request. Please try again.', 'buddypress' ) . '</p></div>'; + + exit; +} + +/** + * Reject a user friendship request via a POST request. + * + * @return mixed String on error, void on success + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_reject_friendship() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + check_admin_referer( 'friends_reject_friendship' ); + + if ( ! friends_reject_friendship( (int) $_POST['id'] ) ) + echo "-1<div id='message' class='error'><p>" . __( 'There was a problem rejecting that request. Please try again.', 'buddypress' ) . '</p></div>'; + + exit; +} + +/** + * Join or leave a group when clicking the "join/leave" button via a POST request. + * + * @return string HTML + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_joinleave_group() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + // Cast gid as integer + $group_id = (int) $_POST['gid']; + + if ( groups_is_user_banned( bp_loggedin_user_id(), $group_id ) ) + return; + + if ( ! $group = groups_get_group( array( 'group_id' => $group_id ) ) ) + return; + + if ( ! groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) { + if ( 'public' == $group->status ) { + check_ajax_referer( 'groups_join_group' ); + + if ( ! groups_join_group( $group->id ) ) { + _e( 'Error joining group', 'buddypress' ); + } else { + echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>'; + } + + } elseif ( 'private' == $group->status ) { + check_ajax_referer( 'groups_request_membership' ); + + if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) { + _e( 'Error requesting membership', 'buddypress' ); + } else { + echo '<a id="group-' . esc_attr( $group->id ) . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Membership Requested', 'buddypress' ) . '</a>'; + } + } + + } else { + check_ajax_referer( 'groups_leave_group' ); + + if ( ! groups_leave_group( $group->id ) ) { + _e( 'Error leaving group', 'buddypress' ); + } elseif ( 'public' == $group->status ) { + echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>'; + } elseif ( 'private' == $group->status ) { + echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>'; + } + } + + exit; +} + +/** + * Close and keep closed site wide notices from an admin in the sidebar, via a POST request. + * + * @return mixed String on error, void on success + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_close_notice() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + if ( ! isset( $_POST['notice_id'] ) ) { + echo "-1<div id='message' class='error'><p>" . __( 'There was a problem closing the notice.', 'buddypress' ) . '</p></div>'; + + } else { + $user_id = get_current_user_id(); + $notice_ids = bp_get_user_meta( $user_id, 'closed_notices', true ); + $notice_ids[] = (int) $_POST['notice_id']; + + bp_update_user_meta( $user_id, 'closed_notices', $notice_ids ); + } + + exit; +} + +/** + * Send a private message reply to a thread via a POST request. + * + * @return string HTML + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_messages_send_reply() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + check_ajax_referer( 'messages_send_message' ); + + $result = messages_new_message( array( 'thread_id' => (int) $_REQUEST['thread_id'], 'content' => $_REQUEST['content'] ) ); + + if ( !empty( $result ) ) { + + // Get the zebra line classes correct on ajax requests + global $thread_template; + + bp_thread_has_messages( array( 'thread_id' => (int) $_REQUEST['thread_id'] ) ); + + if ( $thread_template->message_count % 2 == 1 ) { + $class = 'odd'; + } else { + $class = 'even alt'; + } ?> + + <div class="message-box new-message <?php echo $class; ?>"> + <div class="message-metadata"> + <?php do_action( 'bp_before_message_meta' ); ?> + <?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?> + + <strong><a href="<?php echo bp_loggedin_user_domain(); ?>"><?php bp_loggedin_user_fullname(); ?></a> <span class="activity"><?php printf( __( 'Sent %s', 'buddypress' ), bp_core_time_since( bp_core_current_time() ) ); ?></span></strong> + + <?php do_action( 'bp_after_message_meta' ); ?> + </div> + + <?php do_action( 'bp_before_message_content' ); ?> + + <div class="message-content"> + <?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ); ?> + </div> + + <?php do_action( 'bp_after_message_content' ); ?> + + <div class="clear"></div> + </div> + <?php + } else { + echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'buddypress' ) . '</p></div>'; + } + + exit; +} + +/** + * Mark a private message as unread in your inbox via a POST request. + * + * @return mixed String on error, void on success + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_message_markunread() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + if ( ! isset($_POST['thread_ids']) ) { + echo "-1<div id='message' class='error'><p>" . __( 'There was a problem marking messages as unread.', 'buddypress' ) . '</p></div>'; + + } else { + $thread_ids = explode( ',', $_POST['thread_ids'] ); + + for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { + BP_Messages_Thread::mark_as_unread( (int) $thread_ids[$i] ); + } + } + + exit; +} + +/** + * Mark a private message as read in your inbox via a POST request. + * + * @return mixed String on error, void on success + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_message_markread() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + if ( ! isset($_POST['thread_ids']) ) { + echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as read.', 'buddypress' ) . '</p></div>'; + + } else { + $thread_ids = explode( ',', $_POST['thread_ids'] ); + + for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { + BP_Messages_Thread::mark_as_read( (int) $thread_ids[$i] ); + } + } + + exit; +} + +/** + * Delete a private message(s) in your inbox via a POST request. + * + * @return string HTML + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_messages_delete() { + // Bail if not a POST action + if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) + return; + + if ( ! isset($_POST['thread_ids']) ) { + echo "-1<div id='message' class='error'><p>" . __( 'There was a problem deleting messages.', 'buddypress' ) . '</p></div>'; + + } else { + $thread_ids = explode( ',', $_POST['thread_ids'] ); + + for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { + BP_Messages_Thread::delete( (int) $thread_ids[$i] ); + } + + _e( 'Messages deleted.', 'buddypress' ); + } + + exit; +} + +/** + * AJAX handler for autocomplete. Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined. + * + * @global BuddyPress $bp The one true BuddyPress instance + * @return string HTML + * @since BuddyPress (1.2) + */ +function bp_legacy_theme_ajax_messages_autocomplete_results() { + + // Include everyone in the autocomplete, or just friends? + if ( bp_is_current_component( bp_get_messages_slug() ) ) + $autocomplete_all = buddypress()->messages->autocomplete_all; + + $pag_page = 1; + $limit = (int) $_GET['limit'] ? $_GET['limit'] : apply_filters( 'bp_autocomplete_max_results', 10 ); + + // Get the user ids based on the search terms + if ( ! empty( $autocomplete_all ) ) { + $users = BP_Core_User::search_users( $_GET['q'], $limit, $pag_page ); + + if ( ! empty( $users['users'] ) ) { + // Build an array with the correct format + $user_ids = array(); + foreach( $users['users'] as $user ) { + if ( $user->id != bp_loggedin_user_id() ) { + $user_ids[] = $user->id; + } + } + + $user_ids = apply_filters( 'bp_core_autocomplete_ids', $user_ids, $_GET['q'], $limit ); + } + + } else { + if ( bp_is_active( 'friends' ) ) { + $users = friends_search_friends( $_GET['q'], bp_loggedin_user_id(), $limit, 1 ); + + // Keeping the bp_friends_autocomplete_list filter for backward compatibility + $users = apply_filters( 'bp_friends_autocomplete_list', $users, $_GET['q'], $limit ); + + if ( ! empty( $users['friends'] ) ) { + $user_ids = apply_filters( 'bp_friends_autocomplete_ids', $users['friends'], $_GET['q'], $limit ); + } + } + } + + if ( ! empty( $user_ids ) ) { + foreach ( $user_ids as $user_id ) { + $ud = get_userdata( $user_id ); + if ( ! $ud ) { + continue; + } + + if ( bp_is_username_compatibility_mode() ) { + $username = $ud->user_login; + } else { + $username = $ud->user_nicename; + } + + // Note that the final line break acts as a delimiter for the + // autocomplete javascript and thus should not be removed + echo '<span id="link-' . esc_attr( $username ) . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15, 'alt' => $ud->display_name ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . esc_html( $username ) . ')' . "\n"; + } + } + + exit; +} diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/activity-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/activity-loop.php new file mode 100644 index 0000000000000000000000000000000000000000..8680b86fe327d4b5909978833eda2467d69db41f --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/activity-loop.php @@ -0,0 +1,53 @@ +<?php do_action( 'bp_before_activity_loop' ); ?> + +<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) ) ) : ?> + + <?php /* Show pagination if JS is not enabled, since the "Load More" link will do nothing */ ?> + <noscript> + <div class="pagination"> + <div class="pag-count"><?php bp_activity_pagination_count(); ?></div> + <div class="pagination-links"><?php bp_activity_pagination_links(); ?></div> + </div> + </noscript> + + <?php if ( empty( $_POST['page'] ) ) : ?> + + <ul id="activity-stream" class="activity-list item-list"> + + <?php endif; ?> + + <?php while ( bp_activities() ) : bp_the_activity(); ?> + + <?php bp_get_template_part( 'activity/entry' ); ?> + + <?php endwhile; ?> + + <?php if ( bp_activity_has_more_items() ) : ?> + + <li class="load-more"> + <a href="#more"><?php _e( 'Load More', 'buddypress' ); ?></a> + </li> + + <?php endif; ?> + + <?php if ( empty( $_POST['page'] ) ) : ?> + + </ul> + + <?php endif; ?> + +<?php else : ?> + + <div id="message" class="info"> + <p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ); ?></p> + </div> + +<?php endif; ?> + +<?php do_action( 'bp_after_activity_loop' ); ?> + +<form action="" name="activity-loop-form" id="activity-loop-form" method="post"> + + <?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ); ?> + +</form> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/comment.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/comment.php new file mode 100644 index 0000000000000000000000000000000000000000..d8bf0f8e67282c91521f29693a2807d698627f54 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/comment.php @@ -0,0 +1,54 @@ +<?php + +/** + * BuddyPress - Activity Stream Comment + * + * This template is used by bp_activity_comments() functions to show + * each activity. + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<?php do_action( 'bp_before_activity_comment' ); ?> + +<li id="acomment-<?php bp_activity_comment_id(); ?>"> + <div class="acomment-avatar"> + <a href="<?php bp_activity_comment_user_link(); ?>"> + <?php bp_activity_avatar( 'type=thumb&user_id=' . bp_get_activity_comment_user_id() ); ?> + </a> + </div> + + <div class="acomment-meta"> + <?php + /* translators: 1: user profile link, 2: user name, 3: activity permalink, 4: activity timestamp */ + printf( __( '<a href="%1$s">%2$s</a> replied <a href="%3$s" class="activity-time-since"><span class="time-since">%4$s</span></a>', 'buddypress' ), bp_get_activity_comment_user_link(), bp_get_activity_comment_name(), bp_get_activity_thread_permalink(), bp_get_activity_comment_date_recorded() ); + ?> + </div> + + <div class="acomment-content"><?php bp_activity_comment_content(); ?></div> + + <div class="acomment-options"> + + <?php if ( is_user_logged_in() && bp_activity_can_comment_reply( bp_activity_current_comment() ) ) : ?> + + <a href="#acomment-<?php bp_activity_comment_id(); ?>" class="acomment-reply bp-primary-action" id="acomment-reply-<?php bp_activity_id(); ?>-from-<?php bp_activity_comment_id(); ?>"><?php _e( 'Reply', 'buddypress' ); ?></a> + + <?php endif; ?> + + <?php if ( bp_activity_user_can_delete() ) : ?> + + <a href="<?php bp_activity_comment_delete_link(); ?>" class="delete acomment-delete confirm bp-secondary-action" rel="nofollow"><?php _e( 'Delete', 'buddypress' ); ?></a> + + <?php endif; ?> + + <?php do_action( 'bp_activity_comment_options' ); ?> + + </div> + + <?php bp_activity_recurse_comments( bp_activity_current_comment() ); ?> +</li> + +<?php do_action( 'bp_after_activity_comment' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/entry.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/entry.php new file mode 100644 index 0000000000000000000000000000000000000000..b197fbd39e9ad5ddd10f903e0945d90de8630441 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/entry.php @@ -0,0 +1,122 @@ +<?php + +/** + * BuddyPress - Activity Stream (Single Item) + * + * This template is used by activity-loop.php and AJAX functions to show + * each activity. + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<?php do_action( 'bp_before_activity_entry' ); ?> + +<li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>"> + <div class="activity-avatar"> + <a href="<?php bp_activity_user_link(); ?>"> + + <?php bp_activity_avatar(); ?> + + </a> + </div> + + <div class="activity-content"> + + <div class="activity-header"> + + <?php bp_activity_action(); ?> + + </div> + + <?php if ( bp_activity_has_content() ) : ?> + + <div class="activity-inner"> + + <?php bp_activity_content_body(); ?> + + </div> + + <?php endif; ?> + + <?php do_action( 'bp_activity_entry_content' ); ?> + + <div class="activity-meta"> + + <?php if ( bp_get_activity_type() == 'activity_comment' ) : ?> + + <a href="<?php bp_activity_thread_permalink(); ?>" class="button view bp-secondary-action" title="<?php _e( 'View Conversation', 'buddypress' ); ?>"><?php _e( 'View Conversation', 'buddypress' ); ?></a> + + <?php endif; ?> + + <?php if ( is_user_logged_in() ) : ?> + + <?php if ( bp_activity_can_comment() ) : ?> + + <a href="<?php bp_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment <span>%s</span>', 'buddypress' ), bp_activity_get_comment_count() ); ?></a> + + <?php endif; ?> + + <?php if ( bp_activity_can_favorite() ) : ?> + + <?php if ( !bp_get_activity_is_favorite() ) : ?> + + <a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action" title="<?php esc_attr_e( 'Mark as Favorite', 'buddypress' ); ?>"><?php _e( 'Favorite', 'buddypress' ); ?></a> + + <?php else : ?> + + <a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action" title="<?php esc_attr_e( 'Remove Favorite', 'buddypress' ); ?>"><?php _e( 'Remove Favorite', 'buddypress' ); ?></a> + + <?php endif; ?> + + <?php endif; ?> + + <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?> + + <?php do_action( 'bp_activity_entry_meta' ); ?> + + <?php endif; ?> + + </div> + + </div> + + <?php do_action( 'bp_before_activity_entry_comments' ); ?> + + <?php if ( ( is_user_logged_in() && bp_activity_can_comment() ) || bp_activity_get_comment_count() ) : ?> + + <div class="activity-comments"> + + <?php bp_activity_comments(); ?> + + <?php if ( is_user_logged_in() ) : ?> + + <form action="<?php bp_activity_comment_form_action(); ?>" method="post" id="ac-form-<?php bp_activity_id(); ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display(); ?>> + <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div> + <div class="ac-reply-content"> + <div class="ac-textarea"> + <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea> + </div> + <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?>" /> <a href="#" class="ac-reply-cancel"><?php _e( 'Cancel', 'buddypress' ); ?></a> + <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" /> + </div> + + <?php do_action( 'bp_activity_entry_comments' ); ?> + + <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?> + + </form> + + <?php endif; ?> + + </div> + + <?php endif; ?> + + <?php do_action( 'bp_after_activity_entry_comments' ); ?> + +</li> + +<?php do_action( 'bp_after_activity_entry' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php new file mode 100644 index 0000000000000000000000000000000000000000..beaff81442db89927be114ea928dfdeac08d7afd --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php @@ -0,0 +1,129 @@ +<?php do_action( 'bp_before_directory_activity' ); ?> + +<div id="buddypress"> + + <?php do_action( 'bp_before_directory_activity_content' ); ?> + + <?php if ( is_user_logged_in() ) : ?> + + <?php bp_get_template_part( 'activity/post-form' ); ?> + + <?php endif; ?> + + <?php do_action( 'template_notices' ); ?> + + <div class="item-list-tabs activity-type-tabs" role="navigation"> + <ul> + <?php do_action( 'bp_before_activity_type_tab_all' ); ?> + + <li class="selected" id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php _e( 'The public activity for everyone on this site.', 'buddypress' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li> + + <?php if ( is_user_logged_in() ) : ?> + + <?php do_action( 'bp_before_activity_type_tab_friends' ); ?> + + <?php if ( bp_is_active( 'friends' ) ) : ?> + + <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> + + <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/'; ?>" title="<?php _e( 'The activity of my friends only.', 'buddypress' ); ?>"><?php printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li> + + <?php endif; ?> + + <?php endif; ?> + + <?php do_action( 'bp_before_activity_type_tab_groups' ); ?> + + <?php if ( bp_is_active( 'groups' ) ) : ?> + + <?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?> + + <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/'; ?>" title="<?php _e( 'The activity of groups I am a member of.', 'buddypress' ); ?>"><?php printf( __( 'My Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ); ?></a></li> + + <?php endif; ?> + + <?php endif; ?> + + <?php do_action( 'bp_before_activity_type_tab_favorites' ); ?> + + <?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?> + + <li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/'; ?>" title="<?php _e( "The activity I've marked as a favorite.", 'buddypress' ); ?>"><?php printf( __( 'My Favorites <span>%s</span>', 'buddypress' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ); ?></a></li> + + <?php endif; ?> + + <?php do_action( 'bp_before_activity_type_tab_mentions' ); ?> + + <li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ); ?>"><?php _e( 'Mentions', 'buddypress' ); ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><?php printf( __( '<span>%s new</span>', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ); ?></strong><?php endif; ?></a></li> + + <?php endif; ?> + + <?php do_action( 'bp_activity_type_tabs' ); ?> + </ul> + </div><!-- .item-list-tabs --> + + <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + <li class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li> + + <?php do_action( 'bp_activity_syndication_options' ); ?> + + <li id="activity-filter-select" class="last"> + <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> + <select id="activity-filter-by"> + <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option> + <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option> + + <?php if ( bp_is_active( 'blogs' ) ) : ?> + + <option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ); ?></option> + <option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ); ?></option> + + <?php endif; ?> + + <?php if ( bp_is_active( 'forums' ) ) : ?> + + <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option> + <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option> + + <?php endif; ?> + + <?php if ( bp_is_active( 'groups' ) ) : ?> + + <option value="created_group"><?php _e( 'New Groups', 'buddypress' ); ?></option> + <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option> + + <?php endif; ?> + + <?php if ( bp_is_active( 'friends' ) ) : ?> + + <option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option> + + <?php endif; ?> + + <option value="new_member"><?php _e( 'New Members', 'buddypress' ); ?></option> + + <?php do_action( 'bp_activity_filter_options' ); ?> + + </select> + </li> + </ul> + </div><!-- .item-list-tabs --> + + <?php do_action( 'bp_before_directory_activity_list' ); ?> + + <div class="activity" role="main"> + + <?php bp_get_template_part( 'activity/activity-loop' ); ?> + + </div><!-- .activity --> + + <?php do_action( 'bp_after_directory_activity_list' ); ?> + + <?php do_action( 'bp_directory_activity_content' ); ?> + + <?php do_action( 'bp_after_directory_activity_content' ); ?> + + <?php do_action( 'bp_after_directory_activity' ); ?> + +</div> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php new file mode 100644 index 0000000000000000000000000000000000000000..c7ada634ecb93b11433a3fa645444a134da1ab97 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php @@ -0,0 +1,74 @@ +<?php + +/** + * BuddyPress - Activity Post Form + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary"> + + <?php do_action( 'bp_before_activity_post_form' ); ?> + + <div id="whats-new-avatar"> + <a href="<?php echo bp_loggedin_user_domain(); ?>"> + <?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?> + </a> + </div> + + <p class="activity-greeting"><?php if ( bp_is_group() ) + printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname() ); + else + printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname() ); + ?></p> + + <div id="whats-new-content"> + <div id="whats-new-textarea"> + <textarea name="whats-new" id="whats-new" cols="50" rows="10"><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_attr( $_GET['r'] ); ?> <?php endif; ?></textarea> + </div> + + <div id="whats-new-options"> + <div id="whats-new-submit"> + <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php _e( 'Post Update', 'buddypress' ); ?>" /> + </div> + + <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?> + + <div id="whats-new-post-in-box"> + + <?php _e( 'Post in', 'buddypress' ); ?>: + + <select id="whats-new-post-in" name="whats-new-post-in"> + <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option> + + <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) : + while ( bp_groups() ) : bp_the_group(); ?> + + <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option> + + <?php endwhile; + endif; ?> + + </select> + </div> + <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> + + <?php elseif ( bp_is_group_home() ) : ?> + + <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" /> + <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" /> + + <?php endif; ?> + + <?php do_action( 'bp_activity_post_form_options' ); ?> + + </div><!-- #whats-new-options --> + </div><!-- #whats-new-content --> + + <?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?> + <?php do_action( 'bp_after_activity_post_form' ); ?> + +</form><!-- #whats-new-form --> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/single/home.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/single/home.php new file mode 100644 index 0000000000000000000000000000000000000000..5b4eadd8ff8843e3da82ec4e39b9d4352d987e7b --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/single/home.php @@ -0,0 +1,17 @@ +<div id="buddypress"> + <?php do_action( 'template_notices' ); ?> + + <div class="activity no-ajax" role="main"> + <?php if ( bp_has_activities( 'display_comments=threaded&show_hidden=true&include=' . bp_current_action() ) ) : ?> + + <ul id="activity-stream" class="activity-list item-list"> + <?php while ( bp_activities() ) : bp_the_activity(); ?> + + <?php bp_get_template_part( 'activity/entry' ); ?> + + <?php endwhile; ?> + </ul> + + <?php endif; ?> + </div> +</div> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php new file mode 100644 index 0000000000000000000000000000000000000000..09ce4e28b0f968d8c1c23f6d5d3eaeccab456e6d --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/blogs-loop.php @@ -0,0 +1,95 @@ +<?php + +/** + * BuddyPress - Blogs Loop + * + * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter() + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<?php do_action( 'bp_before_blogs_loop' ); ?> + +<?php if ( bp_has_blogs( bp_ajax_querystring( 'blogs' ) ) ) : ?> + + <div id="pag-top" class="pagination"> + + <div class="pag-count" id="blog-dir-count-top"> + <?php bp_blogs_pagination_count(); ?> + </div> + + <div class="pagination-links" id="blog-dir-pag-top"> + <?php bp_blogs_pagination_links(); ?> + </div> + + </div> + + <?php do_action( 'bp_before_directory_blogs_list' ); ?> + + <ul id="blogs-list" class="item-list" role="main"> + + <?php while ( bp_blogs() ) : bp_the_blog(); ?> + + <li> + <div class="item-avatar"> + <a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_avatar( 'type=thumb' ); ?></a> + </div> + + <div class="item"> + <div class="item-title"><a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_name(); ?></a></div> + <div class="item-meta"><span class="activity"><?php bp_blog_last_active(); ?></span></div> + + <?php do_action( 'bp_directory_blogs_item' ); ?> + </div> + + <div class="action"> + + <?php do_action( 'bp_directory_blogs_actions' ); ?> + + <div class="meta"> + + <?php bp_blog_latest_post(); ?> + + </div> + + </div> + + <div class="clear"></div> + </li> + + <?php endwhile; ?> + + </ul> + + <?php do_action( 'bp_after_directory_blogs_list' ); ?> + + <?php bp_blog_hidden_fields(); ?> + + <div id="pag-bottom" class="pagination"> + + <div class="pag-count" id="blog-dir-count-bottom"> + + <?php bp_blogs_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="blog-dir-pag-bottom"> + + <?php bp_blogs_pagination_links(); ?> + + </div> + + </div> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'Sorry, there were no sites found.', 'buddypress' ); ?></p> + </div> + +<?php endif; ?> + +<?php do_action( 'bp_after_blogs_loop' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/create.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/create.php new file mode 100644 index 0000000000000000000000000000000000000000..8fcca78ce76e50700a8474617d34b782e71df5fa --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/create.php @@ -0,0 +1,21 @@ +<?php do_action( 'bp_before_create_blog_content_template' ); ?> + +<?php do_action( 'template_notices' ); ?> + +<?php do_action( 'bp_before_create_blog_content' ); ?> + +<?php if ( bp_blog_signup_enabled() ) : ?> + + <?php bp_show_blog_signup_form(); ?> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'Site registration is currently disabled', 'buddypress' ); ?></p> + </div> + +<?php endif; ?> + +<?php do_action( 'bp_after_create_blog_content' ); ?> + +<?php do_action( 'bp_after_create_blog_content_template' ); ?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/index.php new file mode 100644 index 0000000000000000000000000000000000000000..aa81ff2a2c07bae73e8aad72e59a9f2d2bedcceb --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/blogs/index.php @@ -0,0 +1,65 @@ +<?php do_action( 'bp_before_directory_blogs' ); ?> + +<div id="buddypress"> + <form action="" method="post" id="blogs-directory-form" class="dir-form"> + + <?php do_action( 'bp_before_directory_blogs_content' ); ?> + + <div id="blog-dir-search" class="dir-search" role="search"> + + <?php bp_directory_blogs_search_form(); ?> + + </div><!-- #blog-dir-search --> + + <div class="item-list-tabs" role="navigation"> + <ul> + <li class="selected" id="blogs-all"><a href="<?php bp_root_domain(); ?>/<?php bp_blogs_root_slug(); ?>"><?php printf( __( 'All Sites <span>%s</span>', 'buddypress' ), bp_get_total_blog_count() ); ?></a></li> + + <?php if ( is_user_logged_in() && bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ) : ?> + + <li id="blogs-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_blogs_slug(); ?>"><?php printf( __( 'My Sites <span>%s</span>', 'buddypress' ), bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ); ?></a></li> + + <?php endif; ?> + + <?php do_action( 'bp_blogs_directory_blog_types' ); ?> + + </ul> + </div><!-- .item-list-tabs --> + + <div class="item-list-tabs" id="subnav" role="navigation"> + <ul> + + <?php do_action( 'bp_blogs_directory_blog_sub_types' ); ?> + + <li id="blogs-order-select" class="last filter"> + + <label for="blogs-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label> + <select id="blogs-order-by"> + <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> + <option value="newest"><?php _e( 'Newest', 'buddypress' ); ?></option> + <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option> + + <?php do_action( 'bp_blogs_directory_order_options' ); ?> + + </select> + </li> + </ul> + </div> + + <div id="blogs-dir-list" class="blogs dir-list"> + + <?php bp_get_template_part( 'blogs/blogs-loop' ); ?> + + </div><!-- #blogs-dir-list --> + + <?php do_action( 'bp_directory_blogs_content' ); ?> + + <?php wp_nonce_field( 'directory_blogs', '_wpnonce-blogs-filter' ); ?> + + <?php do_action( 'bp_after_directory_blogs_content' ); ?> + + </form><!-- #blogs-directory-form --> + + <?php do_action( 'bp_after_directory_blogs' ); ?> + +</div> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/forums-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/forums-loop.php new file mode 100644 index 0000000000000000000000000000000000000000..3c4022526ecbfbc249d4f0d89d0ee01e0f571215 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/forums-loop.php @@ -0,0 +1,127 @@ +<?php + +/** + * BuddyPress - Forums Loop + * + * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter() + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<?php do_action( 'bp_before_forums_loop' ); ?> + +<?php if ( bp_has_forum_topics( bp_ajax_querystring( 'forums' ) ) ) : ?> + + <div id="pag-top" class="pagination"> + + <div class="pag-count" id="topic-count-top"> + + <?php bp_forum_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="topic-pag-top"> + + <?php bp_forum_pagination(); ?> + + </div> + + </div> + + <?php do_action( 'bp_before_directory_forums_list' ); ?> + + <table class="forum"> + <thead> + <tr> + <th id="th-title"><?php _e( 'Topic', 'buddypress' ); ?></th> + <th id="th-postcount"><?php _e( 'Posts', 'buddypress' ); ?></th> + <th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ); ?></th> + + <?php do_action( 'bp_directory_forums_extra_cell_head' ); ?> + + </tr> + </thead> + + <tbody> + + <?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?> + + <tr class="<?php bp_the_topic_css_class(); ?>"> + <td class="td-title"> + <a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php _e( 'Permanent link to this post', 'buddypress' ); ?>"> + + <?php bp_the_topic_title(); ?> + + </a> + + <p class="topic-meta"> + <span class="topic-by"><?php /* translators: "started by [poster] in [forum]" */ printf( __( 'Started by %1$s', 'buddypress' ), bp_get_the_topic_poster_avatar( 'height=20&width=20') . bp_get_the_topic_poster_name() ); ?></span> + + <?php if ( !bp_is_group_forum() ) : ?> + + <span class="topic-in"> + + <?php + $topic_in = '<a href="' . bp_get_the_topic_object_permalink() . '">' . bp_get_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) . '</a>' . + '<a href="' . bp_get_the_topic_object_permalink() . '" title="' . bp_get_the_topic_object_name() . '">' . bp_get_the_topic_object_name() .'</a>'; + + /* translators: "started by [poster] in [forum]" */ + printf( __( 'in %1$s', 'buddypress' ), $topic_in ); + ?> + + </span> + + <?php endif; ?> + + </p> + </td> + <td class="td-postcount"> + <?php bp_the_topic_total_posts(); ?> + </td> + <td class="td-freshness"> + <span class="time-since"><?php bp_the_topic_time_since_last_post(); ?></span> + <p class="topic-meta"> + <span class="freshness-author"> + <a href="<?php bp_the_topic_permalink(); ?>"><?php bp_the_topic_last_poster_avatar( 'type=thumb&width=20&height=20' ); ?></a> + <?php bp_the_topic_last_poster_name(); ?> + </span> + </p> + </td> + + <?php do_action( 'bp_directory_forums_extra_cell' ); ?> + + </tr> + + <?php do_action( 'bp_directory_forums_extra_row' ); ?> + + <?php endwhile; ?> + + </tbody> + </table> + + <?php do_action( 'bp_after_directory_forums_list' ); ?> + + <div id="pag-bottom" class="pagination"> + + <div class="pag-count" id="topic-count-bottom"> + <?php bp_forum_pagination_count(); ?> + </div> + + <div class="pagination-links" id="topic-pag-bottom"> + <?php bp_forum_pagination(); ?> + </div> + + </div> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'Sorry, there were no forum topics found.', 'buddypress' ); ?></p> + </div> + +<?php endif; ?> + +<?php do_action( 'bp_after_forums_loop' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/index.php new file mode 100644 index 0000000000000000000000000000000000000000..944f0d1f3feb33fc2504e3fa6af50c2c6d648c9c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/forums/index.php @@ -0,0 +1,140 @@ +<div id="buddypress"> + + <?php do_action( 'bp_before_directory_forums' ); ?> + + <form action="" method="post" id="forums-search-form" class="dir-form"> + + <?php do_action( 'bp_before_directory_forums_content' ); ?> + + <div id="forums-dir-search" class="dir-search" role="search"> + + <?php bp_directory_forums_search_form(); ?> + + </div> + </form> + + <?php do_action( 'bp_before_topics' ); ?> + + <form action="" method="post" id="forums-directory-form" class="dir-form"> + + <div class="item-list-tabs" role="navigation"> + <ul> + <li class="selected" id="forums-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_forums_root_slug() ); ?>"><?php printf( __( 'All Topics <span>%s</span>', 'buddypress' ), bp_get_forum_topic_count() ); ?></a></li> + + <?php if ( is_user_logged_in() && bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ) : ?> + + <li id="forums-personal"><a href="<?php echo trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() . '/topics' ); ?>"><?php printf( __( 'My Topics <span>%s</span>', 'buddypress' ), bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ); ?></a></li> + + <?php endif; ?> + + <?php do_action( 'bp_forums_directory_group_types' ); ?> + + </ul> + </div> + + <div class="item-list-tabs" id="subnav" role="navigation"> + <ul> + + <?php do_action( 'bp_forums_directory_group_sub_types' ); ?> + + <li id="forums-order-select" class="last filter"> + + <label for="forums-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label> + <select id="forums-order-by"> + <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> + <option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option> + <option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option> + + <?php do_action( 'bp_forums_directory_order_options' ); ?> + + </select> + </li> + </ul> + </div> + + <div id="forums-dir-list" class="forums dir-list" role="main"> + + <?php bp_get_template_part( 'forums/forums-loop' ); ?> + + </div> + + <?php do_action( 'bp_directory_forums_content' ); ?> + + <?php wp_nonce_field( 'directory_forums', '_wpnonce-forums-filter' ); ?> + + </form> + + <?php do_action( 'bp_after_directory_forums' ); ?> + + <?php do_action( 'bp_before_new_topic_form' ); ?> + + <div id="new-topic-post"> + + <?php if ( is_user_logged_in() ) : ?> + + <?php if ( bp_is_active( 'groups' ) && bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100' ) ) : ?> + + <form action="" method="post" id="forum-topic-form" class="standard-form"> + + <?php do_action( 'groups_forum_new_topic_before' ); ?> + + <a name="post-new"></a> + <h5><?php _e( 'Create New Topic:', 'buddypress' ); ?></h5> + + <?php do_action( 'template_notices' ); ?> + + <label><?php _e( 'Title:', 'buddypress' ); ?></label> + <input type="text" name="topic_title" id="topic_title" value="" maxlength="100" /> + + <label><?php _e( 'Content:', 'buddypress' ); ?></label> + <textarea name="topic_text" id="topic_text"></textarea> + + <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label> + <input type="text" name="topic_tags" id="topic_tags" value="" /> + + <label><?php _e( 'Post In Group Forum:', 'buddypress' ); ?></label> + <select id="topic_group_id" name="topic_group_id"> + + <option value=""><?php /* translators: no option picked in select box */ _e( '----', 'buddypress' ); ?></option> + + <?php while ( bp_groups() ) : bp_the_group(); ?> + + <?php if ( bp_group_is_forum_enabled() && ( bp_current_user_can( 'bp_moderate' ) || 'public' == bp_get_group_status() || bp_group_is_member() ) ) : ?> + + <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option> + + <?php endif; ?> + + <?php endwhile; ?> + + </select><!-- #topic_group_id --> + + <?php do_action( 'groups_forum_new_topic_after' ); ?> + + <div class="submit"> + <input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ); ?>" /> + <input type="button" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( 'Cancel', 'buddypress' ); ?>" /> + </div> + + <?php wp_nonce_field( 'bp_forums_new_topic' ); ?> + + </form><!-- #forum-topic-form --> + + <?php elseif ( bp_is_active( 'groups' ) ) : ?> + + <div id="message" class="info"> + + <p><?php printf( __( "You are not a member of any groups so you don't have any group forums you can post in. To start posting, first find a group that matches the topic subject you'd like to start. If this group does not exist, why not <a href='%s'>create a new group</a>? Once you have joined or created the group you can post your topic in that group's forum.", 'buddypress' ), site_url( bp_get_groups_root_slug() . '/create/' ) ); ?></p> + + </div> + + <?php endif; ?> + + <?php endif; ?> + </div><!-- #new-topic-post --> + + <?php do_action( 'bp_after_new_topic_form' ); ?> + + <?php do_action( 'bp_after_directory_forums_content' ); ?> + +</div> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/create.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/create.php new file mode 100644 index 0000000000000000000000000000000000000000..35573ba4cfd91b870aeffe909856b93907a0a97a --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/create.php @@ -0,0 +1,306 @@ +<?php do_action( 'bp_before_create_group_page' ); ?> + +<div id="buddypress"> + + <?php do_action( 'bp_before_create_group_content_template' ); ?> + + <form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data"> + + <?php do_action( 'bp_before_create_group' ); ?> + + <div class="item-list-tabs no-ajax" id="group-create-tabs" role="navigation"> + <ul> + + <?php bp_group_creation_tabs(); ?> + + </ul> + </div> + + <?php do_action( 'template_notices' ); ?> + + <div class="item-body" id="group-create-body"> + + <?php /* Group creation step 1: Basic group details */ ?> + <?php if ( bp_is_group_creation_step( 'group-details' ) ) : ?> + + <?php do_action( 'bp_before_group_details_creation_step' ); ?> + + <div> + <label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label> + <input type="text" name="group-name" id="group-name" aria-required="true" value="<?php bp_new_group_name(); ?>" /> + </div> + + <div> + <label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label> + <textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_new_group_description(); ?></textarea> + </div> + + <?php + do_action( 'bp_after_group_details_creation_step' ); + do_action( 'groups_custom_group_fields_editable' ); // @Deprecated + + wp_nonce_field( 'groups_create_save_group-details' ); ?> + + <?php endif; ?> + + <?php /* Group creation step 2: Group settings */ ?> + <?php if ( bp_is_group_creation_step( 'group-settings' ) ) : ?> + + <?php do_action( 'bp_before_group_settings_creation_step' ); ?> + + <h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4> + + <div class="radio"> + <label><input type="radio" name="group-status" value="public"<?php if ( 'public' == bp_get_new_group_status() || !bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> /> + <strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong> + <ul> + <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li> + <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> + <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li> + </ul> + </label> + + <label><input type="radio" name="group-status" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> /> + <strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong> + <ul> + <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li> + <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> + <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> + </ul> + </label> + + <label><input type="radio" name="group-status" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> /> + <strong><?php _e('This is a hidden group', 'buddypress' ); ?></strong> + <ul> + <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li> + <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li> + <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> + </ul> + </label> + </div> + + <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> + + <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p> + + <div class="radio"> + <label> + <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> + <strong><?php _e( 'All group members', 'buddypress' ); ?></strong> + </label> + + <label> + <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> + <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> + </label> + + <label> + <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> + <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong> + </label> + </div> + + <?php if ( bp_is_active( 'forums' ) ) : ?> + + <h4><?php _e( 'Group Forums', 'buddypress' ); ?></h4> + + <?php if ( bp_forums_is_installed_correctly() ) : ?> + + <p><?php _e( 'Should this group have a forum?', 'buddypress' ); ?></p> + + <div class="checkbox"> + <label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php checked( bp_get_new_group_enable_forum(), true, true ); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label> + </div> + <?php elseif ( is_super_admin() ) : ?> + + <p><?php printf( __( '<strong>Attention Site Admin:</strong> Group forums require the <a href="%s">correct setup and configuration</a> of a bbPress installation.', 'buddypress' ), bp_core_do_network_admin() ? network_admin_url( 'settings.php?page=bb-forums-setup' ) : admin_url( 'admin.php?page=bb-forums-setup' ) ); ?></p> + + <?php endif; ?> + + <?php endif; ?> + + <?php do_action( 'bp_after_group_settings_creation_step' ); ?> + + <?php wp_nonce_field( 'groups_create_save_group-settings' ); ?> + + <?php endif; ?> + + <?php /* Group creation step 3: Avatar Uploads */ ?> + <?php if ( bp_is_group_creation_step( 'group-avatar' ) ) : ?> + + <?php do_action( 'bp_before_group_avatar_creation_step' ); ?> + + <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?> + + <div class="left-menu"> + + <?php bp_new_group_avatar(); ?> + + </div><!-- .left-menu --> + + <div class="main-column"> + <p><?php _e( "Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'buddypress' ); ?></p> + + <p> + <input type="file" name="file" id="file" /> + <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ); ?>" /> + <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> + </p> + + <p><?php _e( 'To skip the avatar upload process, hit the "Next Step" button.', 'buddypress' ); ?></p> + </div><!-- .main-column --> + + <?php endif; ?> + + <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?> + + <h4><?php _e( 'Crop Group Avatar', 'buddypress' ); ?></h4> + + <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ); ?>" /> + + <div id="avatar-crop-pane"> + <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ); ?>" /> + </div> + + <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ); ?>" /> + + <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" /> + <input type="hidden" name="upload" id="upload" /> + <input type="hidden" id="x" name="x" /> + <input type="hidden" id="y" name="y" /> + <input type="hidden" id="w" name="w" /> + <input type="hidden" id="h" name="h" /> + + <?php endif; ?> + + <?php do_action( 'bp_after_group_avatar_creation_step' ); ?> + + <?php wp_nonce_field( 'groups_create_save_group-avatar' ); ?> + + <?php endif; ?> + + <?php /* Group creation step 4: Invite friends to group */ ?> + <?php if ( bp_is_group_creation_step( 'group-invites' ) ) : ?> + + <?php do_action( 'bp_before_group_invites_creation_step' ); ?> + + <?php if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> + + <div class="left-menu"> + + <div id="invite-list"> + <ul> + <?php bp_new_group_invite_friend_list(); ?> + </ul> + + <?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?> + </div> + + </div><!-- .left-menu --> + + <div class="main-column"> + + <div id="message" class="info"> + <p><?php _e('Select people to invite from your friends list.', 'buddypress' ); ?></p> + </div> + + <?php /* The ID 'friend-list' is important for AJAX support. */ ?> + <ul id="friend-list" class="item-list" role="main"> + + <?php if ( bp_group_has_invites() ) : ?> + + <?php while ( bp_group_invites() ) : bp_group_the_invite(); ?> + + <li id="<?php bp_group_invite_item_id(); ?>"> + + <?php bp_group_invite_user_avatar(); ?> + + <h4><?php bp_group_invite_user_link(); ?></h4> + <span class="activity"><?php bp_group_invite_user_last_active(); ?></span> + + <div class="action"> + <a class="remove" href="<?php bp_group_invite_user_remove_invite_url(); ?>" id="<?php bp_group_invite_item_id(); ?>"><?php _e( 'Remove Invite', 'buddypress' ); ?></a> + </div> + </li> + + <?php endwhile; ?> + + <?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?> + + <?php endif; ?> + + </ul> + + </div><!-- .main-column --> + + <?php else : ?> + + <div id="message" class="info"> + <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group.', 'buddypress' ); ?></p> + </div> + + <?php endif; ?> + + <?php wp_nonce_field( 'groups_create_save_group-invites' ); ?> + + <?php do_action( 'bp_after_group_invites_creation_step' ); ?> + + <?php endif; ?> + + <?php do_action( 'groups_custom_create_steps' ); // Allow plugins to add custom group creation steps ?> + + <?php do_action( 'bp_before_group_creation_step_buttons' ); ?> + + <?php if ( 'crop-image' != bp_get_avatar_admin_step() ) : ?> + + <div class="submit" id="previous-next"> + + <?php /* Previous Button */ ?> + <?php if ( !bp_is_first_group_creation_step() ) : ?> + + <input type="button" value="<?php _e( 'Back to Previous Step', 'buddypress' ); ?>" id="group-creation-previous" name="previous" onclick="location.href='<?php bp_group_creation_previous_link(); ?>'" /> + + <?php endif; ?> + + <?php /* Next Button */ ?> + <?php if ( !bp_is_last_group_creation_step() && !bp_is_first_group_creation_step() ) : ?> + + <input type="submit" value="<?php _e( 'Next Step', 'buddypress' ); ?>" id="group-creation-next" name="save" /> + + <?php endif;?> + + <?php /* Create Button */ ?> + <?php if ( bp_is_first_group_creation_step() ) : ?> + + <input type="submit" value="<?php _e( 'Create Group and Continue', 'buddypress' ); ?>" id="group-creation-create" name="save" /> + + <?php endif; ?> + + <?php /* Finish Button */ ?> + <?php if ( bp_is_last_group_creation_step() ) : ?> + + <input type="submit" value="<?php _e( 'Finish', 'buddypress' ); ?>" id="group-creation-finish" name="save" /> + + <?php endif; ?> + </div> + + <?php endif;?> + + <?php do_action( 'bp_after_group_creation_step_buttons' ); ?> + + <?php /* Don't leave out this hidden field */ ?> + <input type="hidden" name="group_id" id="group_id" value="<?php bp_new_group_id(); ?>" /> + + <?php do_action( 'bp_directory_groups_content' ); ?> + + </div><!-- .item-body --> + + <?php do_action( 'bp_after_create_group' ); ?> + + </form> + + <?php do_action( 'bp_after_create_group_content_template' ); ?> + +</div> + +<?php do_action( 'bp_after_create_group_page' ); ?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/groups-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/groups-loop.php new file mode 100644 index 0000000000000000000000000000000000000000..6ba22233aaf5e68f0ceb1232b1395a42cf94ef2b --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/groups-loop.php @@ -0,0 +1,100 @@ +<?php + +/** + * BuddyPress - Groups Loop + * + * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter() + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<?php do_action( 'bp_before_groups_loop' ); ?> + +<?php if ( bp_has_groups( bp_ajax_querystring( 'groups' ) ) ) : ?> + + <div id="pag-top" class="pagination"> + + <div class="pag-count" id="group-dir-count-top"> + + <?php bp_groups_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="group-dir-pag-top"> + + <?php bp_groups_pagination_links(); ?> + + </div> + + </div> + + <?php do_action( 'bp_before_directory_groups_list' ); ?> + + <ul id="groups-list" class="item-list" role="main"> + + <?php while ( bp_groups() ) : bp_the_group(); ?> + + <li> + <div class="item-avatar"> + <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a> + </div> + + <div class="item"> + <div class="item-title"><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a></div> + <div class="item-meta"><span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span></div> + + <div class="item-desc"><?php bp_group_description_excerpt(); ?></div> + + <?php do_action( 'bp_directory_groups_item' ); ?> + + </div> + + <div class="action"> + + <?php do_action( 'bp_directory_groups_actions' ); ?> + + <div class="meta"> + + <?php bp_group_type(); ?> / <?php bp_group_member_count(); ?> + + </div> + + </div> + + <div class="clear"></div> + </li> + + <?php endwhile; ?> + + </ul> + + <?php do_action( 'bp_after_directory_groups_list' ); ?> + + <div id="pag-bottom" class="pagination"> + + <div class="pag-count" id="group-dir-count-bottom"> + + <?php bp_groups_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="group-dir-pag-bottom"> + + <?php bp_groups_pagination_links(); ?> + + </div> + + </div> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'There were no groups found.', 'buddypress' ); ?></p> + </div> + +<?php endif; ?> + +<?php do_action( 'bp_after_groups_loop' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/index.php new file mode 100644 index 0000000000000000000000000000000000000000..8f421bbcdeb632c4520d0fb9e29585fbfd8a1037 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/index.php @@ -0,0 +1,66 @@ +<?php do_action( 'bp_before_directory_groups_page' ); ?> + +<div id="buddypress"> + + <?php do_action( 'bp_before_directory_groups' ); ?> + + <?php do_action( 'bp_before_directory_groups_content' ); ?> + + <div id="group-dir-search" class="dir-search" role="search"> + <?php bp_directory_groups_search_form(); ?> + </div><!-- #group-dir-search --> + + <form action="" method="post" id="groups-directory-form" class="dir-form"> + + <?php do_action( 'template_notices' ); ?> + + <div class="item-list-tabs" role="navigation"> + <ul> + <li class="selected" id="groups-all"><a href="<?php bp_groups_directory_permalink(); ?>"><?php printf( __( 'All Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count() ); ?></a></li> + + <?php if ( is_user_logged_in() && bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?> + <li id="groups-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_groups_slug() . '/my-groups/'; ?>"><?php printf( __( 'My Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ); ?></a></li> + <?php endif; ?> + + <?php do_action( 'bp_groups_directory_group_filter' ); ?> + + </ul> + </div><!-- .item-list-tabs --> + + <div class="item-list-tabs" id="subnav" role="navigation"> + <ul> + <?php do_action( 'bp_groups_directory_group_types' ); ?> + + <li id="groups-order-select" class="last filter"> + + <label for="groups-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label> + + <select id="groups-order-by"> + <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> + <option value="popular"><?php _e( 'Most Members', 'buddypress' ); ?></option> + <option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option> + <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option> + + <?php do_action( 'bp_groups_directory_order_options' ); ?> + </select> + </li> + </ul> + </div> + + <div id="groups-dir-list" class="groups dir-list"> + <?php bp_get_template_part( 'groups/groups-loop' ); ?> + </div><!-- #groups-dir-list --> + + <?php do_action( 'bp_directory_groups_content' ); ?> + + <?php wp_nonce_field( 'directory_groups', '_wpnonce-groups-filter' ); ?> + + <?php do_action( 'bp_after_directory_groups_content' ); ?> + + </form><!-- #groups-directory-form --> + + <?php do_action( 'bp_after_directory_groups' ); ?> + +</div><!-- #buddypress --> + +<?php do_action( 'bp_after_directory_groups_page' ); ?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/activity.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/activity.php new file mode 100644 index 0000000000000000000000000000000000000000..79b18d04a8c093b80d8cabb182806bc5ceba60ad --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/activity.php @@ -0,0 +1,43 @@ +<div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + <li class="feed"><a href="<?php bp_group_activity_feed_link(); ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li> + + <?php do_action( 'bp_group_activity_syndication_options' ); ?> + + <li id="activity-filter-select" class="last"> + <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> + <select id="activity-filter-by"> + <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option> + <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option> + + <?php if ( bp_is_active( 'forums' ) ) : ?> + <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option> + <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option> + <?php endif; ?> + + <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option> + + <?php do_action( 'bp_group_activity_filter_options' ); ?> + </select> + </li> + </ul> +</div><!-- .item-list-tabs --> + +<?php do_action( 'bp_before_group_activity_post_form' ); ?> + +<?php if ( is_user_logged_in() && bp_group_is_member() ) : ?> + + <?php bp_get_template_part( 'activity/post-form' ); ?> + +<?php endif; ?> + +<?php do_action( 'bp_after_group_activity_post_form' ); ?> +<?php do_action( 'bp_before_group_activity_content' ); ?> + +<div class="activity single-group" role="main"> + + <?php bp_get_template_part( 'activity/activity-loop' ); ?> + +</div><!-- .activity.single-group --> + +<?php do_action( 'bp_after_group_activity_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/admin.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/admin.php new file mode 100644 index 0000000000000000000000000000000000000000..a5e6c588c4110d4ad0177bf0d0ca6b77ec1b150d --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/admin.php @@ -0,0 +1,373 @@ +<div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + <?php bp_group_admin_tabs(); ?> + </ul> +</div><!-- .item-list-tabs --> + +<form action="<?php bp_group_admin_form_action(); ?>" name="group-settings-form" id="group-settings-form" class="standard-form" method="post" enctype="multipart/form-data" role="main"> + +<?php do_action( 'bp_before_group_admin_content' ); ?> + +<?php /* Edit Group Details */ ?> +<?php if ( bp_is_group_admin_screen( 'edit-details' ) ) : ?> + + <?php do_action( 'bp_before_group_details_admin' ); ?> + + <label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label> + <input type="text" name="group-name" id="group-name" value="<?php bp_group_name(); ?>" aria-required="true" /> + + <label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label> + <textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_group_description_editable(); ?></textarea> + + <?php do_action( 'groups_custom_group_fields_editable' ); ?> + + <p> + <label for="group-notifiy-members"><?php _e( 'Notify group members of changes via email', 'buddypress' ); ?></label> + <input type="radio" name="group-notify-members" value="1" /> <?php _e( 'Yes', 'buddypress' ); ?> + <input type="radio" name="group-notify-members" value="0" checked="checked" /> <?php _e( 'No', 'buddypress' ); ?> + </p> + + <?php do_action( 'bp_after_group_details_admin' ); ?> + + <p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p> + <?php wp_nonce_field( 'groups_edit_group_details' ); ?> + +<?php endif; ?> + +<?php /* Manage Group Settings */ ?> +<?php if ( bp_is_group_admin_screen( 'group-settings' ) ) : ?> + + <?php do_action( 'bp_before_group_settings_admin' ); ?> + + <?php if ( bp_is_active( 'forums' ) ) : ?> + + <?php if ( bp_forums_is_installed_correctly() ) : ?> + + <div class="checkbox"> + <label><input type="checkbox" name="group-show-forum" id="group-show-forum" value="1"<?php bp_group_show_forum_setting(); ?> /> <?php _e( 'Enable discussion forum', 'buddypress' ); ?></label> + </div> + + <hr /> + + <?php endif; ?> + + <?php endif; ?> + + <h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4> + + <div class="radio"> + <label> + <input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting( 'public' ); ?> /> + <strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong> + <ul> + <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li> + <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> + <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li> + </ul> + </label> + + <label> + <input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting( 'private' ); ?> /> + <strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong> + <ul> + <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li> + <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li> + <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> + </ul> + </label> + + <label> + <input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting( 'hidden' ); ?> /> + <strong><?php _e( 'This is a hidden group', 'buddypress' ); ?></strong> + <ul> + <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li> + <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li> + <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li> + </ul> + </label> + </div> + + <hr /> + + <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> + + <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p> + + <div class="radio"> + <label> + <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> + <strong><?php _e( 'All group members', 'buddypress' ); ?></strong> + </label> + + <label> + <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> + <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> + </label> + + <label> + <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> + <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong> + </label> + </div> + + <hr /> + + <?php do_action( 'bp_after_group_settings_admin' ); ?> + + <p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p> + <?php wp_nonce_field( 'groups_edit_group_settings' ); ?> + +<?php endif; ?> + +<?php /* Group Avatar Settings */ ?> +<?php if ( bp_is_group_admin_screen( 'group-avatar' ) ) : ?> + + <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?> + + <p><?php _e("Upload an image to use as an avatar for this group. The image will be shown on the main group page, and in search results.", 'buddypress' ); ?></p> + + <p> + <input type="file" name="file" id="file" /> + <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ); ?>" /> + <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> + </p> + + <?php if ( bp_get_group_has_avatar() ) : ?> + + <p><?php _e( "If you'd like to remove the existing avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ); ?></p> + + <?php bp_button( array( 'id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __( 'Delete Avatar', 'buddypress' ), 'link_text' => __( 'Delete Avatar', 'buddypress' ) ) ); ?> + + <?php endif; ?> + + <?php wp_nonce_field( 'bp_avatar_upload' ); ?> + + <?php endif; ?> + + <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?> + + <h4><?php _e( 'Crop Avatar', 'buddypress' ); ?></h4> + + <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ); ?>" /> + + <div id="avatar-crop-pane"> + <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ); ?>" /> + </div> + + <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ); ?>" /> + + <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" /> + <input type="hidden" id="x" name="x" /> + <input type="hidden" id="y" name="y" /> + <input type="hidden" id="w" name="w" /> + <input type="hidden" id="h" name="h" /> + + <?php wp_nonce_field( 'bp_avatar_cropstore' ); ?> + + <?php endif; ?> + +<?php endif; ?> + +<?php /* Manage Group Members */ ?> +<?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?> + + <?php do_action( 'bp_before_group_manage_members_admin' ); ?> + + <div class="bp-widget"> + <h4><?php _e( 'Administrators', 'buddypress' ); ?></h4> + + <?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?> + + <ul id="admins-list" class="item-list single-line"> + + <?php while ( bp_members() ) : bp_the_member(); ?> + <li> + <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?> + <h5> + <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> + <?php if ( count( bp_group_admin_ids( false, 'array' ) ) > 1 ) : ?> + <span class="small"> + <a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a> + </span> + <?php endif; ?> + </h5> + </li> + <?php endwhile; ?> + + </ul> + + <?php endif; ?> + + </div> + + <?php if ( bp_group_has_moderators() ) : ?> + <div class="bp-widget"> + <h4><?php _e( 'Moderators', 'buddypress' ); ?></h4> + + <?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?> + <ul id="mods-list" class="item-list single-line"> + + <?php while ( bp_members() ) : bp_the_member(); ?> + <li> + <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?> + <h5> + <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> + <span class="small"> + <a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => bp_get_member_user_id() ) ); ?>" class="button confirm mod-promote-to-admin" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a> + <a class="button confirm mod-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a> + </span> + </h5> + </li> + <?php endwhile; ?> + + </ul> + + <?php endif; ?> + </div> + <?php endif ?> + + + <div class="bp-widget"> + <h4><?php _e("Members", "buddypress"); ?></h4> + + <?php if ( bp_group_has_members( 'per_page=15&exclude_banned=false' ) ) : ?> + + <?php if ( bp_group_member_needs_pagination() ) : ?> + + <div class="pagination no-ajax"> + + <div id="member-count" class="pag-count"> + <?php bp_group_member_pagination_count(); ?> + </div> + + <div id="member-admin-pagination" class="pagination-links"> + <?php bp_group_member_admin_pagination(); ?> + </div> + + </div> + + <?php endif; ?> + + <ul id="members-list" class="item-list single-line"> + <?php while ( bp_group_members() ) : bp_group_the_member(); ?> + + <li class="<?php bp_group_member_css_class(); ?>"> + <?php bp_group_member_avatar_mini(); ?> + + <h5> + <?php bp_group_member_link(); ?> + + <?php if ( bp_get_group_member_is_banned() ) _e( '(banned)', 'buddypress' ); ?> + + <span class="small"> + + <?php if ( bp_get_group_member_is_banned() ) : ?> + + <a href="<?php bp_group_member_unban_link(); ?>" class="button confirm member-unban" title="<?php _e( 'Unban this member', 'buddypress' ); ?>"><?php _e( 'Remove Ban', 'buddypress' ); ?></a> + + <?php else : ?> + + <a href="<?php bp_group_member_ban_link(); ?>" class="button confirm member-ban" title="<?php _e( 'Kick and ban this member', 'buddypress' ); ?>"><?php _e( 'Kick & Ban', 'buddypress' ); ?></a> + <a href="<?php bp_group_member_promote_mod_link(); ?>" class="button confirm member-promote-to-mod" title="<?php _e( 'Promote to Mod', 'buddypress' ); ?>"><?php _e( 'Promote to Mod', 'buddypress' ); ?></a> + <a href="<?php bp_group_member_promote_admin_link(); ?>" class="button confirm member-promote-to-admin" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a> + + <?php endif; ?> + + <a href="<?php bp_group_member_remove_link(); ?>" class="button confirm" title="<?php _e( 'Remove this member', 'buddypress' ); ?>"><?php _e( 'Remove from group', 'buddypress' ); ?></a> + + <?php do_action( 'bp_group_manage_members_admin_item' ); ?> + + </span> + </h5> + </li> + + <?php endwhile; ?> + </ul> + + <?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'This group has no members.', 'buddypress' ); ?></p> + </div> + + <?php endif; ?> + + </div> + + <?php do_action( 'bp_after_group_manage_members_admin' ); ?> + +<?php endif; ?> + +<?php /* Manage Membership Requests */ ?> +<?php if ( bp_is_group_admin_screen( 'membership-requests' ) ) : ?> + + <?php do_action( 'bp_before_group_membership_requests_admin' ); ?> + + <?php if ( bp_group_has_membership_requests() ) : ?> + + <ul id="request-list" class="item-list"> + <?php while ( bp_group_membership_requests() ) : bp_group_the_membership_request(); ?> + + <li> + <?php bp_group_request_user_avatar_thumb(); ?> + <h4><?php bp_group_request_user_link(); ?> <span class="comments"><?php bp_group_request_comment(); ?></span></h4> + <span class="activity"><?php bp_group_request_time_since_requested(); ?></span> + + <?php do_action( 'bp_group_membership_requests_admin_item' ); ?> + + <div class="action"> + + <?php bp_button( array( 'id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __( 'Accept', 'buddypress' ), 'link_text' => __( 'Accept', 'buddypress' ) ) ); ?> + + <?php bp_button( array( 'id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __( 'Reject', 'buddypress' ), 'link_text' => __( 'Reject', 'buddypress' ) ) ); ?> + + <?php do_action( 'bp_group_membership_requests_admin_item_action' ); ?> + + </div> + </li> + + <?php endwhile; ?> + </ul> + + <?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'There are no pending membership requests.', 'buddypress' ); ?></p> + </div> + + <?php endif; ?> + + <?php do_action( 'bp_after_group_membership_requests_admin' ); ?> + +<?php endif; ?> + +<?php do_action( 'groups_custom_edit_steps' ) // Allow plugins to add custom group edit screens ?> + +<?php /* Delete Group Option */ ?> +<?php if ( bp_is_group_admin_screen( 'delete-group' ) ) : ?> + + <?php do_action( 'bp_before_group_delete_admin' ); ?> + + <div id="message" class="info"> + <p><?php _e( 'WARNING: Deleting this group will completely remove ALL content associated with it. There is no way back, please be careful with this option.', 'buddypress' ); ?></p> + </div> + + <label><input type="checkbox" name="delete-group-understand" id="delete-group-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-group-button').disabled = ''; } else { document.getElementById('delete-group-button').disabled = 'disabled'; }" /> <?php _e( 'I understand the consequences of deleting this group.', 'buddypress' ); ?></label> + + <?php do_action( 'bp_after_group_delete_admin' ); ?> + + <div class="submit"> + <input type="submit" disabled="disabled" value="<?php _e( 'Delete Group', 'buddypress' ); ?>" id="delete-group-button" name="delete-group-button" /> + </div> + + <?php wp_nonce_field( 'groups_delete_group' ); ?> + +<?php endif; ?> + +<?php /* This is important, don't forget it */ ?> + <input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id(); ?>" /> + +<?php do_action( 'bp_after_group_admin_content' ); ?> + +</form><!-- #group-settings-form --> + diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum.php new file mode 100644 index 0000000000000000000000000000000000000000..97b670a12d0e30f0a0b4920097b39e36bd29a814 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum.php @@ -0,0 +1,97 @@ +<?php + +do_action( 'bp_before_group_forum_content' ); + +if ( bp_is_group_forum_topic_edit() ) : + bp_get_template_part( 'groups/single/forum/edit' ); + +elseif ( bp_is_group_forum_topic() ) : + bp_get_template_part( 'groups/single/forum/topic' ); + +else : ?> + + <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + + <?php if ( is_user_logged_in() ) : ?> + + <li> + <a href="#post-new" class="show-hide-new"><?php _e( 'New Topic', 'buddypress' ); ?></a> + </li> + + <?php endif; ?> + + <?php if ( bp_forums_has_directory() ) : ?> + + <li> + <a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress' ); ?></a> + </li> + + <?php endif; ?> + + <?php do_action( 'bp_forums_directory_group_sub_types' ); ?> + + <li id="forums-order-select" class="last filter"> + + <label for="forums-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label> + <select id="forums-order-by"> + <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> + <option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option> + <option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option> + + <?php do_action( 'bp_forums_directory_order_options' ); ?> + + </select> + </li> + </ul> + </div> + + <div class="forums single-forum" role="main"> + + <?php bp_get_template_part( 'forums/forums-loop' ) ?> + + </div><!-- .forums.single-forum --> + +<?php endif; ?> + +<?php do_action( 'bp_after_group_forum_content' ); ?> + +<?php if ( !bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic() ) : ?> + + <?php if ( !bp_group_is_user_banned() && ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) ) : ?> + + <form action="" method="post" id="forum-topic-form" class="standard-form"> + <div id="new-topic-post"> + + <?php do_action( 'bp_before_group_forum_post_new' ); ?> + + <?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?> + <p><?php _e( 'You will auto join this group when you start a new topic.', 'buddypress' ); ?></p> + <?php endif; ?> + + <p id="post-new"></p> + <h4><?php _e( 'Post a New Topic:', 'buddypress' ); ?></h4> + + <label><?php _e( 'Title:', 'buddypress' ); ?></label> + <input type="text" name="topic_title" id="topic_title" value="" maxlength="100" /> + + <label><?php _e( 'Content:', 'buddypress' ); ?></label> + <textarea name="topic_text" id="topic_text"></textarea> + + <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label> + <input type="text" name="topic_tags" id="topic_tags" value="" /> + + <?php do_action( 'bp_after_group_forum_post_new' ); ?> + + <div class="submit"> + <input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ); ?>" /> + </div> + + <?php wp_nonce_field( 'bp_forums_new_topic' ); ?> + </div><!-- #new-topic-post --> + </form><!-- #forum-topic-form --> + + <?php endif; ?> + +<?php endif; ?> + diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php new file mode 100644 index 0000000000000000000000000000000000000000..0005ff28fabce551d1fc72db9d222dbf24ead6fe --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/edit.php @@ -0,0 +1,92 @@ +<?php do_action( 'bp_before_group_forum_edit_form' ); ?> + +<?php if ( bp_has_forum_topic_posts() ) : ?> + + <form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form"> + + <div class="item-list-tabs" id="subnav" role="navigation"> + <ul> + <li> + <a href="#post-topic-reply"><?php _e( 'Reply', 'buddypress' ); ?></a> + </li> + + <?php if ( bp_forums_has_directory() ) : ?> + + <li> + <a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress' ); ?></a> + </li> + + <?php endif; ?> + + </ul> + </div> + + <div id="topic-meta"> + <h3><?php _e( 'Edit:', 'buddypress' ); ?> <?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3> + + <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?> + + <div class="last admin-links"> + + <?php bp_the_topic_admin_links(); ?> + + </div> + + <?php endif; ?> + + <?php do_action( 'bp_group_forum_topic_meta' ); ?> + + </div> + + <?php if ( bp_is_edit_topic() ) : ?> + + <div id="edit-topic"> + + <?php do_action( 'bp_group_before_edit_forum_topic' ); ?> + + <label for="topic_title"><?php _e( 'Title:', 'buddypress' ); ?></label> + <input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title(); ?>" maxlength="100" /> + + <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label> + <textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea> + + <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label> + <input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list(); ?>" /> + + <?php do_action( 'bp_group_after_edit_forum_topic' ); ?> + + <p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p> + + <?php wp_nonce_field( 'bp_forums_edit_topic' ); ?> + + </div> + + <?php else : ?> + + <div id="edit-post"> + + <?php do_action( 'bp_group_before_edit_forum_post' ); ?> + + <textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea> + + <?php do_action( 'bp_group_after_edit_forum_post' ); ?> + + <p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p> + + <?php wp_nonce_field( 'bp_forums_edit_post' ); ?> + + </div> + + <?php endif; ?> + + </form><!-- #forum-topic-form --> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'This topic does not exist.', 'buddypress' ); ?></p> + </div> + +<?php endif;?> + +<?php do_action( 'bp_after_group_forum_edit_form' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php new file mode 100644 index 0000000000000000000000000000000000000000..a13ac07e0626652051245b89329b391d977e165f --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/forum/topic.php @@ -0,0 +1,166 @@ +<?php do_action( 'bp_before_group_forum_topic' ); ?> + +<form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form"> + <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + <?php if ( is_user_logged_in() ) : ?> + + <li> + <a href="<?php bp_forum_topic_new_reply_link(); ?>" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ); ?></a> + </li> + + <?php endif; ?> + + <?php if ( bp_forums_has_directory() ) : ?> + + <li> + <a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress' ); ?></a> + </li> + + <?php endif; ?> + + </ul> + </div> + + <div id="topic-meta"> + <h3><?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3> + + <?php if ( bp_forum_topic_has_tags() ) : ?> + + <div class="topic-tags"> + + <?php _e( 'Topic tags:', 'buddypress' ); ?> <?php bp_forum_topic_tag_list(); ?> + + </div> + + <?php endif; ?> + + <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?> + + <div class="last admin-links"> + + <?php bp_the_topic_admin_links(); ?> + + </div> + + <?php endif; ?> + + <?php do_action( 'bp_group_forum_topic_meta' ); ?> + + </div> + + + <?php if ( bp_has_forum_topic_posts() ) : ?> + + <div class="pagination no-ajax"> + + <div id="post-count-top" class="pag-count"> + + <?php bp_the_topic_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="topic-pag-top"> + + <?php bp_the_topic_pagination(); ?> + + </div> + + </div> + + <?php do_action( 'bp_before_group_forum_topic_posts' ); ?> + + <ul id="topic-post-list" class="item-list" role="main"> + <?php while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?> + + <li id="post-<?php bp_the_topic_post_id(); ?>" class="<?php bp_the_topic_post_css_class(); ?>"> + <div class="poster-meta"> + <a href="<?php bp_the_topic_post_poster_link(); ?>"> + <?php bp_the_topic_post_poster_avatar( 'width=40&height=40' ); ?> + </a> + <?php echo sprintf( __( '%1$s said %2$s:', 'buddypress' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ); ?> + </div> + + <div class="post-content"> + <?php bp_the_topic_post_content(); ?> + </div> + + <div class="admin-links"> + <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?> + <?php bp_the_topic_post_admin_links(); ?> + <?php endif; ?> + + <?php do_action( 'bp_group_forum_post_meta' ); ?> + + <a href="#post-<?php bp_the_topic_post_id(); ?>" title="<?php _e( 'Permanent link to this post', 'buddypress' ); ?>">#</a> + </div> + </li> + + <?php endwhile; ?> + </ul><!-- #topic-post-list --> + + <?php do_action( 'bp_after_group_forum_topic_posts' ); ?> + + <div class="pagination no-ajax"> + + <div id="post-count-bottom" class="pag-count"> + <?php bp_the_topic_pagination_count(); ?> + </div> + + <div class="pagination-links" id="topic-pag-bottom"> + <?php bp_the_topic_pagination(); ?> + </div> + + </div> + + <?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'There are no posts for this topic.', 'buddypress' ); ?></p> + </div> + + <?php endif;?> + + <?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?> + + <?php if ( bp_get_the_topic_is_last_page() ) : ?> + + <?php if ( bp_get_the_topic_is_topic_open() && !bp_group_is_user_banned() ) : ?> + + <div id="post-topic-reply"> + <p id="post-reply"></p> + + <?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?> + <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ); ?></p> + <?php endif; ?> + + <?php do_action( 'groups_forum_new_reply_before' ); ?> + + <h4><?php _e( 'Add a reply:', 'buddypress' ); ?></h4> + + <textarea name="reply_text" id="reply_text"></textarea> + + <div class="submit"> + <input type="submit" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'buddypress' ); ?>" /> + </div> + + <?php do_action( 'groups_forum_new_reply_after' ); ?> + + <?php wp_nonce_field( 'bp_forums_new_reply' ); ?> + </div> + + <?php elseif ( !bp_group_is_user_banned() ) : ?> + + <div id="message" class="info"> + <p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ); ?></p> + </div> + + <?php endif; ?> + + <?php endif; ?> + + <?php endif; ?> + +</form><!-- #forum-topic-form --> + +<?php do_action( 'bp_after_group_forum_topic' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/group-header.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/group-header.php new file mode 100644 index 0000000000000000000000000000000000000000..9954be3c0d1e3659c3fc2dde18f13754f7fcab81 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/group-header.php @@ -0,0 +1,64 @@ +<?php + +do_action( 'bp_before_group_header' ); + +?> + +<div id="item-actions"> + + <?php if ( bp_group_is_visible() ) : ?> + + <h3><?php _e( 'Group Admins', 'buddypress' ); ?></h3> + + <?php bp_group_list_admins(); + + do_action( 'bp_after_group_menu_admins' ); + + if ( bp_group_has_moderators() ) : + do_action( 'bp_before_group_menu_mods' ); ?> + + <h3><?php _e( 'Group Mods' , 'buddypress' ); ?></h3> + + <?php bp_group_list_mods(); + + do_action( 'bp_after_group_menu_mods' ); + + endif; + + endif; ?> + +</div><!-- #item-actions --> + +<div id="item-header-avatar"> + <a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>"> + + <?php bp_group_avatar(); ?> + + </a> +</div><!-- #item-header-avatar --> + +<div id="item-header-content"> + <span class="highlight"><?php bp_group_type(); ?></span> + <span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span> + + <?php do_action( 'bp_before_group_header_meta' ); ?> + + <div id="item-meta"> + + <?php bp_group_description(); ?> + + <div id="item-buttons"> + + <?php do_action( 'bp_group_header_actions' ); ?> + + </div><!-- #item-buttons --> + + <?php do_action( 'bp_group_header_meta' ); ?> + + </div> +</div><!-- #item-header-content --> + +<?php +do_action( 'bp_after_group_header' ); +do_action( 'template_notices' ); +?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/home.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/home.php new file mode 100644 index 0000000000000000000000000000000000000000..55dd5b000aaffd44106abbeae153ccbbb1a2ae12 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/home.php @@ -0,0 +1,107 @@ +<div id="buddypress"> + + <?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?> + + <?php do_action( 'bp_before_group_home_content' ); ?> + + <div id="item-header" role="complementary"> + + <?php bp_get_template_part( 'groups/single/group-header' ); ?> + + </div><!-- #item-header --> + + <div id="item-nav"> + <div class="item-list-tabs no-ajax" id="object-nav" role="navigation"> + <ul> + + <?php bp_get_options_nav(); ?> + + <?php do_action( 'bp_group_options_nav' ); ?> + + </ul> + </div> + </div><!-- #item-nav --> + + <div id="item-body"> + + <?php do_action( 'bp_before_group_body' ); + + /** + * Does this next bit look familiar? If not, go check out WordPress's + * /wp-includes/template-loader.php file. + * + * @todo A real template hierarchy? Gasp! + */ + + // Group is visible + if ( bp_group_is_visible() ) : + + // Looking at home location + if ( bp_is_group_home() ) : + + // Use custom front if one exists + $custom_front = bp_locate_template( array( 'groups/single/front.php' ), false, true ); + if ( ! empty( $custom_front ) ) : load_template( $custom_front, true ); + + // Default to activity + elseif ( bp_is_active( 'activity' ) ) : bp_get_template_part( 'groups/single/activity' ); + + // Otherwise show members + elseif ( bp_is_active( 'members' ) ) : bp_get_template_part( 'groups/single/members' ); + + endif; + + // Not looking at home + else : + + // Group Admin + if ( bp_is_group_admin_page() ) : bp_get_template_part( 'groups/single/admin' ); + + // Group Activity + elseif ( bp_is_group_activity() ) : bp_get_template_part( 'groups/single/activity' ); + + // Group Members + elseif ( bp_is_group_members() ) : bp_get_template_part( 'groups/single/members' ); + + // Group Invitations + elseif ( bp_is_group_invites() ) : bp_get_template_part( 'groups/single/send-invites' ); + + // Old group forums + elseif ( bp_is_group_forum() ) : bp_get_template_part( 'groups/single/forum' ); + + // Anything else (plugins mostly) + else : bp_get_template_part( 'groups/single/plugins' ); + + endif; + endif; + + // Group is not visible + elseif ( ! bp_group_is_visible() ) : + + // Membership request + if ( bp_is_group_membership_request() ) : + bp_get_template_part( 'groups/single/request-membership' ); + + // The group is not visible, show the status message + else : + + do_action( 'bp_before_group_status_message' ); ?> + + <div id="message" class="info"> + <p><?php bp_group_status_message(); ?></p> + </div> + + <?php do_action( 'bp_after_group_status_message' ); + + endif; + endif; + + do_action( 'bp_after_group_body' ); ?> + + </div><!-- #item-body --> + + <?php do_action( 'bp_after_group_home_content' ); ?> + + <?php endwhile; endif; ?> + +</div><!-- #buddypress --> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/members.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/members.php new file mode 100644 index 0000000000000000000000000000000000000000..fb7b4e2e99f01338455cf2b106dc5d44ba6fbcaa --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/members.php @@ -0,0 +1,90 @@ +<?php if ( bp_group_has_members( 'exclude_admins_mods=0' ) ) : ?> + + <?php do_action( 'bp_before_group_members_content' ); ?> + + <div class="item-list-tabs" id="subnav" role="navigation"> + <ul> + + <?php do_action( 'bp_members_directory_member_sub_types' ); ?> + + </ul> + </div> + + <div id="pag-top" class="pagination no-ajax"> + + <div class="pag-count" id="member-count-top"> + + <?php bp_members_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="member-pag-top"> + + <?php bp_members_pagination_links(); ?> + + </div> + + </div> + + <?php do_action( 'bp_before_group_members_list' ); ?> + + <ul id="member-list" class="item-list" role="main"> + + <?php while ( bp_group_members() ) : bp_group_the_member(); ?> + + <li> + <a href="<?php bp_group_member_domain(); ?>"> + + <?php bp_group_member_avatar_thumb(); ?> + + </a> + + <h5><?php bp_group_member_link(); ?></h5> + <span class="activity"><?php bp_group_member_joined_since(); ?></span> + + <?php do_action( 'bp_group_members_list_item' ); ?> + + <?php if ( bp_is_active( 'friends' ) ) : ?> + + <div class="action"> + + <?php bp_add_friend_button( bp_get_group_member_id(), bp_get_group_member_is_friend() ); ?> + + <?php do_action( 'bp_group_members_list_item_action' ); ?> + + </div> + + <?php endif; ?> + </li> + + <?php endwhile; ?> + + </ul> + + <?php do_action( 'bp_after_group_members_list' ); ?> + + <div id="pag-bottom" class="pagination no-ajax"> + + <div class="pag-count" id="member-count-bottom"> + + <?php bp_members_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="member-pag-bottom"> + + <?php bp_members_pagination_links(); ?> + + </div> + + </div> + + <?php do_action( 'bp_after_group_members_content' ); ?> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'This group has no members.', 'buddypress' ); ?></p> + </div> + +<?php endif; ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/plugins.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/plugins.php new file mode 100644 index 0000000000000000000000000000000000000000..c8e2f47d54a578068635e7fbc493f33bd2bb607a --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/plugins.php @@ -0,0 +1,13 @@ +<?php do_action( 'bp_before_group_plugin_template' ); ?> + +<div id="item-body"> + + <?php do_action( 'bp_before_group_body' ); ?> + + <?php do_action( 'bp_template_content' ); ?> + + <?php do_action( 'bp_after_group_body' ); ?> + +</div><!-- #item-body --> + +<?php do_action( 'bp_after_group_plugin_template' ); diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/request-membership.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/request-membership.php new file mode 100644 index 0000000000000000000000000000000000000000..fd9635810c583d776639c17742286532626f71c3 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/request-membership.php @@ -0,0 +1,18 @@ +<?php do_action( 'bp_before_group_request_membership_content' ); ?> + +<?php if ( !bp_group_has_requested_membership() ) : ?> + <p><?php printf( __( "You are requesting to become a member of the group '%s'.", "buddypress" ), bp_get_group_name( false ) ); ?></p> + + <form action="<?php bp_group_form_action('request-membership' ); ?>" method="post" name="request-membership-form" id="request-membership-form" class="standard-form"> + <label for="group-request-membership-comments"><?php _e( 'Comments (optional)', 'buddypress' ); ?></label> + <textarea name="group-request-membership-comments" id="group-request-membership-comments"></textarea> + + <?php do_action( 'bp_group_request_membership_content' ); ?> + + <p><input type="submit" name="group-request-send" id="group-request-send" value="<?php _e( 'Send Request', 'buddypress' ); ?>" /> + + <?php wp_nonce_field( 'groups_request_membership' ); ?> + </form><!-- #request-membership-form --> +<?php endif; ?> + +<?php do_action( 'bp_after_group_request_membership_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/send-invites.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/send-invites.php new file mode 100644 index 0000000000000000000000000000000000000000..4d30849b78348ef77bd28307d47287477b4806aa --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/groups/single/send-invites.php @@ -0,0 +1,78 @@ +<?php do_action( 'bp_before_group_send_invites_content' ); ?> + +<?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> + + <form action="<?php bp_group_send_invite_form_action(); ?>" method="post" id="send-invite-form" class="standard-form" role="main"> + + <div class="left-menu"> + + <div id="invite-list"> + <ul> + <?php bp_new_group_invite_friend_list(); ?> + </ul> + + <?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?> + </div> + + </div><!-- .left-menu --> + + <div class="main-column"> + + <div id="message" class="info"> + <p><?php _e('Select people to invite from your friends list.', 'buddypress' ); ?></p> + </div> + + <?php do_action( 'bp_before_group_send_invites_list' ); ?> + + <?php /* The ID 'friend-list' is important for AJAX support. */ ?> + <ul id="friend-list" class="item-list"> + <?php if ( bp_group_has_invites() ) : ?> + + <?php while ( bp_group_invites() ) : bp_group_the_invite(); ?> + + <li id="<?php bp_group_invite_item_id(); ?>"> + <?php bp_group_invite_user_avatar(); ?> + + <h4><?php bp_group_invite_user_link(); ?></h4> + <span class="activity"><?php bp_group_invite_user_last_active(); ?></span> + + <?php do_action( 'bp_group_send_invites_item' ); ?> + + <div class="action"> + <a class="button remove" href="<?php bp_group_invite_user_remove_invite_url(); ?>" id="<?php bp_group_invite_item_id(); ?>"><?php _e( 'Remove Invite', 'buddypress' ); ?></a> + + <?php do_action( 'bp_group_send_invites_item_action' ); ?> + </div> + </li> + + <?php endwhile; ?> + + <?php endif; ?> + </ul><!-- #friend-list --> + + <?php do_action( 'bp_after_group_send_invites_list' ); ?> + + </div><!-- .main-column --> + + <div class="clear"></div> + + <div class="submit"> + <input type="submit" name="submit" id="submit" value="<?php _e( 'Send Invites', 'buddypress' ); ?>" /> + </div> + + <?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?> + + <?php /* This is important, don't forget it */ ?> + <input type="hidden" name="group_id" id="group_id" value="<?php bp_group_id(); ?>" /> + + </form><!-- #send-invite-form --> + +<?php else : ?> + + <div id="message" class="info" role="main"> + <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group.', 'buddypress' ); ?></p> + </div> + +<?php endif; ?> + +<?php do_action( 'bp_after_group_send_invites_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/activate.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/activate.php new file mode 100644 index 0000000000000000000000000000000000000000..eea8e38ff03a6ed382d434cdaa2d25335531f474 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/activate.php @@ -0,0 +1,42 @@ +<div id="buddypress"> + + <?php do_action( 'bp_before_activation_page' ); ?> + + <div class="page" id="activate-page"> + + <?php do_action( 'template_notices' ); ?> + + <?php do_action( 'bp_before_activate_content' ); ?> + + <?php if ( bp_account_was_activated() ) : ?> + + <?php if ( isset( $_GET['e'] ) ) : ?> + <p><?php _e( 'Your account was activated successfully! Your account details have been sent to you in a separate email.', 'buddypress' ); ?></p> + <?php else : ?> + <p><?php _e( 'Your account was activated successfully! You can now log in with the username and password you provided when you signed up.', 'buddypress' ); ?></p> + <?php endif; ?> + + <?php else : ?> + + <p><?php _e( 'Please provide a valid activation key.', 'buddypress' ); ?></p> + + <form action="" method="get" class="standard-form" id="activation-form"> + + <label for="key"><?php _e( 'Activation Key:', 'buddypress' ); ?></label> + <input type="text" name="key" id="key" value="" /> + + <p class="submit"> + <input type="submit" name="submit" value="<?php _e( 'Activate', 'buddypress' ); ?>" /> + </p> + + </form> + + <?php endif; ?> + + <?php do_action( 'bp_after_activate_content' ); ?> + + </div><!-- .page --> + + <?php do_action( 'bp_after_activation_page' ); ?> + +</div><!-- #buddypress --> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/index.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/index.php new file mode 100644 index 0000000000000000000000000000000000000000..86b30cf44f3ca2cfc5403ab390f353f9fe68dc92 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/index.php @@ -0,0 +1,64 @@ +<?php do_action( 'bp_before_directory_members_page' ); ?> + +<div id="buddypress"> + + <?php do_action( 'bp_before_directory_members' ); ?> + + <?php do_action( 'bp_before_directory_members_content' ); ?> + + <div id="members-dir-search" class="dir-search" role="search"> + <?php bp_directory_members_search_form(); ?> + </div><!-- #members-dir-search --> + + <form action="" method="post" id="members-directory-form" class="dir-form"> + + <div class="item-list-tabs" role="navigation"> + <ul> + <li class="selected" id="members-all"><a href="<?php bp_members_directory_permalink(); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li> + + <?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> + <li id="members-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/'; ?>"><?php printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li> + <?php endif; ?> + + <?php do_action( 'bp_members_directory_member_types' ); ?> + + </ul> + </div><!-- .item-list-tabs --> + + <div class="item-list-tabs" id="subnav" role="navigation"> + <ul> + <?php do_action( 'bp_members_directory_member_sub_types' ); ?> + + <li id="members-order-select" class="last filter"> + <label for="members-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label> + <select id="members-order-by"> + <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> + <option value="newest"><?php _e( 'Newest Registered', 'buddypress' ); ?></option> + + <?php if ( bp_is_active( 'xprofile' ) ) : ?> + <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option> + <?php endif; ?> + + <?php do_action( 'bp_members_directory_order_options' ); ?> + </select> + </li> + </ul> + </div> + + <div id="members-dir-list" class="members dir-list"> + <?php bp_get_template_part( 'members/members-loop' ); ?> + </div><!-- #members-dir-list --> + + <?php do_action( 'bp_directory_members_content' ); ?> + + <?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?> + + <?php do_action( 'bp_after_directory_members_content' ); ?> + + </form><!-- #members-directory-form --> + + <?php do_action( 'bp_after_directory_members' ); ?> + +</div><!-- #buddypress --> + +<?php do_action( 'bp_after_directory_members_page' ); ?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php new file mode 100644 index 0000000000000000000000000000000000000000..deeb941779e6825932207210afc0f27ce4335840 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php @@ -0,0 +1,113 @@ +<?php + +/** + * BuddyPress - Members Loop + * + * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter() + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<?php do_action( 'bp_before_members_loop' ); ?> + +<?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?> + + <div id="pag-top" class="pagination"> + + <div class="pag-count" id="member-dir-count-top"> + + <?php bp_members_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="member-dir-pag-top"> + + <?php bp_members_pagination_links(); ?> + + </div> + + </div> + + <?php do_action( 'bp_before_directory_members_list' ); ?> + + <ul id="members-list" class="item-list" role="main"> + + <?php while ( bp_members() ) : bp_the_member(); ?> + + <li> + <div class="item-avatar"> + <a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a> + </div> + + <div class="item"> + <div class="item-title"> + <a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a> + + <?php if ( bp_get_member_latest_update() ) : ?> + + <span class="update"> <?php bp_member_latest_update(); ?></span> + + <?php endif; ?> + + </div> + + <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div> + + <?php do_action( 'bp_directory_members_item' ); ?> + + <?php + /*** + * If you want to show specific profile fields here you can, + * but it'll add an extra query for each member in the loop + * (only one regardless of the number of fields you show): + * + * bp_member_profile_data( 'field=the field name' ); + */ + ?> + </div> + + <div class="action"> + + <?php do_action( 'bp_directory_members_actions' ); ?> + + </div> + + <div class="clear"></div> + </li> + + <?php endwhile; ?> + + </ul> + + <?php do_action( 'bp_after_directory_members_list' ); ?> + + <?php bp_member_hidden_fields(); ?> + + <div id="pag-bottom" class="pagination"> + + <div class="pag-count" id="member-dir-count-bottom"> + + <?php bp_members_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="member-dir-pag-bottom"> + + <?php bp_members_pagination_links(); ?> + + </div> + + </div> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p> + </div> + +<?php endif; ?> + +<?php do_action( 'bp_after_members_loop' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/register.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/register.php new file mode 100644 index 0000000000000000000000000000000000000000..60baffda69462d8502e4681414a5de89cf843e89 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/register.php @@ -0,0 +1,269 @@ +<div id="buddypress"> + + <?php do_action( 'bp_before_register_page' ); ?> + + <div class="page" id="register-page"> + + <form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data"> + + <?php if ( 'registration-disabled' == bp_get_current_signup_step() ) : ?> + <?php do_action( 'template_notices' ); ?> + <?php do_action( 'bp_before_registration_disabled' ); ?> + + <p><?php _e( 'User registration is currently not allowed.', 'buddypress' ); ?></p> + + <?php do_action( 'bp_after_registration_disabled' ); ?> + <?php endif; // registration-disabled signup setp ?> + + <?php if ( 'request-details' == bp_get_current_signup_step() ) : ?> + + <?php do_action( 'template_notices' ); ?> + + <p><?php _e( 'Registering for this site is easy, just fill in the fields below and we\'ll get a new account set up for you in no time.', 'buddypress' ); ?></p> + + <?php do_action( 'bp_before_account_details_fields' ); ?> + + <div class="register-section" id="basic-details-section"> + + <?php /***** Basic Account Details ******/ ?> + + <h4><?php _e( 'Account Details', 'buddypress' ); ?></h4> + + <label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> + <?php do_action( 'bp_signup_username_errors' ); ?> + <input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" /> + + <label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> + <?php do_action( 'bp_signup_email_errors' ); ?> + <input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" /> + + <label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> + <?php do_action( 'bp_signup_password_errors' ); ?> + <input type="password" name="signup_password" id="signup_password" value="" /> + + <label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> + <?php do_action( 'bp_signup_password_confirm_errors' ); ?> + <input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" /> + + </div><!-- #basic-details-section --> + + <?php do_action( 'bp_after_account_details_fields' ); ?> + + <?php /***** Extra Profile Details ******/ ?> + + <?php if ( bp_is_active( 'xprofile' ) ) : ?> + + <?php do_action( 'bp_before_signup_profile_fields' ); ?> + + <div class="register-section" id="profile-details-section"> + + <h4><?php _e( 'Profile Details', 'buddypress' ); ?></h4> + + <?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?> + <?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?> + + <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> + + <div class="editfield"> + + <?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?> + + <label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?> + <input type="text" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" value="<?php bp_the_profile_field_edit_value(); ?>" /> + + <?php endif; ?> + + <?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?> + + <label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?> + <textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_edit_value(); ?></textarea> + + <?php endif; ?> + + <?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?> + + <label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?> + <select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>"> + <?php bp_the_profile_field_options(); ?> + </select> + + <?php endif; ?> + + <?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?> + + <label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?> + <select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" multiple="multiple"> + <?php bp_the_profile_field_options(); ?> + </select> + + <?php endif; ?> + + <?php if ( 'radio' == bp_get_the_profile_field_type() ) : ?> + + <div class="radio"> + <span class="label"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></span> + + <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?> + <?php bp_the_profile_field_options(); ?> + + <?php if ( !bp_get_the_profile_field_is_required() ) : ?> + <a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name(); ?>' );"><?php _e( 'Clear', 'buddypress' ); ?></a> + <?php endif; ?> + </div> + + <?php endif; ?> + + <?php if ( 'checkbox' == bp_get_the_profile_field_type() ) : ?> + + <div class="checkbox"> + <span class="label"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></span> + + <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?> + <?php bp_the_profile_field_options(); ?> + </div> + + <?php endif; ?> + + <?php if ( 'datebox' == bp_get_the_profile_field_type() ) : ?> + + <div class="datebox"> + <label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?> + + <select name="<?php bp_the_profile_field_input_name(); ?>_day" id="<?php bp_the_profile_field_input_name(); ?>_day"> + <?php bp_the_profile_field_options( 'type=day' ); ?> + </select> + + <select name="<?php bp_the_profile_field_input_name(); ?>_month" id="<?php bp_the_profile_field_input_name(); ?>_month"> + <?php bp_the_profile_field_options( 'type=month' ); ?> + </select> + + <select name="<?php bp_the_profile_field_input_name(); ?>_year" id="<?php bp_the_profile_field_input_name(); ?>_year"> + <?php bp_the_profile_field_options( 'type=year' ); ?> + </select> + </div> + + <?php endif; ?> + + <?php do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?> + + <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> + <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> + <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></a> + </p> + + <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> + <fieldset> + <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend> + + <?php bp_profile_visibility_radio_buttons() ?> + + </fieldset> + <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a> + + </div> + <?php else : ?> + <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> + <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> + </p> + <?php endif ?> + + <?php do_action( 'bp_custom_profile_edit_fields' ); ?> + + <p class="description"><?php bp_the_profile_field_description(); ?></p> + + </div> + + <?php endwhile; ?> + + <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids(); ?>" /> + + <?php endwhile; endif; endif; ?> + + </div><!-- #profile-details-section --> + + <?php do_action( 'bp_after_signup_profile_fields' ); ?> + + <?php endif; ?> + + <?php if ( bp_get_blog_signup_allowed() ) : ?> + + <?php do_action( 'bp_before_blog_details_fields' ); ?> + + <?php /***** Blog Creation Details ******/ ?> + + <div class="register-section" id="blog-details-section"> + + <h4><?php _e( 'Blog Details', 'buddypress' ); ?></h4> + + <p><input type="checkbox" name="signup_with_blog" id="signup_with_blog" value="1"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes, I\'d like to create a new site', 'buddypress' ); ?></p> + + <div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>> + + <label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> + <?php do_action( 'bp_signup_blog_url_errors' ); ?> + + <?php if ( is_subdomain_install() ) : ?> + http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> .<?php bp_blogs_subdomain_base(); ?> + <?php else : ?> + <?php echo site_url(); ?>/ <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> + <?php endif; ?> + + <label for="signup_blog_title"><?php _e( 'Site Title', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label> + <?php do_action( 'bp_signup_blog_title_errors' ); ?> + <input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value(); ?>" /> + + <span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>:</span> + <?php do_action( 'bp_signup_blog_privacy_errors' ); ?> + + <label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_public" value="public"<?php if ( 'public' == bp_get_signup_blog_privacy_value() || !bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'Yes', 'buddypress' ); ?></label> + <label><input type="radio" name="signup_blog_privacy" id="signup_blog_privacy_private" value="private"<?php if ( 'private' == bp_get_signup_blog_privacy_value() ) : ?> checked="checked"<?php endif; ?> /> <?php _e( 'No', 'buddypress' ); ?></label> + + </div> + + </div><!-- #blog-details-section --> + + <?php do_action( 'bp_after_blog_details_fields' ); ?> + + <?php endif; ?> + + <?php do_action( 'bp_before_registration_submit_buttons' ); ?> + + <div class="submit"> + <input type="submit" name="signup_submit" id="signup_submit" value="<?php _e( 'Complete Sign Up', 'buddypress' ); ?>" /> + </div> + + <?php do_action( 'bp_after_registration_submit_buttons' ); ?> + + <?php wp_nonce_field( 'bp_new_signup' ); ?> + + <?php endif; // request-details signup step ?> + + <?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?> + + <?php do_action( 'template_notices' ); ?> + <?php do_action( 'bp_before_registration_confirmed' ); ?> + + <?php if ( bp_registration_needs_activation() ) : ?> + <p><?php _e( 'You have successfully created your account! To begin using this site you will need to activate your account via the email we have just sent to your address.', 'buddypress' ); ?></p> + <?php else : ?> + <p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ); ?></p> + <?php endif; ?> + + <?php do_action( 'bp_after_registration_confirmed' ); ?> + + <?php endif; // completed-confirmation signup step ?> + + <?php do_action( 'bp_custom_signup_steps' ); ?> + + </form> + + </div> + + <?php do_action( 'bp_after_register_page' ); ?> + +</div><!-- #buddypress --> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/activity.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/activity.php new file mode 100644 index 0000000000000000000000000000000000000000..06e9263d19e19c4523030403ae4cd03642095803 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/activity.php @@ -0,0 +1,77 @@ +<?php + +/** + * BuddyPress - Users Activity + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + + <?php bp_get_options_nav(); ?> + + <li id="activity-filter-select" class="last"> + <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> + <select id="activity-filter-by"> + <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option> + <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option> + + <?php + if ( !bp_is_current_action( 'groups' ) ) : + if ( bp_is_active( 'blogs' ) ) : ?> + + <option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ); ?></option> + <option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ); ?></option> + + <?php + endif; + + if ( bp_is_active( 'friends' ) ) : ?> + + <option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option> + + <?php endif; + + endif; + + if ( bp_is_active( 'forums' ) ) : ?> + + <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option> + <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option> + + <?php endif; + + if ( bp_is_active( 'groups' ) ) : ?> + + <option value="created_group"><?php _e( 'New Groups', 'buddypress' ); ?></option> + <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option> + + <?php endif; + + do_action( 'bp_member_activity_filter_options' ); ?> + + </select> + </li> + </ul> +</div><!-- .item-list-tabs --> + +<?php do_action( 'bp_before_member_activity_post_form' ); ?> + +<?php +if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( 'just-me' ) ) ) + bp_get_template_part( 'activity/post-form' ); + +do_action( 'bp_after_member_activity_post_form' ); +do_action( 'bp_before_member_activity_content' ); ?> + +<div class="activity" role="main"> + + <?php bp_get_template_part( 'activity/activity-loop' ) ?> + +</div><!-- .activity --> + +<?php do_action( 'bp_after_member_activity_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/blogs.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/blogs.php new file mode 100644 index 0000000000000000000000000000000000000000..27b767802840949659dfcd7bcc99978f405beba7 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/blogs.php @@ -0,0 +1,52 @@ +<?php + +/** + * BuddyPress - Users Blogs + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<div class="item-list-tabs" id="subnav" role="navigation"> + <ul> + + <?php bp_get_options_nav(); ?> + + <li id="blogs-order-select" class="last filter"> + + <label for="blogs-all"><?php _e( 'Order By:', 'buddypress' ); ?></label> + <select id="blogs-all"> + <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> + <option value="newest"><?php _e( 'Newest', 'buddypress' ); ?></option> + <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option> + + <?php do_action( 'bp_member_blog_order_options' ); ?> + + </select> + </li> + </ul> +</div><!-- .item-list-tabs --> + +<?php +switch ( bp_current_action() ) : + + // Home/My Blogs + case 'my-sites' : + do_action( 'bp_before_member_blogs_content' ); ?> + + <div class="blogs myblogs" role="main"> + + <?php bp_get_template_part( 'blogs/blogs-loop' ) ?> + + </div><!-- .blogs.myblogs --> + + <?php do_action( 'bp_after_member_blogs_content' ); + break; + + // Any other + default : + bp_get_template_part( 'members/single/plugins' ); + break; +endswitch; \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums.php new file mode 100644 index 0000000000000000000000000000000000000000..d40180af2402681bea1f99b82a7a2a25a0299c59 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums.php @@ -0,0 +1,47 @@ +<?php + +/** + * BuddyPress - Users Forums + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + <?php bp_get_options_nav(); ?> + + <li id="forums-order-select" class="last filter"> + + <label for="forums-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label> + <select id="forums-order-by"> + <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> + <option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option> + <option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option> + + <?php do_action( 'bp_forums_directory_order_options' ); ?> + + </select> + </li> + </ul> +</div><!-- .item-list-tabs --> + +<?php + +if ( bp_is_current_action( 'favorites' ) ) : + bp_get_template_part( 'members/single/forums/topics' ); + +else : + do_action( 'bp_before_member_forums_content' ); ?> + + <div class="forums myforums"> + + <?php bp_get_template_part( 'forums/forums-loop' ) ?> + + </div> + + <?php do_action( 'bp_after_member_forums_content' ); ?> + +<?php endif; ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums/topics.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums/topics.php new file mode 100644 index 0000000000000000000000000000000000000000..a202e9e730719fb3edd6bae27dd4cf59f6ba832b --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/forums/topics.php @@ -0,0 +1,7 @@ +<?php +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends.php new file mode 100644 index 0000000000000000000000000000000000000000..0019fd6f73856e5c44be1d8a53a377ac819e26c6 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends.php @@ -0,0 +1,60 @@ +<?php + +/** + * BuddyPress - Users Friends + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + <?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?> + + <?php if ( !bp_is_current_action( 'requests' ) ) : ?> + + <li id="members-order-select" class="last filter"> + + <label for="members-friends"><?php _e( 'Order By:', 'buddypress' ); ?></label> + <select id="members-friends"> + <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> + <option value="newest"><?php _e( 'Newest Registered', 'buddypress' ); ?></option> + <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option> + + <?php do_action( 'bp_member_blog_order_options' ); ?> + + </select> + </li> + + <?php endif; ?> + + </ul> +</div> + +<?php +switch ( bp_current_action() ) : + + // Home/My Friends + case 'my-friends' : + do_action( 'bp_before_member_friends_content' ); ?> + + <div class="members friends"> + + <?php bp_get_template_part( 'members/members-loop' ) ?> + + </div><!-- .members.friends --> + + <?php do_action( 'bp_after_member_friends_content' ); + break; + + case 'requests' : + bp_get_template_part( 'members/single/friends/requests' ); + break; + + // Any other + default : + bp_get_template_part( 'members/single/plugins' ); + break; +endswitch; diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends/requests.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends/requests.php new file mode 100644 index 0000000000000000000000000000000000000000..a47f6bc5ecada19723b56a5e5796634e79330be0 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/friends/requests.php @@ -0,0 +1,73 @@ +<?php do_action( 'bp_before_member_friend_requests_content' ); ?> + +<?php if ( bp_has_members( 'type=alphabetical&include=' . bp_get_friendship_requests() ) ) : ?> + + <div id="pag-top" class="pagination no-ajax"> + + <div class="pag-count" id="member-dir-count-top"> + + <?php bp_members_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="member-dir-pag-top"> + + <?php bp_members_pagination_links(); ?> + + </div> + + </div> + + <ul id="friend-list" class="item-list" role="main"> + <?php while ( bp_members() ) : bp_the_member(); ?> + + <li id="friendship-<?php bp_friend_friendship_id(); ?>"> + <div class="item-avatar"> + <a href="<?php bp_member_link(); ?>"><?php bp_member_avatar(); ?></a> + </div> + + <div class="item"> + <div class="item-title"><a href="<?php bp_member_link(); ?>"><?php bp_member_name(); ?></a></div> + <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div> + </div> + + <?php do_action( 'bp_friend_requests_item' ); ?> + + <div class="action"> + <a class="button accept" href="<?php bp_friend_accept_request_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> + <a class="button reject" href="<?php bp_friend_reject_request_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?></a> + + <?php do_action( 'bp_friend_requests_item_action' ); ?> + </div> + </li> + + <?php endwhile; ?> + </ul> + + <?php do_action( 'bp_friend_requests_content' ); ?> + + <div id="pag-bottom" class="pagination no-ajax"> + + <div class="pag-count" id="member-dir-count-bottom"> + + <?php bp_members_pagination_count(); ?> + + </div> + + <div class="pagination-links" id="member-dir-pag-bottom"> + + <?php bp_members_pagination_links(); ?> + + </div> + + </div> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'You have no pending friendship requests.', 'buddypress' ); ?></p> + </div> + +<?php endif;?> + +<?php do_action( 'bp_after_member_friend_requests_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups.php new file mode 100644 index 0000000000000000000000000000000000000000..252f9297d8b4af11c8efb28b72596c3303b7176f --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups.php @@ -0,0 +1,63 @@ +<?php + +/** + * BuddyPress - Users Groups + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + <?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?> + + <?php if ( !bp_is_current_action( 'invites' ) ) : ?> + + <li id="groups-order-select" class="last filter"> + + <label for="groups-sort-by"><?php _e( 'Order By:', 'buddypress' ); ?></label> + <select id="groups-sort-by"> + <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option> + <option value="popular"><?php _e( 'Most Members', 'buddypress' ); ?></option> + <option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option> + <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option> + + <?php do_action( 'bp_member_group_order_options' ); ?> + + </select> + </li> + + <?php endif; ?> + + </ul> +</div><!-- .item-list-tabs --> + +<?php + +switch ( bp_current_action() ) : + + // Home/My Groups + case 'my-groups' : + do_action( 'bp_before_member_groups_content' ); ?> + + <div class="groups mygroups"> + + <?php bp_get_template_part( 'groups/groups-loop' ); ?> + + </div> + + <?php do_action( 'bp_after_member_groups_content' ); + break; + + // Group Invitations + case 'invites' : + bp_get_template_part( 'members/single/groups/invites' ); + break; + + // Any other + default : + bp_get_template_part( 'members/single/plugins' ); + break; +endswitch; \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php new file mode 100644 index 0000000000000000000000000000000000000000..4d2047fe77c4a9bdfaf69146bcd3606a482be0e1 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php @@ -0,0 +1,42 @@ +<?php do_action( 'bp_before_group_invites_content' ); ?> + +<?php if ( bp_has_groups( 'type=invites&user_id=' . bp_loggedin_user_id() ) ) : ?> + + <ul id="group-list" class="invites item-list" role="main"> + + <?php while ( bp_groups() ) : bp_the_group(); ?> + + <li> + <div class="item-avatar"> + <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a> + </div> + + <h4><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a><span class="small"> - <?php printf( __( '%s members', 'buddypress' ), bp_group_total_members( false ) ); ?></span></h4> + + <p class="desc"> + <?php bp_group_description_excerpt(); ?> + </p> + + <?php do_action( 'bp_group_invites_item' ); ?> + + <div class="action"> + <a class="button accept" href="<?php bp_group_accept_invite_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> + <a class="button reject confirm" href="<?php bp_group_reject_invite_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?></a> + + <?php do_action( 'bp_group_invites_item_action' ); ?> + + </div> + </li> + + <?php endwhile; ?> + </ul> + +<?php else: ?> + + <div id="message" class="info" role="main"> + <p><?php _e( 'You have no outstanding group invites.', 'buddypress' ); ?></p> + </div> + +<?php endif;?> + +<?php do_action( 'bp_after_group_invites_content' ); ?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php new file mode 100644 index 0000000000000000000000000000000000000000..9fcf24ec135baecf432abba0244833a1c5894899 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/home.php @@ -0,0 +1,63 @@ +<div id="buddypress"> + + <?php do_action( 'bp_before_member_home_content' ); ?> + + <div id="item-header" role="complementary"> + + <?php bp_get_template_part( 'members/single/member-header' ) ?> + + </div><!-- #item-header --> + + <div id="item-nav"> + <div class="item-list-tabs no-ajax" id="object-nav" role="navigation"> + <ul> + + <?php bp_get_displayed_user_nav(); ?> + + <?php do_action( 'bp_member_options_nav' ); ?> + + </ul> + </div> + </div><!-- #item-nav --> + + <div id="item-body"> + + <?php do_action( 'bp_before_member_body' ); + + if ( bp_is_user_activity() || !bp_current_component() ) : + bp_get_template_part( 'members/single/activity' ); + + elseif ( bp_is_user_blogs() ) : + bp_get_template_part( 'members/single/blogs' ); + + elseif ( bp_is_user_friends() ) : + bp_get_template_part( 'members/single/friends' ); + + elseif ( bp_is_user_groups() ) : + bp_get_template_part( 'members/single/groups' ); + + elseif ( bp_is_user_messages() ) : + bp_get_template_part( 'members/single/messages' ); + + elseif ( bp_is_user_profile() ) : + bp_get_template_part( 'members/single/profile' ); + + elseif ( bp_is_user_forums() ) : + bp_get_template_part( 'members/single/forums' ); + + elseif ( bp_is_user_settings() ) : + bp_get_template_part( 'members/single/settings' ); + + // If nothing sticks, load a generic template + else : + bp_get_template_part( 'members/single/plugins' ); + + endif; + + do_action( 'bp_after_member_body' ); ?> + + </div><!-- #item-body --> + + <?php do_action( 'bp_after_member_home_content' ); ?> + +</div><!-- #buddypress --> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/member-header.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/member-header.php new file mode 100644 index 0000000000000000000000000000000000000000..9bd1c1d4bfad4493f3456f649382bf195e3cb171 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/member-header.php @@ -0,0 +1,62 @@ +<?php + +/** + * BuddyPress - Users Header + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<?php do_action( 'bp_before_member_header' ); ?> + +<div id="item-header-avatar"> + <a href="<?php bp_displayed_user_link(); ?>"> + + <?php bp_displayed_user_avatar( 'type=full' ); ?> + + </a> +</div><!-- #item-header-avatar --> + +<div id="item-header-content"> + + <h2 class="user-nicename">@<?php bp_displayed_user_username(); ?></h2> + <span class="activity"><?php bp_last_activity( bp_displayed_user_id() ); ?></span> + + <?php do_action( 'bp_before_member_header_meta' ); ?> + + <div id="item-meta"> + + <?php if ( bp_is_active( 'activity' ) ) : ?> + + <div id="latest-update"> + + <?php bp_activity_latest_update( bp_displayed_user_id() ); ?> + + </div> + + <?php endif; ?> + + <div id="item-buttons"> + + <?php do_action( 'bp_member_header_actions' ); ?> + + </div><!-- #item-buttons --> + + <?php + /*** + * If you'd like to show specific profile fields here use: + * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field + */ + do_action( 'bp_profile_header_meta' ); + + ?> + + </div><!-- #item-meta --> + +</div><!-- #item-header-content --> + +<?php do_action( 'bp_after_member_header' ); ?> + +<?php do_action( 'template_notices' ); ?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages.php new file mode 100644 index 0000000000000000000000000000000000000000..3990a2be27996d1e2b204142e0aedc301337045c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages.php @@ -0,0 +1,67 @@ +<?php + +/** + * BuddyPress - Users Messages + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + + <?php bp_get_options_nav(); ?> + + </ul> + + <?php if ( bp_is_messages_inbox() || bp_is_messages_sentbox() ) : ?> + + <div class="message-search"><?php bp_message_search_form(); ?></div> + + <?php endif; ?> + +</div><!-- .item-list-tabs --> + +<?php +switch ( bp_current_action() ) : + + // Inbox/Sentbox + case 'inbox' : + case 'sentbox' : + do_action( 'bp_before_member_messages_content' ); ?> + + <div class="messages" role="main"> + <?php bp_get_template_part( 'members/single/messages/messages-loop' ); ?> + </div><!-- .messages --> + + <?php do_action( 'bp_after_member_messages_content' ); + break; + + // Single Message View + case 'view' : + bp_get_template_part( 'members/single/messages/single' ); + break; + + // Compose + case 'compose' : + bp_get_template_part( 'members/single/messages/compose' ); + break; + + // Sitewide Notices + case 'notices' : + do_action( 'bp_before_member_messages_content' ); ?> + + <div class="messages" role="main"> + <?php bp_get_template_part( 'members/single/messages/notices-loop' );; ?> + </div><!-- .messages --> + + <?php do_action( 'bp_after_member_messages_content' ); + break; + + // Any other + default : + bp_get_template_part( 'members/single/plugins' ); + break; +endswitch; \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/compose.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/compose.php new file mode 100644 index 0000000000000000000000000000000000000000..cc8076aba4436cc21d72627849d320e58e6a5ddb --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/compose.php @@ -0,0 +1,37 @@ +<form action="<?php bp_messages_form_action('compose' ); ?>" method="post" id="send_message_form" class="standard-form" role="main" enctype="multipart/form-data"> + + <?php do_action( 'bp_before_messages_compose_content' ); ?> + + <label for="send-to-input"><?php _e("Send To (Username or Friend's Name)", 'buddypress' ); ?></label> + <ul class="first acfb-holder"> + <li> + <?php bp_message_get_recipient_tabs(); ?> + <input type="text" name="send-to-input" class="send-to-input" id="send-to-input" /> + </li> + </ul> + + <?php if ( bp_current_user_can( 'bp_moderate' ) ) : ?> + <input type="checkbox" id="send-notice" name="send-notice" value="1" /> <?php _e( "This is a notice to all users.", "buddypress" ); ?> + <?php endif; ?> + + <label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label> + <input type="text" name="subject" id="subject" value="<?php bp_messages_subject_value(); ?>" /> + + <label for="content"><?php _e( 'Message', 'buddypress' ); ?></label> + <textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value(); ?></textarea> + + <input type="hidden" name="send_to_usernames" id="send-to-usernames" value="<?php bp_message_get_recipient_usernames(); ?>" class="<?php bp_message_get_recipient_usernames(); ?>" /> + + <?php do_action( 'bp_after_messages_compose_content' ); ?> + + <div class="submit"> + <input type="submit" value="<?php _e( "Send Message", 'buddypress' ); ?>" name="send" id="send" /> + </div> + + <?php wp_nonce_field( 'messages_send_message' ); ?> +</form> + +<script type="text/javascript"> + document.getElementById("send-to-input").focus(); +</script> + diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php new file mode 100644 index 0000000000000000000000000000000000000000..2e721df896ac1f8cca227c8d5d69803c7a873c91 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php @@ -0,0 +1,74 @@ +<?php do_action( 'bp_before_member_messages_loop' ); ?> + +<?php if ( bp_has_message_threads( bp_ajax_querystring( 'messages' ) ) ) : ?> + + <div class="pagination no-ajax" id="user-pag"> + + <div class="pag-count" id="messages-dir-count"> + <?php bp_messages_pagination_count(); ?> + </div> + + <div class="pagination-links" id="messages-dir-pag"> + <?php bp_messages_pagination(); ?> + </div> + + </div><!-- .pagination --> + + <?php do_action( 'bp_after_member_messages_pagination' ); ?> + + <?php do_action( 'bp_before_member_messages_threads' ); ?> + + <table id="message-threads" class="messages-notices"> + <?php while ( bp_message_threads() ) : bp_message_thread(); ?> + + <tr id="m-<?php bp_message_thread_id(); ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread<?php else: ?> read<?php endif; ?>"> + <td width="1%" class="thread-count"> + <span class="unread-count"><?php bp_message_thread_unread_count(); ?></span> + </td> + <td width="1%" class="thread-avatar"><?php bp_message_thread_avatar(); ?></td> + + <?php if ( 'sentbox' != bp_current_action() ) : ?> + <td width="30%" class="thread-from"> + <?php _e( 'From:', 'buddypress' ); ?> <?php bp_message_thread_from(); ?><br /> + <span class="activity"><?php bp_message_thread_last_post_date(); ?></span> + </td> + <?php else: ?> + <td width="30%" class="thread-from"> + <?php _e( 'To:', 'buddypress' ); ?> <?php bp_message_thread_to(); ?><br /> + <span class="activity"><?php bp_message_thread_last_post_date(); ?></span> + </td> + <?php endif; ?> + + <td width="50%" class="thread-info"> + <p><a href="<?php bp_message_thread_view_link(); ?>" title="<?php _e( "View Message", "buddypress" ); ?>"><?php bp_message_thread_subject(); ?></a></p> + <p class="thread-excerpt"><?php bp_message_thread_excerpt(); ?></p> + </td> + + <?php do_action( 'bp_messages_inbox_list_item' ); ?> + + <td width="13%" class="thread-options"> + <input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id(); ?>" /> + <a class="button confirm" href="<?php bp_message_thread_delete_link(); ?>" title="<?php _e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> + </td> + </tr> + + <?php endwhile; ?> + </table><!-- #message-threads --> + + <div class="messages-options-nav"> + <?php bp_messages_options(); ?> + </div><!-- .messages-options-nav --> + + <?php do_action( 'bp_after_member_messages_threads' ); ?> + + <?php do_action( 'bp_after_member_messages_options' ); ?> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'Sorry, no messages were found.', 'buddypress' ); ?></p> + </div> + +<?php endif;?> + +<?php do_action( 'bp_after_member_messages_loop' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php new file mode 100644 index 0000000000000000000000000000000000000000..5733c8b2fc3ff6cdf33e6117456ff8670951dbef --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/notices-loop.php @@ -0,0 +1,59 @@ +<?php do_action( 'bp_before_notices_loop' ); ?> + +<?php if ( bp_has_message_threads() ) : ?> + + <div class="pagination no-ajax" id="user-pag"> + + <div class="pag-count" id="messages-dir-count"> + <?php bp_messages_pagination_count(); ?> + </div> + + <div class="pagination-links" id="messages-dir-pag"> + <?php bp_messages_pagination(); ?> + </div> + + </div><!-- .pagination --> + + <?php do_action( 'bp_after_notices_pagination' ); ?> + <?php do_action( 'bp_before_notices' ); ?> + + <table id="message-threads" class="messages-notices"> + <?php while ( bp_message_threads() ) : bp_message_thread(); ?> + <tr id="notice-<?php bp_message_notice_id(); ?>" class="<?php bp_message_css_class(); ?>"> + <td width="1%"></td> + <td width="38%"> + <strong><?php bp_message_notice_subject(); ?></strong> + <?php bp_message_notice_text(); ?> + </td> + <td width="21%"> + + <?php if ( bp_messages_is_active_notice() ) : ?> + + <strong><?php bp_messages_is_active_notice(); ?></strong> + + <?php endif; ?> + + <span class="activity"><?php _e( 'Sent:', 'buddypress' ); ?> <?php bp_message_notice_post_date(); ?></span> + </td> + + <?php do_action( 'bp_notices_list_item' ); ?> + + <td width="10%"> + <a class="button" href="<?php bp_message_activate_deactivate_link(); ?>" class="confirm"><?php bp_message_activate_deactivate_text(); ?></a> + <a class="button" href="<?php bp_message_notice_delete_link(); ?>" class="confirm" title="<?php _e( "Delete Message", "buddypress" ); ?>">x</a> + </td> + </tr> + <?php endwhile; ?> + </table><!-- #message-threads --> + + <?php do_action( 'bp_after_notices' ); ?> + +<?php else: ?> + + <div id="message" class="info"> + <p><?php _e( 'Sorry, no notices were found.', 'buddypress' ); ?></p> + </div> + +<?php endif;?> + +<?php do_action( 'bp_after_notices_loop' ); ?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/single.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/single.php new file mode 100644 index 0000000000000000000000000000000000000000..0f0648aa9994dcfe485f1caeb5279c22d2d38c00 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/messages/single.php @@ -0,0 +1,121 @@ +<div id="message-thread" role="main"> + + <?php do_action( 'bp_before_message_thread_content' ); ?> + + <?php if ( bp_thread_has_messages() ) : ?> + + <h3 id="message-subject"><?php bp_the_thread_subject(); ?></h3> + + <p id="message-recipients"> + <span class="highlight"> + + <?php if ( !bp_get_the_thread_recipients() ) : ?> + + <?php _e( 'You are alone in this conversation.', 'buddypress' ); ?> + + <?php else : ?> + + <?php printf( __( 'Conversation between %s and you.', 'buddypress' ), bp_get_the_thread_recipients() ); ?> + + <?php endif; ?> + + </span> + + <a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>" title="<?php _e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> + </p> + + <?php do_action( 'bp_before_message_thread_list' ); ?> + + <?php while ( bp_thread_messages() ) : bp_thread_the_message(); ?> + + <div class="message-box <?php bp_the_thread_message_alt_class(); ?>"> + + <div class="message-metadata"> + + <?php do_action( 'bp_before_message_meta' ); ?> + + <?php bp_the_thread_message_sender_avatar( 'type=thumb&width=30&height=30' ); ?> + + <?php if ( bp_get_the_thread_message_sender_link() ) : ?> + + <strong><a href="<?php bp_the_thread_message_sender_link(); ?>" title="<?php bp_the_thread_message_sender_name(); ?>"><?php bp_the_thread_message_sender_name(); ?></a></strong> + + <?php else : ?> + + <strong><?php bp_the_thread_message_sender_name(); ?></strong> + + <?php endif; ?> + + <span class="activity"><?php bp_the_thread_message_time_since(); ?></span> + + <?php do_action( 'bp_after_message_meta' ); ?> + + </div><!-- .message-metadata --> + + <?php do_action( 'bp_before_message_content' ); ?> + + <div class="message-content"> + + <?php bp_the_thread_message_content(); ?> + + </div><!-- .message-content --> + + <?php do_action( 'bp_after_message_content' ); ?> + + <div class="clear"></div> + + </div><!-- .message-box --> + + <?php endwhile; ?> + + <?php do_action( 'bp_after_message_thread_list' ); ?> + + <?php do_action( 'bp_before_message_thread_reply' ); ?> + + <form id="send-reply" action="<?php bp_messages_form_action(); ?>" method="post" class="standard-form"> + + <div class="message-box"> + + <div class="message-metadata"> + + <?php do_action( 'bp_before_message_meta' ); ?> + + <div class="avatar-box"> + <?php bp_loggedin_user_avatar( 'type=thumb&height=30&width=30' ); ?> + + <strong><?php _e( 'Send a Reply', 'buddypress' ); ?></strong> + </div> + + <?php do_action( 'bp_after_message_meta' ); ?> + + </div><!-- .message-metadata --> + + <div class="message-content"> + + <?php do_action( 'bp_before_message_reply_box' ); ?> + + <textarea name="content" id="message_content" rows="15" cols="40"></textarea> + + <?php do_action( 'bp_after_message_reply_box' ); ?> + + <div class="submit"> + <input type="submit" name="send" value="<?php _e( 'Send Reply', 'buddypress' ); ?>" id="send_reply_button"/> + </div> + + <input type="hidden" id="thread_id" name="thread_id" value="<?php bp_the_thread_id(); ?>" /> + <input type="hidden" id="messages_order" name="messages_order" value="<?php bp_thread_messages_order(); ?>" /> + <?php wp_nonce_field( 'messages_send_message', 'send_message_nonce' ); ?> + + </div><!-- .message-content --> + + </div><!-- .message-box --> + + </form><!-- #send-reply --> + + <?php do_action( 'bp_after_message_thread_reply' ); ?> + + <?php endif; ?> + + <?php do_action( 'bp_after_message_thread_content' ); ?> + +</div> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/plugins.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/plugins.php new file mode 100644 index 0000000000000000000000000000000000000000..4c956fb57977f59ff827bccc78a0976d0f78f501 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/plugins.php @@ -0,0 +1,31 @@ +<?php +/** + * BuddyPress - Users Plugins Template + * + * 3rd-party plugins should use this template to easily add template + * support to their plugins for the members component. + * + * @package BuddyPress + * @subpackage bp-legacy + */ +?> + + <?php do_action( 'bp_before_member_plugin_template' ); ?> + + <?php if ( ! bp_is_current_component_core() ) : ?> + + <div class="item-list-tabs no-ajax" id="subnav"> + <ul> + <?php bp_get_options_nav(); ?> + + <?php do_action( 'bp_member_plugin_options_nav' ); ?> + </ul> + </div><!-- .item-list-tabs --> + + <?php endif; ?> + + <h3><?php do_action( 'bp_template_title' ); ?></h3> + + <?php do_action( 'bp_template_content' ); ?> + + <?php do_action( 'bp_after_member_plugin_template' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile.php new file mode 100644 index 0000000000000000000000000000000000000000..928f926d4ce93c8d3b802d9adccee992d676ae96 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile.php @@ -0,0 +1,60 @@ +<?php + +/** + * BuddyPress - Users Profile + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<?php if ( bp_is_my_profile() ) : ?> + + <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + + <?php bp_get_options_nav(); ?> + + </ul> + </div><!-- .item-list-tabs --> + +<?php endif; ?> + +<?php do_action( 'bp_before_profile_content' ); ?> + +<div class="profile" role="main"> + +<?php switch ( bp_current_action() ) : + + // Edit + case 'edit' : + bp_get_template_part( 'members/single/profile/edit' ); + break; + + // Change Avatar + case 'change-avatar' : + bp_get_template_part( 'members/single/profile/change-avatar' ); + break; + + // Compose + case 'public' : + + // Display XProfile + if ( bp_is_active( 'xprofile' ) ) + bp_get_template_part( 'members/single/profile/profile-loop' ); + + // Display WordPress profile (fallback) + else + bp_get_template_part( 'members/single/profile/profile-wp' ); + + break; + + // Any other + default : + bp_get_template_part( 'members/single/plugins' ); + break; +endswitch; ?> +</div><!-- .profile --> + +<?php do_action( 'bp_after_profile_content' ); ?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php new file mode 100644 index 0000000000000000000000000000000000000000..636bc3f61b7403ff1c2bfa3f5b9ef24d5d12c786 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/change-avatar.php @@ -0,0 +1,59 @@ +<h4><?php _e( 'Change Avatar', 'buddypress' ); ?></h4> + +<?php do_action( 'bp_before_profile_avatar_upload_content' ); ?> + +<?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?> + + <p><?php _e( 'Your avatar will be used on your profile and throughout the site. If there is a <a href="http://gravatar.com">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer.', 'buddypress' ); ?></p> + + <form action="" method="post" id="avatar-upload-form" class="standard-form" enctype="multipart/form-data"> + + <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?> + + <?php wp_nonce_field( 'bp_avatar_upload' ); ?> + <p><?php _e( 'Click below to select a JPG, GIF or PNG format photo from your computer and then click \'Upload Image\' to proceed.', 'buddypress' ); ?></p> + + <p id="avatar-upload"> + <input type="file" name="file" id="file" /> + <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ); ?>" /> + <input type="hidden" name="action" id="action" value="bp_avatar_upload" /> + </p> + + <?php if ( bp_get_user_has_avatar() ) : ?> + <p><?php _e( "If you'd like to delete your current avatar but not upload a new one, please use the delete avatar button.", 'buddypress' ); ?></p> + <p><a class="button edit" href="<?php bp_avatar_delete_link(); ?>" title="<?php _e( 'Delete Avatar', 'buddypress' ); ?>"><?php _e( 'Delete My Avatar', 'buddypress' ); ?></a></p> + <?php endif; ?> + + <?php endif; ?> + + <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?> + + <h5><?php _e( 'Crop Your New Avatar', 'buddypress' ); ?></h5> + + <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ); ?>" /> + + <div id="avatar-crop-pane"> + <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ); ?>" /> + </div> + + <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ); ?>" /> + + <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" /> + <input type="hidden" id="x" name="x" /> + <input type="hidden" id="y" name="y" /> + <input type="hidden" id="w" name="w" /> + <input type="hidden" id="h" name="h" /> + + <?php wp_nonce_field( 'bp_avatar_cropstore' ); ?> + + <?php endif; ?> + + </form> + +<?php else : ?> + + <p><?php _e( 'Your avatar will be used on your profile and throughout the site. To change your avatar, please create an account with <a href="http://gravatar.com">Gravatar</a> using the same email address as you used to register with this site.', 'buddypress' ); ?></p> + +<?php endif; ?> + +<?php do_action( 'bp_after_profile_avatar_upload_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php new file mode 100644 index 0000000000000000000000000000000000000000..c4def0ba7540fe1f4d6fd10e113ab4c50035465b --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/edit.php @@ -0,0 +1,159 @@ +<?php do_action( 'bp_before_profile_edit_content' ); + +if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) : + while ( bp_profile_groups() ) : bp_the_profile_group(); ?> + +<form action="<?php bp_the_profile_group_edit_form_action(); ?>" method="post" id="profile-edit-form" class="standard-form <?php bp_the_profile_group_slug(); ?>"> + + <?php do_action( 'bp_before_profile_field_content' ); ?> + + <h4><?php printf( __( "Editing '%s' Profile Group", "buddypress" ), bp_get_the_profile_group_name() ); ?></h4> + + <ul class="button-nav"> + + <?php bp_profile_group_tabs(); ?> + + </ul> + + <div class="clear"></div> + + <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> + + <div<?php bp_field_css_class( 'editfield' ); ?>> + + <?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?> + + <label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + <input type="text" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" value="<?php bp_the_profile_field_edit_value(); ?>" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>/> + + <?php endif; ?> + + <?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?> + + <label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + <textarea rows="5" cols="40" name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>><?php bp_the_profile_field_edit_value(); ?></textarea> + + <?php endif; ?> + + <?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?> + + <label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + <select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>> + <?php bp_the_profile_field_options(); ?> + </select> + + <?php endif; ?> + + <?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?> + + <label for="<?php bp_the_profile_field_input_name(); ?>"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + <select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" multiple="multiple" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>> + + <?php bp_the_profile_field_options(); ?> + + </select> + + <?php if ( !bp_get_the_profile_field_is_required() ) : ?> + + <a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name(); ?>' );"><?php _e( 'Clear', 'buddypress' ); ?></a> + + <?php endif; ?> + + <?php endif; ?> + + <?php if ( 'radio' == bp_get_the_profile_field_type() ) : ?> + + <div class="radio"> + <span class="label"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></span> + + <?php bp_the_profile_field_options(); ?> + + <?php if ( !bp_get_the_profile_field_is_required() ) : ?> + + <a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name(); ?>' );"><?php _e( 'Clear', 'buddypress' ); ?></a> + + <?php endif; ?> + </div> + + <?php endif; ?> + + <?php if ( 'checkbox' == bp_get_the_profile_field_type() ) : ?> + + <div class="checkbox"> + <span class="label"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></span> + + <?php bp_the_profile_field_options(); ?> + </div> + + <?php endif; ?> + + <?php if ( 'datebox' == bp_get_the_profile_field_type() ) : ?> + + <div class="datebox"> + <label for="<?php bp_the_profile_field_input_name(); ?>_day"><?php bp_the_profile_field_name(); ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ); ?><?php endif; ?></label> + + <select name="<?php bp_the_profile_field_input_name(); ?>_day" id="<?php bp_the_profile_field_input_name(); ?>_day" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>> + + <?php bp_the_profile_field_options( 'type=day' ); ?> + + </select> + + <select name="<?php bp_the_profile_field_input_name(); ?>_month" id="<?php bp_the_profile_field_input_name(); ?>_month" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>> + + <?php bp_the_profile_field_options( 'type=month' ); ?> + + </select> + + <select name="<?php bp_the_profile_field_input_name(); ?>_year" id="<?php bp_the_profile_field_input_name(); ?>_year" <?php if ( bp_get_the_profile_field_is_required() ) : ?>aria-required="true"<?php endif; ?>> + + <?php bp_the_profile_field_options( 'type=year' ); ?> + + </select> + </div> + + <?php endif; ?> + + <?php do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?> + + <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> + <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> + <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></a> + </p> + + <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> + <fieldset> + <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend> + + <?php bp_profile_visibility_radio_buttons() ?> + + </fieldset> + <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a> + </div> + <?php else : ?> + <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> + <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> + </div> + <?php endif ?> + + <?php do_action( 'bp_custom_profile_edit_fields' ); ?> + + <p class="description"><?php bp_the_profile_field_description(); ?></p> + </div> + + <?php endwhile; ?> + + <?php do_action( 'bp_after_profile_field_content' ); ?> + + <div class="submit"> + <input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?> " /> + </div> + + <input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_group_field_ids(); ?>" /> + + <?php wp_nonce_field( 'bp_xprofile_edit' ); ?> + +</form> + +<?php endwhile; endif; ?> + +<?php do_action( 'bp_after_profile_edit_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php new file mode 100644 index 0000000000000000000000000000000000000000..b90d0a882d526c6dada04065e196d808d09c5b76 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-loop.php @@ -0,0 +1,48 @@ +<?php do_action( 'bp_before_profile_loop_content' ); ?> + +<?php if ( bp_has_profile() ) : ?> + + <?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?> + + <?php if ( bp_profile_group_has_fields() ) : ?> + + <?php do_action( 'bp_before_profile_field_content' ); ?> + + <div class="bp-widget <?php bp_the_profile_group_slug(); ?>"> + + <h4><?php bp_the_profile_group_name(); ?></h4> + + <table class="profile-fields"> + + <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?> + + <?php if ( bp_field_has_data() ) : ?> + + <tr<?php bp_field_css_class(); ?>> + + <td class="label"><?php bp_the_profile_field_name(); ?></td> + + <td class="data"><?php bp_the_profile_field_value(); ?></td> + + </tr> + + <?php endif; ?> + + <?php do_action( 'bp_profile_field_item' ); ?> + + <?php endwhile; ?> + + </table> + </div> + + <?php do_action( 'bp_after_profile_field_content' ); ?> + + <?php endif; ?> + + <?php endwhile; ?> + + <?php do_action( 'bp_profile_field_buttons' ); ?> + +<?php endif; ?> + +<?php do_action( 'bp_after_profile_loop_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php new file mode 100644 index 0000000000000000000000000000000000000000..cc00f7d0a33d37965c15423a071fac27e7507a25 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php @@ -0,0 +1,73 @@ +<?php do_action( 'bp_before_profile_loop_content' ); ?> + +<?php $ud = get_userdata( bp_displayed_user_id() ); ?> + +<?php do_action( 'bp_before_profile_field_content' ); ?> + + <div class="bp-widget wp-profile"> + <h4><?php bp_is_my_profile() ? _e( 'My Profile', 'buddypress' ) : printf( __( "%s's Profile", 'buddypress' ), bp_get_displayed_user_fullname() ); ?></h4> + + <table class="wp-profile-fields"> + + <?php if ( $ud->display_name ) : ?> + + <tr id="wp_displayname"> + <td class="label"><?php _e( 'Name', 'buddypress' ); ?></td> + <td class="data"><?php echo $ud->display_name; ?></td> + </tr> + + <?php endif; ?> + + <?php if ( $ud->user_description ) : ?> + + <tr id="wp_desc"> + <td class="label"><?php _e( 'About Me', 'buddypress' ); ?></td> + <td class="data"><?php echo $ud->user_description; ?></td> + </tr> + + <?php endif; ?> + + <?php if ( $ud->user_url ) : ?> + + <tr id="wp_website"> + <td class="label"><?php _e( 'Website', 'buddypress' ); ?></td> + <td class="data"><?php echo make_clickable( $ud->user_url ); ?></td> + </tr> + + <?php endif; ?> + + <?php if ( $ud->jabber ) : ?> + + <tr id="wp_jabber"> + <td class="label"><?php _e( 'Jabber', 'buddypress' ); ?></td> + <td class="data"><?php echo $ud->jabber; ?></td> + </tr> + + <?php endif; ?> + + <?php if ( $ud->aim ) : ?> + + <tr id="wp_aim"> + <td class="label"><?php _e( 'AOL Messenger', 'buddypress' ); ?></td> + <td class="data"><?php echo $ud->aim; ?></td> + </tr> + + <?php endif; ?> + + <?php if ( $ud->yim ) : ?> + + <tr id="wp_yim"> + <td class="label"><?php _e( 'Yahoo Messenger', 'buddypress' ); ?></td> + <td class="data"><?php echo $ud->yim; ?></td> + </tr> + + <?php endif; ?> + + </table> + </div> + +<?php do_action( 'bp_after_profile_field_content' ); ?> + +<?php do_action( 'bp_profile_field_buttons' ); ?> + +<?php do_action( 'bp_after_profile_loop_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings.php new file mode 100644 index 0000000000000000000000000000000000000000..b10256b92366535ccb5c942fdfd01d6f23d400f3 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings.php @@ -0,0 +1,40 @@ +<?php + +/** + * BuddyPress - Users Settings + * + * @package BuddyPress + * @subpackage bp-legacy + */ + +?> + +<div class="item-list-tabs no-ajax" id="subnav" role="navigation"> + <ul> + <?php if ( bp_core_can_edit_settings() ) : ?> + + <?php bp_get_options_nav(); ?> + + <?php endif; ?> + </ul> +</div> + +<?php + +switch ( bp_current_action() ) : + case 'notifications' : + bp_get_template_part( 'members/single/settings/notifications' ); + break; + case 'capabilities' : + bp_get_template_part( 'members/single/settings/capabilities' ); + break; + case 'delete-account' : + bp_get_template_part( 'members/single/settings/delete-account' ); + break; + case 'general' : + bp_get_template_part( 'members/single/settings/general' ); + break; + default: + bp_get_template_part( 'members/single/plugins' ); + break; +endswitch; \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php new file mode 100644 index 0000000000000000000000000000000000000000..9c84ee96260890184c721b3937020a944b78ce45 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/capabilities.php @@ -0,0 +1,34 @@ +<div id="buddypress"> + + <?php do_action( 'bp_before_member_settings_template' ); ?> + + <div id="item-body" role="main"> + + <?php do_action( 'bp_before_member_body' ); ?> + + <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/capabilities/'; ?>" name="account-capabilities-form" id="account-capabilities-form" class="standard-form" method="post"> + + <?php do_action( 'bp_members_capabilities_account_before_submit' ); ?> + + <label> + <input type="checkbox" name="user-spammer" id="user-spammer" value="1" <?php checked( bp_is_user_spammer( bp_displayed_user_id() ) ); ?> /> + <?php _e( 'This user is a spammer.', 'buddypress' ); ?> + </label> + + <div class="submit"> + <input type="submit" value="<?php _e( 'Save', 'buddypress' ); ?>" id="capabilities-submit" name="capabilities-submit" /> + </div> + + <?php do_action( 'bp_members_capabilities_account_after_submit' ); ?> + + <?php wp_nonce_field( 'capabilities' ); ?> + + </form> + + <?php do_action( 'bp_after_member_body' ); ?> + + </div><!-- #item-body --> + + <?php do_action( 'bp_after_member_settings_template' ); ?> + +</div><!-- #buddypress --> diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php new file mode 100644 index 0000000000000000000000000000000000000000..386d53f2a520f5ea6d3b9f56a95041961c0f45b5 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/delete-account.php @@ -0,0 +1,48 @@ +<div id="buddypress"> + + <?php do_action( 'bp_before_member_settings_template' ); ?> + + <div id="item-body" role="main"> + + <?php do_action( 'bp_before_member_body' ); ?> + + <div id="message" class="info"> + + <?php if ( bp_is_my_profile() ) : ?> + + <p><?php _e( 'Deleting your account will delete all of the content you have created. It will be completely irrecoverable.', 'buddypress' ); ?></p> + + <?php else : ?> + + <p><?php _e( 'Deleting this account will delete all of the content it has created. It will be completely irrecoverable.', 'buddypress' ); ?></p> + + <?php endif; ?> + + </div> + + <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post"> + + <?php do_action( 'bp_members_delete_account_before_submit' ); ?> + + <label> + <input type="checkbox" name="delete-account-understand" id="delete-account-understand" value="1" onclick="if(this.checked) { document.getElementById('delete-account-button').disabled = ''; } else { document.getElementById('delete-account-button').disabled = 'disabled'; }" /> + <?php _e( 'I understand the consequences.', 'buddypress' ); ?> + </label> + + <div class="submit"> + <input type="submit" disabled="disabled" value="<?php _e( 'Delete Account', 'buddypress' ); ?>" id="delete-account-button" name="delete-account-button" /> + </div> + + <?php do_action( 'bp_members_delete_account_after_submit' ); ?> + + <?php wp_nonce_field( 'delete-account' ); ?> + + </form> + + <?php do_action( 'bp_after_member_body' ); ?> + + </div><!-- #item-body --> + + <?php do_action( 'bp_after_member_settings_template' ); ?> + +</div><!-- #buddypress --> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/general.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/general.php new file mode 100644 index 0000000000000000000000000000000000000000..5587889c1d24cb3dfc3f06ef92b17a142e690b66 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/general.php @@ -0,0 +1,45 @@ +<div id="buddypress"> + + <?php do_action( 'bp_before_member_settings_template' ); ?> + + <div id="item-body" role="main"> + + <?php do_action( 'bp_before_member_body' ); ?> + + <?php do_action( 'bp_template_content' ); ?> + + <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/general'; ?>" method="post" class="standard-form" id="settings-form"> + + <?php if ( !is_super_admin() ) : ?> + + <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label> + <input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" /> <a href="<?php echo site_url( add_query_arg( array( 'action' => 'lostpassword' ), 'wp-login.php' ), 'login' ); ?>" title="<?php _e( 'Password Lost and Found', 'buddypress' ); ?>"><?php _e( 'Lost your password?', 'buddypress' ); ?></a> + + <?php endif; ?> + + <label for="email"><?php _e( 'Account Email', 'buddypress' ); ?></label> + <input type="text" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input" /> + + <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ); ?></label> + <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> <?php _e( 'New Password', 'buddypress' ); ?><br /> + <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> <?php _e( 'Repeat New Password', 'buddypress' ); ?> + + <?php do_action( 'bp_core_general_settings_before_submit' ); ?> + + <div class="submit"> + <input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="submit" class="auto" /> + </div> + + <?php do_action( 'bp_core_general_settings_after_submit' ); ?> + + <?php wp_nonce_field( 'bp_settings_general' ); ?> + + </form> + + <?php do_action( 'bp_after_member_body' ); ?> + + </div><!-- #item-body --> + + <?php do_action( 'bp_after_member_settings_template' ); ?> + +</div><!-- #buddypress --> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php new file mode 100644 index 0000000000000000000000000000000000000000..dc30170423e59298ce0d3d0c18c632c54e7063b8 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/single/settings/notifications.php @@ -0,0 +1,34 @@ +<div id="buddypress"> + + <?php do_action( 'bp_before_member_settings_template' ); ?> + + <div id="item-body" role="main"> + + <?php do_action( 'bp_before_member_body' ); ?> + + <?php do_action( 'bp_template_content' ); ?> + + <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications'; ?>" method="post" class="standard-form" id="settings-form"> + <p><?php _e( 'Send a notification by email when:', 'buddypress' ); ?></p> + + <?php do_action( 'bp_notification_settings' ); ?> + + <?php do_action( 'bp_members_notification_settings_before_submit' ); ?> + + <div class="submit"> + <input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="submit" class="auto" /> + </div> + + <?php do_action( 'bp_members_notification_settings_after_submit' ); ?> + + <?php wp_nonce_field('bp_settings_notifications' ); ?> + + </form> + + <?php do_action( 'bp_after_member_body' ); ?> + + </div><!-- #item-body --> + + <?php do_action( 'bp_after_member_settings_template' ); ?> + +</div><!-- #buddypress --> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.css new file mode 100644 index 0000000000000000000000000000000000000000..9ffb82b327ce5c6c9c03951b4e399f9652326b2c --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress-rtl.css @@ -0,0 +1,1536 @@ +/*-------------------------------------------------------------- +Hello, this is the BuddyPress Legacy (RTL) stylesheet. + +---------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +4.0 - Navigation + 4.1 - Pagination +5.0 - WordPress + 5.1 - Alignments + 5.2 - Comments + 5.3 - Gallery + 5.4 - Images + 5.5 - Posts +6.0 - BuddyPress + 6.1 - Activity + 6.1.1 - Activity Listing + 6.1.2 - Activity Comments + 6.2 - Toolbar + 6.3 - Directories - Members, Groups, Blogs, Forums + 6.4 - Error / Success Messages + 6.5 - Forms + 6.6 - Ajax Loading + 6.7 - Topics and Tables - Forums and General + 6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums + 6.9 - Private Messaging Threads + 6.10 - Extended Profiles + 6.11 - Widgets +7.0 - Media Queries + 7.1 - Smartphones Landscape + 7.2 - Smartphones Portrait + 7.3 - Smartphones - smaller screen sizes +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +4.1 - Pagination +--------------------------------------------------------------*/ +#buddypress div.pagination { + background: transparent; + border: none; + color: #888; + font-size: 90%; + margin: 0; + position: relative; + display: block; + float: right; + width: 100%; + padding: 10px 0; +} +#buddypress div.pagination .pag-count { + float: right; + margin-right: 10px; +} +#buddypress div.pagination .pagination-links { + float: left; + margin-left: 10px; +} +#buddypress div.pagination .pagination-links span, +#buddypress div.pagination .pagination-links a { + font-size: 90%; + padding: 0 5px; +} +#buddypress div.pagination .pagination-links a:hover { + font-weight: bold; +} +#buddypress noscript div.pagination { + margin-bottom: 15px; +} +#buddypress #nav-above { + display: none; +} +#buddypress .paged #nav-above { + display: block; +} + +/*-------------------------------------------------------------- +5.4 - Images +--------------------------------------------------------------*/ +#buddypress img.wp-smiley { + border: none !important; + clear: none !important; + float: none !important; + margin: 0 !important; + padding: 0 !important; +} + +/*-------------------------------------------------------------- +6.0 - BuddyPress +--------------------------------------------------------------*/ +/*-------------------------------------------------------------- +6.1 - Activity +--------------------------------------------------------------*/ +#buddypress #activity-stream { + margin-top: -5px; +} + +#buddypress #activity-stream p { + margin: 5px 0; +} + +#buddypress #item-body form#whats-new-form { + margin: 0; + padding: 0; +} +#buddypress .home-page form#whats-new-form { + border-bottom: none; + padding-bottom: 0; +} +#buddypress form#whats-new-form #whats-new-avatar { + float: right; +} +#buddypress form#whats-new-form #whats-new-content { + margin-right: 55px; + padding: 0 20px 20px 0; +} +#buddypress form#whats-new-form p.activity-greeting { + line-height: 0.5em; + margin-bottom: 15px; + margin-right: 75px; +} +#buddypress form#whats-new-form textarea { + background: #fff; + border: 1px inset #ccc; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #555; + font-family: inherit; + font-size: 90%; + height: 20px; + padding: 6px; + width: 98%; +} +body.no-js #buddypress form#whats-new-form textarea { + height: 50px; +} +#buddypress form#whats-new-form #whats-new-options select { + max-width: 200px; + margin-top: 12px; +} +#buddypress form#whats-new-form #whats-new-submit { + float: left; + margin-top: 12px; +} +#buddypress #whats-new-options { + overflow: auto; + height: 0; +} +body.no-js #buddypress #whats-new-options { + height: auto; +} +#buddypress #whats-new:focus { + border-color: rgba(31, 179, 221, 0.9) !important; + outline-color: rgba(31, 179, 221, 0.9); + box-shadow: 0 0 7px rgba(31, 179, 221, 0.7); + -moz-box-shadow: 0 0 7px rgba(31, 179, 221, 0.7); + -webkit-box-shadow: 0 0 7px rgba(31, 179, 221, 0.7); +} + +/*-------------------------------------------------------------- +6.1.1 - Activity Listing +--------------------------------------------------------------*/ +#buddypress ul.activity-list li { + overflow: hidden; + padding: 15px 0 0; + list-style: none; +} +#buddypress .activity-list .activity-avatar { + float: right; +} +#buddypress ul.item-list.activity-list li.has-comments { + padding-bottom: 15px; +} +body.activity-permalink #buddypress ul.activity-list li.has-comments { + padding-bottom: 0; +} +#buddypress .activity-list li.mini { + font-size: 80%; + position: relative; +} +#buddypress .activity-list li.mini .activity-avatar img.avatar, +#buddypress .activity-list li.mini .activity-avatar img.FB_profile_pic { + height: 20px; + margin-right: 30px; + width: 20px; +} +#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.avatar, +#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.FB_profile_pic { + height: auto; + margin-right: 0; + width: auto; +} +body.activity-permalink #buddypress .activity-list > li:first-child { + padding-top: 0; +} +#buddypress .activity-list li .activity-content { + position: relative; +} +#buddypress .activity-list li.mini .activity-content p { + margin: 0; +} +#buddypress .activity-list li.mini .activity-comments { + clear: both; + font-size: 120%; +} +body.activity-permalink #buddypress li.mini .activity-meta { + margin-top: 4px; +} +#buddypress .activity-list li .activity-inreplyto { + color: #888; + font-size: 80%; +} +#buddypress .activity-list li .activity-inreplyto > p { + margin: 0; + display: inline; +} +#buddypress .activity-list li .activity-inreplyto blockquote, +#buddypress .activity-list li .activity-inreplyto div.activity-inner { + background: none; + border: none; + display: inline; + margin: 0; + overflow: hidden; + padding: 0; +} +#buddypress .activity-list .activity-content { + margin: 0 70px 0 0; +} +body.activity-permalink #buddypress .activity-list li .activity-content { + border: none; + font-size: 100%; + line-height: 150%; + margin-right: 170px; + margin-left: 0; + padding: 0; +} +body.activity-permalink #buddypress .activity-list li .activity-header > p { + margin: 0; + padding: 5px 0 0 0; +} +#buddypress .activity-list .activity-content .activity-header, +#buddypress .activity-list .activity-content .comment-header { + color: #888; + line-height: 220%; +} +#buddypress .activity-header { + margin-left: 20px; +} +#buddypress .activity-header a, +#buddypress .comment-meta a, +#buddypress .acomment-meta a { + text-decoration: none; +} +#buddypress .activity-list .activity-content .activity-header img.avatar { + float: none !important; + margin: 0 0 -8px 5px !important; +} +#buddypress a.bp-secondary-action, +#buddypress span.highlight { + font-size: 80%; + padding: 0; + margin-left: 5px; + text-decoration: none; +} +#buddypress .activity-list .activity-content .activity-inner, +#buddypress .activity-list .activity-content blockquote { + margin: 10px 0 5px 10px; + overflow: hidden; +} +#buddypress .activity-list li.new_forum_post .activity-content .activity-inner, +#buddypress .activity-list li.new_forum_topic .activity-content .activity-inner { + border-left: 2px solid #EAEAEA; + margin-right: 5px; + padding-right: 10px; +} +body.activity-permalink #buddypress .activity-content .activity-inner, +body.activity-permalink #buddypress .activity-content blockquote { + margin-right: 0; + margin-top: 5px; +} +#buddypress .activity-inner > p { + word-wrap: break-word; +} +#buddypress .activity-inner > .activity-inner { + margin: 0; +} +#buddypress .activity-inner > blockquote { + margin: 0; +} +#buddypress .activity-list .activity-content img.thumbnail { + border: 2px solid #eee; + float: right; + margin: 0 0 5px 10px; +} +#buddypress .activity-read-more { + margin-right: 1em; + white-space: nowrap; +} +#buddypress .activity-list li.load-more { + background: #f0f0f0; + font-size: 110%; + margin: 15px 0; + padding: 10px 15px; + text-align: center; +} +#buddypress .activity-list li.load-more a { + color: #4D4D4D; +} + + +/*-------------------------------------------------------------- +6.1.2 - Activity Comments +--------------------------------------------------------------*/ +#buddypress div.activity-meta { + margin: 18px 0 0; +} +body.activity-permalink #buddypress div.activity-meta { + margin-bottom: 6px; +} +#buddypress div.activity-meta a { + font: normal 11px/20px Arial, Tahoma, Verdana, sans-serif; + padding: 4px 8px; +} +#buddypress a.activity-time-since { + color: #aaa; + text-decoration: none; +} +#buddypress a.activity-time-since:hover { + color: #888; + text-decoration: underline; +} +#buddypress a.bp-primary-action, +#buddypress #reply-title small a { + font-size: 80%; + margin-left: 5px; + text-decoration: none; +} +#buddypress a.bp-primary-action span, +#buddypress #reply-title small a span { + background: #999; + border-radius: 3px; + color: #fff; + font-size: 90%; + margin-right: 2px; + padding: 0 5px; +} +#buddypress a.bp-primary-action:hover span, +#buddypress #reply-title small a:hover span { + background: #555; + color: #fff; +} +#buddypress div.activity-comments { + margin: 0 70px 0 0; + overflow: hidden; /* IE fix */ + position: relative; + width: auto; + clear: both; +} +body.activity-permalink #buddypress div.activity-comments { + background: none; + margin-right: 170px; + width: auto; +} +#buddypress div.activity-comments > ul { + padding: 0 10px 0 0; +} +#buddypress div.activity-comments ul, +#buddypress div.activity-comments ul li { + border: none; + list-style: none; +} +#buddypress div.activity-comments ul { + clear: both; + margin: 0; +} +#buddypress div.activity-comments ul li { + border-top: 1px solid #eee; + padding: 10px 0 0; +} +body.activity-permalink #buddypress .activity-list li.mini .activity-comments { + clear: none; + margin-top: 0; +} +body.activity-permalink #buddypress div.activity-comments ul li { + border-width: 1px; + padding: 10px 0 0 0; +} +#buddypress div.activity-comments > ul > li:first-child { + border-top: none; +} +#buddypress div.activity-comments ul li:last-child { + margin-bottom: 0; +} +#buddypress div.activity-comments ul li > ul { + margin-right: 30px; + margin-top: 0; + padding-right: 10px; +} +body.activity-permalink #buddypress div.activity-comments ul li > ul { + margin-top: 10px; +} +body.activity-permalink #buddypress div.activity-comments > ul { + padding: 0 15px 0 10px; +} +#buddypress div.activity-comments div.acomment-avatar img { + border-width: 1px; + float: right; + height: 25px; + margin-left: 10px; + width: 25px; +} +#buddypress div.activity-comments div.acomment-content { + font-size: 80%; + margin: 5px 40px 0 0; +} +#buddypress div.acomment-content .time-since, +#buddypress div.acomment-content .activity-delete-link, +#buddypress div.acomment-content .comment-header { + display: none; +} +body.activity-permalink #buddypress div.activity-comments div.acomment-content { + font-size: 90%; +} +#buddypress div.activity-comments div.acomment-meta { + color: #888; + font-size: 80%; +} +#buddypress div.activity-comments form.ac-form { + display: none; + padding: 10px; +} +#buddypress div.activity-comments li form.ac-form { + margin-left: 15px; + clear: both; +} +#buddypress div.activity-comments form.root { + margin-right: 0; +} +#buddypress div.activity-comments div#message { + margin-top: 15px; + margin-bottom: 0; +} +#buddypress div.activity-comments form .ac-textarea { + background: #fff; + border: 1px inset #ccc; + border-radius: 3px; + margin-bottom: 10px; + padding: 8px; +} +#buddypress div.activity-comments form textarea { + border: none; + background: transparent; + box-shadow: none; + outline: none; + color: #555; + font-family: inherit; + font-size: 100%; + height: 60px; + padding: 0; + margin: 0; + width: 100%; +} +#buddypress div.activity-comments form input { + margin-top: 5px; +} +#buddypress div.activity-comments form div.ac-reply-avatar { + float: right; +} +#buddypress div.ac-reply-avatar img { + border: 1px solid #eee; +} +#buddypress div.activity-comments form div.ac-reply-content { + color: #888; + margin-right: 50px; + padding-right: 15px; +} +#buddypress div.activity-comments form div.ac-reply-content a { + text-decoration: none; +} +#buddypress .acomment-options { + float: right; + margin: 5px 40px 5px 0; +} +#buddypress .acomment-options a { + color: #999; +} +#buddypress .acomment-options a:hover { + color: inherit; +} + +/*-------------------------------------------------------------- +6.3 - Directories - Members, Groups, Blogs, Forums +--------------------------------------------------------------*/ +#buddypress div.dir-search { + float: left; + margin: -39px 0 0 0; +} +#buddypress div.dir-search input[type=text] { + font-size: 90%; + padding: 1px 3px; +} + +#buddypress .dir-form { + clear: both; +} + +/*-------------------------------------------------------------- +6.4 - Errors / Success Messages +--------------------------------------------------------------*/ +#buddypress div#message { + margin: 0 0 15px; +} +#buddypress #message.info { + margin-bottom: 0; +} +#buddypress div#message.updated { + clear: both; +} +#buddypress div#message p, +#sitewide-notice p { + font-size: 90%; + display: block; + padding: 10px 15px; +} +#buddypress div#message.error p { + background-color: #db1717; + border-color: #a71a1a; + clear: right; + color: #fff; +} +#buddypress div#message.updated p { + background-color: #8ff57a; + border-color: #80cf70; + color: #1a6a00; +} +#buddypress .standard-form#signup_form div div.error { + background: #e41717; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #fff; + margin: 0 0 10px 0; + padding: 6px; + width: 90%; +} +#buddypress div.accept, +#buddypress div.reject { + float: right; + margin-right: 10px; +} +#buddypress ul.button-nav li { + float: right; + margin: 0 0 10px 10px; + list-style: none; +} +#buddypress ul.button-nav li.current a { + font-weight: bold; +} +#sitewide-notice #message { + left: 2%; + position: fixed; + top: 1em; + width: 96%; + z-index: 9999; +} +#sitewide-notice.admin-bar-on #message { + top: 3.3em; +} +#sitewide-notice strong { + display: block; + margin-bottom: -1em; +} + +/*-------------------------------------------------------------- +6.5 - Forms +--------------------------------------------------------------*/ +#buddypress .standard-form textarea, +#buddypress .standard-form input[type=text], +#buddypress .standard-form select, +#buddypress .standard-form input[type=password], +#buddypress .dir-search input[type=text] { + border: 1px inset #ccc; + border-radius: 3px; + color: #888; + font: inherit; + font-size: 100%; + padding: 6px; +} +#buddypress .standard-form select { + padding: 3px; +} +#buddypress .standard-form input[type=password] { + margin-bottom: 5px; +} +#buddypress .standard-form label, +#buddypress .standard-form span.label { + display: block; + font-weight: bold; + margin: 15px 0 5px 0; +} +#buddypress .standard-form div.checkbox label, +#buddypress .standard-form div.radio label { + color: #888; + font-size: 100%; + font-weight: normal; + margin: 5px 0 0 0; +} +#buddypress .standard-form#sidebar-login-form label { + margin-top: 5px; +} +#buddypress .standard-form input[type=text] { + width: 75%; +} +#buddypress .standard-form#sidebar-login-form input[type=text], +#buddypress .standard-form#sidebar-login-form input[type=password] { + padding: 4px; + width: 95%; +} +#buddypress .standard-form #basic-details-section input[type=password], +#buddypress .standard-form #blog-details-section input#signup_blog_url { + width: 35%; +} +#buddypress .standard-form#signup_form input[type=text], +#buddypress .standard-form#signup_form textarea, +#buddypress .form-allowed-tags, +#buddypress #commentform input[type=text], +#buddypress #commentform textarea { + width: 90%; +} +#buddypress .standard-form#signup_form div.submit { + float: left; +} +#buddypress div#signup-avatar img { + margin: 0 0 10px 15px; +} +#buddypress .standard-form textarea { + width: 75%; + height: 120px; +} +#buddypress .standard-form textarea#message_content { + height: 200px; +} +#buddypress .standard-form#send-reply textarea { + width: 97.5%; +} +#buddypress .standard-form p.description { + color: #888; + font-size: 80%; + margin: 5px 0; +} +#buddypress .standard-form div.submit { + clear: both; + padding: 15px 0 0 0; +} +#buddypress .standard-form p.submit { + margin-bottom: 0; + padding: 15px 0 0 0; +} +#buddypress .standard-form div.submit input { + margin-left: 15px; +} +#buddypress .standard-form div.radio ul { + margin: 10px 38px 15px 0; + list-style: disc; +} +#buddypress .standard-form div.radio ul li { + margin-bottom: 5px; +} +#buddypress .standard-form a.clear-value { + display: block; + margin-top: 5px; + outline: none; +} +#buddypress .standard-form #basic-details-section, +#buddypress .standard-form #blog-details-section, +#buddypress .standard-form #profile-details-section { + float: right; + width: 48%; +} +#buddypress .standard-form #profile-details-section { + float: left; +} +#buddypress .standard-form #blog-details-section { + clear: right; +} +#buddypress .standard-form input:focus, +#buddypress .standard-form textarea:focus, +#buddypress .standard-form select:focus { + background: #fafafa; + color: #555; +} +#buddypress form#send-invite-form { + margin-top: 20px; +} +#buddypress div#invite-list { + background: #f5f5f5; + height: 400px; + margin: 0 0 10px; + overflow: auto; + padding: 5px; + width: 160px; +} +#buddypress button, +#buddypress a.button, +#buddypress input[type=submit], +#buddypress input[type=button], +#buddypress input[type=reset], +#buddypress ul.button-nav li a, +#buddypress div.generic-button a, +#buddypress .comment-reply-link, +a.bp-title-button { + background: #fff; /* Old browsers */ + background: -moz-linear-gradient(top, #ffffff 0%, #ededed 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ededed)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #ffffff 0%,#ededed 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #ffffff 0%,#ededed 100%); /* W3C */ + border: 1px solid #ccc; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #777; + cursor: pointer; + font: normal 12px/20px Arial, Tahoma, Verdana, sans-serif; + outline: none; + padding: 4px 10px; + text-align: center; + text-decoration: none; + line-height: 14px; +} +#buddypress button:hover, +#buddypress a.button:hover, +#buddypress a.button:focus, +#buddypress input[type=submit]:hover, +#buddypress input[type=button]:hover, +#buddypress input[type=reset]:hover, +#buddypress ul.button-nav li a:hover, +#buddypress ul.button-nav li.current a, +#buddypress div.generic-button a:hover, +#buddypress .comment-reply-link:hover { + background: #ededed; + background: -moz-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e0e0e0)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e0e0e0',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* W3C */ + border: 1px solid #bbb; + color: #555; + outline: none; + text-decoration: none; +} + +/*-------------------------------------------------------------- +6.6 - Ajax Loading +--------------------------------------------------------------*/ +#buddypress a.loading, +#buddypress input.loading { + -webkit-animation: loader-pulsate .5s infinite ease-in-out alternate; + -moz-animation: loader-pulsate .5s infinite ease-in-out alternate; + border-color: #aaa; + -moz-box-shadow: 0 0 6px #ccc; + -webkit-box-shadow: 0 0 6px #ccc; + box-shadow: 0 0 6px #ccc; +} +@-webkit-keyframes loader-pulsate { + from { + border-color: #aaa; + -webkit-box-shadow: 0 0 6px #ccc; + box-shadow: 0 0 6px #ccc; + } + to { + border-color: #ccc; + -webkit-box-shadow: 0 0 6px #f8f8f8; + box-shadow: 0 0 6px #f8f8f8; + } +} +@-moz-keyframes loader-pulsate { + from { + border-color: #aaa; + -moz-box-shadow: 0 0 6px #ccc; + box-shadow: 0 0 6px #ccc; + } + to { + border-color: #ccc; + -moz-box-shadow: 0 0 6px #f8f8f8; + box-shadow: 0 0 6px #f8f8f8; + } +} + +#buddypress a.loading:hover, +#buddypress input.loading:hover { + color: #777; +} +#buddypress input[type="submit"].pending, +#buddypress input[type="button"].pending, +#buddypress input[type="reset"].pending, +#buddypress input[type="submit"].disabled, +#buddypress input[type="button"].disabled, +#buddypress input[type="reset"].disabled, +#buddypress button.pending, +#buddypress button.disabled, +#buddypress div.pending a, +#buddypress a.disabled { + border-color: #eee; + color: #bbb; + cursor: default; +} +#buddypress input[type="submit"]:hover.pending, +#buddypress input[type="button"]:hover.pending, +#buddypress input[type="reset"]:hover.pending, +#buddypress input[type="submit"]:hover.disabled, +#buddypress input[type="button"]:hover.disabled, +#buddypress input[type="reset"]:hover.disabled, +#buddypress button.pending:hover, +#buddypress button.disabled:hover, +#buddypress div.pending a:hover, +#buddypress a.disabled:hover { + background: -moz-linear-gradient(top, #ffffff 0%, #ededed 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ededed)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #ffffff 0%,#ededed 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #ffffff 0%,#ededed 100%); /* W3C */ + border-color: #eee; + color: #bbb; +} + +/*-------------------------------------------------------------- +6.7 - Forums, Tables and Topics +--------------------------------------------------------------*/ +#buddypress ul#topic-post-list { + margin: 0; + width: auto; +} +#buddypress ul#topic-post-list li { + padding: 15px; + position: relative; +} +#buddypress ul#topic-post-list li.alt { + background: #f5f5f5; +} +#buddypress ul#topic-post-list li div.poster-meta { + color: #888; + margin-bottom: 10px; +} +#buddypress ul#topic-post-list li div.post-content { + margin-right: 54px; +} +#buddypress div.topic-tags { + font-size: 80%; +} +#buddypress div.admin-links { + color: #888; + font-size: 80%; + position: absolute; + top: 15px; + right: 25px; +} +#buddypress div#topic-meta { + margin: 0; + padding: 5px 19px 30px; + position: relative; +} +#buddypress div#topic-meta div.admin-links { + right: 19px; + top: -36px; +} +#buddypress div#topic-meta h3 { + margin: 5px 0; +} +#buddypress div#new-topic-post { + display: none; + margin: 20px 0 0 0; + padding: 1px 0 0 0; +} +#buddypress table { + width: 100%; +} +#buddypress table thead tr { + background: #eaeaea; +} +#buddypress table#message-threads { + clear: both; + margin: 0; + width: auto; +} +#buddypress table.profile-fields { + margin-bottom: 20px; +} +#buddypress table.profile-fields:last-child { + margin-bottom: 0; +} +#buddypress table.profile-fields p { + margin: 0; +} +#buddypress table.profile-fields p:last-child { + margin-top: 0; +} +#buddypress table tr td, +#buddypress table tr th { + padding: 8px; + vertical-align: middle; +} +#buddypress table tr td.label { + border-right: 1px solid #eaeaea; + font-weight: bold; + width: 25%; +} +#buddypress table tr td.thread-info p { + margin: 0; +} +#buddypress table tr td.thread-info p.thread-excerpt { + color: #888; + font-size: 80%; + margin-top: 3px; +} +#buddypress table.forum td { + text-align: center; +} +#buddypress table tr.alt td { + background: #f5f5f5; +} +#buddypress table.notification-settings { + margin-bottom: 20px; + text-align: right; +} +#buddypress #groups-notification-settings { + margin-bottom: 0; +} +#buddypress table.notification-settings th.icon, +#buddypress table.notification-settings td:first-child { + display: none; +} +#buddypress table.notification-settings th.title { + width: 80%; +} +#buddypress table.notification-settings .yes, +#buddypress table.notification-settings .no { + text-align: center; + width: 40px; +} +#buddypress table.forum { + margin: 0; + width: auto; + clear: both; +} +#buddypress table.forum tr.sticky td { + font-size: 110%; + background: #fff9db; + border-top: 1px solid #ffe8c4; + border-bottom: 1px solid #ffe8c4; +} +#buddypress table.forum tr.closed td.td-title { + padding-right: 35px; +} +#buddypress table.forum td p.topic-text { + color: #888; + font-size: 100%; +} +#buddypress table.forum tr > td:first-child, +#buddypress table.forum tr > th:first-child { + padding-right: 15px; +} +#buddypress table.forum tr > td:last-child, +#buddypress table.forum tr > th:last-child { + padding-left: 15px; +} +#buddypress table.forum tr th#th-title, +#buddypress table.forum tr th#th-poster, +#buddypress table.forum tr th#th-group, +#buddypress table.forum td.td-poster, +#buddypress table.forum td.td-group, +#buddypress table.forum td.td-title { + text-align: right; +} +#buddypress table.forum tr td.td-title a.topic-title { + font-size: 110%; +} +#buddypress table.forum td.td-freshness { + white-space: nowrap; +} +#buddypress table.forum td.td-freshness span.time-since { + font-size: 80%; + color: #888; +} +#buddypress table.forum td img.avatar { + float: none; + margin: 0 0 -8px 5px; +} +#buddypress table.forum td.td-poster, +#buddypress table.forum td.td-group { + min-width: 140px; +} +#buddypress table.forum th#th-title { + width: 80%; +} +#buddypress table.forum th#th-freshness { + width: 25%; +} +#buddypress table.forum th#th-postcount { + width: 15%; +} +#buddypress table.forum p.topic-meta { + font-size: 80%; + margin: 5px 0 0 0; +} + +/*------------------------------------------------------------------------- +6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums, Profiles +-------------------------------------------------------------------------*/ +#buddypress .item-body { + margin: 20px 0; +} +#buddypress span.activity { + display: inline-block; + font-size: 80%; + opacity: 0.8; + padding: 0; +} +#buddypress span.user-nicename { + color: #777; + display: inline-block; + font-size: 120%; + font-weight: bold; +} +#buddypress div#message p, +#sitewide-notice p { + border: 1px solid #e1ca82; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + font-weight: normal; + margin-top: 3px; + text-decoration: none; + background: #ffeaa6; + background-image: -webkit-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255, 255, 255, .5)), color-stop(100%,rgba(255, 255, 255, 0))); /* Chrome,Safari4+ */ + background-image: -moz-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); + background-image: -ms-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); + background-image: -o-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); + background-image: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); +} +#buddypress div#item-header { + overflow: hidden; +} +#buddypress div#item-header div#item-header-content { + float: right; + margin-right: 0; +} +#buddypress div#item-header h2 { + line-height: 120%; + margin: 0 0 15px 0; +} +#buddypress div#item-header h2 a { + color: #777; + text-decoration: none; +} +#buddypress div#item-header img.avatar { + float: right; + margin: 0 0 19px 15px; +} +#buddypress div#item-header h2 { + margin-bottom: 5px; +} +#buddypress div#item-header h2 span.highlight { + font-size: 60%; + font-weight: normal; + line-height: 170%; + vertical-align: middle; + display: inline-block; +} +#buddypress div#item-header h2 span.highlight span { + background: #a1dcfa; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #fff; + cursor: pointer; + font-weight: bold; + font-size: 80%; + margin-bottom: 2px; + padding: 1px 4px; + position: relative; + right: -2px; + top: -2px; + vertical-align: middle; +} +#buddypress div#item-header div#item-meta { + font-size: 80%; + color: #aaa; + overflow: hidden; + margin: 15px 0 5px 0; + padding-bottom: 10px; +} +#buddypress div#item-header div#item-actions { + float: left; + margin: 0 15px 15px 0; + text-align: left; + width: 20%; +} +#buddypress div#item-header div#item-actions h3 { + margin: 0 0 5px 0; +} +#buddypress div#item-header ul { + margin-bottom: 15px; + overflow: hidden; +} +#buddypress div#item-header ul h5, +#buddypress div#item-header ul span, +#buddypress div#item-header ul hr { + display: none; +} +#buddypress div#item-header ul li { + float: left; + list-style: none; +} +#buddypress div#item-header ul img.avatar, +#buddypress div#item-header ul.avatars img.avatar { + height: 30px; + margin: 2px; + width: 30px; +} +#buddypress div#item-header div.generic-button, +#buddypress div#item-header a.button { + float: right; + margin: 10px 0 0 10px; +} +#buddypress div#item-header div#message.info { + line-height: 80%; +} +#buddypress ul.item-list { + border-top: 1px solid #eaeaea; + width: 100%; + list-style: none; + clear: both; + margin: 0; + padding: 0; +} +body.activity-permalink #buddypress ul.item-list, +body.activity-permalink #buddypress ul.item-list li.activity-item { + border: none; +} +#buddypress ul.item-list li { + border-bottom: 1px solid #eaeaea; + padding: 15px 0; + margin: 0; + position: relative; + list-style: none; +} +#buddypress ul.single-line li { + border: none; +} +#buddypress ul.item-list li img.avatar { + float: right; + margin: 0 0 0 10px; +} +#buddypress ul.item-list li div.item-title, +#buddypress ul.item-list li h4 { + font-weight: normal; + font-size: 90%; + margin: 0; + width: 75%; +} +#buddypress ul.item-list li div.item-title span { + color: #999; + font-size: 80%; +} +#buddypress ul.item-list li div.item-desc { + color: #888; + font-size: 80%; + margin: 10px 60px 0 0; + width: 50%; +} +#buddypress ul.item-list li div.action { + position: absolute; + top: 15px; + right: 0; + text-align: left; +} +#buddypress ul.item-list li div.meta { + color: #888; + font-size: 80%; + margin-top: 10px; +} +#buddypress ul.item-list li h5 span.small { + float: left; + font-size: 80%; + font-weight: normal; +} +#buddypress div.item-list-tabs { + background: transparent; + clear: right; + overflow: hidden; +} + +#buddypress div.item-list-tabs ul { + margin: 0; + padding: 0; +} +#buddypress div.item-list-tabs ul li { + float: right; + margin: 0; + list-style: none; +} +#buddypress div.item-list-tabs#subnav ul li { + margin-top: 0; +} +#buddypress div.item-list-tabs ul li.last { + float: left; + margin: 7px 0 0; +} +#buddypress div.item-list-tabs#subnav ul li.last { + margin-top: 4px; +} +#buddypress div.item-list-tabs ul li.last select { + max-width: 175px; +} +#buddypress div.item-list-tabs ul li a, +#buddypress div.item-list-tabs ul li span { + display: block; + padding: 5px 10px; + text-decoration: none; +} +#buddypress div.item-list-tabs ul li a span { + background: #eee; + border-radius: 50%; + border: 1px solid #ccc; + color: #999; + display: inline; + font-size: 70%; + margin-right: 2px; + padding: 3px 6px; + text-align: center; + vertical-align: middle; +} +#buddypress div.item-list-tabs ul li.selected a, +#buddypress div.item-list-tabs ul li.current a { + background-color: #eee; + color: #555; + opacity: .8; + font-weight: bold; +} +#buddypress div.item-list-tabs ul li.selected a span, +#buddypress div.item-list-tabs ul li.current a span, +#buddypress div.item-list-tabs ul li a:hover span { + background-color: #eee; +} +#buddypress div.item-list-tabs ul li.selected a span, +#buddypress div.item-list-tabs ul li.current a span { + background-color: #fff; +} +#buddypress div#item-nav ul li.loading a { + background-position: 88% 50%; +} +#buddypress div.item-list-tabs#object-nav { + margin-top: 0; +} +#buddypress div.item-list-tabs#subnav { + background: transparent; + margin: 10px 0 10px; + overflow: hidden; +} +#buddypress #admins-list li, +#buddypress #mods-list li, +#buddypress #members-list li { + overflow: auto; + list-style: none; +} + + +/*-------------------------------------------------------------- +6.9 - Private Messaging Threads +--------------------------------------------------------------*/ +#buddypress table#message-threads tr.unread td { + background: #fff9db; + border-top: 1px solid #ffe8c4; + border-bottom: 1px solid #ffe8c4; + font-weight: bold; +} +#buddypress li span.unread-count, +#buddypress tr.unread span.unread-count { + background: #dd0000; + border-radius: 3px; + color: #fff; + font-weight: bold; + padding: 2px 8px; +} +#buddypress div.item-list-tabs ul li a span.unread-count { + padding: 1px 6px; + color: #fff; +} +#buddypress div.messages-options-nav { + background: #eee; + font-size: 80%; + margin: 0; + padding: 5px 15px; + text-align: left; +} +#buddypress div#message-thread div.message-box { + margin: 0; + padding: 15px; +} +#buddypress div#message-thread div.alt { + background: #f4f4f4; +} +#buddypress div#message-thread p#message-recipients { + margin: 10px 0 20px 0; +} +#buddypress div#message-thread img.avatar { + float: right; + margin: 0 0 0 10px; + vertical-align: middle; +} +#buddypress div#message-thread strong { + font-size: 100%; + margin: 0; +} +#buddypress div#message-thread strong a { + text-decoration: none; +} +#buddypress div#message-thread strong span.activity { + margin-top: 4px; +} +#buddypress div#message-thread div.message-metadata { + overflow: hidden; +} +#buddypress div#message-thread div.message-content { + margin-right: 45px; +} +#buddypress div#message-thread div.message-options { + text-align: left; +} +#buddypress #message-threads img.avatar { + max-width: none; +} +#buddypress div.message-search { + float: left; + margin: 0 20px; +} + +/*-------------------------------------------------------------- +6.10 - Extended Profiles +--------------------------------------------------------------*/ + +#buddypress div.profile h4 { + margin-bottom: auto; + margin-top: 15px; +} +#buddypress #profile-edit-form ul.button-nav { + margin-top: 15px; +} +body.no-js #buddypress .field-visibility-settings-toggle, +body.no-js #buddypress .field-visibility-settings-close { + display: none; +} +#buddypress .field-visibility-settings { + display: none; + margin-top: 10px; +} + body.no-js #buddypress .field-visibility-settings { + display: block; + } +#buddypress .current-visibility-level { + font-weight: bold; + font-style: normal; +} +#buddypress .field-visibility-settings, +#buddypress .field-visibility-settings-toggle, +#buddypress .field-visibility-settings-notoggle { + color: #888; +} +#buddypress .field-visibility-settings-toggle a, +#buddypress .field-visibility-settings a { + font-size: 80%; +} +body.register #buddypress div.page ul { + list-style: none; +} +#buddypress .standard-form .field-visibility-settings label { + margin: 0; + font-weight: normal; +} +#buddypress .field-visibility-settings legend, +#buddypress .field-visibility-settings-toggle { + font-style: italic; +} + +/*-------------------------------------------------------------- +6.11 - Widgets +--------------------------------------------------------------*/ + +.widget.buddypress div.item-avatar img.avatar { + float: right; + margin: 0 0 15px 10px; +} + +.widget.buddypress span.activity { + display: inline-block; + font-size: 80%; + opacity: 0.8; + padding: 0; +} + +.widget.buddypress div.item-options { + font-size: 90%; + margin: 0 0 1em 0; + padding: 1em 0; +} + +.widget.buddypress div.item{ + margin:0 0 1em 0; +} + +.widget.buddypress div.item-meta, +.widget.buddypress div.item-content { + font-size: 11px; + margin-right: 38px; +} + +.widget.buddypress ul.item-list img.avatar { + height: 20px; + margin-left: 10px; + width: 20px; +} +.widget.buddypress div.item-avatar img { + height: 40px; + margin: 1px; + width: 40px; +} + +.widget.buddypress div.avatar-block{ + overflow: hidden; +} + +/*-------------------------------------------------------------- +7.0 - Media Queries +--------------------------------------------------------------*/ +/*-------------------------------------------------------------- +7.1 - Smartphones - landscape +--------------------------------------------------------------*/ +@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) { + -webkit-text-size-adjust: none; +} +@media only screen and (max-width: 480px ){ + #buddypress div.dir-search { + float: left; + margin-top: -50px; + text-align: left; + } + #buddypress div.dir-search input[type="text"] { + margin-bottom: 1em; + width: 50%; + } + a.bp-title-button { + margin-right: 10px; + } +} + +/*-------------------------------------------------------------- +7.2 - Smartphones - portrait +--------------------------------------------------------------*/ +@media only screen and (max-width: 320px) { + #buddypress div.dir-search { + clear: right; + float: right; + margin-top: 0; + text-align: right; + } + #buddypress li#groups-order-select { + clear: right; + float: right; + } + #buddypress ul.item-list li div.action { + clear: right; + float: right; + margin-top: 0; + margin-right: 70px; + position: relative; + top: 0; + right: 0; + text-align: right; + } + #buddypress ul.item-list li div.item-desc { + clear: right; + float: right; + margin: 10px 0 0; + width: auto; + } + #buddypress li div.item { + margin-right: 70px; + width: auto; + } + #buddypress ul.item-list li div.meta { + margin-top: 0; + } + #buddypress .item-desc p { + margin: 0 0 10px; + } + #buddypress div.pagination .pag-count { + margin-right: 0; + } +} + +/*-------------------------------------------------------------- +7.2 - Smartphones - smaller screen sizes +--------------------------------------------------------------*/ +@media only screen and (max-width: 240px) { + #buddypress div.dir-search { + float: right; + margin: 0; + } + #buddypress div.dir-search input[type="text"] { + width: 50%; + } + #buddypress li#groups-order-select { + float: right; + } + #buddypress ul.item-list li img.avatar { + width: 30px; + height: auto; + } + #buddypress ul.item-list li div.action, + #buddypress li div.item{ + margin-right: 45px; + } + h1 a.bp-title-button { + clear: right; + float: right; + margin: 10px 0 20px; + } +} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.css b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.css new file mode 100644 index 0000000000000000000000000000000000000000..34919c4247161b4cc0a3baf34f5d8965acc559cd --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/css/buddypress.css @@ -0,0 +1,1536 @@ +/*-------------------------------------------------------------- +Hello, this is the BuddyPress Legacy stylesheet. + +---------------------------------------------------------------- +>>> TABLE OF CONTENTS: +---------------------------------------------------------------- +4.0 - Navigation + 4.1 - Pagination +5.0 - WordPress + 5.1 - Alignments + 5.2 - Comments + 5.3 - Gallery + 5.4 - Images + 5.5 - Posts +6.0 - BuddyPress + 6.1 - Activity + 6.1.1 - Activity Listing + 6.1.2 - Activity Comments + 6.2 - Toolbar + 6.3 - Directories - Members, Groups, Blogs, Forums + 6.4 - Error / Success Messages + 6.5 - Forms + 6.6 - Ajax Loading + 6.7 - Topics and Tables - Forums and General + 6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums + 6.9 - Private Messaging Threads + 6.10 - Extended Profiles + 6.11 - Widgets +7.0 - Media Queries + 7.1 - Smartphones Landscape + 7.2 - Smartphones Portrait + 7.3 - Smartphones - smaller screen sizes +--------------------------------------------------------------*/ + +/*-------------------------------------------------------------- +4.1 - Pagination +--------------------------------------------------------------*/ +#buddypress div.pagination { + background: transparent; + border: none; + color: #888; + font-size: 90%; + margin: 0; + position: relative; + display: block; + float: left; + width: 100%; + padding: 10px 0; +} +#buddypress div.pagination .pag-count { + float: left; + margin-left: 10px; +} +#buddypress div.pagination .pagination-links { + float: right; + margin-right: 10px; +} +#buddypress div.pagination .pagination-links span, +#buddypress div.pagination .pagination-links a { + font-size: 90%; + padding: 0 5px; +} +#buddypress div.pagination .pagination-links a:hover { + font-weight: bold; +} +#buddypress noscript div.pagination { + margin-bottom: 15px; +} +#buddypress #nav-above { + display: none; +} +#buddypress .paged #nav-above { + display: block; +} + +/*-------------------------------------------------------------- +5.4 - Images +--------------------------------------------------------------*/ +#buddypress img.wp-smiley { + border: none !important; + clear: none !important; + float: none !important; + margin: 0 !important; + padding: 0 !important; +} + +/*-------------------------------------------------------------- +6.0 - BuddyPress +--------------------------------------------------------------*/ +/*-------------------------------------------------------------- +6.1 - Activity +--------------------------------------------------------------*/ +#buddypress #activity-stream { + margin-top: -5px; +} + +#buddypress #activity-stream p { + margin: 5px 0; +} + +#buddypress #item-body form#whats-new-form { + margin: 0; + padding: 0; +} +#buddypress .home-page form#whats-new-form { + border-bottom: none; + padding-bottom: 0; +} +#buddypress form#whats-new-form #whats-new-avatar { + float: left; +} +#buddypress form#whats-new-form #whats-new-content { + margin-left: 55px; + padding: 0 0 20px 20px; +} +#buddypress form#whats-new-form p.activity-greeting { + line-height: 0.5em; + margin-bottom: 15px; + margin-left: 75px; +} +#buddypress form#whats-new-form textarea { + background: #fff; + border: 1px inset #ccc; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #555; + font-family: inherit; + font-size: 90%; + height: 20px; + padding: 6px; + width: 98%; +} +body.no-js #buddypress form#whats-new-form textarea { + height: 50px; +} +#buddypress form#whats-new-form #whats-new-options select { + max-width: 200px; + margin-top: 12px; +} +#buddypress form#whats-new-form #whats-new-submit { + float: right; + margin-top: 12px; +} +#buddypress #whats-new-options { + overflow: auto; + height: 0; +} +body.no-js #buddypress #whats-new-options { + height: auto; +} +#buddypress #whats-new:focus { + border-color: rgba(31, 179, 221, 0.9) !important; + outline-color: rgba(31, 179, 221, 0.9); + box-shadow: 0 0 7px rgba(31, 179, 221, 0.7); + -moz-box-shadow: 0 0 7px rgba(31, 179, 221, 0.7); + -webkit-box-shadow: 0 0 7px rgba(31, 179, 221, 0.7); +} + +/*-------------------------------------------------------------- +6.1.1 - Activity Listing +--------------------------------------------------------------*/ +#buddypress ul.activity-list li { + overflow: hidden; + padding: 15px 0 0; + list-style: none; +} +#buddypress .activity-list .activity-avatar { + float: left; +} +#buddypress ul.item-list.activity-list li.has-comments { + padding-bottom: 15px; +} +body.activity-permalink #buddypress ul.activity-list li.has-comments { + padding-bottom: 0; +} +#buddypress .activity-list li.mini { + font-size: 80%; + position: relative; +} +#buddypress .activity-list li.mini .activity-avatar img.avatar, +#buddypress .activity-list li.mini .activity-avatar img.FB_profile_pic { + height: 20px; + margin-left: 30px; + width: 20px; +} +#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.avatar, +#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.FB_profile_pic { + height: auto; + margin-left: 0; + width: auto; +} +body.activity-permalink #buddypress .activity-list > li:first-child { + padding-top: 0; +} +#buddypress .activity-list li .activity-content { + position: relative; +} +#buddypress .activity-list li.mini .activity-content p { + margin: 0; +} +#buddypress .activity-list li.mini .activity-comments { + clear: both; + font-size: 120%; +} +body.activity-permalink #buddypress li.mini .activity-meta { + margin-top: 4px; +} +#buddypress .activity-list li .activity-inreplyto { + color: #888; + font-size: 80%; +} +#buddypress .activity-list li .activity-inreplyto > p { + margin: 0; + display: inline; +} +#buddypress .activity-list li .activity-inreplyto blockquote, +#buddypress .activity-list li .activity-inreplyto div.activity-inner { + background: none; + border: none; + display: inline; + margin: 0; + overflow: hidden; + padding: 0; +} +#buddypress .activity-list .activity-content { + margin: 0 0 0 70px; +} +body.activity-permalink #buddypress .activity-list li .activity-content { + border: none; + font-size: 100%; + line-height: 150%; + margin-left: 170px; + margin-right: 0; + padding: 0; +} +body.activity-permalink #buddypress .activity-list li .activity-header > p { + margin: 0; + padding: 5px 0 0 0; +} +#buddypress .activity-list .activity-content .activity-header, +#buddypress .activity-list .activity-content .comment-header { + color: #888; + line-height: 220%; +} +#buddypress .activity-header { + margin-right: 20px; +} +#buddypress .activity-header a, +#buddypress .comment-meta a, +#buddypress .acomment-meta a { + text-decoration: none; +} +#buddypress .activity-list .activity-content .activity-header img.avatar { + float: none !important; + margin: 0 5px -8px 0 !important; +} +#buddypress a.bp-secondary-action, +#buddypress span.highlight { + font-size: 80%; + padding: 0; + margin-right: 5px; + text-decoration: none; +} +#buddypress .activity-list .activity-content .activity-inner, +#buddypress .activity-list .activity-content blockquote { + margin: 10px 10px 5px 0; + overflow: hidden; +} +#buddypress .activity-list li.new_forum_post .activity-content .activity-inner, +#buddypress .activity-list li.new_forum_topic .activity-content .activity-inner { + border-left: 2px solid #EAEAEA; + margin-left: 5px; + padding-left: 10px; +} +body.activity-permalink #buddypress .activity-content .activity-inner, +body.activity-permalink #buddypress .activity-content blockquote { + margin-left: 0; + margin-top: 5px; +} +#buddypress .activity-inner > p { + word-wrap: break-word; +} +#buddypress .activity-inner > .activity-inner { + margin: 0; +} +#buddypress .activity-inner > blockquote { + margin: 0; +} +#buddypress .activity-list .activity-content img.thumbnail { + border: 2px solid #eee; + float: left; + margin: 0 10px 5px 0; +} +#buddypress .activity-read-more { + margin-left: 1em; + white-space: nowrap; +} +#buddypress .activity-list li.load-more { + background: #f0f0f0; + font-size: 110%; + margin: 15px 0; + padding: 10px 15px; + text-align: center; +} +#buddypress .activity-list li.load-more a { + color: #4D4D4D; +} + + +/*-------------------------------------------------------------- +6.1.2 - Activity Comments +--------------------------------------------------------------*/ +#buddypress div.activity-meta { + margin: 18px 0 0; +} +body.activity-permalink #buddypress div.activity-meta { + margin-bottom: 6px; +} +#buddypress div.activity-meta a { + font: normal 11px/20px Arial, Tahoma, Verdana, sans-serif; + padding: 4px 8px; +} +#buddypress a.activity-time-since { + color: #aaa; + text-decoration: none; +} +#buddypress a.activity-time-since:hover { + color: #888; + text-decoration: underline; +} +#buddypress a.bp-primary-action, +#buddypress #reply-title small a { + font-size: 80%; + margin-right: 5px; + text-decoration: none; +} +#buddypress a.bp-primary-action span, +#buddypress #reply-title small a span { + background: #999; + border-radius: 3px; + color: #fff; + font-size: 90%; + margin-left: 2px; + padding: 0 5px; +} +#buddypress a.bp-primary-action:hover span, +#buddypress #reply-title small a:hover span { + background: #555; + color: #fff; +} +#buddypress div.activity-comments { + margin: 0 0 0 70px; + overflow: hidden; /* IE fix */ + position: relative; + width: auto; + clear: both; +} +body.activity-permalink #buddypress div.activity-comments { + background: none; + margin-left: 170px; + width: auto; +} +#buddypress div.activity-comments > ul { + padding: 0 0 0 10px; +} +#buddypress div.activity-comments ul, +#buddypress div.activity-comments ul li { + border: none; + list-style: none; +} +#buddypress div.activity-comments ul { + clear: both; + margin: 0; +} +#buddypress div.activity-comments ul li { + border-top: 1px solid #eee; + padding: 10px 0 0; +} +body.activity-permalink #buddypress .activity-list li.mini .activity-comments { + clear: none; + margin-top: 0; +} +body.activity-permalink #buddypress div.activity-comments ul li { + border-width: 1px; + padding: 10px 0 0 0; +} +#buddypress div.activity-comments > ul > li:first-child { + border-top: none; +} +#buddypress div.activity-comments ul li:last-child { + margin-bottom: 0; +} +#buddypress div.activity-comments ul li > ul { + margin-left: 30px; + margin-top: 0; + padding-left: 10px; +} +body.activity-permalink #buddypress div.activity-comments ul li > ul { + margin-top: 10px; +} +body.activity-permalink #buddypress div.activity-comments > ul { + padding: 0 10px 0 15px; +} +#buddypress div.activity-comments div.acomment-avatar img { + border-width: 1px; + float: left; + height: 25px; + margin-right: 10px; + width: 25px; +} +#buddypress div.activity-comments div.acomment-content { + font-size: 80%; + margin: 5px 0 0 40px; +} +#buddypress div.acomment-content .time-since, +#buddypress div.acomment-content .activity-delete-link, +#buddypress div.acomment-content .comment-header { + display: none; +} +body.activity-permalink #buddypress div.activity-comments div.acomment-content { + font-size: 90%; +} +#buddypress div.activity-comments div.acomment-meta { + color: #888; + font-size: 80%; +} +#buddypress div.activity-comments form.ac-form { + display: none; + padding: 10px; +} +#buddypress div.activity-comments li form.ac-form { + margin-right: 15px; + clear: both; +} +#buddypress div.activity-comments form.root { + margin-left: 0; +} +#buddypress div.activity-comments div#message { + margin-top: 15px; + margin-bottom: 0; +} +#buddypress div.activity-comments form .ac-textarea { + background: #fff; + border: 1px inset #ccc; + border-radius: 3px; + margin-bottom: 10px; + padding: 8px; +} +#buddypress div.activity-comments form textarea { + border: none; + background: transparent; + box-shadow: none; + outline: none; + color: #555; + font-family: inherit; + font-size: 100%; + height: 60px; + padding: 0; + margin: 0; + width: 100%; +} +#buddypress div.activity-comments form input { + margin-top: 5px; +} +#buddypress div.activity-comments form div.ac-reply-avatar { + float: left; +} +#buddypress div.ac-reply-avatar img { + border: 1px solid #eee; +} +#buddypress div.activity-comments form div.ac-reply-content { + color: #888; + margin-left: 50px; + padding-left: 15px; +} +#buddypress div.activity-comments form div.ac-reply-content a { + text-decoration: none; +} +#buddypress .acomment-options { + float: left; + margin: 5px 0 5px 40px; +} +#buddypress .acomment-options a { + color: #999; +} +#buddypress .acomment-options a:hover { + color: inherit; +} + +/*-------------------------------------------------------------- +6.3 - Directories - Members, Groups, Blogs, Forums +--------------------------------------------------------------*/ +#buddypress div.dir-search { + float: right; + margin: -39px 0 0 0; +} +#buddypress div.dir-search input[type=text] { + font-size: 90%; + padding: 1px 3px; +} + +#buddypress .dir-form { + clear: both; +} + +/*-------------------------------------------------------------- +6.4 - Errors / Success Messages +--------------------------------------------------------------*/ +#buddypress div#message { + margin: 0 0 15px; +} +#buddypress #message.info { + margin-bottom: 0; +} +#buddypress div#message.updated { + clear: both; +} +#buddypress div#message p, +#sitewide-notice p { + font-size: 90%; + display: block; + padding: 10px 15px; +} +#buddypress div#message.error p { + background-color: #db1717; + border-color: #a71a1a; + clear: left; + color: #fff; +} +#buddypress div#message.updated p { + background-color: #8ff57a; + border-color: #80cf70; + color: #1a6a00; +} +#buddypress .standard-form#signup_form div div.error { + background: #e41717; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #fff; + margin: 0 0 10px 0; + padding: 6px; + width: 90%; +} +#buddypress div.accept, +#buddypress div.reject { + float: left; + margin-left: 10px; +} +#buddypress ul.button-nav li { + float: left; + margin: 0 10px 10px 0; + list-style: none; +} +#buddypress ul.button-nav li.current a { + font-weight: bold; +} +#sitewide-notice #message { + left: 2%; + position: fixed; + top: 1em; + width: 96%; + z-index: 9999; +} +#sitewide-notice.admin-bar-on #message { + top: 3.3em; +} +#sitewide-notice strong { + display: block; + margin-bottom: -1em; +} + +/*-------------------------------------------------------------- +6.5 - Forms +--------------------------------------------------------------*/ +#buddypress .standard-form textarea, +#buddypress .standard-form input[type=text], +#buddypress .standard-form select, +#buddypress .standard-form input[type=password], +#buddypress .dir-search input[type=text] { + border: 1px inset #ccc; + border-radius: 3px; + color: #888; + font: inherit; + font-size: 100%; + padding: 6px; +} +#buddypress .standard-form select { + padding: 3px; +} +#buddypress .standard-form input[type=password] { + margin-bottom: 5px; +} +#buddypress .standard-form label, +#buddypress .standard-form span.label { + display: block; + font-weight: bold; + margin: 15px 0 5px 0; +} +#buddypress .standard-form div.checkbox label, +#buddypress .standard-form div.radio label { + color: #888; + font-size: 100%; + font-weight: normal; + margin: 5px 0 0 0; +} +#buddypress .standard-form#sidebar-login-form label { + margin-top: 5px; +} +#buddypress .standard-form input[type=text] { + width: 75%; +} +#buddypress .standard-form#sidebar-login-form input[type=text], +#buddypress .standard-form#sidebar-login-form input[type=password] { + padding: 4px; + width: 95%; +} +#buddypress .standard-form #basic-details-section input[type=password], +#buddypress .standard-form #blog-details-section input#signup_blog_url { + width: 35%; +} +#buddypress .standard-form#signup_form input[type=text], +#buddypress .standard-form#signup_form textarea, +#buddypress .form-allowed-tags, +#buddypress #commentform input[type=text], +#buddypress #commentform textarea { + width: 90%; +} +#buddypress .standard-form#signup_form div.submit { + float: right; +} +#buddypress div#signup-avatar img { + margin: 0 15px 10px 0; +} +#buddypress .standard-form textarea { + width: 75%; + height: 120px; +} +#buddypress .standard-form textarea#message_content { + height: 200px; +} +#buddypress .standard-form#send-reply textarea { + width: 97.5%; +} +#buddypress .standard-form p.description { + color: #888; + font-size: 80%; + margin: 5px 0; +} +#buddypress .standard-form div.submit { + clear: both; + padding: 15px 0 0 0; +} +#buddypress .standard-form p.submit { + margin-bottom: 0; + padding: 15px 0 0 0; +} +#buddypress .standard-form div.submit input { + margin-right: 15px; +} +#buddypress .standard-form div.radio ul { + margin: 10px 0 15px 38px; + list-style: disc; +} +#buddypress .standard-form div.radio ul li { + margin-bottom: 5px; +} +#buddypress .standard-form a.clear-value { + display: block; + margin-top: 5px; + outline: none; +} +#buddypress .standard-form #basic-details-section, +#buddypress .standard-form #blog-details-section, +#buddypress .standard-form #profile-details-section { + float: left; + width: 48%; +} +#buddypress .standard-form #profile-details-section { + float: right; +} +#buddypress .standard-form #blog-details-section { + clear: left; +} +#buddypress .standard-form input:focus, +#buddypress .standard-form textarea:focus, +#buddypress .standard-form select:focus { + background: #fafafa; + color: #555; +} +#buddypress form#send-invite-form { + margin-top: 20px; +} +#buddypress div#invite-list { + background: #f5f5f5; + height: 400px; + margin: 0 0 10px; + overflow: auto; + padding: 5px; + width: 160px; +} +#buddypress button, +#buddypress a.button, +#buddypress input[type=submit], +#buddypress input[type=button], +#buddypress input[type=reset], +#buddypress ul.button-nav li a, +#buddypress div.generic-button a, +#buddypress .comment-reply-link, +a.bp-title-button { + background: #fff; /* Old browsers */ + background: -moz-linear-gradient(top, #ffffff 0%, #ededed 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ededed)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #ffffff 0%,#ededed 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #ffffff 0%,#ededed 100%); /* W3C */ + border: 1px solid #ccc; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #777; + cursor: pointer; + font: normal 12px/20px Arial, Tahoma, Verdana, sans-serif; + outline: none; + padding: 4px 10px; + text-align: center; + text-decoration: none; + line-height: 14px; +} +#buddypress button:hover, +#buddypress a.button:hover, +#buddypress a.button:focus, +#buddypress input[type=submit]:hover, +#buddypress input[type=button]:hover, +#buddypress input[type=reset]:hover, +#buddypress ul.button-nav li a:hover, +#buddypress ul.button-nav li.current a, +#buddypress div.generic-button a:hover, +#buddypress .comment-reply-link:hover { + background: #ededed; + background: -moz-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e0e0e0)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e0e0e0',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* W3C */ + border: 1px solid #bbb; + color: #555; + outline: none; + text-decoration: none; +} + +/*-------------------------------------------------------------- +6.6 - Ajax Loading +--------------------------------------------------------------*/ +#buddypress a.loading, +#buddypress input.loading { + -webkit-animation: loader-pulsate .5s infinite ease-in-out alternate; + -moz-animation: loader-pulsate .5s infinite ease-in-out alternate; + border-color: #aaa; + -moz-box-shadow: 0 0 6px #ccc; + -webkit-box-shadow: 0 0 6px #ccc; + box-shadow: 0 0 6px #ccc; +} +@-webkit-keyframes loader-pulsate { + from { + border-color: #aaa; + -webkit-box-shadow: 0 0 6px #ccc; + box-shadow: 0 0 6px #ccc; + } + to { + border-color: #ccc; + -webkit-box-shadow: 0 0 6px #f8f8f8; + box-shadow: 0 0 6px #f8f8f8; + } +} +@-moz-keyframes loader-pulsate { + from { + border-color: #aaa; + -moz-box-shadow: 0 0 6px #ccc; + box-shadow: 0 0 6px #ccc; + } + to { + border-color: #ccc; + -moz-box-shadow: 0 0 6px #f8f8f8; + box-shadow: 0 0 6px #f8f8f8; + } +} + +#buddypress a.loading:hover, +#buddypress input.loading:hover { + color: #777; +} +#buddypress input[type="submit"].pending, +#buddypress input[type="button"].pending, +#buddypress input[type="reset"].pending, +#buddypress input[type="submit"].disabled, +#buddypress input[type="button"].disabled, +#buddypress input[type="reset"].disabled, +#buddypress button.pending, +#buddypress button.disabled, +#buddypress div.pending a, +#buddypress a.disabled { + border-color: #eee; + color: #bbb; + cursor: default; +} +#buddypress input[type="submit"]:hover.pending, +#buddypress input[type="button"]:hover.pending, +#buddypress input[type="reset"]:hover.pending, +#buddypress input[type="submit"]:hover.disabled, +#buddypress input[type="button"]:hover.disabled, +#buddypress input[type="reset"]:hover.disabled, +#buddypress button.pending:hover, +#buddypress button.disabled:hover, +#buddypress div.pending a:hover, +#buddypress a.disabled:hover { + background: -moz-linear-gradient(top, #ffffff 0%, #ededed 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ededed)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Opera11.10+ */ + background: -ms-linear-gradient(top, #ffffff 0%,#ededed 100%); /* IE10+ */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */ + background: linear-gradient(top, #ffffff 0%,#ededed 100%); /* W3C */ + border-color: #eee; + color: #bbb; +} + +/*-------------------------------------------------------------- +6.7 - Forums, Tables and Topics +--------------------------------------------------------------*/ +#buddypress ul#topic-post-list { + margin: 0; + width: auto; +} +#buddypress ul#topic-post-list li { + padding: 15px; + position: relative; +} +#buddypress ul#topic-post-list li.alt { + background: #f5f5f5; +} +#buddypress ul#topic-post-list li div.poster-meta { + color: #888; + margin-bottom: 10px; +} +#buddypress ul#topic-post-list li div.post-content { + margin-left: 54px; +} +#buddypress div.topic-tags { + font-size: 80%; +} +#buddypress div.admin-links { + color: #888; + font-size: 80%; + position: absolute; + top: 15px; + right: 25px; +} +#buddypress div#topic-meta { + margin: 0; + padding: 5px 19px 30px; + position: relative; +} +#buddypress div#topic-meta div.admin-links { + right: 19px; + top: -36px; +} +#buddypress div#topic-meta h3 { + margin: 5px 0; +} +#buddypress div#new-topic-post { + display: none; + margin: 20px 0 0 0; + padding: 1px 0 0 0; +} +#buddypress table { + width: 100%; +} +#buddypress table thead tr { + background: #eaeaea; +} +#buddypress table#message-threads { + clear: both; + margin: 0; + width: auto; +} +#buddypress table.profile-fields { + margin-bottom: 20px; +} +#buddypress table.profile-fields:last-child { + margin-bottom: 0; +} +#buddypress table.profile-fields p { + margin: 0; +} +#buddypress table.profile-fields p:last-child { + margin-top: 0; +} +#buddypress table tr td, +#buddypress table tr th { + padding: 8px; + vertical-align: middle; +} +#buddypress table tr td.label { + border-right: 1px solid #eaeaea; + font-weight: bold; + width: 25%; +} +#buddypress table tr td.thread-info p { + margin: 0; +} +#buddypress table tr td.thread-info p.thread-excerpt { + color: #888; + font-size: 80%; + margin-top: 3px; +} +#buddypress table.forum td { + text-align: center; +} +#buddypress table tr.alt td { + background: #f5f5f5; +} +#buddypress table.notification-settings { + margin-bottom: 20px; + text-align: left; +} +#buddypress #groups-notification-settings { + margin-bottom: 0; +} +#buddypress table.notification-settings th.icon, +#buddypress table.notification-settings td:first-child { + display: none; +} +#buddypress table.notification-settings th.title { + width: 80%; +} +#buddypress table.notification-settings .yes, +#buddypress table.notification-settings .no { + text-align: center; + width: 40px; +} +#buddypress table.forum { + margin: 0; + width: auto; + clear: both; +} +#buddypress table.forum tr.sticky td { + font-size: 110%; + background: #fff9db; + border-top: 1px solid #ffe8c4; + border-bottom: 1px solid #ffe8c4; +} +#buddypress table.forum tr.closed td.td-title { + padding-left: 35px; +} +#buddypress table.forum td p.topic-text { + color: #888; + font-size: 100%; +} +#buddypress table.forum tr > td:first-child, +#buddypress table.forum tr > th:first-child { + padding-left: 15px; +} +#buddypress table.forum tr > td:last-child, +#buddypress table.forum tr > th:last-child { + padding-right: 15px; +} +#buddypress table.forum tr th#th-title, +#buddypress table.forum tr th#th-poster, +#buddypress table.forum tr th#th-group, +#buddypress table.forum td.td-poster, +#buddypress table.forum td.td-group, +#buddypress table.forum td.td-title { + text-align: left; +} +#buddypress table.forum tr td.td-title a.topic-title { + font-size: 110%; +} +#buddypress table.forum td.td-freshness { + white-space: nowrap; +} +#buddypress table.forum td.td-freshness span.time-since { + font-size: 80%; + color: #888; +} +#buddypress table.forum td img.avatar { + float: none; + margin: 0 5px -8px 0; +} +#buddypress table.forum td.td-poster, +#buddypress table.forum td.td-group { + min-width: 140px; +} +#buddypress table.forum th#th-title { + width: 80%; +} +#buddypress table.forum th#th-freshness { + width: 25%; +} +#buddypress table.forum th#th-postcount { + width: 15%; +} +#buddypress table.forum p.topic-meta { + font-size: 80%; + margin: 5px 0 0 0; +} + +/*------------------------------------------------------------------------- +6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums, Profiles +-------------------------------------------------------------------------*/ +#buddypress .item-body { + margin: 20px 0; +} +#buddypress span.activity { + display: inline-block; + font-size: 80%; + opacity: 0.8; + padding: 0; +} +#buddypress span.user-nicename { + color: #777; + display: inline-block; + font-size: 120%; + font-weight: bold; +} +#buddypress div#message p, +#sitewide-notice p { + border: 1px solid #e1ca82; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + font-weight: normal; + margin-top: 3px; + text-decoration: none; + background: #ffeaa6; + background-image: -webkit-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255, 255, 255, .5)), color-stop(100%,rgba(255, 255, 255, 0))); /* Chrome,Safari4+ */ + background-image: -moz-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); + background-image: -ms-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); + background-image: -o-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); + background-image: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0)); +} +#buddypress div#item-header { + overflow: hidden; +} +#buddypress div#item-header div#item-header-content { + float: left; + margin-left: 0; +} +#buddypress div#item-header h2 { + line-height: 120%; + margin: 0 0 15px 0; +} +#buddypress div#item-header h2 a { + color: #777; + text-decoration: none; +} +#buddypress div#item-header img.avatar { + float: left; + margin: 0 15px 19px 0; +} +#buddypress div#item-header h2 { + margin-bottom: 5px; +} +#buddypress div#item-header h2 span.highlight { + font-size: 60%; + font-weight: normal; + line-height: 170%; + vertical-align: middle; + display: inline-block; +} +#buddypress div#item-header h2 span.highlight span { + background: #a1dcfa; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + color: #fff; + cursor: pointer; + font-weight: bold; + font-size: 80%; + margin-bottom: 2px; + padding: 1px 4px; + position: relative; + right: -2px; + top: -2px; + vertical-align: middle; +} +#buddypress div#item-header div#item-meta { + font-size: 80%; + color: #aaa; + overflow: hidden; + margin: 15px 0 5px 0; + padding-bottom: 10px; +} +#buddypress div#item-header div#item-actions { + float: right; + margin: 0 0 15px 15px; + text-align: right; + width: 20%; +} +#buddypress div#item-header div#item-actions h3 { + margin: 0 0 5px 0; +} +#buddypress div#item-header ul { + margin-bottom: 15px; + overflow: hidden; +} +#buddypress div#item-header ul h5, +#buddypress div#item-header ul span, +#buddypress div#item-header ul hr { + display: none; +} +#buddypress div#item-header ul li { + float: right; + list-style: none; +} +#buddypress div#item-header ul img.avatar, +#buddypress div#item-header ul.avatars img.avatar { + height: 30px; + margin: 2px; + width: 30px; +} +#buddypress div#item-header div.generic-button, +#buddypress div#item-header a.button { + float: left; + margin: 10px 10px 0 0; +} +#buddypress div#item-header div#message.info { + line-height: 80%; +} +#buddypress ul.item-list { + border-top: 1px solid #eaeaea; + width: 100%; + list-style: none; + clear: both; + margin: 0; + padding: 0; +} +body.activity-permalink #buddypress ul.item-list, +body.activity-permalink #buddypress ul.item-list li.activity-item { + border: none; +} +#buddypress ul.item-list li { + border-bottom: 1px solid #eaeaea; + padding: 15px 0; + margin: 0; + position: relative; + list-style: none; +} +#buddypress ul.single-line li { + border: none; +} +#buddypress ul.item-list li img.avatar { + float: left; + margin: 0 10px 0 0; +} +#buddypress ul.item-list li div.item-title, +#buddypress ul.item-list li h4 { + font-weight: normal; + font-size: 90%; + margin: 0; + width: 75%; +} +#buddypress ul.item-list li div.item-title span { + color: #999; + font-size: 80%; +} +#buddypress ul.item-list li div.item-desc { + color: #888; + font-size: 80%; + margin: 10px 0 0 60px; + width: 50%; +} +#buddypress ul.item-list li div.action { + position: absolute; + top: 15px; + right: 0; + text-align: right; +} +#buddypress ul.item-list li div.meta { + color: #888; + font-size: 80%; + margin-top: 10px; +} +#buddypress ul.item-list li h5 span.small { + float: right; + font-size: 80%; + font-weight: normal; +} +#buddypress div.item-list-tabs { + background: transparent; + clear: left; + overflow: hidden; +} + +#buddypress div.item-list-tabs ul { + margin: 0; + padding: 0; +} +#buddypress div.item-list-tabs ul li { + float: left; + margin: 0; + list-style: none; +} +#buddypress div.item-list-tabs#subnav ul li { + margin-top: 0; +} +#buddypress div.item-list-tabs ul li.last { + float: right; + margin: 7px 0 0; +} +#buddypress div.item-list-tabs#subnav ul li.last { + margin-top: 4px; +} +#buddypress div.item-list-tabs ul li.last select { + max-width: 175px; +} +#buddypress div.item-list-tabs ul li a, +#buddypress div.item-list-tabs ul li span { + display: block; + padding: 5px 10px; + text-decoration: none; +} +#buddypress div.item-list-tabs ul li a span { + background: #eee; + border-radius: 50%; + border: 1px solid #ccc; + color: #999; + display: inline; + font-size: 70%; + margin-left: 2px; + padding: 3px 6px; + text-align: center; + vertical-align: middle; +} +#buddypress div.item-list-tabs ul li.selected a, +#buddypress div.item-list-tabs ul li.current a { + background-color: #eee; + color: #555; + opacity: .8; + font-weight: bold; +} +#buddypress div.item-list-tabs ul li.selected a span, +#buddypress div.item-list-tabs ul li.current a span, +#buddypress div.item-list-tabs ul li a:hover span { + background-color: #eee; +} +#buddypress div.item-list-tabs ul li.selected a span, +#buddypress div.item-list-tabs ul li.current a span { + background-color: #fff; +} +#buddypress div#item-nav ul li.loading a { + background-position: 88% 50%; +} +#buddypress div.item-list-tabs#object-nav { + margin-top: 0; +} +#buddypress div.item-list-tabs#subnav { + background: transparent; + margin: 10px 0 10px; + overflow: hidden; +} +#buddypress #admins-list li, +#buddypress #mods-list li, +#buddypress #members-list li { + overflow: auto; + list-style: none; +} + + +/*-------------------------------------------------------------- +6.9 - Private Messaging Threads +--------------------------------------------------------------*/ +#buddypress table#message-threads tr.unread td { + background: #fff9db; + border-top: 1px solid #ffe8c4; + border-bottom: 1px solid #ffe8c4; + font-weight: bold; +} +#buddypress li span.unread-count, +#buddypress tr.unread span.unread-count { + background: #dd0000; + border-radius: 3px; + color: #fff; + font-weight: bold; + padding: 2px 8px; +} +#buddypress div.item-list-tabs ul li a span.unread-count { + padding: 1px 6px; + color: #fff; +} +#buddypress div.messages-options-nav { + background: #eee; + font-size: 80%; + margin: 0; + padding: 5px 15px; + text-align: right; +} +#buddypress div#message-thread div.message-box { + margin: 0; + padding: 15px; +} +#buddypress div#message-thread div.alt { + background: #f4f4f4; +} +#buddypress div#message-thread p#message-recipients { + margin: 10px 0 20px 0; +} +#buddypress div#message-thread img.avatar { + float: left; + margin: 0 10px 0 0; + vertical-align: middle; +} +#buddypress div#message-thread strong { + font-size: 100%; + margin: 0; +} +#buddypress div#message-thread strong a { + text-decoration: none; +} +#buddypress div#message-thread strong span.activity { + margin-top: 4px; +} +#buddypress div#message-thread div.message-metadata { + overflow: hidden; +} +#buddypress div#message-thread div.message-content { + margin-left: 45px; +} +#buddypress div#message-thread div.message-options { + text-align: right; +} +#buddypress #message-threads img.avatar { + max-width: none; +} +#buddypress div.message-search { + float: right; + margin: 0 20px; +} + +/*-------------------------------------------------------------- +6.10 - Extended Profiles +--------------------------------------------------------------*/ + +#buddypress div.profile h4 { + margin-bottom: auto; + margin-top: 15px; +} +#buddypress #profile-edit-form ul.button-nav { + margin-top: 15px; +} +body.no-js #buddypress .field-visibility-settings-toggle, +body.no-js #buddypress .field-visibility-settings-close { + display: none; +} +#buddypress .field-visibility-settings { + display: none; + margin-top: 10px; +} + body.no-js #buddypress .field-visibility-settings { + display: block; + } +#buddypress .current-visibility-level { + font-weight: bold; + font-style: normal; +} +#buddypress .field-visibility-settings, +#buddypress .field-visibility-settings-toggle, +#buddypress .field-visibility-settings-notoggle { + color: #888; +} +#buddypress .field-visibility-settings-toggle a, +#buddypress .field-visibility-settings a { + font-size: 80%; +} +body.register #buddypress div.page ul { + list-style: none; +} +#buddypress .standard-form .field-visibility-settings label { + margin: 0; + font-weight: normal; +} +#buddypress .field-visibility-settings legend, +#buddypress .field-visibility-settings-toggle { + font-style: italic; +} + +/*-------------------------------------------------------------- +6.11 - Widgets +--------------------------------------------------------------*/ + +.widget.buddypress div.item-avatar img.avatar { + float: left; + margin: 0 10px 15px 0; +} + +.widget.buddypress span.activity { + display: inline-block; + font-size: 80%; + opacity: 0.8; + padding: 0; +} + +.widget.buddypress div.item-options { + font-size: 90%; + margin: 0 0 1em 0; + padding: 1em 0; +} + +.widget.buddypress div.item{ + margin:0 0 1em 0; +} + +.widget.buddypress div.item-meta, +.widget.buddypress div.item-content { + font-size: 11px; + margin-left: 38px; +} + +.widget.buddypress ul.item-list img.avatar { + height: 20px; + margin-right: 10px; + width: 20px; +} +.widget.buddypress div.item-avatar img { + height: 40px; + margin: 1px; + width: 40px; +} + +.widget.buddypress div.avatar-block{ + overflow: hidden; +} + +/*-------------------------------------------------------------- +7.0 - Media Queries +--------------------------------------------------------------*/ +/*-------------------------------------------------------------- +7.1 - Smartphones - landscape +--------------------------------------------------------------*/ +@media screen and (max-device-width: 480px), screen and (-webkit-min-device-pixel-ratio: 2) { + -webkit-text-size-adjust: none; +} +@media only screen and (max-width: 480px ){ + #buddypress div.dir-search { + float: right; + margin-top: -50px; + text-align: right; + } + #buddypress div.dir-search input[type="text"] { + margin-bottom: 1em; + width: 50%; + } + a.bp-title-button { + margin-left: 10px; + } +} + +/*-------------------------------------------------------------- +7.2 - Smartphones - portrait +--------------------------------------------------------------*/ +@media only screen and (max-width: 320px) { + #buddypress div.dir-search { + clear: left; + float: left; + margin-top: 0; + text-align: left; + } + #buddypress li#groups-order-select { + clear: left; + float: left; + } + #buddypress ul.item-list li div.action { + clear: left; + float: left; + margin-top: 0; + margin-left: 70px; + position: relative; + top: 0; + right: 0; + text-align: left; + } + #buddypress ul.item-list li div.item-desc { + clear: left; + float: left; + margin: 10px 0 0; + width: auto; + } + #buddypress li div.item { + margin-left: 70px; + width: auto; + } + #buddypress ul.item-list li div.meta { + margin-top: 0; + } + #buddypress .item-desc p { + margin: 0 0 10px; + } + #buddypress div.pagination .pag-count { + margin-left: 0; + } +} + +/*-------------------------------------------------------------- +7.2 - Smartphones - smaller screen sizes +--------------------------------------------------------------*/ +@media only screen and (max-width: 240px) { + #buddypress div.dir-search { + float: left; + margin: 0; + } + #buddypress div.dir-search input[type="text"] { + width: 50%; + } + #buddypress li#groups-order-select { + float: left; + } + #buddypress ul.item-list li img.avatar { + width: 30px; + height: auto; + } + #buddypress ul.item-list li div.action, + #buddypress li div.item{ + margin-left: 45px; + } + h1 a.bp-title-button { + clear: left; + float: left; + margin: 10px 0 20px; + } +} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.js b/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.js new file mode 100644 index 0000000000000000000000000000000000000000..889c91966c97f20fbe00d15b0d5c31b344b916df --- /dev/null +++ b/wp-content/plugins/buddypress/bp-templates/bp-legacy/js/buddypress.js @@ -0,0 +1,1461 @@ +// AJAX Functions +var jq = jQuery; + +// Global variable to prevent multiple AJAX requests +var bp_ajax_request = null; + +jq(document).ready( function() { + /**** Page Load Actions *******************************************************/ + + /* Hide Forums Post Form */ + if ( '-1' == window.location.search.indexOf('new') && jq('div.forums').length ) + jq('#new-topic-post').hide(); + else + jq('#new-topic-post').show(); + + /* Activity filter and scope set */ + bp_init_activity(); + + /* Object filter and scope set. */ + var objects = [ 'members', 'groups', 'blogs', 'forums' ]; + bp_init_objects( objects ); + + /* @mention Compose Scrolling */ + if ( jq.query.get('r') && jq('#whats-new').length ) { + jq('#whats-new-options').animate({ + height:'40px' + }); + jq("#whats-new-form textarea").animate({ + height:'50px' + }); + jq.scrollTo( jq('#whats-new'), 500, { + offset:-125, + easing:'easeOutQuad' + } ); + jq('#whats-new').focus(); + } + + /**** Activity Posting ********************************************************/ + + /* Textarea focus */ + jq('#whats-new').focus( function(){ + jq("#whats-new-options").animate({ + height:'40px' + }); + jq("#whats-new-form textarea").animate({ + height:'50px' + }); + jq("#aw-whats-new-submit").prop("disabled", false); + }); + + /* New posts */ + jq("#aw-whats-new-submit").on( 'click', function() { + var button = jq(this); + var form = button.parent().parent().parent().parent(); + + form.children().each( function() { + if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") ) + jq(this).prop( 'disabled', true ); + }); + + /* Remove any errors */ + jq('div.error').remove(); + button.addClass('loading'); + button.prop('disabled', true); + + /* Default POST values */ + var object = ''; + var item_id = jq("#whats-new-post-in").val(); + var content = jq("#whats-new").val(); + + /* Set object for non-profile posts */ + if ( item_id > 0 ) { + object = jq("#whats-new-post-object").val(); + } + + jq.post( ajaxurl, { + action: 'post_update', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce_post_update': jq("#_wpnonce_post_update").val(), + 'content': content, + 'object': object, + 'item_id': item_id, + '_bp_as_nonce': jq('#_bp_as_nonce').val() || '' + }, + function(response) { + + form.children().each( function() { + if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") ) { + jq(this).prop( 'disabled', false ); + } + }); + + /* Check for errors and append if found. */ + if ( response[0] + response[1] == '-1' ) { + form.prepend( response.substr( 2, response.length ) ); + jq( '#' + form.attr('id') + ' div.error').hide().fadeIn( 200 ); + } else { + if ( 0 == jq("ul.activity-list").length ) { + jq("div.error").slideUp(100).remove(); + jq("#message").slideUp(100).remove(); + jq("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' ); + } + + jq("#activity-stream").prepend(response); + jq("#activity-stream li:first").addClass('new-update'); + + if ( 0 != jq("#latest-update").length ) { + var l = jq("#activity-stream li.new-update .activity-content .activity-inner p").html(); + var v = jq("#activity-stream li.new-update .activity-content .activity-header p a.view").attr('href'); + + var ltext = jq("#activity-stream li.new-update .activity-content .activity-inner p").text(); + + var u = ''; + if ( ltext != '' ) + u = l + ' '; + + u += '<a href="' + v + '" rel="nofollow">' + BP_DTheme.view + '</a>'; + + jq("#latest-update").slideUp(300,function(){ + jq("#latest-update").html( u ); + jq("#latest-update").slideDown(300); + }); + } + + jq("li.new-update").hide().slideDown( 300 ); + jq("li.new-update").removeClass( 'new-update' ); + jq("#whats-new").val(''); + } + + jq("#whats-new-options").animate({ + height:'0px' + }); + jq("#whats-new-form textarea").animate({ + height:'20px' + }); + jq("#aw-whats-new-submit").prop("disabled", true).removeClass('loading'); + }); + + return false; + }); + + /* List tabs event delegation */ + jq('div.activity-type-tabs').on( 'click', function(event) { + var target = jq(event.target).parent(); + + if ( event.target.nodeName == 'STRONG' || event.target.nodeName == 'SPAN' ) + target = target.parent(); + else if ( event.target.nodeName != 'A' ) + return false; + + /* Reset the page */ + jq.cookie( 'bp-activity-oldestpage', 1, { + path: '/' + } ); + + /* Activity Stream Tabs */ + var scope = target.attr('id').substr( 9, target.attr('id').length ); + var filter = jq("#activity-filter-select select").val(); + + if ( scope == 'mentions' ) + jq( '#' + target.attr('id') + ' a strong' ).remove(); + + bp_activity_request(scope, filter); + + return false; + }); + + /* Activity filter select */ + jq('#activity-filter-select select').change( function() { + var selected_tab = jq( 'div.activity-type-tabs li.selected' ); + + if ( !selected_tab.length ) + var scope = null; + else + var scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length ); + + var filter = jq(this).val(); + + bp_activity_request(scope, filter); + + return false; + }); + + /* Stream event delegation */ + jq('div.activity').on( 'click', function(event) { + var target = jq(event.target); + + /* Favoriting activity stream items */ + if ( target.hasClass('fav') || target.hasClass('unfav') ) { + var type = target.hasClass('fav') ? 'fav' : 'unfav'; + var parent = target.closest('.activity-item'); + var parent_id = parent.attr('id').substr( 9, parent.attr('id').length ); + + target.addClass('loading'); + + jq.post( ajaxurl, { + action: 'activity_mark_' + type, + 'cookie': encodeURIComponent(document.cookie), + 'id': parent_id + }, + function(response) { + target.removeClass('loading'); + + target.fadeOut( 200, function() { + jq(this).html(response); + jq(this).attr('title', 'fav' == type ? BP_DTheme.remove_fav : BP_DTheme.mark_as_fav); + jq(this).fadeIn(200); + }); + + if ( 'fav' == type ) { + if ( !jq('.item-list-tabs #activity-favs-personal-li').length ) { + if ( !jq('.item-list-tabs #activity-favorites').length ) + jq('.item-list-tabs ul #activity-mentions').before( '<li id="activity-favorites"><a href="#">' + BP_DTheme.my_favs + ' <span>0</span></a></li>'); + + jq('.item-list-tabs ul #activity-favorites span').html( Number( jq('.item-list-tabs ul #activity-favorites span').html() ) + 1 ); + } + + target.removeClass('fav'); + target.addClass('unfav'); + + } else { + target.removeClass('unfav'); + target.addClass('fav'); + + jq('.item-list-tabs ul #activity-favorites span').html( Number( jq('.item-list-tabs ul #activity-favorites span').html() ) - 1 ); + + if ( !Number( jq('.item-list-tabs ul #activity-favorites span').html() ) ) { + if ( jq('.item-list-tabs ul #activity-favorites').hasClass('selected') ) + bp_activity_request( null, null ); + + jq('.item-list-tabs ul #activity-favorites').remove(); + } + } + + if ( 'activity-favorites' == jq( '.item-list-tabs li.selected').attr('id') ) + target.parent().parent().parent().slideUp(100); + }); + + return false; + } + + /* Delete activity stream items */ + if ( target.hasClass('delete-activity') ) { + var li = target.parents('div.activity ul li'); + var id = li.attr('id').substr( 9, li.attr('id').length ); + var link_href = target.attr('href'); + var nonce = link_href.split('_wpnonce='); + + nonce = nonce[1]; + + target.addClass('loading'); + + jq.post( ajaxurl, { + action: 'delete_activity', + 'cookie': encodeURIComponent(document.cookie), + 'id': id, + '_wpnonce': nonce + }, + function(response) { + + if ( response[0] + response[1] == '-1' ) { + li.prepend( response.substr( 2, response.length ) ); + li.children('#message').hide().fadeIn(300); + } else { + li.slideUp(300); + } + }); + + return false; + } + + // Spam activity stream items + if ( target.hasClass( 'spam-activity' ) ) { + var li = target.parents( 'div.activity ul li' ); + target.addClass( 'loading' ); + + jq.post( ajaxurl, { + action: 'bp_spam_activity', + 'cookie': encodeURIComponent( document.cookie ), + 'id': li.attr( 'id' ).substr( 9, li.attr( 'id' ).length ), + '_wpnonce': target.attr( 'href' ).split( '_wpnonce=' )[1] + }, + + function(response) { + if ( response[0] + response[1] === '-1' ) { + li.prepend( response.substr( 2, response.length ) ); + li.children( '#message' ).hide().fadeIn(300); + } else { + li.slideUp( 300 ); + } + }); + + return false; + } + + /* Load more updates at the end of the page */ + if ( target.parent().hasClass('load-more') ) { + jq("#buddypress 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), + 'page': oldest_page + }, + function(response) + { + jq("#buddypress li.load-more").removeClass('loading'); + jq.cookie( 'bp-activity-oldestpage', oldest_page, { + path: '/' + } ); + jq("#buddypress ul.activity-list").append(response.contents); + + target.parent().hide(); + }, 'json' ); + + return false; + } + }); + + // Activity "Read More" links + jq('.activity-read-more a').on('click', function(event) { + var target = jq(event.target); + var link_id = target.parent().attr('id').split('-'); + var a_id = link_id[3]; + var type = link_id[0]; /* activity or acomment */ + + var inner_class = type == 'acomment' ? 'acomment-content' : 'activity-inner'; + var a_inner = jq('#' + type + '-' + a_id + ' .' + inner_class + ':first' ); + jq(target).addClass('loading'); + + jq.post( ajaxurl, { + action: 'get_single_activity_content', + 'activity_id': a_id + }, + function(response) { + jq(a_inner).slideUp(300).html(response).slideDown(300); + }); + + return false; + }); + + /**** Activity Comments *******************************************************/ + + /* Hide all activity comment forms */ + jq('form.ac-form').hide(); + + /* Hide excess comments */ + if ( jq('.activity-comments').length ) + bp_legacy_theme_hide_comments(); + + /* Activity list event delegation */ + jq('div.activity').on( 'click', function(event) { + var target = jq(event.target); + + /* Comment / comment reply links */ + if ( target.hasClass('acomment-reply') || target.parent().hasClass('acomment-reply') ) { + if ( target.parent().hasClass('acomment-reply') ) + target = target.parent(); + + var id = target.attr('id'); + ids = id.split('-'); + + var a_id = ids[2] + var c_id = target.attr('href').substr( 10, target.attr('href').length ); + var form = jq( '#ac-form-' + a_id ); + + form.css( 'display', 'none' ); + form.removeClass('root'); + jq('.ac-form').hide(); + + /* Hide any error messages */ + form.children('div').each( function() { + if ( jq(this).hasClass( 'error' ) ) + jq(this).hide(); + }); + + if ( ids[1] != 'comment' ) { + jq('#acomment-' + c_id).append( form ); + } else { + jq('#activity-' + a_id + ' .activity-comments').append( form ); + } + + if ( form.parent().hasClass( 'activity-comments' ) ) + form.addClass('root'); + + form.slideDown( 200 ); + jq.scrollTo( form, 500, { + offset:-100, + easing:'easeOutQuad' + } ); + jq('#ac-form-' + ids[2] + ' textarea').focus(); + + return false; + } + + /* Activity comment posting */ + if ( target.attr('name') == 'ac_form_submit' ) { + var form = target.parents( 'form' ); + var form_parent = form.parent(); + var form_id = form.attr('id').split('-'); + + if ( !form_parent.hasClass('activity-comments') ) { + var tmp_id = form_parent.attr('id').split('-'); + var comment_id = tmp_id[1]; + } else { + var comment_id = form_id[2]; + } + + var content = jq( '#' + form.attr('id') + ' textarea' ); + + /* Hide any error messages */ + jq( '#' + form.attr('id') + ' div.error').hide(); + target.addClass('loading').prop('disabled', true); + content.addClass('loading').prop('disabled', true); + + var ajaxdata = { + action: 'new_activity_comment', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce_new_activity_comment': jq("#_wpnonce_new_activity_comment").val(), + 'comment_id': comment_id, + 'form_id': form_id[2], + 'content': content.val() + }; + + // Akismet + var ak_nonce = jq('#_bp_as_nonce_' + comment_id).val(); + if ( ak_nonce ) { + ajaxdata['_bp_as_nonce_' + comment_id] = ak_nonce; + } + + jq.post( ajaxurl, ajaxdata, function(response) { + target.removeClass('loading'); + content.removeClass('loading'); + + /* Check for errors and append if found. */ + if ( response[0] + response[1] == '-1' ) { + form.append( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); + } else { + form.fadeOut( 200, function() { + if ( 0 == form.parent().children('ul').length ) { + if ( form.parent().hasClass('activity-comments') ) { + form.parent().prepend('<ul></ul>'); + } else { + form.parent().append('<ul></ul>'); + } + } + + /* Preceeding whitespace breaks output with jQuery 1.9.0 */ + var the_comment = jq.trim( response ); + + form.parent().children('ul').append( jq( the_comment ).hide().fadeIn( 200 ) ); + form.children('textarea').val(''); + form.parent().parent().addClass('has-comments'); + } ); + jq( '#' + form.attr('id') + ' textarea').val(''); + + /* Increase the "Reply (X)" button count */ + jq('#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 ); + } + + jq(target).prop("disabled", false); + jq(content).prop("disabled", false); + }); + + return false; + } + + /* Deleting an activity comment */ + if ( target.hasClass('acomment-delete') ) { + var link_href = target.attr('href'); + var comment_li = target.parent().parent(); + var form = comment_li.parents('div.activity-comments').children('form'); + + var nonce = link_href.split('_wpnonce='); + nonce = nonce[1]; + + var comment_id = link_href.split('cid='); + comment_id = comment_id[1].split('&'); + comment_id = comment_id[0]; + + target.addClass('loading'); + + /* Remove any error messages */ + jq('.activity-comments ul .error').remove(); + + /* Reset the form position */ + comment_li.parents('.activity-comments').append(form); + + jq.post( ajaxurl, { + action: 'delete_activity_comment', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce': nonce, + 'id': comment_id + }, + function(response) { + /* Check for errors and append if found. */ + if ( response[0] + response[1] == '-1' ) { + comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); + } else { + var children = jq( '#' + comment_li.attr('id') + ' ul' ).children('li'); + var child_count = 0; + jq(children).each( function() { + if ( !jq(this).is(':hidden') ) + child_count++; + }); + comment_li.fadeOut(200); + + /* Decrease the "Reply (X)" button count */ + var count_span = jq('#' + comment_li.parents('#activity-stream > li').attr('id') + ' a.acomment-reply span'); + var new_count = count_span.html() - ( 1 + child_count ); + count_span.html(new_count); + + /* If that was the last comment for the item, remove the has-comments class to clean up the styling */ + if ( 0 == new_count ) { + jq(comment_li.parents('#activity-stream > li')).removeClass('has-comments'); + } + } + }); + + return false; + } + + // Spam an activity stream comment + if ( target.hasClass( 'spam-activity-comment' ) ) { + var link_href = target.attr( 'href' ); + var comment_li = target.parent().parent(); + + target.addClass('loading'); + + // Remove any error messages + jq( '.activity-comments ul div.error' ).remove(); + + // Reset the form position + comment_li.parents( '.activity-comments' ).append( comment_li.parents( '.activity-comments' ).children( 'form' ) ); + + jq.post( ajaxurl, { + action: 'bp_spam_activity_comment', + 'cookie': encodeURIComponent( document.cookie ), + '_wpnonce': link_href.split( '_wpnonce=' )[1], + 'id': link_href.split( 'cid=' )[1].split( '&' )[0] + }, + + function ( response ) { + // Check for errors and append if found. + if ( response[0] + response[1] == '-1' ) { + comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); + + } else { + var children = jq( '#' + comment_li.attr( 'id' ) + ' ul' ).children( 'li' ); + var child_count = 0; + jq(children).each( function() { + if ( !jq( this ).is( ':hidden' ) ) { + child_count++; + } + }); + comment_li.fadeOut( 200 ); + + // Decrease the "Reply (X)" button count + var parent_li = comment_li.parents( '#activity-stream > li' ); + jq( '#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html( jq( '#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html() - ( 1 + child_count ) ); + } + }); + + return false; + } + + /* Showing hidden comments - pause for half a second */ + if ( target.parent().hasClass('show-all') ) { + target.parent().addClass('loading'); + + setTimeout( function() { + target.parent().parent().children('li').fadeIn(200, function() { + target.parent().remove(); + }); + }, 600 ); + + return false; + } + + // Canceling an activity comment + if ( target.hasClass( 'ac-reply-cancel' ) ) { + jq(target).closest('.ac-form').slideUp( 200 ); + return false; + }; + }); + + /* Escape Key Press for cancelling comment forms */ + jq(document).keydown( function(e) { + e = e || window.event; + if (e.target) + element = e.target; + else if (e.srcElement) + element = e.srcElement; + + if( element.nodeType == 3) + element = element.parentNode; + + if( e.ctrlKey == true || e.altKey == true || e.metaKey == true ) + return; + + var keyCode = (e.keyCode) ? e.keyCode : e.which; + + if ( keyCode == 27 ) { + if (element.tagName == 'TEXTAREA') { + if ( jq(element).hasClass('ac-input') ) + jq(element).parent().parent().parent().slideUp( 200 ); + } + } + }); + + /**** Directory Search ****************************************************/ + + /* The search form on all directory pages */ + jq('.dir-search').on( 'click', function(event) { + if ( jq(this).hasClass('no-ajax') ) + return; + + var target = jq(event.target); + + if ( target.attr('type') == 'submit' ) { + var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' ); + var object = css_id[0]; + + 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; + } + }); + + /**** Tabs and Filters ****************************************************/ + + /* When a navigation tab is clicked - e.g. | All Groups | My Groups | */ + jq('div.item-list-tabs').on( 'click', function(event) { + if ( jq(this).hasClass('no-ajax') ) + return; + + var targetElem = ( event.target.nodeName == 'SPAN' ) ? event.target.parentNode : event.target; + var target = jq( targetElem ).parent(); + if ( 'LI' == target[0].nodeName && !target.hasClass( 'last' ) ) { + var css_id = target.attr('id').split( '-' ); + var object = css_id[0]; + + if ( 'activity' == object ) + return false; + + var scope = css_id[1]; + 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; + } + }); + + /* When the filter select box is changed re-query */ + jq('li.filter select').change( function() { + if ( jq('.item-list-tabs li.selected').length ) + var el = jq('.item-list-tabs li.selected'); + else + var el = jq(this); + + var css_id = el.attr('id').split('-'); + var object = css_id[0]; + var scope = css_id[1]; + var filter = jq(this).val(); + var search_terms = false; + + if ( jq('.dir-search input').length ) + search_terms = jq('.dir-search input').val(); + + if ( 'friends' == object ) + object = 'members'; + + bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') ); + + return false; + }); + + /* All pagination links run through this function */ + jq('#buddypress').on( 'click', function(event) { + var target = jq(event.target); + + if ( target.hasClass('button') ) + return true; + + if ( target.parent().parent().hasClass('pagination') && !target.parent().parent().hasClass('no-ajax') ) { + if ( target.hasClass('dots') || target.hasClass('current') ) + return false; + + if ( jq('.item-list-tabs li.selected').length ) + var el = jq('.item-list-tabs li.selected'); + else + var el = jq('li.filter select'); + + var page_number = 1; + var css_id = el.attr('id').split( '-' ); + var object = css_id[0]; + var search_terms = false; + + if ( jq('div.dir-search input').length ) + search_terms = jq('.dir-search input').val(); + + if ( jq(target).hasClass('next') ) + var page_number = Number( jq('.pagination span.current').html() ) + 1; + else if ( jq(target).hasClass('prev') ) + var page_number = Number( jq('.pagination span.current').html() ) - 1; + else + 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; + } + + }); + + /**** New Forum Directory Post **************************************/ + + /* Hit the "New Topic" button on the forums directory page */ + jq('a.show-hide-new').on( 'click', function() { + if ( !jq('#new-topic-post').length ) + return false; + + if ( jq('#new-topic-post').is(":visible") ) + jq('#new-topic-post').slideUp(200); + else + jq('#new-topic-post').slideDown(200, function() { + jq('#topic_title').focus(); + } ); + + return false; + }); + + /* Cancel the posting of a new forum topic */ + jq('#submit_topic_cancel').on( 'click', function() { + if ( !jq('#new-topic-post').length ) + return false; + + jq('#new-topic-post').slideUp(200); + return false; + }); + + /* Clicking a forum tag */ + jq('#forum-directory-tags a').on( '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; + }); + + /** Invite Friends Interface ****************************************/ + + /* Select a user from the list of friends and add them to the invite list */ + jq("#invite-list input").on( 'click', function() { + jq('.ajax-loader').toggle(); + + var friend_id = jq(this).val(); + + if ( jq(this).prop('checked') == true ) + var friend_action = 'invite'; + else + var friend_action = 'uninvite'; + + jq('.item-list-tabs li.selected').addClass('loading'); + + jq.post( ajaxurl, { + action: 'groups_invite_user', + 'friend_action': friend_action, + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce': jq("#_wpnonce_invite_uninvite_user").val(), + 'friend_id': friend_id, + 'group_id': jq("#group_id").val() + }, + function(response) + { + if ( jq("#message") ) + jq("#message").hide(); + + jq('.ajax-loader').toggle(); + + if ( friend_action == 'invite' ) { + jq('#friend-list').append(response); + } else if ( friend_action == 'uninvite' ) { + jq('#friend-list li#uid-' + friend_id).remove(); + } + + jq('.item-list-tabs li.selected').removeClass('loading'); + }); + }); + + /* Remove a user from the list of users to invite to a group */ + jq("#friend-list").on('click', 'li a.remove', function() { + jq('.ajax-loader').toggle(); + + var friend_id = jq(this).attr('id'); + friend_id = friend_id.split('-'); + friend_id = friend_id[1]; + + jq.post( ajaxurl, { + action: 'groups_invite_user', + 'friend_action': 'uninvite', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce': jq("#_wpnonce_invite_uninvite_user").val(), + 'friend_id': friend_id, + 'group_id': jq("#group_id").val() + }, + function(response) + { + jq('.ajax-loader').toggle(); + jq('#friend-list #uid-' + friend_id).remove(); + jq('#invite-list #f-' + friend_id).prop('checked', false); + }); + + return false; + }); + + /** Profile Visibility Settings *********************************/ + jq('.field-visibility-settings').hide(); + jq('.visibility-toggle-link').on( 'click', function() { + var toggle_div = jq(this).parent(); + + jq(toggle_div).fadeOut( 600, function(){ + jq(toggle_div).siblings('.field-visibility-settings').slideDown(400); + }); + + return false; + } ); + + jq('.field-visibility-settings-close').on( 'click', function() { + var settings_div = jq(this).parent(); + + jq(settings_div).slideUp( 400, function(){ + jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800); + }); + + return false; + } ); + + + /** Friendship Requests **************************************/ + + /* Accept and Reject friendship request buttons */ + jq("#friend-list a.accept, #friend-list a.reject").on( 'click', function() { + var button = jq(this); + var li = jq(this).parents('#friend-list li'); + var action_div = jq(this).parents('li div.action'); + + var id = li.attr('id').substr( 11, li.attr('id').length ); + var link_href = button.attr('href'); + + var nonce = link_href.split('_wpnonce='); + nonce = nonce[1]; + + 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' ); + } else { + var action = 'reject_friendship'; + action_div.children('a.accept').css( 'visibility', 'hidden' ); + } + + button.addClass('loading'); + + jq.post( ajaxurl, { + action: action, + 'cookie': encodeURIComponent(document.cookie), + 'id': id, + '_wpnonce': nonce + }, + function(response) { + button.removeClass('loading'); + + if ( response[0] + response[1] == '-1' ) { + li.prepend( response.substr( 2, response.length ) ); + li.children('#message').hide().fadeIn(200); + } else { + button.fadeOut( 100, function() { + if ( jq(this).hasClass('accept') ) { + action_div.children('a.reject').hide(); + jq(this).html( BP_DTheme.accepted ).contents().unwrap(); + } else { + action_div.children('a.accept').hide(); + jq(this).html( BP_DTheme.rejected ).contents().unwrap(); + } + }); + } + }); + + return false; + }); + + /* Add / Remove friendship buttons */ + jq(".friendship-button a").on('click', function() { + jq(this).parent().addClass('loading'); + var fid = jq(this).attr('id'); + fid = fid.split('-'); + fid = fid[1]; + + var nonce = jq(this).attr('href'); + nonce = nonce.split('?_wpnonce='); + nonce = nonce[1].split('&'); + nonce = nonce[0]; + + var thelink = jq(this); + + jq.post( ajaxurl, { + action: 'addremove_friend', + 'cookie': encodeURIComponent(document.cookie), + 'fid': fid, + '_wpnonce': nonce + }, + function(response) + { + var action = thelink.attr('rel'); + var parentdiv = thelink.parent(); + + if ( action == 'add' ) { + jq(parentdiv).fadeOut(200, + function() { + parentdiv.removeClass('add_friend'); + parentdiv.removeClass('loading'); + parentdiv.addClass('pending_friend'); + parentdiv.fadeIn(200).html(response); + } + ); + + } else if ( action == 'remove' ) { + jq(parentdiv).fadeOut(200, + function() { + parentdiv.removeClass('remove_friend'); + parentdiv.removeClass('loading'); + parentdiv.addClass('add'); + parentdiv.fadeIn(200).html(response); + } + ); + } + }); + return false; + } ); + + /** Group Join / Leave Buttons **************************************/ + + jq(".group-button a").on('click', function() { + var gid = jq(this).parent().attr('id'); + gid = gid.split('-'); + gid = gid[1]; + + var nonce = jq(this).attr('href'); + nonce = nonce.split('?_wpnonce='); + nonce = nonce[1].split('&'); + nonce = nonce[0]; + + var thelink = jq(this); + + jq.post( ajaxurl, { + action: 'joinleave_group', + 'cookie': encodeURIComponent(document.cookie), + 'gid': gid, + '_wpnonce': nonce + }, + function(response) + { + var parentdiv = thelink.parent(); + + if ( !jq('body.directory').length ) + location.href = location.href; + else { + jq(parentdiv).fadeOut(200, + function() { + parentdiv.fadeIn(200).html(response); + } + ); + } + }); + return false; + } ); + + /** Button disabling ************************************************/ + + jq('.pending').click(function() { + return false; + }); + + /** Private Messaging ******************************************/ + + /** Message search*/ + jq('.message-search').on( 'click', function(event) { + if ( jq(this).hasClass('no-ajax') ) + return; + + var target = jq(event.target); + + if ( target.attr('type') == 'submit' ) { + //var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' ); + var object = 'messages'; + + 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; + } + }); + + /* AJAX send reply functionality */ + jq("#send_reply_button").click( + function() { + var order = jq('#messages_order').val() || 'ASC', + offset = jq('#message-recipients').offset(); + + var button = jq("#send_reply_button"); + jq(button).addClass('loading'); + + jq.post( ajaxurl, { + action: 'messages_send_reply', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce': jq("#send_message_nonce").val(), + + 'content': jq("#message_content").val(), + 'send_to': jq("#send_to").val(), + 'subject': jq("#subject").val(), + 'thread_id': jq("#thread_id").val() + }, + function(response) + { + if ( response[0] + response[1] == "-1" ) { + jq('#send-reply').prepend( response.substr( 2, response.length ) ); + } else { + jq('#send-reply #message').remove(); + jq("#message_content").val(''); + + if ( 'ASC' == order ) { + jq('#send-reply').before( response ); + } else { + jq('#message-recipients').after( response ); + jq(window).scrollTop(offset.top); + } + + jq(".new-message").hide().slideDown( 200, function() { + jq('.new-message').removeClass('new-message'); + }); + } + jq(button).removeClass('loading'); + }); + + return false; + } + ); + + /* Marking private messages as read and unread */ + jq("#mark_as_read, #mark_as_unread").click(function() { + var checkboxes_tosend = ''; + var checkboxes = jq("#message-threads tr td input[type='checkbox']"); + + if ( 'mark_as_unread' == jq(this).attr('id') ) { + var currentClass = 'read' + var newClass = 'unread' + var unreadCount = 1; + var inboxCount = 0; + var unreadCountDisplay = 'inline'; + var action = 'messages_markunread'; + } else { + var currentClass = 'unread' + var newClass = 'read' + var unreadCount = 0; + var inboxCount = 1; + var unreadCountDisplay = 'none'; + var action = 'messages_markread'; + } + + checkboxes.each( function(i) { + if(jq(this).is(':checked')) { + if ( jq('#m-' + jq(this).attr('value')).hasClass(currentClass) ) { + checkboxes_tosend += jq(this).attr('value'); + jq('#m-' + jq(this).attr('value')).removeClass(currentClass); + jq('#m-' + jq(this).attr('value')).addClass(newClass); + var thread_count = jq('#m-' + jq(this).attr('value') + ' td span.unread-count').html(); + + jq('#m-' + jq(this).attr('value') + ' td span.unread-count').html(unreadCount); + jq('#m-' + jq(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay); + + var inboxcount = jq('tr.unread').length; + + jq('#user-messages span').html( inboxcount ); + + if ( i != checkboxes.length - 1 ) { + checkboxes_tosend += ',' + } + } + } + }); + jq.post( ajaxurl, { + action: action, + 'thread_ids': checkboxes_tosend + }); + return false; + }); + + /* Selecting unread and read messages in inbox */ + jq("#message-type-select").change( + function() { + var selection = jq("#message-type-select").val(); + var checkboxes = jq("td input[type='checkbox']"); + checkboxes.each( function(i) { + checkboxes[i].checked = ""; + }); + + switch(selection) { + case 'unread': + var checkboxes = jq("tr.unread td input[type='checkbox']"); + break; + case 'read': + var checkboxes = jq("tr.read td input[type='checkbox']"); + break; + } + if ( selection != '' ) { + checkboxes.each( function(i) { + checkboxes[i].checked = "checked"; + }); + } else { + checkboxes.each( function(i) { + checkboxes[i].checked = ""; + }); + } + } + ); + + /* Bulk delete messages */ + jq("#delete_inbox_messages, #delete_sentbox_messages").on( 'click', function() { + checkboxes_tosend = ''; + checkboxes = jq("#message-threads tr td input[type='checkbox']"); + + jq('#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 ) { + jq(this).removeClass('loading'); + return false; + } + + jq.post( ajaxurl, { + action: 'messages_delete', + 'thread_ids': checkboxes_tosend + }, function(response) { + if ( response[0] + response[1] == "-1" ) { + jq('#message-threads').prepend( response.substr( 2, response.length ) ); + } else { + jq('#message-threads').before( '<div id="message" class="updated"><p>' + response + '</p></div>' ); + + jq(checkboxes).each( function(i) { + if( jq(this).is(':checked') ) + jq(this).parent().parent().fadeOut(150); + }); + } + + jq('#message').hide().slideDown(150); + jq("#delete_inbox_messages, #delete_sentbox_messages").removeClass('loading'); + }); + return false; + }); + + /* Close site wide notices in the sidebar */ + jq("#close-notice").on( 'click', function() { + jq(this).addClass('loading'); + jq('#sidebar div.error').remove(); + + jq.post( ajaxurl, { + action: 'messages_close_notice', + 'notice_id': jq('.notice').attr('rel').substr( 2, jq('.notice').attr('rel').length ) + }, + function(response) { + jq("#close-notice").removeClass('loading'); + + if ( response[0] + response[1] == '-1' ) { + jq('.notice').prepend( response.substr( 2, response.length ) ); + jq( '#sidebar div.error').hide().fadeIn( 200 ); + } else { + jq('.notice').slideUp( 100 ); + } + }); + return false; + }); + + /* Toolbar & wp_list_pages Javascript IE6 hover class */ + jq("#wp-admin-bar ul.main-nav li, #nav li").mouseover( function() { + jq(this).addClass('sfhover'); + }); + + jq("#wp-admin-bar ul.main-nav li, #nav li").mouseout( function() { + jq(this).removeClass('sfhover'); + }); + + /* Clear BP cookies on logout */ + jq('a.logout').on( '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' ]; + 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: '/' + } ); + }); + }); + + /* if js is enabled then replace the no-js class by a js one */ + if( jq('body').hasClass('no-js') ) + jq('body').attr('class', jq('body').attr('class').replace( /no-js/,'js' ) ); + +}); + +/* Setup activity scope and filter based on the current cookie settings. */ +function bp_init_activity() { + /* Reset the page */ + 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') + '"]').prop( 'selected', true ); + + /* Activity Tab Set */ + if ( null != jq.cookie('bp-activity-scope') && jq('.activity-type-tabs').length ) { + jq('.activity-type-tabs li').each( function() { + jq(this).removeClass('selected'); + }); + jq('#activity-' + jq.cookie('bp-activity-scope') + ', .item-list-tabs li.current').addClass('selected'); + } +} + +/* Setup object scope and filter based on the current cookie settings for the object. */ +function bp_init_objects(objects) { + jq(objects).each( function(i) { + if ( null != jq.cookie('bp-' + objects[i] + '-filter') && jq('#' + objects[i] + '-order-select select').length ) + jq('#' + objects[i] + '-order-select select option[value="' + jq.cookie('bp-' + objects[i] + '-filter') + '"]').prop( 'selected', true ); + + if ( null != jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) { + jq('.item-list-tabs li').each( function() { + jq(this).removeClass('selected'); + }); + jq('#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', #object-nav li.current').addClass('selected'); + } + }); +} + +/* Filter the current content list (groups/members/blogs/topics) */ +function bp_filter_request( object, filter, scope, target, search_terms, page, extras ) { + if ( 'activity' == object ) + return false; + + if ( jq.query.get('s') && !search_terms ) + search_terms = jq.query.get('s'); + + if ( null == scope ) + scope = 'all'; + + /* Save the settings we want to remain persistent to a cookie */ + 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 */ + jq('.item-list-tabs li').each( function() { + jq(this).removeClass('selected'); + }); + jq('#' + object + '-' + scope + ', #object-nav li.current').addClass('selected'); + jq('.item-list-tabs li.selected').addClass('loading'); + jq('.item-list-tabs select option[value="' + filter + '"]').prop( 'selected', true ); + + if ( 'friends' == object ) + object = 'members'; + + if ( bp_ajax_request ) + bp_ajax_request.abort(); + + bp_ajax_request = jq.post( ajaxurl, { + action: object + '_filter', + 'cookie': encodeURIComponent(document.cookie), + 'object': object, + 'filter': filter, + 'search_terms': search_terms, + 'scope': scope, + 'page': page, + 'extras': extras + }, + function(response) + { + jq(target).fadeOut( 100, function() { + jq(this).html(response); + jq(this).fadeIn(100); + }); + jq('.item-list-tabs li.selected').removeClass('loading'); + }); +} + +/* Activity Loop Requesting */ +function bp_activity_request(scope, filter) { + /* Save the type and filter to a session cookie */ + jq.cookie( 'bp-activity-scope', scope, { + path: '/' + } ); + jq.cookie( 'bp-activity-filter', filter, { + path: '/' + } ); + jq.cookie( 'bp-activity-oldestpage', 1, { + path: '/' + } ); + + /* Remove selected and loading classes from tabs */ + jq('.item-list-tabs li').each( function() { + jq(this).removeClass('selected loading'); + }); + /* Set the correct selected nav and filter */ + jq('#activity-' + scope + ', .item-list-tabs li.current').addClass('selected'); + jq('#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading'); + jq('#activity-filter-select select option[value="' + filter + '"]').prop( 'selected', true ); + + /* Reload the activity stream based on the selection */ + jq('.widget_bp_activity_widget h2 span.ajax-loader').show(); + + if ( bp_ajax_request ) + bp_ajax_request.abort(); + + bp_ajax_request = jq.post( ajaxurl, { + action: 'activity_widget_filter', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce_activity_filter': jq("#_wpnonce_activity_filter").val(), + 'scope': scope, + 'filter': filter + }, + function(response) + { + 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); + + /* Selectively hide comments */ + bp_legacy_theme_hide_comments(); + }); + + /* Update the feed link */ + if ( null != response.feed_url ) + jq('.directory #subnav li.feed a, .home-page #subnav li.feed a').attr('href', response.feed_url); + + jq('.item-list-tabs li.selected').removeClass('loading'); + + }, 'json' ); +} + +/* Hide long lists of activity comments, only show the latest five root comments. */ +function bp_legacy_theme_hide_comments() { + var comments_divs = jq('div.activity-comments'); + + if ( !comments_divs.length ) + return false; + + comments_divs.each( function() { + if ( jq(this).children('ul').children('li').length < 5 ) return; + + var comments_div = jq(this); + var parent_li = comments_div.parents('#activity-stream > li'); + var comment_lis = jq(this).children('ul').children('li'); + var comment_count = ' '; + + if ( jq('#' + parent_li.attr('id') + ' a.acomment-reply span').length ) + var comment_count = jq('#' + 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 ) { + jq(this).addClass('hidden'); + jq(this).toggle(); + + if ( !i ) + jq(this).before( '<li class="show-all"><a href="#' + parent_li.attr('id') + '/show-all/" title="' + BP_DTheme.show_all_comments + '">' + BP_DTheme.show_all + ' ' + comment_count + ' ' + BP_DTheme.comments + '</a></li>' ); + } + }); + + }); +} + +/* Helper Functions */ + +function checkAll() { + var checkboxes = document.getElementsByTagName("input"); + for(var i=0; i<checkboxes.length; i++) { + if(checkboxes[i].type == "checkbox") { + if($("check_all").checked == "") { + checkboxes[i].checked = ""; + } + else { + checkboxes[i].checked = "checked"; + } + } + } +} + +function clear(container) { + if( !document.getElementById(container) ) return; + + var container = document.getElementById(container); + + if ( radioButtons = container.getElementsByTagName('INPUT') ) { + for(var i=0; i<radioButtons.length; i++) { + radioButtons[i].checked = ''; + } + } + + if ( options = container.getElementsByTagName('OPTION') ) { + for(var i=0; i<options.length; i++) { + options[i].selected = false; + } + } + + return; +} + +/* ScrollTo plugin - just inline and minified */ +;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); + +/* jQuery Easing Plugin, v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */ +jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}}); + +/* jQuery Cookie plugin */ +jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}}; + +/* jQuery querystring plugin */ +eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('M 6(A){4 $11=A.11||\'&\';4 $V=A.V===r?r:j;4 $1p=A.1p===r?\'\':\'[]\';4 $13=A.13===r?r:j;4 $D=$13?A.D===j?"#":"?":"";4 $15=A.15===r?r:j;v.1o=M 6(){4 f=6(o,t){8 o!=1v&&o!==x&&(!!t?o.1t==t:j)};4 14=6(1m){4 m,1l=/\\[([^[]*)\\]/g,T=/^([^[]+)(\\[.*\\])?$/.1r(1m),k=T[1],e=[];19(m=1l.1r(T[2]))e.u(m[1]);8[k,e]};4 w=6(3,e,7){4 o,y=e.1b();b(I 3!=\'X\')3=x;b(y===""){b(!3)3=[];b(f(3,L)){3.u(e.h==0?7:w(x,e.z(0),7))}n b(f(3,1a)){4 i=0;19(3[i++]!=x);3[--i]=e.h==0?7:w(3[i],e.z(0),7)}n{3=[];3.u(e.h==0?7:w(x,e.z(0),7))}}n b(y&&y.T(/^\\s*[0-9]+\\s*$/)){4 H=1c(y,10);b(!3)3=[];3[H]=e.h==0?7:w(3[H],e.z(0),7)}n b(y){4 H=y.B(/^\\s*|\\s*$/g,"");b(!3)3={};b(f(3,L)){4 18={};1w(4 i=0;i<3.h;++i){18[i]=3[i]}3=18}3[H]=e.h==0?7:w(3[H],e.z(0),7)}n{8 7}8 3};4 C=6(a){4 p=d;p.l={};b(a.C){v.J(a.Z(),6(5,c){p.O(5,c)})}n{v.J(1u,6(){4 q=""+d;q=q.B(/^[?#]/,\'\');q=q.B(/[;&]$/,\'\');b($V)q=q.B(/[+]/g,\' \');v.J(q.Y(/[&;]/),6(){4 5=1e(d.Y(\'=\')[0]||"");4 c=1e(d.Y(\'=\')[1]||"");b(!5)8;b($15){b(/^[+-]?[0-9]+\\.[0-9]*$/.1d(c))c=1A(c);n b(/^[+-]?[0-9]+$/.1d(c))c=1c(c,10)}c=(!c&&c!==0)?j:c;b(c!==r&&c!==j&&I c!=\'1g\')c=c;p.O(5,c)})})}8 p};C.1H={C:j,1G:6(5,1f){4 7=d.Z(5);8 f(7,1f)},1h:6(5){b(!f(5))8 d.l;4 K=14(5),k=K[0],e=K[1];4 3=d.l[k];19(3!=x&&e.h!=0){3=3[e.1b()]}8 I 3==\'1g\'?3:3||""},Z:6(5){4 3=d.1h(5);b(f(3,1a))8 v.1E(j,{},3);n b(f(3,L))8 3.z(0);8 3},O:6(5,c){4 7=!f(c)?x:c;4 K=14(5),k=K[0],e=K[1];4 3=d.l[k];d.l[k]=w(3,e.z(0),7);8 d},w:6(5,c){8 d.N().O(5,c)},1s:6(5){8 d.O(5,x).17()},1z:6(5){8 d.N().1s(5)},1j:6(){4 p=d;v.J(p.l,6(5,7){1y p.l[5]});8 p},1F:6(Q){4 D=Q.B(/^.*?[#](.+?)(?:\\?.+)?$/,"$1");4 S=Q.B(/^.*?[?](.+?)(?:#.+)?$/,"$1");8 M C(Q.h==S.h?\'\':S,Q.h==D.h?\'\':D)},1x:6(){8 d.N().1j()},N:6(){8 M C(d)},17:6(){6 F(G){4 R=I G=="X"?f(G,L)?[]:{}:G;b(I G==\'X\'){6 1k(o,5,7){b(f(o,L))o.u(7);n o[5]=7}v.J(G,6(5,7){b(!f(7))8 j;1k(R,5,F(7))})}8 R}d.l=F(d.l);8 d},1B:6(){8 d.N().17()},1D:6(){4 i=0,U=[],W=[],p=d;4 16=6(E){E=E+"";b($V)E=E.B(/ /g,"+");8 1C(E)};4 1n=6(1i,5,7){b(!f(7)||7===r)8;4 o=[16(5)];b(7!==j){o.u("=");o.u(16(7))}1i.u(o.P(""))};4 F=6(R,k){4 12=6(5){8!k||k==""?[5].P(""):[k,"[",5,"]"].P("")};v.J(R,6(5,7){b(I 7==\'X\')F(7,12(5));n 1n(W,12(5),7)})};F(d.l);b(W.h>0)U.u($D);U.u(W.P($11));8 U.P("")}};8 M C(1q.S,1q.D)}}(v.1o||{});',62,106,'|||target|var|key|function|value|return|||if|val|this|tokens|is||length||true|base|keys||else||self||false|||push|jQuery|set|null|token|slice|settings|replace|queryObject|hash|str|build|orig|index|typeof|each|parsed|Array|new|copy|SET|join|url|obj|search|match|queryString|spaces|chunks|object|split|get||separator|newKey|prefix|parse|numbers|encode|COMPACT|temp|while|Object|shift|parseInt|test|decodeURIComponent|type|number|GET|arr|EMPTY|add|rx|path|addFields|query|suffix|location|exec|REMOVE|constructor|arguments|undefined|for|empty|delete|remove|parseFloat|compact|encodeURIComponent|toString|extend|load|has|prototype'.split('|'),0,{})) diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php index b05d32d50af06d6bfe72fdc044942a93f988594c..fa0a6d79be69cf28214711a57fdefbf22303ae68 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php @@ -9,7 +9,7 @@ * http://codex.wordpress.org/AJAX_in_Plugins. * * @package BuddyPress - * @since 1.2 + * @since BuddyPress (1.2) * @subpackage BP-Default */ @@ -279,7 +279,7 @@ function bp_dtheme_post_update() { if ( bp_has_activities ( 'include=' . $activity_id ) ) { while ( bp_activities() ) { - bp_the_activity(); + bp_the_activity(); locate_template( array( 'activity/entry.php' ), true ); } } @@ -326,6 +326,7 @@ function bp_dtheme_new_activity_comment() { bp_has_activities( 'display_comments=stream&hide_spam=false&include=' . $comment_id ); // Swap the current comment with the activity item we just loaded + $activities_template->activity = new stdClass; $activities_template->activity->id = $activities_template->activities[0]->item_id; $activities_template->activity->current_comment = $activities_template->activities[0]; @@ -351,7 +352,7 @@ function bp_dtheme_new_activity_comment() { * * @return mixed String on error, void on success * @since BuddyPress (1.2) - */ + */ function bp_dtheme_delete_activity() { // Bail if not a POST action if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) @@ -369,7 +370,7 @@ function bp_dtheme_delete_activity() { $activity = new BP_Activity_Activity( (int) $_POST['id'] ); // Check access - if ( empty( $activity->user_id ) || ! bp_activity_user_can_delete( $activity ) ) + if ( ! bp_activity_user_can_delete( $activity ) ) exit( '-1' ); // Call the action before the delete so plugins can still fetch information about it @@ -593,30 +594,40 @@ function bp_dtheme_ajax_addremove_friend() { if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) { + // Cast fid as an integer + $friend_id = (int) $_POST['fid']; + + // Trying to cancel friendship + if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { check_ajax_referer( 'friends_remove_friend' ); - if ( ! friends_remove_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) + if ( ! friends_remove_friend( bp_loggedin_user_id(), $friend_id ) ) { echo __( 'Friendship could not be canceled.', 'buddypress' ); - else - echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; + } else { + echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; + } - } elseif ( 'not_friends' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) { + // Trying to request friendship + } elseif ( 'not_friends' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { check_ajax_referer( 'friends_add_friend' ); - if ( ! friends_add_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) + if ( ! friends_add_friend( bp_loggedin_user_id(), $friend_id ) ) { echo __(' Friendship could not be requested.', 'buddypress' ); - else - echo '<a id="friend-' . $_POST['fid'] . '" class="remove" rel="remove" title="' . __( 'Cancel Friendship Request', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . (int) $_POST['fid'] . '/', 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>'; + } else { + echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="remove" rel="remove" title="' . __( 'Cancel Friendship Request', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . $friend_id . '/', 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>'; + } - } elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), (int) $_POST['fid'] ) ) { + // Trying to cancel pending request + } elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $friend_id ) ) { check_ajax_referer( 'friends_withdraw_friendship' ); - if ( friends_withdraw_friendship( bp_loggedin_user_id(), (int) $_POST['fid'] ) ) - echo '<a id="friend-' . $_POST['fid'] . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $_POST['fid'], 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; - else + if ( friends_withdraw_friendship( bp_loggedin_user_id(), $friend_id ) ) { + echo '<a id="friend-' . esc_attr( $friend_id ) . '" class="add" rel="add" title="' . __( 'Add Friend', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/add-friend/' . $friend_id, 'friends_add_friend' ) . '">' . __( 'Add Friend', 'buddypress' ) . '</a>'; + } else { echo __("Friendship request could not be cancelled.", 'buddypress'); + } + // Request already pending } else { echo __( 'Request Pending', 'buddypress' ); } @@ -637,7 +648,7 @@ function bp_dtheme_ajax_accept_friendship() { check_admin_referer( 'friends_accept_friendship' ); - if ( ! friends_accept_friendship( $_POST['id'] ) ) + if ( ! friends_accept_friendship( (int) $_POST['id'] ) ) echo "-1<div id='message' class='error'><p>" . __( 'There was a problem accepting that request. Please try again.', 'buddypress' ) . '</p></div>'; exit; @@ -656,7 +667,7 @@ function bp_dtheme_ajax_reject_friendship() { check_admin_referer( 'friends_reject_friendship' ); - if ( ! friends_reject_friendship( $_POST['id'] ) ) + if ( ! friends_reject_friendship( (int) $_POST['id'] ) ) echo "-1<div id='message' class='error'><p>" . __( 'There was a problem rejecting that request. Please try again.', 'buddypress' ) . '</p></div>'; exit; @@ -673,39 +684,45 @@ function bp_dtheme_ajax_joinleave_group() { if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) return; - if ( groups_is_user_banned( bp_loggedin_user_id(), $_POST['gid'] ) ) + // Cast gid as integer + $group_id = (int) $_POST['gid']; + + if ( groups_is_user_banned( bp_loggedin_user_id(), $group_id ) ) return; - if ( ! $group = groups_get_group( array( 'group_id' => $_POST['gid'] ) ) ) + if ( ! $group = groups_get_group( array( 'group_id' => $group_id ) ) ) return; if ( ! groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) { if ( 'public' == $group->status ) { check_ajax_referer( 'groups_join_group' ); - if ( ! groups_join_group( $group->id ) ) + if ( ! groups_join_group( $group->id ) ) { _e( 'Error joining group', 'buddypress' ); - else + } else { echo '<a id="group-' . esc_attr( $group->id ) . '" class="leave-group" rel="leave" title="' . __( 'Leave Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ) . '">' . __( 'Leave Group', 'buddypress' ) . '</a>'; + } } elseif ( 'private' == $group->status ) { check_ajax_referer( 'groups_request_membership' ); - if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) + if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) { _e( 'Error requesting membership', 'buddypress' ); - else + } else { echo '<a id="group-' . esc_attr( $group->id ) . '" class="membership-requested" rel="membership-requested" title="' . __( 'Membership Requested', 'buddypress' ) . '" href="' . bp_get_group_permalink( $group ) . '">' . __( 'Membership Requested', 'buddypress' ) . '</a>'; + } } } else { check_ajax_referer( 'groups_leave_group' ); - if ( ! groups_leave_group( $group->id ) ) + if ( ! groups_leave_group( $group->id ) ) { _e( 'Error leaving group', 'buddypress' ); - elseif ( 'public' == $group->status ) + } elseif ( 'public' == $group->status ) { echo '<a id="group-' . esc_attr( $group->id ) . '" class="join-group" rel="join" title="' . __( 'Join Group', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ) . '">' . __( 'Join Group', 'buddypress' ) . '</a>'; - elseif ( 'private' == $group->status ) + } elseif ( 'private' == $group->status ) { echo '<a id="group-' . esc_attr( $group->id ) . '" class="request-membership" rel="join" title="' . __( 'Request Membership', 'buddypress' ) . '" href="' . wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_send_membership_request' ) . '">' . __( 'Request Membership', 'buddypress' ) . '</a>'; + } } exit; @@ -749,7 +766,7 @@ function bp_dtheme_ajax_messages_send_reply() { check_ajax_referer( 'messages_send_message' ); - $result = messages_new_message( array( 'thread_id' => $_REQUEST['thread_id'], 'content' => $_REQUEST['content'] ) ); + $result = messages_new_message( array( 'thread_id' => (int) $_REQUEST['thread_id'], 'content' => $_REQUEST['content'] ) ); if ( $result ) { ?> <div class="message-box new-message"> @@ -798,7 +815,7 @@ function bp_dtheme_ajax_message_markunread() { $thread_ids = explode( ',', $_POST['thread_ids'] ); for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { - BP_Messages_Thread::mark_as_unread($thread_ids[$i]); + BP_Messages_Thread::mark_as_unread( (int) $thread_ids[$i] ); } } @@ -823,7 +840,7 @@ function bp_dtheme_ajax_message_markread() { $thread_ids = explode( ',', $_POST['thread_ids'] ); for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { - BP_Messages_Thread::mark_as_read($thread_ids[$i]); + BP_Messages_Thread::mark_as_read( (int) $thread_ids[$i] ); } } @@ -847,8 +864,9 @@ function bp_dtheme_ajax_messages_delete() { } else { $thread_ids = explode( ',', $_POST['thread_ids'] ); - for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) - BP_Messages_Thread::delete($thread_ids[$i]); + for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { + BP_Messages_Thread::delete( (int) $thread_ids[$i] ); + } _e( 'Messages deleted.', 'buddypress' ); } @@ -859,19 +877,17 @@ function bp_dtheme_ajax_messages_delete() { /** * AJAX handler for autocomplete. Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined. * - * @global BuddyPress $bp The one true BuddyPress instance * @return string HTML * @since BuddyPress (1.2) */ function bp_dtheme_ajax_messages_autocomplete_results() { - global $bp; // Include everyone in the autocomplete, or just friends? if ( bp_is_current_component( bp_get_messages_slug() ) ) - $autocomplete_all = $bp->messages->autocomplete_all; + $autocomplete_all = buddypress()->messages->autocomplete_all; $pag_page = 1; - $limit = $_GET['limit'] ? $_GET['limit'] : apply_filters( 'bp_autocomplete_max_results', 10 ); + $limit = (int) $_GET['limit'] ? $_GET['limit'] : apply_filters( 'bp_autocomplete_max_results', 10 ); // Get the user ids based on the search terms if ( ! empty( $autocomplete_all ) ) { @@ -881,8 +897,9 @@ function bp_dtheme_ajax_messages_autocomplete_results() { // Build an array with the correct format $user_ids = array(); foreach( $users['users'] as $user ) { - if ( $user->id != bp_loggedin_user_id() ) + if ( $user->id != bp_loggedin_user_id() ) { $user_ids[] = $user->id; + } } $user_ids = apply_filters( 'bp_core_autocomplete_ids', $user_ids, $_GET['q'], $limit ); @@ -895,28 +912,30 @@ function bp_dtheme_ajax_messages_autocomplete_results() { // Keeping the bp_friends_autocomplete_list filter for backward compatibility $users = apply_filters( 'bp_friends_autocomplete_list', $users, $_GET['q'], $limit ); - if ( ! empty( $users['friends'] ) ) + if ( ! empty( $users['friends'] ) ) { $user_ids = apply_filters( 'bp_friends_autocomplete_ids', $users['friends'], $_GET['q'], $limit ); + } } } if ( ! empty( $user_ids ) ) { foreach ( $user_ids as $user_id ) { $ud = get_userdata( $user_id ); - if ( ! $ud ) + if ( ! $ud ) { continue; + } - if ( bp_is_username_compatibility_mode() ) + if ( bp_is_username_compatibility_mode() ) { $username = $ud->user_login; - else + } else { $username = $ud->user_nicename; + } // Note that the final line break acts as a delimiter for the // autocomplete javascript and thus should not be removed - echo '<span id="link-' . $username . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15, 'alt' => $ud->display_name ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')' . "\n"; + echo '<span id="link-' . esc_attr( $username ) . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15, 'alt' => $ud->display_name ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . esc_html( $username ) . ')' . "\n"; } } exit; } -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js index 9efbd7100605c0164998599858ff57a707b2d9f8..1a3a6e2c88686a623a8b00cbe4d116575066522b 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/global.js @@ -29,7 +29,7 @@ jq(document).ready( function() { height:'50px' }); jq.scrollTo( jq('textarea#whats-new'), 500, { - offset:-125, + offset:-125, easing:'easeOutQuad' } ); jq('textarea#whats-new').focus(); @@ -322,7 +322,7 @@ jq(document).ready( function() { }); // Activity "Read More" links - jq('.activity-read-more a').live('click', function(event) { + jq('.activity-read-more a').on('click', function(event) { var target = jq(event.target); var link_id = target.parent().attr('id').split('-'); var a_id = link_id[3]; @@ -389,7 +389,7 @@ jq(document).ready( function() { form.slideDown( 200 ); jq.scrollTo( form, 500, { - offset:-100, + offset:-100, easing:'easeOutQuad' } ); jq('#ac-form-' + ids[2] + ' textarea').focus(); @@ -399,9 +399,9 @@ jq(document).ready( function() { /* Activity comment posting */ if ( target.attr('name') == 'ac_form_submit' ) { - var form = target.parent().parent(); + var form = target.parents( 'form' ); var form_parent = form.parent(); - var form_id = form.attr('id').split('-'); + var form_id = form.attr('id').split('-'); if ( !form_parent.hasClass('activity-comments') ) { var tmp_id = form_parent.attr('id').split('-'); @@ -411,7 +411,7 @@ jq(document).ready( function() { } /* Hide any error messages */ - jq( 'form#' + form + ' div.error').hide(); + jq( 'form#' + form.attr('id') + ' div.error').hide(); target.addClass('loading').prop('disabled', true); var ajaxdata = { @@ -429,37 +429,38 @@ jq(document).ready( function() { ajaxdata['_bp_as_nonce_' + comment_id] = ak_nonce; } - jq.post( ajaxurl, ajaxdata, - function(response) - { - target.removeClass('loading'); + jq.post( ajaxurl, ajaxdata, function(response) { + target.removeClass('loading'); - /* Check for errors and append if found. */ - if ( response[0] + response[1] == '-1' ) { - form.append( response.substr( 2, response.length ) ).hide().fadeIn( 200 ); - } else { - form.fadeOut( 200, - function() { - if ( 0 == form.parent().children('ul').length ) { - if ( form.parent().hasClass('activity-comments') ) - form.parent().prepend('<ul></ul>'); - else - form.parent().append('<ul></ul>'); - } - - form.parent().children('ul').append(response).hide().fadeIn( 200 ); - form.children('textarea').val(''); - form.parent().parent().addClass('has-comments'); + /* Check for errors and append if found. */ + if ( response[0] + response[1] == '-1' ) { + form.append( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); + } else { + form.fadeOut( 200, function() { + if ( 0 == form.parent().children('ul').length ) { + if ( form.parent().hasClass('activity-comments') ) { + form.parent().prepend('<ul></ul>'); + } else { + form.parent().append('<ul></ul>'); } - ); - jq( 'form#' + form + ' textarea').val(''); + } - /* Increase the "Reply (X)" button count */ - jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 ); - } + /* Preceeding whitespace breaks output with jQuery 1.9.0 */ + var the_comment = jq.trim( response ); - jq(target).prop("disabled", false); - }); + form.parent().children('ul').append( jq( the_comment ).hide().fadeIn( 200 ) ); + form.children('textarea').val(''); + form.parent().parent().addClass('has-comments'); + } ); + + jq( 'form#' + form.attr('id') + ' textarea').val(''); + + /* Increase the "Reply (X)" button count */ + jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 ); + } + + jq(target).prop("disabled", false); + }); return false; } @@ -495,7 +496,7 @@ jq(document).ready( function() { { /* Check for errors and append if found. */ if ( response[0] + response[1] == '-1' ) { - comment_li.prepend( response.substr( 2, response.length ) ).hide().fadeIn( 200 ); + comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); } else { var children = jq( 'li#' + comment_li.attr('id') + ' ul' ).children('li'); var child_count = 0; @@ -543,7 +544,7 @@ jq(document).ready( function() { function ( response ) { // Check for errors and append if found. if ( response[0] + response[1] == '-1' ) { - comment_li.prepend( response.substr( 2, response.length ) ).hide().fadeIn( 200 ); + comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) ); } else { var children = jq( 'li#' + comment_li.attr( 'id' ) + ' ul' ).children( 'li' ); @@ -628,9 +629,9 @@ jq(document).ready( function() { if ( jq(this).hasClass('no-ajax') ) return; - var target = jq(event.target).parent(); - - if ( 'LI' == event.target.parentNode.nodeName && !target.hasClass('last') ) { + var targetElem = ( event.target.nodeName == 'SPAN' ) ? event.target.parentNode : event.target; + var target = jq( targetElem ).parent(); + if ( 'LI' == target[0].nodeName && !target.hasClass('last') ) { var css_id = target.attr('id').split( '-' ); var object = css_id[0]; @@ -782,7 +783,7 @@ jq(document).ready( function() { }); /* Remove a user from the list of users to invite to a group */ - jq("#friend-list li a.remove").live('click', function() { + jq("#friend-list li a.remove").on('click', function() { jq('.ajax-loader').toggle(); var friend_id = jq(this).attr('id'); @@ -811,21 +812,21 @@ jq(document).ready( function() { jq('.field-visibility-settings').hide(); jq('.visibility-toggle-link').on( 'click', function() { var toggle_div = jq(this).parent(); - + jq(toggle_div).fadeOut( 600, function(){ jq(toggle_div).siblings('.field-visibility-settings').slideDown(400); }); - + return false; } ); jq('.field-visibility-settings-close').on( 'click', function() { var settings_div = jq(this).parent(); - + jq(settings_div).slideUp( 400, function(){ jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800); }); - + return false; } ); @@ -873,12 +874,10 @@ jq(document).ready( function() { button.fadeOut( 100, function() { if ( jq(this).hasClass('accept') ) { action_div.children('a.reject').hide(); - jq(this).html( BP_DTheme.accepted ).fadeIn(50); - jq(this).addClass('accepted'); + jq(this).html( BP_DTheme.accepted ).contents().unwrap(); } else { action_div.children('a.accept').hide(); - jq(this).html( BP_DTheme.rejected ).fadeIn(50); - jq(this).addClass('rejected'); + jq(this).html( BP_DTheme.rejected ).contents().unwrap(); } }); } @@ -888,7 +887,7 @@ jq(document).ready( function() { }); /* Add / Remove friendship buttons */ - jq(".friendship-button a").live('click', function() { + jq('#members-dir-list').on('click', '.friendship-button a', function() { jq(this).parent().addClass('loading'); var fid = jq(this).attr('id'); fid = fid.split('-'); @@ -938,7 +937,7 @@ jq(document).ready( function() { /** Group Join / Leave Buttons **************************************/ - jq(".group-button a").live('click', function() { + jq('#groups-dir-list').on('click', '.group-button a', function() { var gid = jq(this).parent().attr('id'); gid = gid.split('-'); gid = gid[1]; @@ -1433,7 +1432,7 @@ function clear(container) { } /* ScrollTo plugin - just inline and minified */ -;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); +;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); /* jQuery Easing Plugin, v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */ jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}}); diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/images/rss.png b/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/images/rss.png old mode 100755 new mode 100644 diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/comment.php b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/comment.php index 2ff231f78ec356650db93b1ad5f61c15aff7316c..a7f341df3947e7948c06b29dbebcff09c4f46954 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/comment.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/comment.php @@ -17,7 +17,10 @@ <li id="acomment-<?php bp_activity_comment_id(); ?>"> <div class="acomment-avatar"> <a href="<?php bp_activity_comment_user_link(); ?>"> - <?php bp_activity_avatar( 'type=thumb&user_id=' . bp_get_activity_comment_user_id() ); ?> + <?php bp_activity_avatar( array( + 'type' => 'thumb', + 'user_id' => bp_get_activity_comment_user_id() + ) ); ?> </a> </div> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/entry.php b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/entry.php index c18d6e5774d72bedd5ebf590321fc06ea2f65924..e32c716636d3b34e9a863dd4db11d7e22dba19ef 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/activity/entry.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/activity/entry.php @@ -57,7 +57,7 @@ <?php if ( bp_activity_can_comment() ) : ?> - <a href="<?php bp_get_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment <span>%s</span>', 'buddypress' ), bp_activity_get_comment_count() ); ?></a> + <a href="<?php bp_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment <span>%s</span>', 'buddypress' ), bp_activity_get_comment_count() ); ?></a> <?php endif; ?> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/create.php b/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/create.php index 7084a7900ad21fdc2a8b07e39776972e0d7e6b90..9b8b72edb0f319f7040e6276e40a3e746b242342 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/create.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/blogs/create.php @@ -44,4 +44,5 @@ get_header( 'buddypress' ); ?> <?php do_action( 'bp_after_directory_blogs_content' ); ?> <?php get_sidebar( 'buddypress' ); ?> -<?php get_footer( 'buddypress' ); ?> \ No newline at end of file +<?php get_footer( 'buddypress' ); ?> + diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php b/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php index ba8fc2a9dd9f049264820d33f95cfe54516e420c..c9698e19297a39e30e8d20b56bd0a4e73b2154e1 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/comments.php @@ -1,21 +1,28 @@ <?php + + // Bail if post type doesn't support comments + if ( ! post_type_supports( get_post_type(), 'comments' ) ) + return; + + // Bail if is a page, and comments are not open + if ( is_page() && ! have_comments() && ! comments_open() && ! pings_open() ) + return; + if ( post_password_required() ) { echo '<h3 class="comments-header">' . __( 'Password Protected', 'buddypress' ) . '</h3>'; echo '<p class="alert password-protected">' . __( 'Enter the password to view comments.', 'buddypress' ) . '</p>'; return; } - if ( is_page() && !have_comments() && !comments_open() && !pings_open() ) - return; - if ( have_comments() ) : - $num_comments = 0; + $num_comments = 0; $num_trackbacks = 0; foreach ( (array) $comments as $comment ) { - if ( 'comment' != get_comment_type() ) + if ( 'comment' != get_comment_type() ) { $num_trackbacks++; - else + } else { $num_comments++; + } } ?> <div id="comments"> @@ -39,23 +46,24 @@ <?php endif; ?> </div><!-- #comments --> + <?php else : ?> - <?php if ( pings_open() && !comments_open() && ( is_single() || is_page() ) ) : ?> - <p class="comments-closed pings-open"> - <?php printf( __( 'Comments are closed, but <a href="%1$s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', 'buddypress' ), trackback_url( '0' ) ); ?> - </p> - <?php elseif ( !comments_open() && ( is_single() || is_page() ) ) : ?> - <p class="comments-closed"> - <?php _e( 'Comments are closed.', 'buddypress' ); ?> - </p> + <?php if ( ! comments_open() ) : ?> + <?php if ( pings_open() ) : ?> + <p class="comments-closed pings-open"> + <?php printf( __( 'Comments are closed, but <a href="%1$s" title="Trackback URL for this post">trackbacks</a> and pingbacks are open.', 'buddypress' ), trackback_url( '0' ) ); ?> + </p> + <?php else : ?> + <p class="comments-closed"> + <?php _e( 'Comments are closed.', 'buddypress' ); ?> + </p> + <?php endif; ?> <?php endif; ?> <?php endif; ?> -<?php if ( comments_open() ) : ?> - <?php comment_form(); ?> -<?php endif; ?> +<?php if ( comments_open() ) comment_form(); ?> <?php if ( !empty( $num_trackbacks ) ) : ?> <div id="trackbacks"> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/forums/forums-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/forums/forums-loop.php index 0aa9c459cd95ab1c23426a7ffb1a6bd579a7d33b..51dea2f571a0ea8d9c1e32698559c47ead95eb2e 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/forums/forums-loop.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/forums/forums-loop.php @@ -51,7 +51,7 @@ <tr class="<?php bp_the_topic_css_class(); ?>"> <td class="td-title"> - <a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php bp_the_topic_title(); ?> - <?php _e( 'Permalink', 'buddypress' ); ?>"> + <a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php _e( 'Permanent link to this post', 'buddypress' ); ?>"> <?php bp_the_topic_title(); ?> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php b/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php index fef15060a5a5ba3c7673f924ec657f24cb553f4b..6f2eaa19238534d49a8f62430f5360017c99746a 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/functions.php @@ -24,7 +24,7 @@ * * @package BuddyPress * @subpackage BP-Default - * @since 1.2 + * @since BuddyPress (1.2) */ // Exit if accessed directly @@ -62,7 +62,7 @@ if ( ! function_exists( 'bp_dtheme_setup' ) ) : function bp_dtheme_setup() { // Load the AJAX functions for the theme - require( TEMPLATEPATH . '/_inc/ajax.php' ); + require( get_template_directory() . '/_inc/ajax.php' ); // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); @@ -112,7 +112,7 @@ function bp_dtheme_setup() { add_theme_support( 'custom-header', $custom_header_args ); } - if ( !is_admin() ) { + if ( ! is_admin() || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) { // Register buttons for the relevant component templates // Friends button if ( bp_is_active( 'friends' ) ) @@ -226,7 +226,7 @@ if ( !function_exists( 'bp_dtheme_admin_header_style' ) ) : * * Referenced via add_custom_image_header() in bp_dtheme_setup(). * - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_admin_header_style() { ?> @@ -334,7 +334,7 @@ if ( !function_exists( 'bp_dtheme_header_style' ) ) : * Referenced via add_custom_image_header() in bp_dtheme_setup(). * * @global WP_Query $post The current WP_Query object for the current post or page - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_header_style() { global $post; @@ -453,7 +453,7 @@ if ( !function_exists( 'bp_dtheme_blog_comments' ) ) : * @param array $args Arguments from wp_list_comments() call * @param int $depth Comment nesting level * @see wp_list_comments() - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_blog_comments( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; @@ -520,7 +520,7 @@ if ( !function_exists( 'bp_dtheme_page_on_front' ) ) : * Return the ID of a page set as the home page. * * @return false|int ID of page set as the home page - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_page_on_front() { if ( 'page' != get_option( 'show_on_front' ) ) @@ -538,7 +538,7 @@ if ( !function_exists( 'bp_dtheme_activity_secondary_avatars' ) ) : * @param BP_Activity_Activity $activity Activity object * @package BuddyPress Theme * @return string - * @since 1.2.6 + * @since BuddyPress (1.2.6) */ function bp_dtheme_activity_secondary_avatars( $action, $activity ) { switch ( $activity->component ) { @@ -562,7 +562,7 @@ if ( !function_exists( 'bp_dtheme_show_notice' ) ) : /** * Show a notice when the theme is activated - workaround by Ozh (http://old.nabble.com/Activation-hook-exist-for-themes--td25211004.html) * - * @since 1.2 + * @since BuddyPress (1.2) */ function bp_dtheme_show_notice() { global $pagenow; diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/create.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/create.php index 39533d1ee9634f929c24f1ba659aa6d1ecd19334..d2a42246f6b0cbf55edf54277ac0d1b6a36e01a7 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/create.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/create.php @@ -243,7 +243,7 @@ get_header( 'buddypress' ); ?> <?php else : ?> <div id="message" class="info"> - <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group. You can send invites any time in the future by selecting the "Send Invites" option when viewing your new group.', 'buddypress' ); ?></p> + <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group.', 'buddypress' ); ?></p> </div> <?php endif; ?> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/index.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/index.php index 56e3eb10dd7acfc1698aa00184d04c45ed3d339b..1c1249f8dd822567fc4e77830fa9adcf61d1418e 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/index.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/index.php @@ -88,4 +88,5 @@ get_header( 'buddypress' ); ?> <?php do_action( 'bp_after_directory_groups_page' ); ?> <?php get_sidebar( 'buddypress' ); ?> -<?php get_footer( 'buddypress' ); ?> \ No newline at end of file +<?php get_footer( 'buddypress' ); ?> + diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum.php index d94faba9abba89f3827b3ed286d53b4d4e9b0bf2..91b61d250a273b5da59a0afe365cfcd868af58d6 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/forum.php @@ -93,4 +93,5 @@ else : ?> <?php endif; ?> -<?php endif; ?> \ No newline at end of file +<?php endif; ?> + diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/home.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/home.php index 5fee65574782ce952183ec06c695abad4c2b2d12..fe2743ac0e1e3e4d85cd4d17809b88d61ac81e7c 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/home.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/home.php @@ -29,43 +29,75 @@ <?php do_action( 'bp_before_group_body' ); - if ( bp_is_group_admin_page() && bp_group_is_visible() ) : - locate_template( array( 'groups/single/admin.php' ), true ); + /** + * Does this next bit look familiar? If not, go check out WordPress's + * /wp-includes/template-loader.php file. + * + * @todo A real template hierarchy? Gasp! + */ - elseif ( bp_is_group_members() && bp_group_is_visible() ) : - locate_template( array( 'groups/single/members.php' ), true ); + // Group is visible + if ( bp_group_is_visible() ) : - elseif ( bp_is_group_invites() && bp_group_is_visible() ) : - locate_template( array( 'groups/single/send-invites.php' ), true ); + // Looking at home location + if ( bp_is_group_home() ) : - elseif ( bp_is_group_forum() && bp_group_is_visible() && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) : - locate_template( array( 'groups/single/forum.php' ), true ); + // Use custom front if one exists + $custom_front = locate_template( array( 'groups/single/front.php' ) ); + if ( ! empty( $custom_front ) ) : load_template( $custom_front, true ); + + // Default to activity + elseif ( bp_is_active( 'activity' ) ) : locate_template( array( 'groups/single/activity.php' ), true ); - elseif ( bp_is_group_membership_request() ) : - locate_template( array( 'groups/single/request-membership.php' ), true ); + // Otherwise show members + elseif ( bp_is_active( 'members' ) ) : locate_template( array( 'groups/single/members.php' ), true ); - elseif ( bp_group_is_visible() && bp_is_active( 'activity' ) ) : - locate_template( array( 'groups/single/activity.php' ), true ); + endif; - elseif ( bp_group_is_visible() ) : - locate_template( array( 'groups/single/members.php' ), true ); + // Not looking at home + else : - elseif ( !bp_group_is_visible() ) : - // The group is not visible, show the status message + // Group Admin + if ( bp_is_group_admin_page() ) : locate_template( array( 'groups/single/admin.php' ), true ); + + // Group Activity + elseif ( bp_is_group_activity() ) : locate_template( array( 'groups/single/activity.php' ), true ); + + // Group Members + elseif ( bp_is_group_members() ) : locate_template( array( 'groups/single/members.php' ), true ); + + // Group Invitations + elseif ( bp_is_group_invites() ) : locate_template( array( 'groups/single/send-invites.php' ), true ); + + // Old group forums + elseif ( bp_is_group_forum() ) : locate_template( array( 'groups/single/forum.php' ), true ); - do_action( 'bp_before_group_status_message' ); ?> + // Anything else (plugins mostly) + else : locate_template( array( 'groups/single/plugins.php' ), true ); + + endif; + endif; + + // Group is not visible + elseif ( ! bp_group_is_visible() ) : + + // Membership request + if ( bp_is_group_membership_request() ) : + locate_template( array( 'groups/single/request-membership' ), true ); + + // The group is not visible, show the status message + else : - <div id="message" class="info"> - <p><?php bp_group_status_message(); ?></p> - </div> + do_action( 'bp_before_group_status_message' ); ?> - <?php do_action( 'bp_after_group_status_message' ); + <div id="message" class="info"> + <p><?php bp_group_status_message(); ?></p> + </div> - else : - // If nothing sticks, just load a group front template if one exists. - locate_template( array( 'groups/single/front.php' ), true ); + <?php do_action( 'bp_after_group_status_message' ); - endif; + endif; + endif; do_action( 'bp_after_group_body' ); ?> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/send-invites.php b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/send-invites.php index d83c754bd08d5cf97b33f78f39bab40e56f00d2a..498d25494c1e9e7f1e079b7083f06300eec906de 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/send-invites.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/groups/single/send-invites.php @@ -70,7 +70,7 @@ <?php else : ?> <div id="message" class="info" role="main"> - <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group. You can send invites any time in the future by selecting the "Send Invites" option when viewing your new group.', 'buddypress' ); ?></p> + <p><?php _e( 'Once you have built up friend connections you will be able to invite others to your group.', 'buddypress' ); ?></p> </div> <?php endif; ?> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/header.php b/wp-content/plugins/buddypress/bp-themes/bp-default/header.php index 4753889bb36d4f3462aab7ea2e3ab851cdfc89fa..b78eb87f578671e0330a1fd4664148c2771eeaa6 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/header.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/header.php @@ -7,7 +7,7 @@ <title><?php wp_title( '|', true, 'right' ); bloginfo( 'name' ); ?></title> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> - <?php do_action( 'bp_head' ); ?> + <?php bp_head(); ?> <?php wp_head(); ?> </head> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/license.txt b/wp-content/plugins/buddypress/bp-themes/bp-default/license.txt index 888220587e12015cf35eb05c5d54fd341d11d4cb..b5fcfa6e7a5343eec02d2d25805773efbdf65121 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/license.txt +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/license.txt @@ -1,280 +1,280 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/compose.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/compose.php index 6b08d9ad0675c60e9eb675600d8b1ddd23217bed..9df799c1c13d471fbb6113c1aee91b3e0282a9f5 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/compose.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/compose.php @@ -1,4 +1,4 @@ -<form action="<?php bp_messages_form_action('compose'); ?>" method="post" id="send_message_form" class="standard-form" role="main"> +<form action="<?php bp_messages_form_action('compose'); ?>" method="post" id="send_message_form" class="standard-form" role="main" enctype="multipart/form-data"> <?php do_action( 'bp_before_messages_compose_content' ); ?> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/messages-loop.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/messages-loop.php index 5ed1ca26e3d992e8a7c05ad38899cc578c8e6acb..2e721df896ac1f8cca227c8d5d69803c7a873c91 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/messages-loop.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/messages/messages-loop.php @@ -21,7 +21,7 @@ <table id="message-threads" class="messages-notices"> <?php while ( bp_message_threads() ) : bp_message_thread(); ?> - <tr id="m-<?php bp_message_thread_id(); ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread"<?php else: ?> read"<?php endif; ?>> + <tr id="m-<?php bp_message_thread_id(); ?>" class="<?php bp_message_css_class(); ?><?php if ( bp_message_thread_has_unread() ) : ?> unread<?php else: ?> read<?php endif; ?>"> <td width="1%" class="thread-count"> <span class="unread-count"><?php bp_message_thread_unread_count(); ?></span> </td> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/edit.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/edit.php index 9b4586fa93ee497c33e34a2ecb2b18311a9fa298..c4def0ba7540fe1f4d6fd10e113ab4c50035465b 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/edit.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/profile/edit.php @@ -113,6 +113,8 @@ if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) <?php endif; ?> + <?php do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?> + <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></a> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings.php b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings.php index b981df8aac157f5974f52d1d4afd76956d75dcc8..b38fbc979af0328c17df8d763919dea070c95c9d 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/members/single/settings.php @@ -11,7 +11,7 @@ <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> <ul> - <?php if ( bp_is_my_profile() ) : ?> + <?php if ( bp_core_can_edit_settings() ) : ?> <?php bp_get_options_nav(); ?> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/readme.txt b/wp-content/plugins/buddypress/bp-themes/bp-default/readme.txt index b2c7f6ff4bd41eda3e45d23b0e5fed86acf9f2d0..ab411eeafce4bde629e65ef9314a257255a40c16 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/readme.txt +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/readme.txt @@ -1,22 +1,22 @@ ---- BuddyPress Default --- -Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor. - - ---- Installation --- -The theme is bundled with BuddyPress. After activating the plugin, BuddyPress Default will be added to the "Appearance > Themes" menu in your WordPress admin area. - - ---- About BuddyPress --- -Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress. BuddyPress will let users register on your site and start creating profiles, posting messages, making connections, creating and interacting in groups and much more. - -For help with BuddyPress Default, or for more information about BuddyPress, please visit http://buddypress.org/. - - ---- Building a BuddyPress theme --- -If you want to make a custom theme based on BuddyPress Default, DO NOT copy and edit it. By doing this you will make updates and maintenance much harder for yourself. Instead, please review this codex page for instructions on how to build a BuddyPress child theme: - -http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/ - - ---- Changelog --- +--- BuddyPress Default --- +Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor. + + +--- Installation --- +The theme is bundled with BuddyPress. After activating the plugin, BuddyPress Default will be added to the "Appearance > Themes" menu in your WordPress admin area. + + +--- About BuddyPress --- +Social networking in a box. Build a social network for your company, school, sports team or niche community all based on the power and flexibility of WordPress. BuddyPress will let users register on your site and start creating profiles, posting messages, making connections, creating and interacting in groups and much more. + +For help with BuddyPress Default, or for more information about BuddyPress, please visit http://buddypress.org/. + + +--- Building a BuddyPress theme --- +If you want to make a custom theme based on BuddyPress Default, DO NOT copy and edit it. By doing this you will make updates and maintenance much harder for yourself. Instead, please review this codex page for instructions on how to build a BuddyPress child theme: + +http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/ + + +--- Changelog --- A list of changes is available at http://codex.buddypress.org/theme-development/bp-default-theme-changelog/. \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php b/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php index a030263884cba7cb3e61b73122aa730efc7ad2de..bbc60cba3a476a51734976af127283908a851254 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php @@ -7,11 +7,17 @@ <div class="page" id="activate-page"> - <?php if ( bp_account_was_activated() ) : ?> + <h3><?php if ( bp_account_was_activated() ) : + _e( 'Account Activated', 'buddypress' ); + else : + _e( 'Activate your Account', 'buddypress' ); + endif; ?></h3> + + <?php do_action( 'template_notices' ); ?> - <h2 class="widgettitle"><?php _e( 'Account Activated', 'buddypress' ); ?></h2> + <?php do_action( 'bp_before_activate_content' ); ?> - <?php do_action( 'bp_before_activate_content' ); ?> + <?php if ( bp_account_was_activated() ) : ?> <?php if ( isset( $_GET['e'] ) ) : ?> <p><?php _e( 'Your account was activated successfully! Your account details have been sent to you in a separate email.', 'buddypress' ); ?></p> @@ -21,10 +27,6 @@ <?php else : ?> - <h3><?php _e( 'Activate your Account', 'buddypress' ); ?></h3> - - <?php do_action( 'bp_before_activate_content' ); ?> - <p><?php _e( 'Please provide a valid activation key.', 'buddypress' ); ?></p> <form action="" method="get" class="standard-form" id="activation-form"> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/registration/register.php b/wp-content/plugins/buddypress/bp-themes/bp-default/registration/register.php index 35519388de8c2ca6e79a41d94b80b5babd970d82..20efa5febc52a688a65f713b5a59072936c5923e 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/registration/register.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/registration/register.php @@ -153,29 +153,30 @@ </div> <?php endif; ?> - + + <?php do_action( 'bp_custom_profile_edit_fields_pre_visibility' ); ?> + <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> - <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link">Change</a> + <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _ex( 'Change', 'Change profile field visibility level', 'buddypress' ); ?></a> </p> - + <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> <fieldset> <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend> - + <?php bp_profile_visibility_radio_buttons() ?> - + </fieldset> <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a> - + </div> <?php else : ?> <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> - </p> + </p> <?php endif ?> - <?php do_action( 'bp_custom_profile_edit_fields' ); ?> <p class="description"><?php bp_the_profile_field_description(); ?></p> @@ -288,4 +289,4 @@ }); </script> -<?php get_footer( 'buddypress' ); ?> \ No newline at end of file +<?php get_footer( 'buddypress' ); ?> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css b/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css index 144fe52e7337fabc5c047f1a7b9ea49f2856d841..4626b18a8a7f683f5c9f2116f86365b14eede5a5 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/rtl.css @@ -2,7 +2,7 @@ * Theme Name: BuddyPress Default * Theme URI: http://buddypress.org/extend/themes/ * Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor. - * Version: 1.6.2 + * Version: 1.7.1 * Author: the BuddyPress team * Author URI: http://buddypress.org * License: GNU General Public License @@ -21,4 +21,4 @@ * * This file intentionally left blank. CSS is enqueued in functions.php * - */ + */ \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/searchform.php b/wp-content/plugins/buddypress/bp-themes/bp-default/searchform.php old mode 100755 new mode 100644 diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php b/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php index b891b88c62dc57f125b3d6c0fc12b0b33fa35b52..f3dc868354d9105cd1c74e96f785beaf0eeb5691 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/sidebar.php @@ -70,6 +70,8 @@ <?php do_action( 'bp_inside_after_sidebar' ); ?> + <?php wp_meta(); ?> + </div><!-- .padder --> </div><!-- #sidebar --> diff --git a/wp-content/plugins/buddypress/bp-themes/bp-default/style.css b/wp-content/plugins/buddypress/bp-themes/bp-default/style.css index 144fe52e7337fabc5c047f1a7b9ea49f2856d841..4626b18a8a7f683f5c9f2116f86365b14eede5a5 100644 --- a/wp-content/plugins/buddypress/bp-themes/bp-default/style.css +++ b/wp-content/plugins/buddypress/bp-themes/bp-default/style.css @@ -2,7 +2,7 @@ * Theme Name: BuddyPress Default * Theme URI: http://buddypress.org/extend/themes/ * Description: Clean and stylish, BuddyPress Default lets you build a social network straight out of the box. Make it yours with a custom menu, header image, and background. Along with five widgetized areas (one in the sidebar, four in the footer), BP-Default supports featured images (as custom header images on posts and pages) and is furnished with an optional one-column page template that removes the sidebar, and a stylesheet for the admin Visual Editor. - * Version: 1.6.2 + * Version: 1.7.1 * Author: the BuddyPress team * Author URI: http://buddypress.org * License: GNU General Public License @@ -21,4 +21,4 @@ * * This file intentionally left blank. CSS is enqueued in functions.php * - */ + */ \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-themes/index.php b/wp-content/plugins/buddypress/bp-themes/index.php new file mode 100644 index 0000000000000000000000000000000000000000..fa803040d8c28e13072f800c28a44c84bdfdd7f3 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-themes/index.php @@ -0,0 +1,5 @@ +<?php + +/** + * @todo move bp-default to WordPress.org theme repo + */ diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css index bf26c30bdd868e923a0ab979436c84c7e8304a3d..46b9c4070ac99eb80973d8bcad96a0ee22a816bc 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css +++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.css @@ -1 +1,248 @@ -#tabs-bottom{background:#f9f9f9;height:32px;border:1px solid #dfdfdf;border-radius:0 0 3px 3px}#tabs{position:relative}p.nofields{margin-top:20px}ul#field-group-tabs{float:left;padding:0 0 0 15px;margin:0;display:none}ul#field-group-tabs li{float:left;margin-bottom:-1px;background-color:transparent;margin-right:8px}ul#field-group-tabs li.ui-state-hover{background-color:#fafafa}ul#field-group-tabs li.ui-state-hover a.ui-tab{border-color:#dfdfdf #dfdfdf #f9f9f9 #dfdfdf;color:#d54e21}ul#field-group-tabs li.ui-state-acceptable a.ui-tab{border-color:#5a5 #5a5 #ccc #5a5;color:#8a8;background-color:#efe}ul#field-group-tabs li.ui-tabs-selected.ui-state-acceptable a.ui-tab{background-color:#f9f9f9}ul#field-group-tabs li.drop-candidate a.ui-tab{background-color:#ffc;border-color:#aa5 #aa5 #ccc #aa5;color:#aa8}ul#field-group-tabs li a.ui-tab{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;display:block;margin-top:3px;padding:5px 10px 5px;border:1px solid #dfdfdf;border-bottom:0;border-radius:3px 3px 0 0;text-decoration:none;color:#aaa}ul#field-group-tabs li.ui-tabs-selected a.ui-tab{background-color:#f9f9f9;margin-top:-1px;padding:7px 10px 7px;border:1px solid #dfdfdf;border-bottom:1px solid transparent;color:#000}.tab-toolbar{background:#f9f9f9;border-width:1px 1px 0;border-radius:3px 3px 0 0;margin:-20px -21px 20px -21px;clear:left;padding:10px;border:1px solid #dfdfdf}.field-wrapper a.deletion,.tab-toolbar a.deletion{color:#f00;border-bottom:1px solid #f00;font-size:12px;text-decoration:none;padding:0;margin:-2px 0 0 5px}div.tab-toolbar a.button-primary{color:#fff!important}div.tab-wrapper{background-color:#fff;clear:left;padding:20px;border-left:1px solid #ccc;border-right:1px solid #ccc;border-radius:3px 3px 0 0}.tab-wrapper fieldset{position:relative;cursor:default!important;background:inherit}.tab-wrapper fieldset legend{padding-bottom:15px;font-weight:bold}.tab-wrapper .xprofile-field{position:relative}.tab-wrapper fieldset fieldset{position:relative;border:1px solid #ddd;border-radius:3px;margin:10px 0 0 0;cursor:move!important;background:#f9f9f9}.tab-wrapper fieldset fieldset legend{position:absolute!important;top:0;left:0;width:80%;padding:30px}.tab-wrapper fieldset fieldset legend span{position:absolute;top:6px;left:10px;font-weight:bold;width:100%}.field-group fieldset:hover{background-color:#fafafa;border-color:#ccc}fieldset div.field-wrapper{padding:40px 10px 10px}fieldset.radio div div label,fieldset.checkbox div label{margin-right:20px}fieldset.clear-value{margin-left:10px}.field-group div.actions{float:none;border-top:1px solid #ddd;margin:20px 0 0;padding-top:10px}.field-group div.actions a,.field-group div.actions button,.field-group div.actions input{float:none}.field-group fieldset:hover div.actions{display:block}.field-group fieldset.ui-sortable-placeholder{border:1px dashed #999;background-color:#eee;visibility:visible!important}ul.forTab{list-style:none;padding:0;margin:0 0 0 1em}ul.forTab li{margin:0 0 1em 0}ul.forTab li label{display:block}ul.forTab li input{font-size:1.4em}p.success{background:green}p.err{border-top:2px solid red;border-bottom:2px solid red;color:red;padding:5px 0;width:40%}span.desc,span.signup-description{display:block;font-size:11px;color:#555}select.multi-select{width:90%;height:10em!important}ul.multi-checkbox{margin:0 5px 0 0;padding:.5em .9em;height:10em;overflow:auto;list-style:none;border:solid 1px #ccc;width:90%}ul.multi-checkbox li{padding:0;margin:0}div.options-box{margin-left:20px!important;margin-right:10px!important;border-left:4px solid #eaf3fa;padding-left:15px}th a{background:#fff;padding:2px 5px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;top:-2px}textarea#description{border:1px solid #ddd;width:85%} \ No newline at end of file +/* Profile field group main admin page */ +#tabs-bottom { + background: #f9f9f9; + height: 32px; + border: 1px solid #dfdfdf; + border-radius: 0 0 3px 3px; +} + +#tabs { + position: relative; + } + p.nofields { + margin-top: 20px; + } + + /* Field group tabs */ + ul#field-group-tabs { + float: left; + padding: 0 0 0 15px; + margin: 0; + display: none; + } + ul#field-group-tabs li { + float: left; + margin-bottom: -1px; + background-color: transparent; + margin-right: 8px; + } + ul#field-group-tabs li.ui-state-hover a { + background-color: #fafafa; + } + ul#field-group-tabs li.ui-state-hover a.ui-tab { + border-color: #dfdfdf #dfdfdf #f9f9f9 #dfdfdf; + color: #d54e21; + } + ul#field-group-tabs li.ui-state-acceptable a.ui-tab { + border-color: #5a5 #5a5 #ccc #5a5; + color: #8a8; + background-color: #efe; + } + ul#field-group-tabs li.ui-state-active.ui-state-acceptable a.ui-tab { + background-color: #f9f9f9; + } + ul#field-group-tabs li.drop-candidate a.ui-tab { + background-color: #ffc; + border-color: #aa5 #aa5 #ccc #aa5; + color: #aa8; + } + ul#field-group-tabs li a.ui-tab { + font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif; + font-size: 14px; + display: block; + margin-top: 3px; + padding: 5px 10px 5px; + border: 1px solid #dfdfdf; + border-bottom: none; + border-radius: 3px 3px 0 0; + text-decoration: none; + color: #aaa; + } + + /* Selected tab */ + ul#field-group-tabs li.ui-state-active a.ui-tab { + background-color: #f9f9f9; + margin-top: -1px; + padding: 7px 10px 7px; + border: 1px solid #dfdfdf; + border-bottom: 1px solid transparent; + color: #000; + } + + /* Toolbar */ + .tab-toolbar { + background: #f9f9f9; + border-width: 1px 1px 0; + border-radius: 3px 3px 0 0; + margin: -20px -21px 20px -21px; + clear: left; + padding: 10px; + border: 1px solid #dfdfdf; + } + + .field-wrapper a.deletion, + .tab-toolbar a.deletion { + color: #f00; + border-bottom: 1px solid #f00; + font-size: 12px; + text-decoration: none; + padding: 0; + margin: -2px 0 0 5px; + } + + div.tab-toolbar a.button-primary { + color: #fff !important; /* Overriding a WP !important */ + } + + div.tab-wrapper { + background-color: #fff; + clear: left; + padding: 20px; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; + border-radius: 3px 3px 0 0; + } + + .tab-wrapper fieldset { + position: relative; + cursor: default !important; + background: inherit; + } + .tab-wrapper fieldset legend { + padding-bottom: 15px; + font-weight: bold; + } + .tab-wrapper .xprofile-field { + position: relative; + } + .tab-wrapper fieldset fieldset { + position: relative; + border: 1px solid #ddd; + border-radius: 3px; + margin: 10px 0 0 0; + cursor: move !important; + background: #f9f9f9; + } + .tab-wrapper fieldset fieldset legend { + position: absolute !important; + top: 0; + left: 0; + width: 80%; + padding: 30px; + } + .tab-wrapper fieldset fieldset legend span { + position: absolute; + top: 6px; + left: 10px; + font-weight: bold; + width: 100%; + } + .field-group fieldset:hover { + background-color: #fafafa; + border-color: #ccc; + } + fieldset div.field-wrapper { + padding: 40px 10px 10px; + } + fieldset.radio div div label, + fieldset.checkbox div label { + margin-right: 20px; + } + + fieldset.clear-value { + margin-left: 10px; + } + .field-group div.actions { + float: none; + border-top: 1px solid #ddd; + margin: 20px 0 0; + padding-top: 10px; + } + .field-group div.actions a, + .field-group div.actions button, + .field-group div.actions input { + float: none; + } + .field-group fieldset:hover div.actions { + display: block; + } + .field-group fieldset.ui-sortable-placeholder { + border: 1px dashed #999; + background-color: #eee; + visibility: visible !important; + } + + ul.forTab { + list-style: none; + padding: 0; + margin: 0 0 0 1em; + } + ul.forTab li { + margin: 0 0 1em 0; + } + + ul.forTab li label { + display: block; + } + + ul.forTab li input { + font-size: 1.4em; + } + + p.success { background: green;} + p.err { + border-top: 2px solid red; + border-bottom: 2px solid red; + color: red; + padding: 5px 0; + width: 40%; + } + + span.desc, span.signup-description { + display: block; + font-size: 11px; + color: #555; + } + + select.multi-select { + width:90%; + height:10em !important; + } + +ul.multi-checkbox { + margin: 0 5px 0 0; + padding: .5em .9em; + height: 10em; + overflow: auto; + list-style: none; + border: solid 1px #ccc; + width: 90%; +} + +ul.multi-checkbox li { + padding: 0; + margin: 0; +} + +div.options-box { + margin-left: 20px !important; + margin-right: 10px !important; + border-left: 4px solid #EAF3FA; + padding-left: 15px; +} + +th a { + background: #fff; + padding: 2px 5px; + -moz-border-radius: 3px; + -khtml-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + top: -2px; +} + +textarea#description { + border: 1px solid #ddd; + width: 85%; +} + diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.min.css b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.min.css new file mode 100644 index 0000000000000000000000000000000000000000..51b680c3bc6d5b29d1a7a6f3076ae3552c31f130 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-xprofile/admin/css/admin.min.css @@ -0,0 +1 @@ +#tabs-bottom{background:#f9f9f9;height:32px;border:1px solid #dfdfdf;border-radius:0 0 3px 3px}#tabs{position:relative}p.nofields{margin-top:20px}ul#field-group-tabs{float:left;padding:0 0 0 15px;margin:0;display:none}ul#field-group-tabs li{float:left;margin-bottom:-1px;background-color:transparent;margin-right:8px}ul#field-group-tabs li.ui-state-hover a{background-color:#fafafa}ul#field-group-tabs li.ui-state-hover a.ui-tab{border-color:#dfdfdf #dfdfdf #f9f9f9 #dfdfdf;color:#d54e21}ul#field-group-tabs li.ui-state-acceptable a.ui-tab{border-color:#5a5 #5a5 #ccc #5a5;color:#8a8;background-color:#efe}ul#field-group-tabs li.ui-state-active.ui-state-acceptable a.ui-tab{background-color:#f9f9f9}ul#field-group-tabs li.drop-candidate a.ui-tab{background-color:#ffc;border-color:#aa5 #aa5 #ccc #aa5;color:#aa8}ul#field-group-tabs li a.ui-tab{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-size:14px;display:block;margin-top:3px;padding:5px 10px 5px;border:1px solid #dfdfdf;border-bottom:0;border-radius:3px 3px 0 0;text-decoration:none;color:#aaa}ul#field-group-tabs li.ui-state-active a.ui-tab{background-color:#f9f9f9;margin-top:-1px;padding:7px 10px 7px;border:1px solid #dfdfdf;border-bottom:1px solid transparent;color:#000}.tab-toolbar{background:#f9f9f9;border-width:1px 1px 0;border-radius:3px 3px 0 0;margin:-20px -21px 20px -21px;clear:left;padding:10px;border:1px solid #dfdfdf}.field-wrapper a.deletion,.tab-toolbar a.deletion{color:#f00;border-bottom:1px solid #f00;font-size:12px;text-decoration:none;padding:0;margin:-2px 0 0 5px}div.tab-toolbar a.button-primary{color:#fff!important}div.tab-wrapper{background-color:#fff;clear:left;padding:20px;border-left:1px solid #ccc;border-right:1px solid #ccc;border-radius:3px 3px 0 0}.tab-wrapper fieldset{position:relative;cursor:default!important;background:inherit}.tab-wrapper fieldset legend{padding-bottom:15px;font-weight:bold}.tab-wrapper .xprofile-field{position:relative}.tab-wrapper fieldset fieldset{position:relative;border:1px solid #ddd;border-radius:3px;margin:10px 0 0 0;cursor:move!important;background:#f9f9f9}.tab-wrapper fieldset fieldset legend{position:absolute!important;top:0;left:0;width:80%;padding:30px}.tab-wrapper fieldset fieldset legend span{position:absolute;top:6px;left:10px;font-weight:bold;width:100%}.field-group fieldset:hover{background-color:#fafafa;border-color:#ccc}fieldset div.field-wrapper{padding:40px 10px 10px}fieldset.radio div div label,fieldset.checkbox div label{margin-right:20px}fieldset.clear-value{margin-left:10px}.field-group div.actions{float:none;border-top:1px solid #ddd;margin:20px 0 0;padding-top:10px}.field-group div.actions a,.field-group div.actions button,.field-group div.actions input{float:none}.field-group fieldset:hover div.actions{display:block}.field-group fieldset.ui-sortable-placeholder{border:1px dashed #999;background-color:#eee;visibility:visible!important}ul.forTab{list-style:none;padding:0;margin:0 0 0 1em}ul.forTab li{margin:0 0 1em 0}ul.forTab li label{display:block}ul.forTab li input{font-size:1.4em}p.success{background:green}p.err{border-top:2px solid red;border-bottom:2px solid red;color:red;padding:5px 0;width:40%}span.desc,span.signup-description{display:block;font-size:11px;color:#555}select.multi-select{width:90%;height:10em!important}ul.multi-checkbox{margin:0 5px 0 0;padding:.5em .9em;height:10em;overflow:auto;list-style:none;border:solid 1px #ccc;width:90%}ul.multi-checkbox li{padding:0;margin:0}div.options-box{margin-left:20px!important;margin-right:10px!important;border-left:4px solid #eaf3fa;padding-left:15px}th a{background:#fff;padding:2px 5px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;top:-2px}textarea#description{border:1px solid #ddd;width:85%} \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js index 5f4eb44e2c91b9a9bb281295c6cd8b636067e5e4..b465e18c8392d1c704844a10226889cfd1bf9082 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js +++ b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.js @@ -1 +1,238 @@ -function add_option(g){var j=document.getElementById(g+"_more");var l=document.getElementById(g+"_option_number").value;var a=document.createElement("p");var h=document.createElement("input");var k=document.createElement("label");var f=document.createTextNode("Option "+l+": ");var b=document.createElement("input");var e=document.createElement("label");var d=document.createTextNode(" Default Value ");a.setAttribute("id",g+"_div"+l);h.setAttribute("type","text");h.setAttribute("name",g+"_option["+l+"]");h.setAttribute("id",g+"_option"+l);k.setAttribute("for",g+"_option"+l);k.appendChild(f);if(g=="checkbox"||g=="multiselectbox"){b.setAttribute("type","checkbox");b.setAttribute("name","isDefault_"+g+"_option["+l+"]")}else{b.setAttribute("type","radio");b.setAttribute("name","isDefault_"+g+"_option")}b.setAttribute("value",l);e.appendChild(d);e.setAttribute("for","isDefault_"+g+"_option[]");var c=document.createElement("a");var i=document.createTextNode("[x]");c.setAttribute("href","javascript:hide('"+g+"_div"+l+"')");c.setAttribute("class","delete");c.appendChild(i);a.appendChild(k);a.appendChild(h);a.appendChild(document.createTextNode(" "));a.appendChild(b);a.appendChild(e);a.appendChild(c);j.appendChild(a);l++;document.getElementById(g+"_option_number").value=l}function show_options(a){document.getElementById("radio").style.display="none";document.getElementById("selectbox").style.display="none";document.getElementById("multiselectbox").style.display="none";document.getElementById("checkbox").style.display="none";if(a=="radio"){document.getElementById("radio").style.display=""}if(a=="selectbox"){document.getElementById("selectbox").style.display=""}if(a=="multiselectbox"){document.getElementById("multiselectbox").style.display=""}if(a=="checkbox"){document.getElementById("checkbox").style.display=""}}function hide(a){if(!document.getElementById(a)){return false}document.getElementById(a).style.display="none";document.getElementById(a).value=""}var fixHelper=function(b,a){a.children().each(function(){jQuery(this).width(jQuery(this).width())});return a};jQuery(document).ready(function(){jQuery("a.ajax-option-delete").click(function(){var d=this.id.split("-");d=d[1];jQuery.post(ajaxurl,{action:"xprofile_delete_option",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce").val(),option_id:d},function(e){})});jQuery("ul#field-group-tabs").show();jQuery("ul#field-group-tabs").sortable({cursor:"move",axis:"x",opacity:0.6,items:"li",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_groups",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_groups:jQuery("input#_wpnonce_reorder_groups").val(),group_order:jQuery(this).sortable("serialize")},function(d){})}}).disableSelection();jQuery("fieldset.field-group").sortable({cursor:"move",opacity:0.3,items:"fieldset",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(this).sortable("serialize"),field_group_id:jQuery(this).attr("id")},function(d){})}}).disableSelection().css("cursor","move");var b;var a=jQuery("#tabs").tabs();c(a);function c(d){b=jQuery("ul:first li",d).droppable({accept:".connectedSortable fieldset",hoverClass:"ui-state-hover",activeClass:"ui-state-acceptable",touch:"pointer",tolerance:"pointer",drop:function(g,h){var e=jQuery(this);var f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(e).removeClass("drop-candidate");h.draggable.hide("slow",function(){d.tabs("select",b.index(e));jQuery(this).appendTo(f).show("slow").animate({opacity:"1"},500);f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(f).find("p.nofields").hide("slow");jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(f).sortable("serialize"),field_group_id:jQuery(f).attr("id")},function(i){})})},over:function(e,f){jQuery(this).addClass("drop-candidate")},out:function(e,f){jQuery(this).removeClass("drop-candidate")}})}}); \ No newline at end of file +function add_option(forWhat) { + var holder = document.getElementById(forWhat + "_more"); + var theId = document.getElementById(forWhat + '_option_number').value; + var newDiv = document.createElement('p'); + var newOption = document.createElement('input'); + var span = document.createElement( 'span' ); + var txt = document.createTextNode( "\u00A0\u039E\u00A0" ); + var isDefault = document.createElement( 'input' ); + var span1 = document.createElement( 'span' ); + var txt1 = document.createTextNode( " Default Value " ); + + newDiv.setAttribute('id', forWhat + '_div' + theId); + newDiv.setAttribute('class', 'sortable'); + + newOption.setAttribute( 'type', 'text' ); + newOption.setAttribute( 'name', forWhat + '_option[' + theId + ']' ); + newOption.setAttribute( 'id', forWhat + '_option' + theId ); + + span.appendChild( txt ); + + if ( forWhat == 'checkbox' || forWhat == 'multiselectbox' ) { + isDefault.setAttribute( 'type', 'checkbox' ); + isDefault.setAttribute( 'name', 'isDefault_' + forWhat + '_option[' + theId + ']' ); + } else { + isDefault.setAttribute( 'type', 'radio' ); + isDefault.setAttribute( 'name', 'isDefault_' + forWhat + '_option' ); + } + + isDefault.setAttribute( 'value', theId ); + + span1.appendChild( txt1 ); + + var toDelete = document.createElement( 'a' ); + var toDeleteText = document.createTextNode( '[x]' ); + + toDelete.setAttribute( 'href', "javascript:hide('" + forWhat + '_div' + theId + "')" ); + toDelete.setAttribute( 'class', 'delete' ); + toDelete.appendChild( toDeleteText ); + + newDiv.appendChild( span ); + newDiv.appendChild( newOption ); + newDiv.appendChild( document.createTextNode( " " ) ); + newDiv.appendChild( isDefault ); + newDiv.appendChild( span1 ); + newDiv.appendChild( toDelete ); + holder.appendChild( newDiv ); + + // re-initialize the sorable ui + enableSortableFieldOptions( forWhat ); + + theId++; + + document.getElementById(forWhat + "_option_number").value = theId; +} + +function show_options(forWhat) { + document.getElementById( 'radio' ).style.display = 'none'; + document.getElementById( 'selectbox' ).style.display = 'none'; + document.getElementById( 'multiselectbox' ).style.display = 'none'; + document.getElementById( 'checkbox' ).style.display = 'none'; + + if ( forWhat == 'radio' ) + document.getElementById( 'radio' ).style.display = ""; + + if ( forWhat == 'selectbox' ) + document.getElementById( 'selectbox' ).style.display = ""; + + if ( forWhat == 'multiselectbox' ) + document.getElementById( 'multiselectbox' ).style.display = ""; + + if ( forWhat == 'checkbox' ) + document.getElementById( 'checkbox' ).style.display = ""; +} + +function hide( id ) { + if ( !document.getElementById( id ) ) return false; + + document.getElementById( id ).style.display = "none"; + document.getElementById( id ).value = ''; +} + +var fixHelper = function(e, ui) { + ui.children().each(function() { + jQuery(this).width( jQuery(this).width() ); + }); + return ui; +}; + +function enableSortableFieldOptions( forWhat ) { + if ( jQuery( '#' + forWhat + ' p.sortable' ).length > 1 ) { + jQuery( '.options-box' ).sortable( { + items: 'p.sortable', + tolerance: 'pointer', + axis: 'y', + handle: 'span' + }); + + jQuery( '.sortable span' ).css( 'cursor', 'move' ); + } +} + +function destroySortableFieldOptions() { + jQuery( '.options-box' ).sortable( 'destroy' ); + jQuery( '.sortable span' ).css( 'cursor', 'default' ); +} + +jQuery( document ).ready( function() { + + // Set up deleting options ajax + jQuery( 'a.ajax-option-delete' ).on( 'click', function() { + var theId = this.id.split( '-' ); + theId = theId[1]; + + jQuery.post( ajaxurl, { + action: 'xprofile_delete_option', + 'cookie': encodeURIComponent( document.cookie ), + '_wpnonce': jQuery('input#_wpnonce').val(), + 'option_id': theId + }, + function( response ) {} ); + } ); + + // + jQuery( '[id^="sort_order_"]' ).change(function() { + if ( jQuery( this ).val() != 'custom' ) { + destroySortableFieldOptions(); + } else { + enableSortableFieldOptions( jQuery('#fieldtype :selected').val() ); + } + }); + + // Show object if JS is enabled + jQuery( 'ul#field-group-tabs' ).show(); + + // Allow reordering of field group tabs + jQuery( 'ul#field-group-tabs' ).sortable( { + cursor: 'move', + axis: 'x', + opacity: 0.6, + items: 'li', + tolerance: 'pointer', + + update: function() { + jQuery.post( ajaxurl, { + action: 'xprofile_reorder_groups', + 'cookie': encodeURIComponent( document.cookie ), + '_wpnonce_reorder_groups': jQuery( 'input#_wpnonce_reorder_groups' ).val(), + 'group_order': jQuery( this ).sortable( 'serialize' ) + }, + function( response ) {} ); + } + }).disableSelection(); + + // Allow reordering of fields within groups + jQuery( 'fieldset.field-group' ).sortable({ + cursor: 'move', + opacity: 0.3, + items: 'fieldset', + tolerance: 'pointer', + + update: function() { + jQuery.post( ajaxurl, { + action: 'xprofile_reorder_fields', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce_reorder_fields': jQuery( 'input#_wpnonce_reorder_fields' ).val(), + 'field_order': jQuery(this).sortable( 'serialize' ), + 'field_group_id': jQuery(this).attr( 'id' ) + }, + function( response ) {} ); + } + }) + + // Disallow text selection + .disableSelection() + + // Change cursor to move if JS is enabled + .css( 'cursor', 'move' ); + + // Allow reordering of field options + enableSortableFieldOptions( jQuery('#fieldtype :selected').val() ); + + // tabs init with a custom tab template and an "add" callback filling in the content + var $tab_items; + var $tabs = jQuery( '#tabs' ).tabs(); + set_tab_items( $tabs ); + + function set_tab_items( $tabs ) { + $tab_items = jQuery( 'ul:first li', $tabs ).droppable({ + accept: '.connectedSortable fieldset', + hoverClass: 'ui-state-hover', + activeClass: 'ui-state-acceptable', + touch: 'pointer', + tolerance: 'pointer', + + // When field is dropped on tab + drop: function( ev, ui ) { + // The tab + var $item = jQuery(this); + + // The tab body + var $list = jQuery( $item.find( 'a' ).attr( 'href' ) ).find( '.connectedSortable' ); + + // Remove helper class + jQuery($item).removeClass( 'drop-candidate' ); + + // Hide field, change selected tab, and show new placement + ui.draggable.hide( 'slow', function() { + + // Select new tab as current + $tabs.tabs( 'option', 'active', $tab_items.index( $item ) ); + + // Show new placement + jQuery(this).appendTo($list).show( 'slow' ).animate( {opacity: "1"}, 500 ); + + // Refresh $list variable + $list = jQuery( $item.find( 'a' ).attr( 'href' ) ).find( '.connectedSortable' ); + jQuery($list).find( 'p.nofields' ).hide( 'slow' ); + + // Ajax update field locations and orders + jQuery.post( ajaxurl, { + action: 'xprofile_reorder_fields', + 'cookie': encodeURIComponent(document.cookie), + '_wpnonce_reorder_fields': jQuery( "input#_wpnonce_reorder_fields" ).val(), + 'field_order': jQuery( $list ).sortable( 'serialize' ), + 'field_group_id': jQuery( $list ).attr( 'id' ) + }, + function( response ) {} ); + }); + }, + over: function( event, ui ) { + jQuery(this).addClass( 'drop-candidate' ); + }, + out: function( event, ui ) { + jQuery(this).removeClass( 'drop-candidate' ); + } + }); + } +}); diff --git a/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.min.js b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.min.js new file mode 100644 index 0000000000000000000000000000000000000000..f66eba7cca47cd01da4a76781a8e34461211ef70 --- /dev/null +++ b/wp-content/plugins/buddypress/bp-xprofile/admin/js/admin.min.js @@ -0,0 +1 @@ +function add_option(g){var j=document.getElementById(g+"_more");var l=document.getElementById(g+"_option_number").value;var a=document.createElement("p");var h=document.createElement("input");var k=document.createElement("span");var e=document.createTextNode("\u00A0\u039E\u00A0");var b=document.createElement("input");var f=document.createElement("span");var d=document.createTextNode(" Default Value ");a.setAttribute("id",g+"_div"+l);a.setAttribute("class","sortable");h.setAttribute("type","text");h.setAttribute("name",g+"_option["+l+"]");h.setAttribute("id",g+"_option"+l);k.appendChild(e);if(g=="checkbox"||g=="multiselectbox"){b.setAttribute("type","checkbox");b.setAttribute("name","isDefault_"+g+"_option["+l+"]")}else{b.setAttribute("type","radio");b.setAttribute("name","isDefault_"+g+"_option")}b.setAttribute("value",l);f.appendChild(d);var c=document.createElement("a");var i=document.createTextNode("[x]");c.setAttribute("href","javascript:hide('"+g+"_div"+l+"')");c.setAttribute("class","delete");c.appendChild(i);a.appendChild(k);a.appendChild(h);a.appendChild(document.createTextNode(" "));a.appendChild(b);a.appendChild(f);a.appendChild(c);j.appendChild(a);enableSortableFieldOptions(g);l++;document.getElementById(g+"_option_number").value=l}function show_options(a){document.getElementById("radio").style.display="none";document.getElementById("selectbox").style.display="none";document.getElementById("multiselectbox").style.display="none";document.getElementById("checkbox").style.display="none";if(a=="radio"){document.getElementById("radio").style.display=""}if(a=="selectbox"){document.getElementById("selectbox").style.display=""}if(a=="multiselectbox"){document.getElementById("multiselectbox").style.display=""}if(a=="checkbox"){document.getElementById("checkbox").style.display=""}}function hide(a){if(!document.getElementById(a)){return false}document.getElementById(a).style.display="none";document.getElementById(a).value=""}var fixHelper=function(b,a){a.children().each(function(){jQuery(this).width(jQuery(this).width())});return a};function enableSortableFieldOptions(a){if(jQuery("#"+a+" p.sortable").length>1){jQuery(".options-box").sortable({items:"p.sortable",tolerance:"pointer",axis:"y",handle:"span"});jQuery(".sortable span").css("cursor","move")}}function destroySortableFieldOptions(){jQuery(".options-box").sortable("destroy");jQuery(".sortable span").css("cursor","default")}jQuery(document).ready(function(){jQuery("a.ajax-option-delete").on("click",function(){var d=this.id.split("-");d=d[1];jQuery.post(ajaxurl,{action:"xprofile_delete_option",cookie:encodeURIComponent(document.cookie),_wpnonce:jQuery("input#_wpnonce").val(),option_id:d},function(e){})});jQuery('[id^="sort_order_"]').change(function(){if(jQuery(this).val()!="custom"){destroySortableFieldOptions()}else{enableSortableFieldOptions(jQuery("#fieldtype :selected").val())}});jQuery("ul#field-group-tabs").show();jQuery("ul#field-group-tabs").sortable({cursor:"move",axis:"x",opacity:0.6,items:"li",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_groups",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_groups:jQuery("input#_wpnonce_reorder_groups").val(),group_order:jQuery(this).sortable("serialize")},function(d){})}}).disableSelection();jQuery("fieldset.field-group").sortable({cursor:"move",opacity:0.3,items:"fieldset",tolerance:"pointer",update:function(){jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(this).sortable("serialize"),field_group_id:jQuery(this).attr("id")},function(d){})}}).disableSelection().css("cursor","move");enableSortableFieldOptions(jQuery("#fieldtype :selected").val());var b;var a=jQuery("#tabs").tabs();c(a);function c(d){b=jQuery("ul:first li",d).droppable({accept:".connectedSortable fieldset",hoverClass:"ui-state-hover",activeClass:"ui-state-acceptable",touch:"pointer",tolerance:"pointer",drop:function(g,h){var e=jQuery(this);var f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(e).removeClass("drop-candidate");h.draggable.hide("slow",function(){d.tabs("option","active",b.index(e));jQuery(this).appendTo(f).show("slow").animate({opacity:"1"},500);f=jQuery(e.find("a").attr("href")).find(".connectedSortable");jQuery(f).find("p.nofields").hide("slow");jQuery.post(ajaxurl,{action:"xprofile_reorder_fields",cookie:encodeURIComponent(document.cookie),_wpnonce_reorder_fields:jQuery("input#_wpnonce_reorder_fields").val(),field_order:jQuery(f).sortable("serialize"),field_group_id:jQuery(f).attr("id")},function(i){})})},over:function(e,f){jQuery(this).addClass("drop-candidate")},out:function(e,f){jQuery(this).removeClass("drop-candidate")}})}}); \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php index 2ab4562f131a7e4585510c3a60044f4481a56b73..5001fc327a9e7939c57b905caa88d31d2dc027b0 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-actions.php @@ -23,7 +23,6 @@ if ( !defined( 'ABSPATH' ) ) exit; * @package BuddyPress Xprofile * @uses bp_core_delete_avatar() Deletes the active avatar for the logged in user. * @uses add_action() Runs a specific function for an action when it fires. - * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename) */ function xprofile_action_delete_avatar() { @@ -44,5 +43,3 @@ function xprofile_action_delete_avatar() { bp_core_redirect( wp_get_referer() ); } add_action( 'bp_actions', 'xprofile_action_delete_avatar' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php index 7419f39b7c80c1eeb01c5a9295732eded2f03df1..5f0deff7ee87e620c4607ec717438c81e7c196e6 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-activity.php @@ -3,7 +3,7 @@ /** * BuddyPress XProfile Activity & Notification Functions * - * These functions handle the recording, deleting and formatting of activity and + * These functions handle the recording, deleting and formatting of activity items and * notifications for the user and for this specific component. * * @package BuddyPress @@ -33,7 +33,7 @@ add_action( 'bp_register_activity_actions', 'xprofile_register_activity_actions' * @subpackage XProfileActivity * @param $args Array containing all variables used after extract() call * @global $bp The global BuddyPress settings variable created in bp_core_current_times() - * @uses bp_activity_record() Adds an entry to the activity component tables for a specific activity + * @uses bp_activity_add() Adds an entry to the activity component tables for a specific activity */ function xprofile_record_activity( $args = '' ) { @@ -132,5 +132,3 @@ function bp_xprofile_new_avatar_activity() { ) ); } add_action( 'xprofile_avatar_uploaded', 'bp_xprofile_new_avatar_activity' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php index f32c2af78f035b441ae14184d6e352b3b034766f..8235ea05d57efc85119f7bcc1bafbf449a4b1391 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-admin.php @@ -77,7 +77,7 @@ function xprofile_admin( $message = '', $type = 'error' ) { <form action="" id="profile-field-form" method="post"> <?php - + wp_nonce_field( 'bp_reorder_fields', '_wpnonce_reorder_fields' ); wp_nonce_field( 'bp_reorder_groups', '_wpnonce_reorder_groups', false ); @@ -266,7 +266,7 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) { $type = 'error'; unset( $_GET['mode'] ); - + xprofile_admin( $message, $type ); } else { $message = __( 'The field was saved successfully.', 'buddypress' ); @@ -278,7 +278,7 @@ function xprofile_admin_manage_field( $group_id, $field_id = null ) { if ( !empty( $_POST['default-visibility'] ) ) { bp_xprofile_update_field_meta( $field_id, 'default_visibility', $_POST['default-visibility'] ); } - + if ( !empty( $_POST['allow-custom-visibility'] ) ) { bp_xprofile_update_field_meta( $field_id, 'allow_custom_visibility', $_POST['allow-custom-visibility'] ); } @@ -466,5 +466,3 @@ function xprofile_admin_field( $admin_field, $admin_group, $class = '' ) { <?php } - -?> diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-buddybar.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-buddybar.php index b5751561aa6694df953d2a28f4903d740eae97f2..1cd870ddd949b86a593c6cd9351fbf5141920900 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-buddybar.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-buddybar.php @@ -2,5 +2,3 @@ // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; - -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php index 4e063745578766ef6ac8ccc8ec871e568fca637a..eaac569d82c7ac6715c311a14841c0d53880b9a9 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cache.php @@ -29,5 +29,3 @@ add_action( 'xprofile_updated_profile', 'xprofile_clear_profile_data_object // List actions to clear super cached pages on, if super cache is installed add_action( 'xprofile_updated_profile', 'bp_core_clear_cache' ); - -?> diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php index f5cc6293e6a6abffa78472addb68fdbc5de165d3..eebb3f762f488f6e5c6be1b7055c99647f54e381 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-caps.php @@ -4,7 +4,7 @@ * Roles and capabilities logic for the XProfile component * * @package BuddyPress - * @since 1.6 + * @since BuddyPress (1.6) */ // Exit if accessed directly @@ -13,7 +13,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; /** * Maps XProfile caps to built in WordPress caps * - * @since 1.6 + * @since BuddyPress (1.6) * * @param array $caps Capabilities for meta capability * @param string $cap Capability name @@ -48,7 +48,7 @@ function bp_xprofile_map_meta_caps( $caps, $cap, $user_id, $args ) { // Friends don't let friends edit each other's visibility if ( $profile_user_id != bp_displayed_user_id() && !bp_current_user_can( 'bp_moderate' ) ) { - $caps[] = 'do_not_allow'; + $caps[] = 'do_not_allow'; break; } @@ -58,4 +58,3 @@ function bp_xprofile_map_meta_caps( $caps, $cap, $user_id, $args ) { return apply_filters( 'bp_xprofile_map_meta_caps', $caps, $cap, $user_id, $args ); } add_filter( 'bp_map_meta_caps', 'bp_xprofile_map_meta_caps', 10, 4 ); -?> \ No newline at end of file diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php index b6f9c421ca7d7efd5a716ac75f4e5bc7f134a172..bc39c8e22b3df180a27badf14243a489bfca54aa 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-classes.php @@ -115,15 +115,15 @@ class BP_XProfile_Group { global $wpdb, $bp; $defaults = array( - 'profile_group_id' => false, - 'user_id' => bp_displayed_user_id(), - 'hide_empty_groups' => false, - 'hide_empty_fields' => false, - 'fetch_fields' => false, - 'fetch_field_data' => false, + 'profile_group_id' => false, + 'user_id' => bp_displayed_user_id(), + 'hide_empty_groups' => false, + 'hide_empty_fields' => false, + 'fetch_fields' => false, + 'fetch_field_data' => false, 'fetch_visibility_level' => false, - 'exclude_groups' => false, - 'exclude_fields' => false + 'exclude_groups' => false, + 'exclude_fields' => false ); $r = wp_parse_args( $args, $defaults ); @@ -133,7 +133,7 @@ class BP_XProfile_Group { if ( !empty( $profile_group_id ) ) $where_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id ); elseif ( $exclude_groups ) - $where_sql = "WHERE g.id NOT IN ({$exclude_groups})"; + $where_sql = $wpdb->prepare( "WHERE g.id NOT IN ({$exclude_groups})"); if ( !empty( $hide_empty_groups ) ) $groups = $wpdb->get_results( "SELECT DISTINCT g.* FROM {$bp->profile->table_name_groups} g INNER JOIN {$bp->profile->table_name_fields} f ON g.id = f.group_id {$where_sql} ORDER BY g.group_order ASC" ); @@ -160,7 +160,6 @@ class BP_XProfile_Group { // Visibility - Handled here so as not to be overridden by sloppy use of the // exclude_fields parameter. See bp_xprofile_get_hidden_fields_for_user() $exclude_fields_cs = array_merge( $exclude_fields_cs, bp_xprofile_get_hidden_fields_for_user( $user_id ) ); - $exclude_fields_cs = implode( ',', $exclude_fields_cs ); if ( !empty( $exclude_fields_cs ) ) { @@ -175,7 +174,7 @@ class BP_XProfile_Group { if ( empty( $fields ) ) return $groups; - if ( ! empty( $fetch_field_data ) && ! empty( $user_id ) ) { + if ( ! empty( $fetch_field_data ) ) { // Fetch the field data for the user. foreach( (array) $fields as $field ) { @@ -184,8 +183,9 @@ class BP_XProfile_Group { $field_ids_sql = implode( ',', (array) $field_ids ); - if ( !empty( $field_ids ) ) + if ( ! empty( $field_ids ) && ! empty( $user_id ) ) { $field_data = $wpdb->get_results( $wpdb->prepare( "SELECT id, field_id, value FROM {$bp->profile->table_name_data} WHERE field_id IN ( {$field_ids_sql} ) AND user_id = %d", $user_id ) ); + } // Remove data-less fields, if necessary if ( !empty( $hide_empty_fields ) ) { @@ -224,15 +224,15 @@ class BP_XProfile_Group { // Assign correct data value to the field if ( $field->id == $data->field_id ) { - $fields[$field_key]->data = new stdClass; - $fields[$field_key]->data->value = $data->value; - $fields[$field_key]->data->id = $data->id; + $fields[$field_key]->data = new stdClass; + $fields[$field_key]->data->value = $data->value; + $fields[$field_key]->data->id = $data->id; } } } } - if ( $fetch_visibility_level ) { + if ( !empty( $fetch_visibility_level ) ) { $fields = self::fetch_visibility_level( $user_id, $fields ); } } @@ -287,14 +287,13 @@ class BP_XProfile_Group { /** * Fetch the field visibility level for the fields returned by the query * - * @since 1.6 + * @since BuddyPress (1.6) * * @param int $user_id The profile owner's user_id * @param array $fields The database results returned by the get() query * @return array $fields The database results, with field_visibility added */ - function fetch_visibility_level( $user_id, $fields ) { - global $wpdb, $bp; + function fetch_visibility_level( $user_id = 0, $fields = array() ) { // Get the user's visibility level preferences $visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true ); @@ -302,15 +301,17 @@ class BP_XProfile_Group { // Get the admin-set preferences $admin_set_levels = self::fetch_default_visibility_levels(); - foreach( (array)$fields as $key => $field ) { + foreach( (array) $fields as $key => $field ) { + // Does the admin allow this field to be customized? $allow_custom = empty( $admin_set_levels[$field->id]['allow_custom'] ) || 'allowed' == $admin_set_levels[$field->id]['allow_custom']; // Look to see if the user has set the visibility for this field if ( $allow_custom && isset( $visibility_levels[$field->id] ) ) { $field_visibility = $visibility_levels[$field->id]; + + // If no admin-set default is saved, fall back on a global default } else { - // If no admin-set default is saved, fall back on a global default $field_visibility = !empty( $admin_set_levels[$field->id]['default'] ) ? $admin_set_levels[$field->id]['default'] : apply_filters( 'bp_xprofile_default_visibility_level', 'public' ); } @@ -323,7 +324,7 @@ class BP_XProfile_Group { /** * Fetch the admin-set preferences for all fields * - * @since 1.6 + * @since BuddyPress (1.6) * * @return array $default_visibility_levels An array, keyed by field_id, of default * visibility level + allow_custom (whether the admin allows this field to be set by user) @@ -346,10 +347,6 @@ class BP_XProfile_Group { return $default_visibility_levels; } - /* ADMIN AREA HTML. - * TODO: Get this out of here and replace with standard loops - */ - function render_admin_form() { global $message; @@ -358,7 +355,7 @@ class BP_XProfile_Group { $action = "admin.php?page=bp-profile-setup&mode=add_group"; $button = __( 'Create Field Group', 'buddypress' ); } else { - $title = __( 'Edit Field Group', 'buddypress' ); + $title = __( 'Edit Field Group', 'buddypress' ); $action = "admin.php?page=bp-profile-setup&mode=edit_group&group_id=" . $this->id; $button = __( 'Save Changes', 'buddypress' ); } ?> @@ -367,45 +364,61 @@ class BP_XProfile_Group { <?php screen_icon( 'users' ); ?> - <h2><?php echo $title; ?></h2> - <p><?php _e( 'Fields marked * are required', 'buddypress' ) ?></p> + <h2><?php echo esc_html( $title ); ?></h2> <?php if ( !empty( $message ) ) : $type = ( 'error' == $type ) ? 'error' : 'updated'; ?> - <div id="message" class="<?php echo $type; ?> fade"> - <p><?php echo $message; ?></p> + <div id="message" class="<?php echo esc_attr( $type ); ?> fade"> + <p><?php echo esc_html( $message ); ?></p> </div> <?php endif; ?> - <div id="poststuff"> - <form action="<?php echo esc_attr( $action ); ?>" method="post"> - <div id="titlediv"> - <h3><label for="group_name"><?php _e( "Field Group Title", 'buddypress') ?> *</label></h3> - <div id="titlewrap"> - <input type="text" name="group_name" id="title" value="<?php echo esc_attr( $this->name ); ?>" style="width:50%" /> - </div> - </div> - - <?php if ( '0' != $this->can_delete ) : ?> + <form action="<?php echo esc_url( $action ); ?>" method="post"> + <div id="poststuff"> + <div id="post-body" class="metabox-holder columns-2"> + <div id="post-body-content"> + <div id="titlediv"> + <div id="titlewrap"> + <label class="screen-reader-text" id="title-prompt-text" for="title"><?php _e( 'Field Group Title', 'buddypress') ?></label> + <input type="text" name="group_name" id="title" value="<?php echo esc_attr( $this->name ); ?>" /> + </div> + </div> - <div id="titlediv"> - <h3><label for="description"><?php _e( "Group Description", 'buddypress' ); ?></label></h3> - <div id="titlewrap"> - <textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo htmlspecialchars( $this->description ); ?></textarea> + <div id="postdiv" class="postarea"> + <div class="postbox"> + <div id="titlediv"><h3 class="hndle"><?php _e( 'Group Description', 'buddypress' ); ?></h3></div> + <div class="inside"> + <textarea name="group_description" id="group_description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea> + </div> + </div> </div> </div> - - <?php endif; ?> - - <p class="submit"> - <input type="hidden" name="group_order" id="group_order" value="<?php echo esc_attr( $this->group_order ); ?>" /> - <input type="submit" name="save_group" value="<?php echo esc_attr( $button ); ?>" class="button-primary"/> - <?php _e( 'or', 'buddypress' ); ?> <a href="admin.php?page=bp-profile-setup" class="deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a> - </p> - </form> - </div> + <div id="postbox-container-1" class="postbox-container"> + <div id="side-sortables" class="meta-box-sortables ui-sortable"> + <div id="submitdiv" class="postbox"> + <div id="handlediv"><h3 class="hndle"><?php _e( 'Save', 'buddypress' ); ?></h3></div> + <div class="inside"> + <div id="submitcomment" class="submitbox"> + <div id="major-publishing-actions"> + <div id="delete-action"> + <a href="admin.php?page=bp-profile-setup" class="submitdelete deletion"><?php _e( 'Cancel', 'buddypress' ); ?></a> + </div> + <div id="publishing-action"> + <input type="submit" name="save_group" value="<?php echo esc_attr( $button ); ?>" class="button-primary"/> + </div> + <input type="hidden" name="group_order" id="group_order" value="<?php echo esc_attr( $this->group_order ); ?>" /> + <div class="clear"></div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </form> </div> <?php @@ -736,13 +749,14 @@ class BP_XProfile_Field { ?> - <div id="<?php echo $type; ?>" class="options-box" style="<?php echo $class; ?> margin-left: 15px;"> + <div id="<?php echo esc_attr( $type ); ?>" class="options-box" style="<?php echo esc_attr( $class ); ?> margin-left: 15px;"> <h4><?php _e( 'Please enter options for this Field:', 'buddypress' ); ?></h4> - <p><label for="sort_order_<?php echo $type; ?>"><?php _e( 'Order By:', 'buddypress' ); ?></label> - <select name="sort_order_<?php echo $type; ?>" id="sort_order_<?php echo $type; ?>" > - <option value="default" <?php if ( 'default' == $this->order_by ) {?> selected="selected"<?php } ?> ><?php _e( 'Order Entered', 'buddypress' ); ?></option> - <option value="asc" <?php if ( 'asc' == $this->order_by ) {?> selected="selected"<?php } ?>><?php _e( 'Name - Ascending', 'buddypress' ); ?></option> - <option value="desc" <?php if ( 'desc' == $this->order_by ) {?> selected="selected"<?php } ?>><?php _e( 'Name - Descending', 'buddypress' ); ?></option> + <p> + <label for="sort_order_<?php echo esc_attr( $type ); ?>"><?php _e( 'Sort Order:', 'buddypress' ); ?></label> + <select name="sort_order_<?php echo esc_attr( $type ); ?>" id="sort_order_<?php echo esc_attr( $type ); ?>" > + <option value="custom" <?php selected( 'custom', $this->order_by ); ?>><?php _e( 'Custom', 'buddypress' ); ?></option> + <option value="asc" <?php selected( 'asc', $this->order_by ); ?>><?php _e( 'Ascending', 'buddypress' ); ?></option> + <option value="desc" <?php selected( 'desc', $this->order_by ); ?>><?php _e( 'Descending', 'buddypress' ); ?></option> </select> <?php if ( !$options = $this->get_children( true ) ) { @@ -766,35 +780,35 @@ class BP_XProfile_Field { if ( 'multiselectbox' == $type || 'checkbox' == $type ) $default_name = '[' . $j . ']'; ?> - <p><?php _e( 'Option', 'buddypress' ); ?> <?php echo $j; ?>: - <input type="text" name="<?php echo $type; ?>_option[<?php echo $j; ?>]" id="<?php echo $type; ?>_option<?php echo $j; ?>" value="<?php echo stripslashes( esc_attr( $options[$i]->name ) ); ?>" /> - <input type="<?php echo $default_input; ?>" name="isDefault_<?php echo $type; ?>_option<?php echo $default_name; ?>" <?php if ( (int) $options[$i]->is_default_option ) {?> checked="checked"<?php } ?> " value="<?php echo $j; ?>" /> <?php _e( 'Default Value', 'buddypress' ); ?> - - <?php if ( $j != 1 && $options[$i]->id != -1 ) : ?> - - <a href="admin.php?page=bp-profile-setup&mode=delete_option&option_id=<?php echo $options[$i]->id ?>" class="ajax-option-delete" id="delete-<?php echo $options[$i]->id; ?>">[x]</a> - - <?php endif; ?> - + <p class="sortable"> + <span> Ξ </span> + <input type="text" name="<?php echo esc_attr( $type ); ?>_option[<?php echo esc_attr( $j ); ?>]" id="<?php echo esc_attr( $type ); ?>_option<?php echo esc_attr( $j ); ?>" value="<?php echo stripslashes( esc_attr( $options[$i]->name ) ); ?>" /> + <input type="<?php echo $default_input; ?>" name="isDefault_<?php echo esc_attr( $type ); ?>_option<?php echo esc_attr( $default_name ); ?>" <?php checked( (int) $options[$i]->is_default_option, true ); ?> value="<?php echo esc_attr( $j ); ?>" /> + <span><?php _e( 'Default Value', 'buddypress' ); ?></span> + <a href="<?php echo esc_url( 'admin.php?page=bp-profile-setup&mode=delete_option&option_id=' . $options[$i]->id ); ?>" class="ajax-option-delete" id="delete-<?php echo esc_attr( $options[$i]->id ); ?>">[x]</a> </p> <?php } /* end for */ ?> - <input type="hidden" name="<?php echo $type; ?>_option_number" id="<?php echo $type; ?>_option_number" value="<?php echo $j + 1; ?>" /> + <input type="hidden" name="<?php echo esc_attr( $type ); ?>_option_number" id="<?php echo esc_attr( $type ); ?>_option_number" value="<?php echo esc_attr( (int) $j + 1 ); ?>" /> <?php } else { if ( 'multiselectbox' == $type || 'checkbox' == $type ) $default_name = '[1]'; ?> - <p><?php _e( 'Option', 'buddypress' ); ?> 1: <input type="text" name="<?php echo $type; ?>_option[1]" id="<?php echo $type; ?>_option1" /> - <input type="<?php echo $default_input; ?>" name="isDefault_<?php echo $type; ?>_option<?php echo $default_name; ?>" id="isDefault_<?php echo $type; ?>_option" value="1" /> <?php _e( 'Default Value', 'buddypress' ); ?> - <input type="hidden" name="<?php echo $type; ?>_option_number" id="<?php echo $type; ?>_option_number" value="2" /> + <p class="sortable"> + <span> Ξ </span> + <input type="text" name="<?php echo esc_attr( $type ); ?>_option[1]" id="<?php echo esc_attr( $type ); ?>_option1" /> + <input type="<?php echo esc_attr( $default_input ); ?>" name="isDefault_<?php echo esc_attr( $type ); ?>_option<?php echo esc_attr( $default_name ); ?>" id="isDefault_<?php echo esc_attr( $type ); ?>_option" value="1" /> + <span><?php _e( 'Default Value', 'buddypress' ); ?></span> + <input type="hidden" name="<?php echo esc_attr( $type ); ?>_option_number" id="<?php echo esc_attr( $type ); ?>_option_number" value="2" /> + </p> <?php } /* end if */ ?> - <div id="<?php echo $type; ?>_more"></div> - <p><a href="javascript:add_option('<?php echo $type; ?>')"><?php _e('Add Another Option', 'buddypress'); ?></a></p> + <div id="<?php echo esc_attr( $type ); ?>_more"></div> + <p><a href="javascript:add_option('<?php echo esc_attr( $type ); ?>')"><?php _e( 'Add Another Option', 'buddypress' ); ?></a></p> </div> <?php } @@ -802,11 +816,11 @@ class BP_XProfile_Field { function render_admin_form( $message = '' ) { if ( empty( $this->id ) ) { - $title = __( 'Add Field', 'buddypress' ); - $action = "admin.php?page=bp-profile-setup&group_id=" . $this->group_id . "&mode=add_field#tabs-" . $this->group_id; + $title = __( 'Add Field', 'buddypress' ); + $action = "admin.php?page=bp-profile-setup&group_id=" . $this->group_id . "&mode=add_field#tabs-" . $this->group_id; if ( !empty( $_POST['saveField'] ) ) { - $this->name = $_POST['title']; + $this->name = $_POST['title']; $this->description = $_POST['description']; $this->is_required = $_POST['required']; $this->type = $_POST['fieldtype']; @@ -820,18 +834,18 @@ class BP_XProfile_Field { <div class="wrap"> <div id="icon-users" class="icon32"><br /></div> - <h2><?php echo $title; ?></h2> + <h2><?php echo esc_html( $title ); ?></h2> <p><?php _e( 'Fields marked * are required', 'buddypress' ) ?></p> <?php if ( !empty( $message ) ) : ?> <div id="message" class="error fade"> - <p><?php echo $message; ?></p> + <p><?php echo esc_html( $message ); ?></p> </div> <?php endif; ?> - <form action="<?php echo $action; ?>" method="post"> + <form action="<?php echo esc_url( $action ); ?>" method="post"> <div id="poststuff"> <div id="titlediv"> <h3><label for="title"><?php _e( 'Field Title', 'buddypress' ); ?> *</label></h3> @@ -843,30 +857,30 @@ class BP_XProfile_Field { <div id="titlediv"> <h3><label for="description"><?php _e("Field Description", 'buddypress'); ?></label></h3> <div id="titlewrap"> - <textarea name="description" id="description" rows="8" cols="60"><?php echo htmlspecialchars( $this->description ); ?></textarea> + <textarea name="description" id="description" rows="8" cols="60"><?php echo esc_textarea( $this->description ); ?></textarea> </div> </div> - <?php if ( '0' != $this->can_delete ) { ?> + <?php if ( '0' != $this->can_delete ) : ?> <div id="titlediv"> <h3><label for="required"><?php _e( "Is This Field Required?", 'buddypress' ); ?> *</label></h3> <select name="required" id="required" style="width: 30%"> - <option value="0"<?php if ( $this->is_required == '0' ) { ?> selected="selected"<?php } ?>><?php _e( 'Not Required', 'buddypress' ); ?></option> - <option value="1"<?php if ( $this->is_required == '1' ) { ?> selected="selected"<?php } ?>><?php _e( 'Required', 'buddypress' ); ?></option> + <option value="0"<?php selected( $this->is_required, '0' ); ?>><?php _e( 'Not Required', 'buddypress' ); ?></option> + <option value="1"<?php selected( $this->is_required, '1' ); ?>><?php _e( 'Required', 'buddypress' ); ?></option> </select> </div> <div id="titlediv"> - <h3><label for="fieldtype"><?php _e("Field Type", 'buddypress'); ?> *</label></h3> + <h3><label for="fieldtype"><?php _e( 'Field Type', 'buddypress'); ?> *</label></h3> <select name="fieldtype" id="fieldtype" onchange="show_options(this.value)" style="width: 30%"> - <option value="textbox"<?php if ( $this->type == 'textbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Text Box', 'buddypress' ); ?></option> - <option value="textarea"<?php if ( $this->type == 'textarea' ) {?> selected="selected"<?php } ?>><?php _e( 'Multi-line Text Box', 'buddypress' ); ?></option> - <option value="datebox"<?php if ( $this->type == 'datebox' ) {?> selected="selected"<?php } ?>><?php _e( 'Date Selector', 'buddypress' ); ?></option> - <option value="radio"<?php if ( $this->type == 'radio' ) {?> selected="selected"<?php } ?>><?php _e( 'Radio Buttons', 'buddypress' ); ?></option> - <option value="selectbox"<?php if ( $this->type == 'selectbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Drop Down Select Box', 'buddypress' ); ?></option> - <option value="multiselectbox"<?php if ( $this->type == 'multiselectbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Multi Select Box', 'buddypress' ); ?></option> - <option value="checkbox"<?php if ( $this->type == 'checkbox' ) {?> selected="selected"<?php } ?>><?php _e( 'Checkboxes', 'buddypress' ); ?></option> + <option value="textbox" <?php selected( $this->type, 'textbox' ); ?>><?php _e( 'Text Box', 'buddypress' ); ?></option> + <option value="textarea" <?php selected( $this->type, 'textarea' ); ?>><?php _e( 'Multi-line Text Box', 'buddypress' ); ?></option> + <option value="datebox" <?php selected( $this->type, 'datebox' ); ?>><?php _e( 'Date Selector', 'buddypress' ); ?></option> + <option value="radio" <?php selected( $this->type, 'radio' ); ?>><?php _e( 'Radio Buttons', 'buddypress' ); ?></option> + <option value="selectbox" <?php selected( $this->type, 'selectbox' ); ?>><?php _e( 'Drop Down Select Box', 'buddypress' ); ?></option> + <option value="multiselectbox" <?php selected( $this->type, 'multiselectbox' ); ?>><?php _e( 'Multi Select Box', 'buddypress' ); ?></option> + <option value="checkbox" <?php selected( $this->type, 'checkbox' ); ?>><?php _e( 'Checkboxes', 'buddypress' ); ?></option> </select> </div> @@ -874,33 +888,35 @@ class BP_XProfile_Field { <?php $this->render_admin_form_children(); ?> - <?php } else { ?> + <?php else : ?> - <input type="hidden" name="required" id="required" value="1" /> + <input type="hidden" name="required" id="required" value="1" /> <input type="hidden" name="fieldtype" id="fieldtype" value="textbox" /> - <?php } ?> + <?php endif; - <?php /* The fullname field cannot be hidden */ ?> - <?php if ( 1 != $this->id ) : ?> + /* The fullname field cannot be hidden */ + if ( 1 != $this->id ) : ?> <div id="titlediv"> - <div id="titlewrap"> - <h3><label for="default-visibility"><?php _e( "Default Visibility", 'buddypress' ); ?></label></h3> + <h3><label for="default-visibility"><?php _e( 'Default Visibility', 'buddypress' ); ?></label></h3> <ul> - <?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?> - <li><input type="radio" name="default-visibility" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_visibility, $level['id'] ) ?>> <?php echo esc_html( $level['label'] ) ?></li> - <?php endforeach ?> + + <?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?> + + <li><input type="radio" name="default-visibility" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_visibility, $level['id'] ); ?>> <?php echo esc_html( $level['label'] ) ?></li> + + <?php endforeach ?> + </ul> </div> <div id="titlewrap"> - <h3><label for="allow-custom-visibility"><?php _e( "Per-Member Visibility", 'buddypress' ); ?></label></h3> + <h3><label for="allow-custom-visibility"><?php _e( 'Per-Member Visibility', 'buddypress' ); ?></label></h3> <ul> - <li><input type="radio" name="allow-custom-visibility" value="allowed" <?php checked( $this->allow_custom_visibility, 'allowed' ) ?>> <?php _e( "Let members change the this field's visibility", 'buddypress' ) ?></li> - - <li><input type="radio" name="allow-custom-visibility" value="disabled" <?php checked( $this->allow_custom_visibility, 'disabled' ) ?>> <?php _e( 'Enforce the default visibility for all members', 'buddypress' ) ?></li> + <li><input type="radio" name="allow-custom-visibility" value="allowed" <?php checked( $this->allow_custom_visibility, 'allowed' ); ?>> <?php _e( "Let members change this field's visibility", 'buddypress' ); ?></li> + <li><input type="radio" name="allow-custom-visibility" value="disabled" <?php checked( $this->allow_custom_visibility, 'disabled' ); ?>> <?php _e( 'Enforce the default visibility for all members', 'buddypress' ); ?></li> </ul> </div> </div> @@ -957,8 +973,9 @@ class BP_XProfile_ProfileData { var $last_updated; function __construct( $field_id = null, $user_id = null ) { - if ( !empty( $field_id ) ) + if ( !empty( $field_id ) ) { $this->populate( $field_id, $user_id ); + } } function populate( $field_id, $user_id ) { @@ -1070,9 +1087,9 @@ class BP_XProfile_ProfileData { $profile_data = array(); if ( !empty( $results ) ) { - $profile_data['user_login'] = $results[0]->user_login; - $profile_data['user_nicename'] = $results[0]->user_nicename; - $profile_data['user_email'] = $results[0]->user_email; + $profile_data['user_login'] = $results[0]->user_login; + $profile_data['user_nicename'] = $results[0]->user_nicename; + $profile_data['user_email'] = $results[0]->user_email; foreach( (array) $results as $field ) { $profile_data[$field->field_name] = array( @@ -1136,10 +1153,11 @@ class BP_XProfile_ProfileData { if ( is_array( $fields ) ) { for ( $i = 0, $count = count( $fields ); $i < $count; ++$i ) { - if ( $i == 0 ) + if ( $i == 0 ) { $field_sql .= $wpdb->prepare( "AND ( f.name = %s ", $fields[$i] ); - else + } else { $field_sql .= $wpdb->prepare( "OR f.name = %s ", $fields[$i] ); + } } $field_sql .= ')'; @@ -1157,10 +1175,11 @@ class BP_XProfile_ProfileData { if ( is_array( $fields ) ) { for ( $i = 0, $count = count( $values ); $i < $count; ++$i ) { for ( $j = 0; $j < count( $fields ); $j++ ) { - if ( $values[$i]->name == $fields[$j] ) + if ( $values[$i]->name == $fields[$j] ) { $new_values[$fields[$j]] = $values[$i]->value; - else if ( !array_key_exists( $fields[$j], $new_values ) ) + } else if ( !array_key_exists( $fields[$j], $new_values ) ) { $new_values[$fields[$j]] = NULL; + } } } } else { @@ -1197,7 +1216,7 @@ class BP_XProfile_ProfileData { global $wpdb, $bp; if ( !empty( $exclude_fullname ) ) - $exclude_sql = " AND pf.id != 1"; + $exclude_sql = $wpdb->prepare( " AND pf.id != 1" ); return $wpdb->get_results( $wpdb->prepare( "SELECT pf.type, pf.name, pd.value FROM {$bp->profile->table_name_data} pd INNER JOIN {$bp->profile->table_name_fields} pf ON pd.field_id = pf.id AND pd.user_id = %d {$exclude_sql} ORDER BY RAND() LIMIT 1", $user_id ) ); } @@ -1208,11 +1227,8 @@ class BP_XProfile_ProfileData { $user_id = bp_displayed_user_id(); $field_name = bp_xprofile_fullname_field_name(); - - $data = xprofile_get_field_data( $field_name, $user_id ); + $data = xprofile_get_field_data( $field_name, $user_id ); return $data[$field_name]; } } - -?> diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php index 3e687ff39f31232dc4700f5ada7ab64944e31806..1c8c43226f0b81a522065b6ef26787ef7546c9e9 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-cssjs.php @@ -17,11 +17,8 @@ if ( !defined( 'ABSPATH' ) ) exit; */ function xprofile_add_admin_css() { if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) { - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { - wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . 'bp-xprofile/admin/css/admin.dev.css', array(), bp_get_version() ); - } else { - wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . 'bp-xprofile/admin/css/admin.css', array(), bp_get_version() ); - } + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + wp_enqueue_style( 'xprofile-admin-css', BP_PLUGIN_URL . "bp-xprofile/admin/css/admin{$min}.css", array(), bp_get_version() ); } } add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_css' ); @@ -29,7 +26,7 @@ add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_css' ); /** * Enqueue the jQuery libraries for handling drag/drop/sort * - * @since BuddyPres (1.5) + * @since BuddyPress (1.5) */ function xprofile_add_admin_js() { if ( !empty( $_GET['page'] ) && strpos( $_GET['page'], 'bp-profile-setup' ) !== false ) { @@ -40,13 +37,8 @@ function xprofile_add_admin_js() { wp_enqueue_script( 'jquery-ui-droppable' ); wp_enqueue_script( 'jquery-ui-sortable' ); - if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { - wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . 'bp-xprofile/admin/js/admin.dev.js', array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); - } else { - wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . 'bp-xprofile/admin/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); - } + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; + wp_enqueue_script( 'xprofile-admin-js', BP_PLUGIN_URL . "bp-xprofile/admin/js/admin{$min}.js", array( 'jquery', 'jquery-ui-sortable' ), bp_get_version() ); } } add_action( 'admin_enqueue_scripts', 'xprofile_add_admin_js', 1 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php index fe8bd707bc7ca5c2e1163308fb626fdcc98b6260..bde9c50cc77329718c2930663b6a87eee9d2e3a9 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php @@ -20,12 +20,12 @@ add_filter( 'bp_get_the_profile_field_edit_value', 'wp_filter_kses', add_filter( 'bp_get_the_profile_field_description', 'wp_filter_kses', 1 ); add_filter( 'bp_get_the_profile_field_value', 'wptexturize' ); -add_filter( 'bp_get_the_profile_field_value', 'convert_smilies', 2 ); add_filter( 'bp_get_the_profile_field_value', 'convert_chars' ); add_filter( 'bp_get_the_profile_field_value', 'wpautop' ); add_filter( 'bp_get_the_profile_field_value', 'force_balance_tags' ); add_filter( 'bp_get_the_profile_field_value', 'make_clickable' ); add_filter( 'bp_get_the_profile_field_value', 'esc_html', 8 ); +add_filter( 'bp_get_the_profile_field_value', 'convert_smilies', 9 ); add_filter( 'bp_get_the_profile_field_edit_value', 'force_balance_tags' ); add_filter( 'bp_get_the_profile_field_edit_value', 'esc_html' ); @@ -191,26 +191,41 @@ function xprofile_filter_link_profile_data( $field_value, $field_type = 'textbox return $values; } +/** + * Ensures that BP data appears in comments array + * + * This filter loops through the comments return by a normal WordPress request + * and swaps out user data with BP xprofile data, where available + * + * @param array $comments + * @param int $post_id + * @return array $comments + */ function xprofile_filter_comments( $comments, $post_id ) { + // Locate comment authors with WP accounts foreach( (array) $comments as $comment ) { if ( $comment->user_id ) { $user_ids[] = $comment->user_id; } } - if ( empty( $user_ids ) ) + // If none are found, just return the comments array + if ( empty( $user_ids ) ) { return $comments; + } + // Pull up the xprofile fullname of each commenter if ( $fullnames = BP_XProfile_ProfileData::get_value_byid( 1, $user_ids ) ) { foreach( (array) $fullnames as $user ) { - $users[$user->user_id] = trim($user->value); + $users[ $user->user_id ] = trim( stripslashes( $user->value ) ); } } + // Loop through and match xprofile fullname with commenters foreach( (array) $comments as $i => $comment ) { - if ( !empty( $comment->user_id ) ) { - if ( !empty( $users[$comment->user_id] ) ) { - $comments[$i]->comment_author = $users[$comment->user_id]; + if ( ! empty( $comment->user_id ) ) { + if ( ! empty( $users[ $comment->user_id ] ) ) { + $comments[ $i ]->comment_author = $users[ $comment->user_id ]; } } } @@ -219,6 +234,29 @@ function xprofile_filter_comments( $comments, $post_id ) { } add_filter( 'comments_array', 'xprofile_filter_comments', 10, 2 ); +/** + * Filter BP_User_Query::populate_extras to override each queries users fullname + * + * @since BuddyPress (1.7) + * + * @global BuddyPress $bp + * @global WPDB $wpdb + * @param BP_User_Query $user_query + * @param string $user_ids_sql + */ +function bp_xprofile_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql ) { + global $bp, $wpdb; + if ( bp_is_active( 'xprofile' ) ) { + $fullname_field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", bp_xprofile_fullname_field_name() ) ); + $user_id_names = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, value as fullname FROM {$bp->profile->table_name_data} WHERE user_id IN ({$user_ids_sql}) AND field_id = %d", $fullname_field_id ) ); -?> + // Loop through names and override each user's fullname + foreach ( $user_id_names as $user ) { + if ( isset( $user_query->results[ $user->user_id ] ) ) { + $user_query->results[ $user->user_id ]->fullname = $user->fullname; + } + } + } +} +add_filter( 'bp_user_query_populate_extras', 'bp_xprofile_filter_user_query_populate_extras', 2, 2 ); diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php index 48b0c6b18f11f85d1bb862ac1641a90a895a4df0..b925730bdd0088710f1bf47aedaf1294da6cebe3 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php @@ -425,7 +425,8 @@ function xprofile_avatar_upload_dir( $directory = false, $user_id = 0 ) { * @package BuddyPress Core */ function xprofile_sync_wp_profile( $user_id = 0 ) { - global $bp, $wpdb; + + $bp = buddypress(); if ( !empty( $bp->site_options['bp-disable-profile-sync'] ) && (int) $bp->site_options['bp-disable-profile-sync'] ) return true; @@ -451,16 +452,19 @@ function xprofile_sync_wp_profile( $user_id = 0 ) { bp_update_user_meta( $user_id, 'first_name', $firstname ); bp_update_user_meta( $user_id, 'last_name', $lastname ); + global $wpdb; + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) ); } add_action( 'xprofile_updated_profile', 'xprofile_sync_wp_profile' ); -add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' ); +add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' ); +add_action( 'bp_core_activated_user', 'xprofile_sync_wp_profile' ); /** * Syncs the standard built in WordPress profile data to XProfile. * - * @since 1.2.4 + * @since BuddyPress (1.2.4) * @package BuddyPress Core */ function xprofile_sync_bp_profile( &$errors, $update, &$user ) { @@ -507,17 +511,19 @@ function bp_xprofile_delete_meta( $object_id, $object_type, $meta_key = false, $ $meta_key = preg_replace( '|[^a-z0-9_]|i', '', $meta_key ); - if ( is_array( $meta_value ) || is_object( $meta_value ) ) + if ( is_array( $meta_value ) || is_object( $meta_value ) ) { $meta_value = serialize( $meta_value ); + } $meta_value = trim( $meta_value ); - if ( !$meta_key ) + if ( empty( $meta_key ) ) { $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s", $object_id, $object_type ) ); - else if ( $meta_value ) + } elseif ( !empty( $meta_value ) ) { $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s AND meta_value = %s", $object_id, $object_type, $meta_key, $meta_value ) ); - else + } else { $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->profile->table_name_meta} WHERE object_id = %d AND object_type = %s AND meta_key = %s", $object_id, $object_type, $meta_key ) ); + } // Delete the cached object wp_cache_delete( 'bp_xprofile_meta_' . $object_type . '_' . $object_id . '_' . $meta_key, 'bp' ); @@ -648,7 +654,7 @@ function bp_xprofile_get_visibility_levels() { * profile viewer). Then, based on that relationship, we query for the set of fields that should * be excluded from the profile loop. * - * @since 1.6 + * @since BuddyPress (1.6) * @see BP_XProfile_Group::get() * @uses apply_filters() Filter bp_xprofile_get_hidden_fields_for_user to modify visibility levels, * or if you have added your own custom levels @@ -671,26 +677,34 @@ function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $curren } // @todo - This is where you'd swap out for current_user_can() checks + $hidden_levels = $hidden_fields = array(); + // Current user is logged in if ( $current_user_id ) { - // Current user is logged in + + // If you're viewing your own profile, nothing's private if ( $displayed_user_id == $current_user_id ) { - // If you're viewing your own profile, nothing's private - $hidden_fields = array(); - } else if ( bp_is_active( 'friends' ) && friends_check_friendship( $displayed_user_id, $current_user_id ) ) { - // If the current user and displayed user are friends, show all - $hidden_fields = array(); + // If the current user and displayed user are friends, show all + } elseif ( bp_is_active( 'friends' ) && friends_check_friendship( $displayed_user_id, $current_user_id ) ) { + if ( ! bp_current_user_can( 'bp_moderate' ) ) + $hidden_levels[] = 'adminsonly'; + $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels ); + + // current user is logged-in but not friends, so exclude friends-only } else { - // current user is logged-in but not friends, so exclude friends-only $hidden_levels = array( 'friends' ); + + if ( ! bp_current_user_can( 'bp_moderate' ) ) + $hidden_levels[] = 'adminsonly'; + $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels ); } + // Current user is not logged in, so exclude friends-only, loggedin, and adminsonly. } else { - // Current user is not logged in, so exclude friends-only and loggedin - $hidden_levels = array( 'friends', 'loggedin' ); + $hidden_levels = array( 'friends', 'loggedin', 'adminsonly', ); $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels ); } @@ -700,11 +714,11 @@ function bp_xprofile_get_hidden_fields_for_user( $displayed_user_id = 0, $curren /** * Fetch an array of the xprofile fields that a given user has marked with certain visibility levels * - * @since 1.6 + * @since BuddyPress (1.6) * @see bp_xprofile_get_hidden_fields_for_user() * * @param int $user_id The id of the profile owner - * @param array $levels An array of visibility levels ('public', 'friends', 'loggedin', etc) to be + * @param array $levels An array of visibility levels ('public', 'friends', 'loggedin', 'adminsonly' etc) to be * checked against * @return array $field_ids The fields that match the requested visibility levels for the given user */ @@ -742,6 +756,3 @@ function bp_xprofile_get_fields_by_visibility_levels( $user_id, $levels = array( return $field_ids; } - - -?> diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php index b32b9bcbb587f86144a575c22625c400819ef556..85831e1353ca80f437150f8c0b5719137c8ad405 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-loader.php @@ -26,7 +26,7 @@ class BP_XProfile_Component extends BP_Component { * The acceptable visibility levels for xprofile fields. * * @see bp_xprofile_get_visibility_levels() - * @since 1.6 + * @since BuddyPress (1.6) */ var $visibility_levels = array(); @@ -98,19 +98,23 @@ class BP_XProfile_Component extends BP_Component { 'multiselectbox', 'datebox' ) ); - - // Register the visibility levels. See bp_xprofile_get_visibility_levels() to filter + + // Register the visibility levels. See bp_xprofile_get_visibility_levels() to filter $this->visibility_levels = array( - 'public' => array( - 'id' => 'public', + 'public' => array( + 'id' => 'public', 'label' => __( 'Anyone', 'buddypress' ) ), 'loggedin' => array( - 'id' => 'loggedin', + 'id' => 'loggedin', 'label' => __( 'Logged In Users', 'buddypress' ) - ) + ), + 'adminsonly' => array( + 'id' => 'adminsonly', + 'label' => __( 'Admins Only', 'buddypress' ) + ), ); - + if ( bp_is_active( 'friends' ) ) { $this->visibility_levels['friends'] = array( 'id' => 'friends', @@ -155,11 +159,20 @@ class BP_XProfile_Component extends BP_Component { 'item_css_id' => $this->id ); - $profile_link = trailingslashit( bp_loggedin_user_domain() . $this->slug ); + // Determine user to use + if ( bp_displayed_user_domain() ) { + $user_domain = bp_displayed_user_domain(); + } elseif ( bp_loggedin_user_domain() ) { + $user_domain = bp_loggedin_user_domain(); + } else { + return; + } + + $profile_link = trailingslashit( $user_domain . $this->slug ); // Add the subnav items to the profile $sub_nav[] = array( - 'name' => __( 'Public', 'buddypress' ), + 'name' => __( 'View', 'buddypress' ), 'slug' => 'public', 'parent_url' => $profile_link, 'parent_slug' => $this->slug, @@ -174,7 +187,8 @@ class BP_XProfile_Component extends BP_Component { 'parent_url' => $profile_link, 'parent_slug' => $this->slug, 'screen_function' => 'xprofile_screen_edit_profile', - 'position' => 20 + 'position' => 20, + 'user_has_access' => bp_core_can_edit_settings() ); // Change Avatar @@ -184,7 +198,8 @@ class BP_XProfile_Component extends BP_Component { 'parent_url' => $profile_link, 'parent_slug' => $this->slug, 'screen_function' => 'xprofile_screen_change_avatar', - 'position' => 30 + 'position' => 30, + 'user_has_access' => bp_core_can_edit_settings() ); parent::setup_nav( $main_nav, $sub_nav ); @@ -276,5 +291,3 @@ function bp_setup_xprofile() { $bp->profile = new BP_XProfile_Component(); } add_action( 'bp_setup_components', 'bp_setup_xprofile', 6 ); - -?> diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php index 16102fda59cc9b6ef474ab74605d0679cd792829..6c3bceefabe306b4d1c16ce193391536a40a9938 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-screens.php @@ -36,11 +36,12 @@ function xprofile_screen_display_profile() { * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename) */ function xprofile_screen_edit_profile() { - global $bp; if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) ) return false; + $bp = buddypress(); + // Make sure a group is set. if ( !bp_action_variable( 1 ) ) bp_core_redirect( trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/1' ) ); @@ -104,15 +105,17 @@ function xprofile_screen_edit_profile() { foreach ( (array) $posted_field_ids as $field_id ) { // Certain types of fields (checkboxes, multiselects) may come through empty. Save them as an empty array so that they don't get overwritten by the default on the next edit. - if ( empty( $_POST['field_' . $field_id] ) ) + if ( empty( $_POST['field_' . $field_id] ) ) { $value = array(); - else + } else { $value = $_POST['field_' . $field_id]; + } - if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) ) + if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) ) { $errors = true; - else + } else { do_action( 'xprofile_profile_field_data_updated', $field_id, $value ); + } // Save the visibility level $visibility_level = !empty( $_POST['field_' . $field_id . '_visibility'] ) ? $_POST['field_' . $field_id . '_visibility'] : 'public'; @@ -122,10 +125,11 @@ function xprofile_screen_edit_profile() { do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors ); // Set the feedback messages - if ( !empty( $errors ) ) + if ( !empty( $errors ) ) { bp_core_add_message( __( 'There was a problem updating some of your profile information, please try again.', 'buddypress' ), 'error' ); - else + } else { bp_core_add_message( __( 'Changes saved.', 'buddypress' ) ); + } // Redirect back to the edit screen to display the updates and message bp_core_redirect( trailingslashit( bp_displayed_user_domain() . $bp->profile->slug . '/edit/group/' . bp_action_variable( 1 ) ) ); @@ -144,16 +148,22 @@ function xprofile_screen_edit_profile() { * @uses bp_core_load_template() Looks for and loads a template file within the current member theme (folder/filename) */ function xprofile_screen_change_avatar() { - global $bp; + // Bail if not the correct screen if ( !bp_is_my_profile() && !bp_current_user_can( 'bp_moderate' ) ) return false; + // Bail if there are action variables if ( bp_action_variables() ) { bp_do_404(); return; } + $bp = buddypress(); + + if ( ! isset( $bp->avatar_admin ) ) + $bp->avatar_admin = new stdClass(); + $bp->avatar_admin->step = 'upload-image'; if ( !empty( $_FILES ) ) { @@ -176,10 +186,19 @@ function xprofile_screen_change_avatar() { // Check the nonce check_admin_referer( 'bp_avatar_cropstore' ); - if ( !bp_core_avatar_handle_crop( array( 'item_id' => bp_displayed_user_id(), 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) ) - bp_core_add_message( __( 'There was a problem cropping your avatar, please try uploading it again', 'buddypress' ), 'error' ); - else { - bp_core_add_message( __( 'Your new avatar was uploaded successfully!', 'buddypress' ) ); + $args = array( + 'item_id' => bp_displayed_user_id(), + 'original_file' => $_POST['image_src'], + 'crop_x' => $_POST['x'], + 'crop_y' => $_POST['y'], + 'crop_w' => $_POST['w'], + 'crop_h' => $_POST['h'] + ); + + if ( ! bp_core_avatar_handle_crop( $args ) ) { + bp_core_add_message( __( 'There was a problem cropping your avatar.', 'buddypress' ), 'error' ); + } else { + bp_core_add_message( __( 'Your new avatar was uploaded successfully.', 'buddypress' ) ); do_action( 'xprofile_avatar_uploaded' ); } } @@ -188,5 +207,3 @@ function xprofile_screen_change_avatar() { bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'members/single/home' ) ); } - -?> diff --git a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php index 11dd52e7a673fb9e1d5186381cfd7ed027686ae7..c6ecda3ba314a5b6fd807c9d90400c9bfed3b32a 100644 --- a/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php +++ b/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php @@ -147,10 +147,6 @@ class BP_XProfile_Data_Template { } } -function xprofile_get_profile() { - locate_template( array( 'profile/profile-loop.php'), true ); -} - function bp_has_profile( $args = '' ) { global $profile_template; @@ -398,7 +394,7 @@ function bp_the_profile_field_input_name() { * 'radio', 'checkbox', and 'datebox'. * * @package BuddyPress Xprofile - * @since 1.1 + * @since BuddyPress (1.1) * * @uses bp_get_the_profile_field_options() * @@ -414,7 +410,7 @@ function bp_the_profile_field_options( $args = '' ) { * 'radio', 'checkbox', and 'datebox'. * * @package BuddyPress Xprofile - * @since 1.1 + * @since BuddyPress (1.1) * * @uses BP_XProfile_Field::get_children() * @uses BP_XProfile_ProfileData::get_value_byid() @@ -923,4 +919,3 @@ function bp_profile_visibility_radio_buttons() { return apply_filters( 'bp_profile_get_visibility_radio_buttons', $html ); } -?> diff --git a/wp-content/plugins/buddypress/humans.txt b/wp-content/plugins/buddypress/humans.txt index 3485e8c6488914e4c45c6f452f790feb35b5ed4d..e801a5bc494e52f43fcddaca462bb952c15ec02f 100644 --- a/wp-content/plugins/buddypress/humans.txt +++ b/wp-content/plugins/buddypress/humans.txt @@ -32,23 +32,28 @@ Title: Founding Developer Twitter: apeatling Name: John James Jacoby -Title: Lead Developer -Twitter: johnjamesjacoby -Favorite Food: Pizza +Title: Project Lead +Twitter: jjj +Favorite Food: Truffle Lasagna Name: Boone B. Gorges -Title: Developer +Title: Lead Developer Twitter: boone Favorite Pudgy Pie Filling: Cherry Name: Paul Gibbs -Title: Developer +Title: Lead Developer Twitter: pgibbs Favourite Food: Pizza +Name: Ray +Title: Core Developer +Twitter: r-a-y +Favourite Food: tbd + /* THANKS */ -r-a-y, hnla, mercime, modemlooper, cnorris23, karmatosed +hnla, mercime, modemlooper, cnorris23, karmatosed, photomatt /* META */ -Updated: 2011/08/29 +Updated: 2012/10/22 See: http://humanstxt.org/ \ No newline at end of file diff --git a/wp-content/plugins/buddypress/readme.txt b/wp-content/plugins/buddypress/readme.txt index ddf52884ac244eafd8a0b49108ca3317a756c397..3049570f33bbb8c9de7f7a65555b51976b978fea 100644 --- a/wp-content/plugins/buddypress/readme.txt +++ b/wp-content/plugins/buddypress/readme.txt @@ -1,9 +1,9 @@ === Plugin Name === -Contributors: johnjamesjacoby, DJPaul, boonebgorges -Tags: buddypress, social networking, activity, profiles, messaging, friends, groups, forums, microblogging, twitter, facebook, social, community, networks, networking, cms -Requires at least: 3.4 -Tested up to: 3.4.1 -Stable tag: 1.6.2 +Contributors: johnjamesjacoby, DJPaul, boonebgorges, r-a-y +Tags: social networking, activity, profiles, messaging, friends, groups, forums, notifications, settings, twitter, facebook, social, community, networks, networking, cms +Requires at least: 3.5 +Tested up to: 3.6 +Stable tag: 1.7.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -45,9 +45,7 @@ BuddyPress includes full support for discussion forums. Each group created on yo = Can I use my existing WordPress theme? = -Of course! Once you've installed and activated BuddyPress, the Installation Wizard will guide you through the available theme options. You'll be given the option of installing the <a href="http://wordpress.org/extend/plugins/bp-template-pack/">BuddyPress Template Pack</a>, which will help you add BuddyPress compatibility to your existing theme. - -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 BuddyPress's features in a seamless and beautiful way. The BuddyPress Default theme is a snap to customize, with full support for custom headers and backgrounds and multiple widget areas. It also makes a great starting point for your own <a href="http://codex.buddypress.org/how-to-guides/building-a-buddypress-child-theme/">child theme</a>. +Of course! BuddyPress works out-of-the-box with nearly every WordPress theme. = Will this work on WordPress multisite? = @@ -73,12 +71,11 @@ Check out the development trunk of BuddyPress via Subversion, from <a href="http 1. **Activity Streams** - Global, personal and group activity streams with threaded commenting, direct posting, favoriting and @mentions. All with full RSS feeds and email notification support. 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. -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. -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. -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. -6. **Discussion Forums** - Full powered discussion forums built directly into groups allow for more conventional in-depth conversations. -7. **WordPress Blogging** - Allow your users to start their own blogs using WordPress's Multisite feature, and track posts and comments from across your blog network in the activity stream. -8. **User Settings** - Give your users complete control over profile and notification settings. Settings are fully integrated into your theme, and can be disabled by the administrator. +3. **User Settings** - Give your users complete control over profile and notification settings. Settings are fully integrated into your theme, and can be disabled by the administrator. +4. **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. +5. **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. +6. **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. +7. **Blogging Network** - Allow your users to start their own blogs using WordPress's Multisite feature, and track posts and comments from across your blog network in the activity stream. == Languages == @@ -86,6 +83,21 @@ BuddyPress is available in more than 20 languages. For more information, check o == Upgrade Notice == += 1.7.1 = +See: http://codex.buddypress.org/releases/version-1-7-1/ + += 1.7 = +See: http://codex.buddypress.org/releases/version-1-7/ + += 1.6.5 = +See: http://codex.buddypress.org/releases/version-1-6-5/ + += 1.6.4 = +See: http://codex.buddypress.org/releases/version-1-6-4/ + += 1.6.3 = +See: http://codex.buddypress.org/releases/version-1-6-3/ + = 1.6.2 = Compatibility with WordPress 3.5