new file mode 100644
---bp-theme-compat/bp-legacy/buddypress-functions.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress-functions.php (revision 0)
@@ -0,0 +1,1117 @@
+<?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() {
+
+ // Bail if parent/child themes are bp-default
+ if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) )
+ return;
+
+ $this->setup_globals();
+ $this->setup_actions();
+ }
+
+ /**
+ * Component global variables
+ *
+ * Note that this function is currently commented out in the constructor.
+ * It will only be used if you copy this file into your current theme and
+ * uncomment the line above.
+ *
+ * You'll want to customize the values in here, so they match whatever your
+ * needs are.
+ *
+ * @since BuddyPress (1.7)
+ * @access private
+ */
+ private function setup_globals() {
+ $bp = buddypress();
+ $this->id = 'legacy';
+ $this->name = __( 'BuddyPress Legacy', 'buddypress' );
+ $this->version = bp_get_version();
+ $this->dir = trailingslashit( $bp->theme_compat_dir . '/bp-legacy' );
+ $this->url = trailingslashit( $bp->theme_compat_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
+ */
+ private function setup_actions() {
+
+ /** 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>
+
+ /** 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 admin_url( 'admin-ajax.php' ); ?>';
+ /* ]]> */
+ </script>
+
+ <?php
+ }
+
+ /**
+ * 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() {
+
+ }
+}
+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
+ $activities_template->activity->id = $activities_template->activities[0]->item_id;
+ $activities_template->activity->current_comment = $activities_template->activities[0];
+
+ $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
+ * older themes (which are not children of bp-legacy and won't
+ * have the new template) will still work.
+ */
+ if ( empty( $template ) )
+ $template = "{buddypress()->theme_compat_dir}/bp-legacy/activity/comment.php";
+
+ bp_get_template_part( $template );
+
+ 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 ( empty( $activity->user_id ) || ! 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;
+
+ if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) {
+ check_ajax_referer( 'friends_remove_friend' );
+
+ if ( ! friends_remove_friend( bp_loggedin_user_id(), $_POST['fid'] ) )
+ 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>';
+
+ } elseif ( 'not_friends' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) {
+ check_ajax_referer( 'friends_add_friend' );
+
+ if ( ! friends_add_friend( bp_loggedin_user_id(), $_POST['fid'] ) )
+ 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>';
+
+ } elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), (int) $_POST['fid'] ) ) {
+ 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
+ echo __("Friendship request could not be cancelled.", 'buddypress');
+
+ } 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( $_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( $_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;
+
+ if ( groups_is_user_banned( bp_loggedin_user_id(), $_POST['gid'] ) )
+ return;
+
+ if ( ! $group = groups_get_group( array( 'group_id' => $_POST['gid'] ) ) )
+ 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' => $_REQUEST['thread_id'], 'content' => $_REQUEST['content'] ) );
+
+ if ( $result ) { ?>
+ <div class="message-box new-message">
+ <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($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($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($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() {
+ 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;
+
+ $pag_page = 1;
+ $limit = $_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-' . $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";
+ }
+ }
+
+ exit;
+}
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/activity/activity-loop.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/activity/activity-loop.php (revision 0)
@@ -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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/activity/comment.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/activity/comment.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/activity/entry.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/activity/entry.php (revision 0)
@@ -0,0 +1,124 @@
+<?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 ( 'activity_comment' == bp_get_activity_type() ) : ?>
+
+ <div class="activity-inreplyto">
+ <strong><?php _e( 'In reply to: ', 'buddypress' ); ?></strong><?php bp_activity_parent_content(); ?> <a href="<?php bp_activity_thread_permalink(); ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ); ?>"><?php _e( 'View', 'buddypress' ); ?></a>
+ </div>
+
+ <?php endif; ?>
+
+ <?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' ); ?>
+
+ <?php if ( is_user_logged_in() ) : ?>
+
+ <div class="activity-meta">
+
+ <?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>
+
+ <?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' ); ?>
+
+ </div>
+
+ <?php endif; ?>
+
+ </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' ); ?>" /> <?php _e( 'or press esc to cancel.', 'buddypress' ); ?>
+ <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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/activity/index.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/activity/index.php (revision 0)
@@ -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>
\ No newline at end of file
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/activity/post-form.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/activity/post-form.php (revision 0)
@@ -0,0 +1,68 @@
+<?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>
+
+ <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 -->
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/blogs/blogs-loop.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/blogs/blogs-loop.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/blogs/create.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/blogs/create.php (revision 0)
@@ -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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/blogs/index.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/blogs/index.php (revision 0)
@@ -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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/forums/forums-loop.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/forums/forums-loop.php (revision 0)
@@ -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 bp_the_topic_title(); ?> - <?php _e( 'Permalink', '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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/forums/index.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/forums/index.php (revision 0)
@@ -0,0 +1,136 @@
+<?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' ); ?>
\ No newline at end of file
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/create.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/create.php (revision 0)
@@ -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. You can send invites any time in the future by selecting the "Send Invites" option when viewing your new 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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/groups-loop.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/groups-loop.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/index.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/index.php (revision 0)
@@ -0,0 +1,73 @@
+<?php do_action( 'bp_before_directory_groups_page' ); ?>
+
+<div id="buddypress">
+
+ <?php do_action( 'bp_before_directory_groups' ); ?>
+
+ <form action="" method="post" id="groups-directory-form" class="dir-form">
+
+ <?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 -->
+
+ <?php do_action( 'template_notices' ); ?>
+
+ <div class="item-list-tabs" role="navigation">
+ <ul>
+ <li class="selected" id="groups-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ); ?>"><?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 trailingslashit( 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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/activity.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/activity.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/admin.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/admin.php (revision 0)
@@ -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 -->
+
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/forum.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/forum.php (revision 0)
@@ -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; ?>
+
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/forum/edit.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/forum/edit.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/forum/topic.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/forum/topic.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/group-header.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/group-header.php (revision 0)
@@ -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">
+ <h2><a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>"><?php bp_group_name(); ?></a></h2>
+ <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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/home.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/home.php (revision 0)
@@ -0,0 +1,75 @@
+<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' );
+
+ if ( bp_is_group_admin_page() && bp_group_is_visible() ) :
+ bp_get_template_part( 'groups/single/admin' );
+
+ elseif ( bp_is_group_members() && bp_group_is_visible() ) :
+ bp_get_template_part( 'groups/single/members' );
+
+ elseif ( bp_is_group_invites() && bp_group_is_visible() ) :
+ bp_get_template_part( 'groups/single/send-invites' );
+
+ elseif ( bp_is_group_forum() && bp_group_is_visible() && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) :
+ bp_get_template_part( 'groups/single/forum' );
+
+ elseif ( bp_is_group_membership_request() ) :
+ bp_get_template_part( 'groups/single/request-membership' );
+
+ elseif ( bp_group_is_visible() && bp_is_active( 'activity' ) ) :
+ bp_get_template_part( 'groups/single/activity' );
+
+ elseif ( bp_group_is_visible() ) :
+ bp_get_template_part( 'groups/single/members' );
+
+ // The group is not visible, show the status message
+ elseif ( !bp_group_is_visible() ) :
+
+ 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' );
+
+ // If nothing sticks, just load a group front template if one exists.
+ else :
+ bp_get_template_part( 'groups/single/plugins' );
+
+ endif;
+
+ do_action( 'bp_after_group_body' ); ?>
+
+ </div><!-- #item-body -->
+
+ <?php do_action( 'bp_after_group_home_content' ); ?>
+
+ <?php endwhile; endif; ?>
+
+</div><!-- #buddypress -->
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/members.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/members.php (revision 0)
@@ -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; ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/plugins.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/plugins.php (revision 0)
@@ -0,0 +1,35 @@
+<div id="buddypress">
+
+ <?php do_action( 'bp_before_group_plugin_template' ); ?>
+
+ <div id="item-header">
+
+ <?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_plugin_options_nav' ); ?>
+
+ </ul>
+ </div>
+ </div><!-- #item-nav -->
+
+ <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' ); ?>
+
+</div><!-- #buddypress -->
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/request-membership.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/request-membership.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/groups/single/send-invites.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/groups/single/send-invites.php (revision 0)
@@ -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. You can send invites any time in the future by selecting the "Send Invites" option when viewing your new group.', 'buddypress' ); ?></p>
+ </div>
+
+<?php endif; ?>
+
+<?php do_action( 'bp_after_group_send_invites_content' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/activate.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/activate.php (revision 0)
@@ -0,0 +1,46 @@
+<div id="buddypress">
+
+ <?php do_action( 'bp_before_activation_page' ); ?>
+
+ <div class="page" id="activate-page">
+
+ <?php if ( bp_account_was_activated() ) : ?>
+
+ <h2 class="widgettitle"><?php _e( 'Account Activated', 'buddypress' ); ?></h2>
+
+ <?php do_action( 'bp_before_activate_content' ); ?>
+
+ <?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 : ?>
+
+ <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">
+
+ <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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/index.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/index.php (revision 0)
@@ -0,0 +1,75 @@
+<?php do_action( 'bp_before_directory_members_page' ); ?>
+
+<div id="buddypress">
+
+ <?php do_action( 'bp_before_directory_members' ); ?>
+
+ <form action="" method="post" id="members-directory-form" class="dir-form">
+
+ <?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 -->
+
+ <div class="item-list-tabs" role="navigation">
+ <ul>
+ <li class="selected" id="members-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() ); ?>"><?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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/members-loop.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/members-loop.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/register.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/register.php (revision 0)
@@ -0,0 +1,272 @@
+<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() ) : ?>
+
+ <h2><?php _e( 'Create an Account', 'buddypress' ); ?></h2>
+
+ <?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 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>
+ </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() ) : ?>
+
+ <h2><?php _e( 'Sign Up Complete!', 'buddypress' ); ?></h2>
+
+ <?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 -->
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/activity.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/activity.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/activity/permalink.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/activity/permalink.php (revision 0)
@@ -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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/blogs.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/blogs.php (revision 0)
@@ -0,0 +1,40 @@
+<?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 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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/forums.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/forums.php (revision 0)
@@ -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; ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/forums/topics.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/forums/topics.php (revision 0)
@@ -0,0 +1,7 @@
+<?php
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/friends.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/friends.php (revision 0)
@@ -0,0 +1,52 @@
+<?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
+
+if ( bp_is_current_action( 'requests' ) ) :
+ bp_get_template_part( 'members/single/friends/requests' );
+
+else :
+ 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' ); ?>
+
+<?php endif; ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/friends/requests.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/friends/requests.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/groups.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/groups.php (revision 0)
@@ -0,0 +1,53 @@
+<?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
+
+if ( bp_is_current_action( 'invites' ) ) :
+ bp_get_template_part( 'members/single/groups/invites' );
+
+else :
+ 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' ); ?>
+
+<?php endif; ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/groups/invites.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/groups/invites.php (revision 0)
@@ -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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/home.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/home.php (revision 0)
@@ -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 -->
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/member-header.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/member-header.php (revision 0)
@@ -0,0 +1,66 @@
+<?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>
+ <a href="<?php bp_displayed_user_link(); ?>"><?php bp_displayed_user_fullname(); ?></a>
+ </h2>
+
+ <span class="user-nicename">@<?php bp_displayed_user_username(); ?></span>
+ <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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/messages.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/messages.php (revision 0)
@@ -0,0 +1,51 @@
+<?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
+
+ if ( bp_is_current_action( 'compose' ) ) :
+ bp_get_template_part( 'members/single/messages/compose' );
+
+ elseif ( bp_is_current_action( 'view' ) ) :
+ bp_get_template_part( 'members/single/messages/single' );
+
+ else :
+ do_action( 'bp_before_member_messages_content' ); ?>
+
+ <div class="messages" role="main">
+
+ <?php
+ if ( bp_is_current_action( 'notices' ) )
+ bp_get_template_part( 'members/single/messages/notices-loop' );
+ else
+ bp_get_template_part( 'members/single/messages/messages-loop' );
+ ?>
+
+ </div><!-- .messages -->
+
+ <?php do_action( 'bp_after_member_messages_content' ); ?>
+
+<?php endif; ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/messages/compose.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/messages/compose.php (revision 0)
@@ -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>
+
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/messages/messages-loop.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/messages/messages-loop.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/messages/notices-loop.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/messages/notices-loop.php (revision 0)
@@ -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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/messages/single.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/messages/single.php (revision 0)
@@ -0,0 +1,110 @@
+<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' ); ?>
+ <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> <span class="activity"><?php bp_the_thread_message_time_since(); ?></span></strong>
+
+ <?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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/plugins.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/plugins.php (revision 0)
@@ -0,0 +1,47 @@
+<div id="buddypress">
+
+ <?php do_action( 'bp_before_member_plugin_template' ); ?>
+
+ <div id="item-header">
+
+ <?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" role="main">
+
+ <?php do_action( 'bp_before_member_body' ); ?>
+
+ <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 -->
+
+ <h3><?php do_action( 'bp_template_title' ); ?></h3>
+
+ <?php do_action( 'bp_template_content' ); ?>
+
+ <?php do_action( 'bp_after_member_body' ); ?>
+
+ </div><!-- #item-body -->
+
+ <?php do_action( 'bp_after_member_plugin_template' ); ?>
+
+</div><!-- #buddypress -->
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/profile.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/profile.php (revision 0)
@@ -0,0 +1,48 @@
+<?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
+ // Profile Edit
+ if ( bp_is_current_action( 'edit' ) )
+ bp_get_template_part( 'members/single/profile/edit' );
+
+ // Change Avatar
+ elseif ( bp_is_current_action( 'change-avatar' ) )
+ bp_get_template_part( 'members/single/profile/change-avatar' );
+
+ // Display XProfile
+ elseif ( 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' )
+ ?>
+
+</div><!-- .profile -->
+
+<?php do_action( 'bp_after_profile_content' ); ?>
\ No newline at end of file
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/profile/change-avatar.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/profile/change-avatar.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/profile/edit.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/profile/edit.php (revision 0)
@@ -0,0 +1,157 @@
+<?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 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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/profile/profile-loop.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/profile/profile-loop.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/profile/profile-wp.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/profile/profile-wp.php (revision 0)
@@ -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' ); ?>
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/settings.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/settings.php (revision 0)
@@ -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_is_my_profile() ) : ?>
+
+ <?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;;
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/settings/capabilities.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/settings/capabilities.php (revision 0)
@@ -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 -->
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/settings/delete-account.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/settings/delete-account.php (revision 0)
@@ -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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/settings/general.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/settings/general.php (revision 0)
@@ -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
new file mode 100644
---bp-theme-compat/bp-legacy/buddypress/members/single/settings/notifications.php (revision 0)n+++bp-theme-compat/bp-legacy/buddypress/members/single/settings/notifications.php (revision 0)
@@ -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
new file mode 100644
---bp-theme-compat/bp-legacy/css/buddypress.css (revision 0)n+++bp-theme-compat/bp-legacy/css/buddypress.css (revision 0)
@@ -0,0 +1,1350 @@
+/*--------------------------------------------------------------
+Hello, this is the BuddyPress Default theme 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
+--------------------------------------------------------------*/
+
+/*--------------------------------------------------------------
+4.1 - Pagination
+--------------------------------------------------------------*/
+#buddypress div.pagination {
+ background: #f4f4f4;
+ border: none;
+ color: #888;
+ font-size: 11px;
+ margin: -20px 0 20px 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: 12px;
+ padding: 0 5px;
+}
+#buddypress div.pagination .pagination-links a:hover {
+ font-weight: bold;
+}
+#buddypress noscript div.pagination {
+ margin-bottom: 15px;
+}
+#buddypress div#pag-bottom {
+ margin-top: -1px;
+}
+#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 #item-body form#whats-new-form {
+ border-bottom: 1px solid #ddd;
+ margin: 20px 0 10px;
+ padding: 0 0 20px;
+}
+#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 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: 14px;
+ 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;
+}
+#buddypress .activity-list .activity-avatar {
+ float: left;
+}
+#buddypress ul.activity-list > li:first-child {
+ padding-top: 5px;
+}
+#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: 11px;
+ min-height: 35px;
+ padding: 15px 0 0 0;
+ 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: 12px;
+}
+body.activity-permalink #buddypress li.mini .activity-meta {
+ margin-top: 4px;
+}
+#buddypress .activity-list li .activity-inreplyto {
+ color: #888;
+ font-size: 11px;
+ margin-left: 5px;
+ margin-top: 5px;
+ padding-left: 25px;
+}
+#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-left: 70px;
+ margin-bottom: 15px;
+}
+body.activity-permalink #buddypress .activity-list li .activity-content {
+ background: #fff;
+ border-bottom: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ border-radius: 4px;
+ font-size: 16px;
+ line-height: 150%;
+ min-height: 35px;
+ margin-left: 185px;
+ margin-right: 0;
+ padding: 15px;
+}
+body.activity-permalink #buddypress .activity-list li .activity-header > p {
+ height: 35px;
+ margin-bottom: 0;
+ margin-left: -35px;
+ padding: 5px 0 0 35px;
+}
+#buddypress .activity-list .activity-content .activity-header,
+#buddypress .activity-list .activity-content .comment-header {
+ color: #888;
+ font-size: 11px;
+ 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: 11px;
+ 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 !important;
+}
+#buddypress .activity-inner > blockquote {
+ margin: 0 !important;
+}
+#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 !important;
+ border-right: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+ font-size: 1.2em;
+ margin: 15px 0 !important;
+ padding: 10px 15px !important;
+ text-align: center;
+}
+#buddypress .activity-list li.load-more a {
+ color: #4D4D4D;
+}
+
+
+/*--------------------------------------------------------------
+6.1.2 - Activity Comments
+--------------------------------------------------------------*/
+#buddypress div.activity-meta {
+ margin: 18px 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: 11px;
+ 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: 185px;
+ width: auto;
+}
+#buddypress div.activity-comments > ul {
+ background: #f5f5f5;
+ border-radius: 4px;
+ 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;
+}
+#buddypress div.activity-comments ul li {
+ border-top: 2px solid #fff;
+ 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: 2px !important;
+ float: left;
+ height: 25px;
+ margin-right: 10px;
+ width: 25px;
+}
+#buddypress div.activity-comments div.acomment-content {
+ font-size: 11px;
+ 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: 14px;
+}
+#buddypress div.activity-comments div.acomment-meta {
+ color: #888;
+ font-size: 11px;
+}
+#buddypress div.activity-comments form.ac-form {
+ background: #fafafa;
+ border: 1px solid #ddd;
+ border-radius: 4px;
+ display: none;
+ margin: 0 0 15px 33px;
+ padding: 8px;
+}
+#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;
+ color: #555;
+ font-family: inherit;
+ font-size: 11px;
+ height: 60px;
+ padding: 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: 2px solid #fff !important;
+}
+#buddypress div.activity-comments form div.ac-reply-content {
+ color: #888;
+ font-size: 11px;
+ margin-left: 50px;
+ padding-left: 15px;
+}
+#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: 12px;
+ padding: 1px 3px;
+}
+
+/*--------------------------------------------------------------
+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 {
+ font-size: 12px;
+ 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;
+}
+#buddypress ul.button-nav li.current a {
+ font-weight: bold;
+}
+
+
+/*--------------------------------------------------------------
+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: 14px;
+ 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: 14px;
+ 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: 11px;
+ 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;
+ border: 1px solid #e4e4e4;
+ border-radius: 3px;
+ 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 {
+ 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 {
+ padding-right: 25px;
+}
+#buddypress a.loading:hover,
+#buddypress input.loading:hover {
+ padding-right: 25px;
+ 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: 0px -19px 15px;
+ 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: 11px;
+}
+#buddypress div.admin-links {
+ color: #888;
+ font-size: 11px;
+ position: absolute;
+ top: 15px;
+ right: 25px;
+}
+#buddypress div#topic-meta {
+ margin: -10px -19px;
+ padding: 5px 19px 30px;
+ position: relative;
+}
+#buddypress div#topic-meta div.admin-links {
+ right: 19px;
+ top: -36px;
+}
+#buddypress div#topic-meta h3 {
+ font-size: 20px;
+ 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 {
+ margin: 0 -19px;
+ 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: 11px;
+ 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 -19px;
+ width: auto;
+}
+#buddypress table.forum tr.sticky td {
+ font-size: 1.2em;
+ 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: 13px;
+}
+#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: 1.2em;
+}
+#buddypress table.forum td.td-freshness {
+ white-space: nowrap;
+}
+#buddypress table.forum td.td-freshness span.time-since {
+ font-size: 0.9em;
+ 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: 0.9em;
+ 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: 11px;
+ opacity: 0.8;
+ padding: 1px 8px;
+}
+#buddypress span.user-nicename {
+ color: #777;
+ display: inline-block;
+ font-size: 16px;
+ font-weight: bold;
+}
+#buddypress span.activity,
+#buddypress div#message 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 {
+ font-size: 28px;
+ 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 span.activity,
+#buddypress div#item-header h2 span.highlight {
+ font-size: 11px;
+ font-weight: normal;
+ line-height: 170%;
+ margin-bottom: 7px;
+ vertical-align: middle;
+}
+#buddypress div#item-header h2 span.highlight {
+ font-size: 16px;
+}
+#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: 11px;
+ margin-bottom: 2px;
+ padding: 1px 4px;
+ position: relative;
+ right: -2px;
+ top: -2px;
+ vertical-align: middle;
+}
+#buddypress div#item-header div#item-meta {
+ font-size: 14px;
+ 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 {
+ font-size: 12px;
+ 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;
+}
+#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 {
+ width: 100%;
+ list-style: none;
+ clear: both;
+}
+#buddypress ul.item-list li {
+ border-bottom: 1px solid #eaeaea;
+ padding: 15px 0;
+ position: relative;
+ list-style: none;
+}
+#buddypress ul.item-list.activity-list li {
+ padding-bottom: 0;
+}
+#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: 14px;
+ margin: 0;
+ width: 75%;
+}
+#buddypress ul.item-list li div.item-title span {
+ color: #999;
+ font-size: 12px;
+}
+#buddypress ul.item-list li div.item-desc {
+ color: #888;
+ font-size: 11px;
+ margin: 10px 0 0 64px;
+ 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: 11px;
+ margin-top: 10px;
+}
+#buddypress ul.item-list li h5 span.small {
+ float: right;
+ font-size: 11px;
+ font-weight: normal;
+}
+#buddypress div.item-list-tabs {
+ background: #e6e6e6;
+ clear: left;
+ overflow: hidden;
+}
+#buddypress div.item-list-tabs ul li a {
+ text-decoration: none;
+ height: 20px;
+}
+#buddypress div.item-list-tabs ul {
+ margin: 0;
+ width: 100%;
+}
+#buddypress div.item-list-tabs ul li {
+ float: left;
+ margin: 5px 0 0 5px;
+ 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 10px 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 10px;
+ text-decoration: none;
+}
+#buddypress div.item-list-tabs ul li a span {
+ background: #1fb3dd;
+ border-radius: 3px;
+ color: #fff;
+ display: inline;
+ font-size: 90%;
+ margin-left: 2px;
+ padding: 1px 6px;
+}
+#buddypress div.item-list-tabs ul li.selected a,
+#buddypress div.item-list-tabs ul li.current a {
+ background-color: #fff;
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+ color: #555;
+ 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: #999;
+}
+#buddypress div.item-list-tabs ul li.selected a span,
+#buddypress div.item-list-tabs ul li.current a span {
+ background-color: #555;
+}
+#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: #fff;
+ border-bottom: 1px solid #eaeaea;
+ margin: 0 0 20px;
+ overflow: hidden;
+}
+#buddypress #admins-list li,
+#buddypress #mods-list li,
+#buddypress #members-list li {
+ overflow: auto;
+}
+
+
+/*--------------------------------------------------------------
+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: 11px;
+ margin: 0 -19px;
+ padding: 5px 15px;
+ text-align: right;
+}
+#buddypress div#message-thread div.message-box {
+ margin: 0 -19px;
+ 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: 16px;
+ margin: 0;
+}
+#buddypress div#message-thread strong a {
+ text-decoration: none;
+}
+#buddypress div#message-thread strong span.activity {
+ margin: 4px 0 0 10px;
+}
+#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 div.message-search {
+ float: right;
+ margin: 0 20px;
+}
+
+/*--------------------------------------------------------------
+6.9 - 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: .9em;
+}
+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;
+}
\ No newline at end of file
new file mode 100644
---bp-theme-compat/bp-legacy/js/buddypress.js (revision 0)n+++bp-theme-compat/bp-legacy/js/buddypress.js (revision 0)
@@ -0,0 +1,1445 @@
+// 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('textarea#whats-new').length ) {
+ jq('#whats-new-options').animate({
+ height:'40px'
+ });
+ jq("form#whats-new-form textarea").animate({
+ height:'50px'
+ });
+ jq.scrollTo( jq('textarea#whats-new'), 500, {
+ offset:-125,
+ easing:'easeOutQuad'
+ } );
+ jq('textarea#whats-new').focus();
+ }
+
+ /**** Activity Posting ********************************************************/
+
+ /* Textarea focus */
+ jq('#whats-new').focus( function(){
+ jq("#whats-new-options").animate({
+ height:'40px'
+ });
+ jq("form#whats-new-form textarea").animate({
+ height:'50px'
+ });
+ jq("#aw-whats-new-submit").prop("disabled", false);
+ });
+
+ /* New posts */
+ jq("input#aw-whats-new-submit").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("textarea#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("input#_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#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
+ } else {
+ if ( 0 == jq("ul.activity-list").length ) {
+ jq("div.error").slideUp(100).remove();
+ jq("div#message").slideUp(100).remove();
+ jq("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );
+ }
+
+ jq("ul#activity-stream").prepend(response);
+ jq("ul#activity-stream li:first").addClass('new-update');
+
+ if ( 0 != jq("#latest-update").length ) {
+ var l = jq("ul#activity-stream li.new-update .activity-content .activity-inner p").html();
+ var v = jq("ul#activity-stream li.new-update .activity-content .activity-header p a.view").attr('href');
+
+ var ltext = jq("ul#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("textarea#whats-new").val('');
+ }
+
+ jq("#whats-new-options").animate({
+ height:'0px'
+ });
+ jq("form#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').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( 'li#' + 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').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( 100, function() {
+ jq(this).html(response);
+ jq(this).attr('title', 'fav' == type ? BP_DTheme.remove_fav : BP_DTheme.mark_as_fav);
+ jq(this).fadeIn(100);
+ });
+
+ if ( 'fav' == type ) {
+ if ( !jq('.item-list-tabs li#activity-favorites').length )
+ jq('.item-list-tabs ul li#activity-mentions').before( '<li id="activity-favorites"><a href="#">' + BP_DTheme.my_favs + ' <span>0</span></a></li>');
+
+ target.removeClass('fav');
+ target.addClass('unfav');
+
+ jq('.item-list-tabs ul li#activity-favorites span').html( Number( jq('.item-list-tabs ul li#activity-favorites span').html() ) + 1 );
+ } else {
+ target.removeClass('unfav');
+ target.addClass('fav');
+
+ jq('.item-list-tabs ul li#activity-favorites span').html( Number( jq('.item-list-tabs ul li#activity-favorites span').html() ) - 1 );
+
+ if ( !Number( jq('.item-list-tabs ul li#activity-favorites span').html() ) ) {
+ if ( jq('.item-list-tabs ul li#activity-favorites').hasClass('selected') )
+ bp_activity_request( null, null );
+
+ jq('.item-list-tabs ul li#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('div#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( 'div#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("#content 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("#content li.load-more").removeClass('loading');
+ jq.cookie( 'bp-activity-oldestpage', oldest_page, {
+ path: '/'
+ } );
+ jq("#content ul.activity-list").append(response.contents);
+
+ target.parent().hide();
+ }, 'json' );
+
+ return false;
+ }
+ });
+
+ // Activity "Read More" links
+ jq('.activity-read-more a').live('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('li#' + 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').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('.activity-comments li#acomment-' + c_id).append( form );
+ } else {
+ jq('li#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.parent().parent();
+ 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];
+ }
+
+ /* Hide any error messages */
+ jq( 'form#' + form.attr('id') + ' div.error').hide();
+ target.addClass('loading').prop('disabled', true);
+
+ var ajaxdata = {
+ action: 'new_activity_comment',
+ 'cookie': encodeURIComponent(document.cookie),
+ '_wpnonce_new_activity_comment': jq("input#_wpnonce_new_activity_comment").val(),
+ 'comment_id': comment_id,
+ 'form_id': form_id[2],
+ 'content': jq('form#' + form.attr('id') + ' textarea').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');
+
+ /* 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');
+ }
+ );
+ 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;
+ }
+
+ /* 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( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
+ } else {
+ var children = jq( 'li#' + 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('li#' + comment_li.parents('ul#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('ul#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( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
+
+ } else {
+ var children = jq( 'li#' + 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( 'ul#activity-stream > li' );
+ jq( 'li#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html( jq( 'li#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html() - ( 1 + child_count ) );
+ }
+ });
+
+ 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;
+ }
+ });
+
+ /* 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').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').click( function(event) {
+ if ( jq(this).hasClass('no-ajax') )
+ return;
+
+ var target = jq(event.target).parent();
+
+ if ( 'LI' == event.target.parentNode.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('div#content').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').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('input#submit_topic_cancel').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').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("div#invite-list input").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("input#_wpnonce_invite_uninvite_user").val(),
+ 'friend_id': friend_id,
+ 'group_id': jq("input#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 li a.remove").live('click', function() {
+ jq('.ajax-loader').toggle();
+
+ var friend_id = jq(this).attr('id');
+ friend_id = friend_id.split('-');
+ friend_id = friend_id[1];
+
+ jq.post( ajaxurl, {
+ action: 'groups_invite_user',
+ 'friend_action': 'uninvite',
+ 'cookie': encodeURIComponent(document.cookie),
+ '_wpnonce': jq("input#_wpnonce_invite_uninvite_user").val(),
+ 'friend_id': friend_id,
+ 'group_id': jq("input#group_id").val()
+ },
+ function(response)
+ {
+ jq('.ajax-loader').toggle();
+ jq('#friend-list li#uid-' + friend_id).remove();
+ jq('#invite-list input#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("ul#friend-list a.accept, ul#friend-list a.reject").click( function() {
+ var button = jq(this);
+ var li = jq(this).parents('ul#friend-list li');
+ var action_div = jq(this).parents('li div.action');
+
+ var id = li.attr('id').substr( 11, li.attr('id').length );
+ 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('div#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 ).fadeIn(50);
+ jq(this).addClass('accepted');
+ } else {
+ action_div.children('a.accept').hide();
+ jq(this).html( BP_DTheme.rejected ).fadeIn(50);
+ jq(this).addClass('rejected');
+ }
+ });
+ }
+ });
+
+ return false;
+ });
+
+ /* Add / Remove friendship buttons */
+ jq(".friendship-button a").live('click', function() {
+ jq(this).parent().addClass('loading');
+ var fid = jq(this).attr('id');
+ fid = fid.split('-');
+ fid = fid[1];
+
+ var nonce = 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").live('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').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("input#send_reply_button").click(
+ function() {
+ var order = jq('#messages_order').val() || 'ASC',
+ offset = jq('#message-recipients').offset();
+
+ var button = jq("input#send_reply_button");
+ jq(button).addClass('loading');
+
+ jq.post( ajaxurl, {
+ action: 'messages_send_reply',
+ 'cookie': encodeURIComponent(document.cookie),
+ '_wpnonce': jq("input#send_message_nonce").val(),
+
+ 'content': jq("#message_content").val(),
+ 'send_to': jq("input#send_to").val(),
+ 'subject': jq("input#subject").val(),
+ 'thread_id': jq("input#thread_id").val()
+ },
+ function(response)
+ {
+ if ( response[0] + response[1] == "-1" ) {
+ jq('form#send-reply').prepend( response.substr( 2, response.length ) );
+ } else {
+ jq('form#send-reply div#message').remove();
+ jq("#message_content").val('');
+
+ if ( 'ASC' == order ) {
+ jq('form#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("a#mark_as_read, a#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('tr#m-' + jq(this).attr('value')).hasClass(currentClass) ) {
+ checkboxes_tosend += jq(this).attr('value');
+ jq('tr#m-' + jq(this).attr('value')).removeClass(currentClass);
+ jq('tr#m-' + jq(this).attr('value')).addClass(newClass);
+ var thread_count = jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').html();
+
+ jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').html(unreadCount);
+ jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay);
+
+ var inboxcount = jq('tr.unread').length;
+
+ jq('a#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("select#message-type-select").change(
+ function() {
+ var selection = jq("select#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("a#delete_inbox_messages, a#delete_sentbox_messages").click( function() {
+ checkboxes_tosend = '';
+ checkboxes = jq("#message-threads tr td input[type='checkbox']");
+
+ jq('div#message').remove();
+ jq(this).addClass('loading');
+
+ jq(checkboxes).each( function(i) {
+ if( jq(this).is(':checked') )
+ checkboxes_tosend += jq(this).attr('value') + ',';
+ });
+
+ if ( '' == checkboxes_tosend ) {
+ 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('div#message').hide().slideDown(150);
+ jq("a#delete_inbox_messages, a#delete_sentbox_messages").removeClass('loading');
+ });
+ return false;
+ });
+
+ /* Close site wide notices in the sidebar */
+ jq("a#close-notice").click( function() {
+ jq(this).addClass('loading');
+ jq('div#sidebar div.error').remove();
+
+ jq.post( ajaxurl, {
+ action: 'messages_close_notice',
+ 'notice_id': jq('.notice').attr('rel').substr( 2, jq('.notice').attr('rel').length )
+ },
+ function(response) {
+ jq("a#close-notice").removeClass('loading');
+
+ if ( response[0] + response[1] == '-1' ) {
+ jq('.notice').prepend( response.substr( 2, response.length ) );
+ jq( 'div#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').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: '/'
+ } );
+ });
+ });
+});
+
+/* 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('li#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('li#' + objects[i] + '-order-select select').length )
+ jq('li#' + 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('.item-list-tabs li#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#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('.item-list-tabs li#' + object + '-' + scope + ', .item-list-tabs#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('li#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("input#_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('ul#activity-stream > li');
+ var comment_lis = jq(this).children('ul').children('li');
+ var comment_count = ' ';
+
+ if ( jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').length )
+ var comment_count = jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html();
+
+ comment_lis.each( function(i) {
+ /* Show the latest 5 root comments */
+ if ( i < comment_lis.length - 5 ) {
+ 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(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);
+
+/* 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,{}))
deleted file mode 100644
|
+
|
-
|
|
| 1 | | <?php |
| 2 | | |
| 3 | | /** |
| 4 | | * Functions of BuddyPress's Legacy theme |
| 5 | | * |
| 6 | | * @package BuddyPress |
| 7 | | * @subpackage BP_Theme_Compat |
| 8 | | * @since BuddyPress (1.7) |
| 9 | | */ |
| 10 | | |
| 11 | | // Exit if accessed directly |
| 12 | | if ( !defined( 'ABSPATH' ) ) exit; |
| 13 | | |
| 14 | | /** Theme Setup ***************************************************************/ |
| 15 | | |
| 16 | | if ( !class_exists( 'BP_Legacy' ) ) : |
| 17 | | |
| 18 | | /** |
| 19 | | * Loads BuddyPress Legacy Theme functionality |
| 20 | | * |
| 21 | | * This is not a real theme by WordPress standards, and is instead used as the |
| 22 | | * fallback for any WordPress theme that does not have BuddyPress templates in it. |
| 23 | | * |
| 24 | | * To make your custom theme BuddyPress compatible and customize the templates, you |
| 25 | | * can copy these files into your theme without needing to merge anything |
| 26 | | * together; BuddyPress should safely handle the rest. |
| 27 | | * |
| 28 | | * See @link BP_Theme_Compat() for more. |
| 29 | | * |
| 30 | | * @since BuddyPress (1.7) |
| 31 | | * |
| 32 | | * @package BuddyPress |
| 33 | | * @subpackage BP_Theme_Compat |
| 34 | | */ |
| 35 | | class BP_Legacy extends BP_Theme_Compat { |
| 36 | | |
| 37 | | /** Functions *************************************************************/ |
| 38 | | |
| 39 | | /** |
| 40 | | * The main BuddyPress (Legacy) Loader |
| 41 | | * |
| 42 | | * @since BuddyPress (1.7) |
| 43 | | * |
| 44 | | * @uses BP_Legacy::setup_globals() |
| 45 | | * @uses BP_Legacy::setup_actions() |
| 46 | | */ |
| 47 | | public function __construct() { |
| 48 | | |
| 49 | | // Bail if parent/child themes are bp-default |
| 50 | | if ( in_array( 'bp-default', array( get_template(), get_stylesheet() ) ) ) |
| 51 | | return; |
| 52 | | |
| 53 | | $this->setup_globals(); |
| 54 | | $this->setup_actions(); |
| 55 | | } |
| 56 | | |
| 57 | | /** |
| 58 | | * Component global variables |
| 59 | | * |
| 60 | | * Note that this function is currently commented out in the constructor. |
| 61 | | * It will only be used if you copy this file into your current theme and |
| 62 | | * uncomment the line above. |
| 63 | | * |
| 64 | | * You'll want to customize the values in here, so they match whatever your |
| 65 | | * needs are. |
| 66 | | * |
| 67 | | * @since BuddyPress (1.7) |
| 68 | | * @access private |
| 69 | | */ |
| 70 | | private function setup_globals() { |
| 71 | | $bp = buddypress(); |
| 72 | | $this->id = 'legacy'; |
| 73 | | $this->name = __( 'BuddyPress Legacy', 'buddypress' ); |
| 74 | | $this->version = bp_get_version(); |
| 75 | | $this->dir = trailingslashit( $bp->themes_dir . '/bp-legacy' ); |
| 76 | | $this->url = trailingslashit( $bp->themes_url . '/bp-legacy' ); |
| 77 | | } |
| 78 | | |
| 79 | | /** |
| 80 | | * Setup the theme hooks |
| 81 | | * |
| 82 | | * @since BuddyPress (1.7) |
| 83 | | * @access private |
| 84 | | * |
| 85 | | * @uses add_filter() To add various filters |
| 86 | | * @uses add_action() To add various actions |
| 87 | | */ |
| 88 | | private function setup_actions() { |
| 89 | | |
| 90 | | /** Scripts ***********************************************************/ |
| 91 | | |
| 92 | | add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_styles' ) ); // Enqueue theme CSS |
| 93 | | add_action( 'bp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); // Enqueue theme JS |
| 94 | | add_filter( 'bp_enqueue_scripts', array( $this, 'localize_scripts' ) ); // Enqueue theme script localization |
| 95 | | add_action( 'bp_head', array( $this, 'head_scripts' ) ); // Output some extra JS in the <head> |
| 96 | | |
| 97 | | /** Ajax **************************************************************/ |
| 98 | | |
| 99 | | $actions = array( |
| 100 | | |
| 101 | | // Directory filters |
| 102 | | 'blogs_filter' => 'bp_legacy_theme_object_template_loader', |
| 103 | | 'forums_filter' => 'bp_legacy_theme_object_template_loader', |
| 104 | | 'groups_filter' => 'bp_legacy_theme_object_template_loader', |
| 105 | | 'members_filter' => 'bp_legacy_theme_object_template_loader', |
| 106 | | 'messages_filter' => 'bp_legacy_theme_messages_template_loader', |
| 107 | | |
| 108 | | // Friends |
| 109 | | 'accept_friendship' => 'bp_legacy_theme_ajax_accept_friendship', |
| 110 | | 'addremove_friend' => 'bp_legacy_theme_ajax_addremove_friend', |
| 111 | | 'reject_friendship' => 'bp_legacy_theme_ajax_reject_friendship', |
| 112 | | |
| 113 | | // Activity |
| 114 | | 'activity_get_older_updates' => 'bp_legacy_theme_activity_template_loader', |
| 115 | | 'activity_mark_fav' => 'bp_legacy_theme_mark_activity_favorite', |
| 116 | | 'activity_mark_unfav' => 'bp_legacy_theme_unmark_activity_favorite', |
| 117 | | 'activity_widget_filter' => 'bp_legacy_theme_activity_template_loader', |
| 118 | | 'delete_activity' => 'bp_legacy_theme_delete_activity', |
| 119 | | 'delete_activity_comment' => 'bp_legacy_theme_delete_activity_comment', |
| 120 | | 'get_single_activity_content' => 'bp_legacy_theme_get_single_activity_content', |
| 121 | | 'new_activity_comment' => 'bp_legacy_theme_new_activity_comment', |
| 122 | | 'post_update' => 'bp_legacy_theme_post_update', |
| 123 | | 'bp_spam_activity' => 'bp_legacy_theme_spam_activity', |
| 124 | | 'bp_spam_activity_comment' => 'bp_legacy_theme_spam_activity', |
| 125 | | |
| 126 | | // Groups |
| 127 | | 'groups_invite_user' => 'bp_legacy_theme_ajax_invite_user', |
| 128 | | 'joinleave_group' => 'bp_legacy_theme_ajax_joinleave_group', |
| 129 | | |
| 130 | | // Messages |
| 131 | | 'messages_autocomplete_results' => 'bp_legacy_theme_ajax_messages_autocomplete_results', |
| 132 | | 'messages_close_notice' => 'bp_legacy_theme_ajax_close_notice', |
| 133 | | 'messages_delete' => 'bp_legacy_theme_ajax_messages_delete', |
| 134 | | 'messages_markread' => 'bp_legacy_theme_ajax_message_markread', |
| 135 | | 'messages_markunread' => 'bp_legacy_theme_ajax_message_markunread', |
| 136 | | 'messages_send_reply' => 'bp_legacy_theme_ajax_messages_send_reply', |
| 137 | | ); |
| 138 | | |
| 139 | | /** |
| 140 | | * Register all of these AJAX handlers |
| 141 | | * |
| 142 | | * The "wp_ajax_" action is used for logged in users, and "wp_ajax_nopriv_" |
| 143 | | * executes for users that aren't logged in. This is for backpat with BP <1.6. |
| 144 | | */ |
| 145 | | foreach( $actions as $name => $function ) { |
| 146 | | add_action( 'wp_ajax_' . $name, $function ); |
| 147 | | add_action( 'wp_ajax_nopriv_' . $name, $function ); |
| 148 | | } |
| 149 | | |
| 150 | | add_filter( 'bp_ajax_querystring', 'bp_legacy_theme_ajax_querystring', 10, 2 ); |
| 151 | | |
| 152 | | /** Override **********************************************************/ |
| 153 | | |
| 154 | | do_action_ref_array( 'bp_theme_compat_actions', array( &$this ) ); |
| 155 | | } |
| 156 | | |
| 157 | | /** |
| 158 | | * Load the theme CSS |
| 159 | | * |
| 160 | | * @since BuddyPress (1.7) |
| 161 | | * |
| 162 | | * @uses wp_enqueue_style() To enqueue the styles |
| 163 | | */ |
| 164 | | public function enqueue_styles() { |
| 165 | | |
| 166 | | // LTR or RTL |
| 167 | | $file = is_rtl() ? 'css/buddypress-rtl.css' : 'css/buddypress.css'; |
| 168 | | |
| 169 | | // Check child theme |
| 170 | | if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) { |
| 171 | | $location = trailingslashit( get_stylesheet_directory_uri() ); |
| 172 | | $handle = 'bp-child-css'; |
| 173 | | |
| 174 | | // Check parent theme |
| 175 | | } elseif ( file_exists( trailingslashit( get_template_directory() ) . $file ) ) { |
| 176 | | $location = trailingslashit( get_template_directory_uri() ); |
| 177 | | $handle = 'bp-parent-css'; |
| 178 | | |
| 179 | | // BuddyPress Theme Compatibility |
| 180 | | } else { |
| 181 | | $location = trailingslashit( $this->url ); |
| 182 | | $handle = 'bp-legacy-css'; |
| 183 | | } |
| 184 | | |
| 185 | | // Enqueue the BuddyPress styling |
| 186 | | wp_enqueue_style( $handle, $location . $file, array(), $this->version, 'screen' ); |
| 187 | | } |
| 188 | | |
| 189 | | /** |
| 190 | | * Enqueue the required Javascript files |
| 191 | | * |
| 192 | | * @since BuddyPress (1.7) |
| 193 | | */ |
| 194 | | public function enqueue_scripts() { |
| 195 | | |
| 196 | | // LTR or RTL |
| 197 | | $file = 'js/buddypress.js'; |
| 198 | | |
| 199 | | // Check child theme |
| 200 | | if ( file_exists( trailingslashit( get_stylesheet_directory() ) . $file ) ) { |
| 201 | | $location = trailingslashit( get_stylesheet_directory_uri() ); |
| 202 | | $handle = 'bp-child-js'; |
| 203 | | |
| 204 | | // Check parent theme |
| 205 | | } elseif ( file_exists( trailingslashit( get_template_directory() ) . $file ) ) { |
| 206 | | $location = trailingslashit( get_template_directory_uri() ); |
| 207 | | $handle = 'bp-parent-js'; |
| 208 | | |
| 209 | | // BuddyPress Theme Compatibility |
| 210 | | } else { |
| 211 | | $location = trailingslashit( $this->url ); |
| 212 | | $handle = 'bp-legacy-js'; |
| 213 | | } |
| 214 | | |
| 215 | | // Enqueue the global JS - Ajax will not work without it |
| 216 | | wp_enqueue_script( $handle, $location . $file, array( 'jquery' ), $this->version ); |
| 217 | | |
| 218 | | // Add words that we need to use in JS to the end of the page so they can be translated and still used. |
| 219 | | $params = array( |
| 220 | | 'my_favs' => __( 'My Favorites', 'buddypress' ), |
| 221 | | 'accepted' => __( 'Accepted', 'buddypress' ), |
| 222 | | 'rejected' => __( 'Rejected', 'buddypress' ), |
| 223 | | 'show_all_comments' => __( 'Show all comments for this thread', 'buddypress' ), |
| 224 | | 'show_all' => __( 'Show all', 'buddypress' ), |
| 225 | | 'comments' => __( 'comments', 'buddypress' ), |
| 226 | | 'close' => __( 'Close', 'buddypress' ), |
| 227 | | 'view' => __( 'View', 'buddypress' ), |
| 228 | | 'mark_as_fav' => __( 'Favorite', 'buddypress' ), |
| 229 | | 'remove_fav' => __( 'Remove Favorite', 'buddypress' ) |
| 230 | | ); |
| 231 | | wp_localize_script( $handle, 'BP_DTheme', $params ); |
| 232 | | |
| 233 | | // Maybe enqueue comment reply JS |
| 234 | | if ( is_singular() && bp_is_blog_page() && get_option( 'thread_comments' ) ) { |
| 235 | | wp_enqueue_script( 'comment-reply' ); |
| 236 | | } |
| 237 | | } |
| 238 | | |
| 239 | | /** |
| 240 | | * Put some scripts in the header, like AJAX url for wp-lists |
| 241 | | * |
| 242 | | * @since BuddyPress (1.7) |
| 243 | | */ |
| 244 | | public function head_scripts() { |
| 245 | | ?> |
| 246 | | |
| 247 | | <script type="text/javascript" charset="utf-8"> |
| 248 | | /* <![CDATA[ */ |
| 249 | | var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>'; |
| 250 | | /* ]]> */ |
| 251 | | </script> |
| 252 | | |
| 253 | | <?php |
| 254 | | } |
| 255 | | |
| 256 | | /** |
| 257 | | * Load localizations for topic script |
| 258 | | * |
| 259 | | * These localizations require information that may not be loaded even by init. |
| 260 | | * |
| 261 | | * @since BuddyPress (1.7) |
| 262 | | */ |
| 263 | | public function localize_scripts() { |
| 264 | | |
| 265 | | } |
| 266 | | } |
| 267 | | new BP_Legacy(); |
| 268 | | endif; |
| 269 | | |
| 270 | | /** |
| 271 | | * This function looks scarier than it actually is. :) |
| 272 | | * Each object loop (activity/members/groups/blogs/forums) contains default |
| 273 | | * parameters to show specific information based on the page we are currently |
| 274 | | * looking at. |
| 275 | | * |
| 276 | | * The following function will take into account any cookies set in the JS and |
| 277 | | * allow us to override the parameters sent. That way we can change the results |
| 278 | | * returned without reloading the page. |
| 279 | | * |
| 280 | | * By using cookies we can also make sure that user settings are retained |
| 281 | | * across page loads. |
| 282 | | * |
| 283 | | * @return string Query string for the component loops |
| 284 | | * @since BuddyPress (1.2) |
| 285 | | */ |
| 286 | | function bp_legacy_theme_ajax_querystring( $query_string, $object ) { |
| 287 | | if ( empty( $object ) ) |
| 288 | | return ''; |
| 289 | | |
| 290 | | // Set up the cookies passed on this AJAX request. Store a local var to avoid conflicts |
| 291 | | if ( ! empty( $_POST['cookie'] ) ) |
| 292 | | $_BP_COOKIE = wp_parse_args( str_replace( '; ', '&', urldecode( $_POST['cookie'] ) ) ); |
| 293 | | else |
| 294 | | $_BP_COOKIE = &$_COOKIE; |
| 295 | | |
| 296 | | $qs = array(); |
| 297 | | |
| 298 | | /** |
| 299 | | * Check if any cookie values are set. If there are then override the |
| 300 | | * default params passed to the template loop. |
| 301 | | */ |
| 302 | | |
| 303 | | // Activity stream filtering on action |
| 304 | | if ( ! empty( $_BP_COOKIE['bp-' . $object . '-filter'] ) && '-1' != $_BP_COOKIE['bp-' . $object . '-filter'] ) { |
| 305 | | $qs[] = 'type=' . $_BP_COOKIE['bp-' . $object . '-filter']; |
| 306 | | $qs[] = 'action=' . $_BP_COOKIE['bp-' . $object . '-filter']; |
| 307 | | } |
| 308 | | |
| 309 | | if ( ! empty( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) { |
| 310 | | if ( 'personal' == $_BP_COOKIE['bp-' . $object . '-scope'] ) { |
| 311 | | $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id(); |
| 312 | | $qs[] = 'user_id=' . $user_id; |
| 313 | | } |
| 314 | | |
| 315 | | // Activity stream scope only on activity directory. |
| 316 | | if ( 'all' != $_BP_COOKIE['bp-' . $object . '-scope'] && ! bp_displayed_user_id() && ! bp_is_single_item() ) |
| 317 | | $qs[] = 'scope=' . $_BP_COOKIE['bp-' . $object . '-scope']; |
| 318 | | } |
| 319 | | |
| 320 | | // If page and search_terms have been passed via the AJAX post request, use those. |
| 321 | | if ( ! empty( $_POST['page'] ) && '-1' != $_POST['page'] ) |
| 322 | | $qs[] = 'page=' . $_POST['page']; |
| 323 | | |
| 324 | | $object_search_text = bp_get_search_default_text( $object ); |
| 325 | | if ( ! empty( $_POST['search_terms'] ) && $object_search_text != $_POST['search_terms'] && 'false' != $_POST['search_terms'] && 'undefined' != $_POST['search_terms'] ) |
| 326 | | $qs[] = 'search_terms=' . $_POST['search_terms']; |
| 327 | | |
| 328 | | // Now pass the querystring to override default values. |
| 329 | | $query_string = empty( $qs ) ? '' : join( '&', (array) $qs ); |
| 330 | | |
| 331 | | $object_filter = ''; |
| 332 | | if ( isset( $_BP_COOKIE['bp-' . $object . '-filter'] ) ) |
| 333 | | $object_filter = $_BP_COOKIE['bp-' . $object . '-filter']; |
| 334 | | |
| 335 | | $object_scope = ''; |
| 336 | | if ( isset( $_BP_COOKIE['bp-' . $object . '-scope'] ) ) |
| 337 | | $object_scope = $_BP_COOKIE['bp-' . $object . '-scope']; |
| 338 | | |
| 339 | | $object_page = ''; |
| 340 | | if ( isset( $_BP_COOKIE['bp-' . $object . '-page'] ) ) |
| 341 | | $object_page = $_BP_COOKIE['bp-' . $object . '-page']; |
| 342 | | |
| 343 | | $object_search_terms = ''; |
| 344 | | if ( isset( $_BP_COOKIE['bp-' . $object . '-search-terms'] ) ) |
| 345 | | $object_search_terms = $_BP_COOKIE['bp-' . $object . '-search-terms']; |
| 346 | | |
| 347 | | $object_extras = ''; |
| 348 | | if ( isset( $_BP_COOKIE['bp-' . $object . '-extras'] ) ) |
| 349 | | $object_extras = $_BP_COOKIE['bp-' . $object . '-extras']; |
| 350 | | |
| 351 | | return apply_filters( 'bp_legacy_theme_ajax_querystring', $query_string, $object, $object_filter, $object_scope, $object_page, $object_search_terms, $object_extras ); |
| 352 | | } |
| 353 | | |
| 354 | | /** |
| 355 | | * Load the template loop for the current object. |
| 356 | | * |
| 357 | | * @return string Prints template loop for the specified object |
| 358 | | * @since BuddyPress (1.2) |
| 359 | | */ |
| 360 | | function bp_legacy_theme_object_template_loader() { |
| 361 | | // Bail if not a POST action |
| 362 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 363 | | return; |
| 364 | | |
| 365 | | /** |
| 366 | | * AJAX requests happen too early to be seen by bp_update_is_directory() |
| 367 | | * so we do it manually here to ensure templates load with the correct |
| 368 | | * context. Without this check, templates will load the 'single' version |
| 369 | | * of themselves rather than the directory version. |
| 370 | | */ |
| 371 | | |
| 372 | | if ( ! bp_current_action() ) |
| 373 | | bp_update_is_directory( true, bp_current_component() ); |
| 374 | | |
| 375 | | // Sanitize the post object |
| 376 | | $object = esc_attr( $_POST['object'] ); |
| 377 | | |
| 378 | | // Locate the object template |
| 379 | | bp_get_template_part( "$object/$object-loop" ); |
| 380 | | exit(); |
| 381 | | } |
| 382 | | |
| 383 | | /** |
| 384 | | * Load messages template loop when searched on the private message page |
| 385 | | * |
| 386 | | * @return string Prints template loop for the Messages component |
| 387 | | * @since BuddyPress (1.6) |
| 388 | | */ |
| 389 | | function bp_legacy_theme_messages_template_loader() { |
| 390 | | bp_get_template_part( 'members/single/messages/messages-loop' ); |
| 391 | | exit(); |
| 392 | | } |
| 393 | | |
| 394 | | /** |
| 395 | | * Load the activity loop template when activity is requested via AJAX, |
| 396 | | * |
| 397 | | * @return string JSON object containing 'contents' (output of the template loop |
| 398 | | * for the Activity component) and 'feed_url' (URL to the relevant RSS feed). |
| 399 | | * |
| 400 | | * @since BuddyPress (1.2) |
| 401 | | */ |
| 402 | | function bp_legacy_theme_activity_template_loader() { |
| 403 | | // Bail if not a POST action |
| 404 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 405 | | return; |
| 406 | | |
| 407 | | $scope = ''; |
| 408 | | if ( ! empty( $_POST['scope'] ) ) |
| 409 | | $scope = $_POST['scope']; |
| 410 | | |
| 411 | | // We need to calculate and return the feed URL for each scope |
| 412 | | switch ( $scope ) { |
| 413 | | case 'friends': |
| 414 | | $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/friends/feed/'; |
| 415 | | break; |
| 416 | | case 'groups': |
| 417 | | $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/groups/feed/'; |
| 418 | | break; |
| 419 | | case 'favorites': |
| 420 | | $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/feed/'; |
| 421 | | break; |
| 422 | | case 'mentions': |
| 423 | | $feed_url = bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/feed/'; |
| 424 | | bp_activity_clear_new_mentions( bp_loggedin_user_id() ); |
| 425 | | break; |
| 426 | | default: |
| 427 | | $feed_url = home_url( bp_get_activity_root_slug() . '/feed/' ); |
| 428 | | break; |
| 429 | | } |
| 430 | | |
| 431 | | // Buffer the loop in the template to a var for JS to spit out. |
| 432 | | ob_start(); |
| 433 | | bp_get_template_part( 'activity/activity-loop' ); |
| 434 | | $result['contents'] = ob_get_contents(); |
| 435 | | $result['feed_url'] = apply_filters( 'bp_legacy_theme_activity_feed_url', $feed_url, $scope ); |
| 436 | | ob_end_clean(); |
| 437 | | |
| 438 | | exit( json_encode( $result ) ); |
| 439 | | } |
| 440 | | |
| 441 | | /** |
| 442 | | * Processes Activity updates received via a POST request. |
| 443 | | * |
| 444 | | * @return string HTML |
| 445 | | * @since BuddyPress (1.2) |
| 446 | | */ |
| 447 | | function bp_legacy_theme_post_update() { |
| 448 | | // Bail if not a POST action |
| 449 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 450 | | return; |
| 451 | | |
| 452 | | // Check the nonce |
| 453 | | check_admin_referer( 'post_update', '_wpnonce_post_update' ); |
| 454 | | |
| 455 | | if ( ! is_user_logged_in() ) |
| 456 | | exit( '-1' ); |
| 457 | | |
| 458 | | if ( empty( $_POST['content'] ) ) |
| 459 | | exit( '-1<div id="message" class="error"><p>' . __( 'Please enter some content to post.', 'buddypress' ) . '</p></div>' ); |
| 460 | | |
| 461 | | $activity_id = 0; |
| 462 | | if ( empty( $_POST['object'] ) && bp_is_active( 'activity' ) ) { |
| 463 | | $activity_id = bp_activity_post_update( array( 'content' => $_POST['content'] ) ); |
| 464 | | |
| 465 | | } elseif ( $_POST['object'] == 'groups' ) { |
| 466 | | if ( ! empty( $_POST['item_id'] ) && bp_is_active( 'groups' ) ) |
| 467 | | $activity_id = groups_post_update( array( 'content' => $_POST['content'], 'group_id' => $_POST['item_id'] ) ); |
| 468 | | |
| 469 | | } else { |
| 470 | | $activity_id = apply_filters( 'bp_activity_custom_update', $_POST['object'], $_POST['item_id'], $_POST['content'] ); |
| 471 | | } |
| 472 | | |
| 473 | | if ( empty( $activity_id ) ) |
| 474 | | exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem posting your update, please try again.', 'buddypress' ) . '</p></div>' ); |
| 475 | | |
| 476 | | if ( bp_has_activities ( 'include=' . $activity_id ) ) { |
| 477 | | while ( bp_activities() ) { |
| 478 | | bp_the_activity(); |
| 479 | | bp_get_template_part( 'activity/entry' ); |
| 480 | | } |
| 481 | | } |
| 482 | | |
| 483 | | exit; |
| 484 | | } |
| 485 | | |
| 486 | | /** |
| 487 | | * Posts new Activity comments received via a POST request. |
| 488 | | * |
| 489 | | * @global BP_Activity_Template $activities_template |
| 490 | | * @return string HTML |
| 491 | | * @since BuddyPress (1.2) |
| 492 | | */ |
| 493 | | function bp_legacy_theme_new_activity_comment() { |
| 494 | | global $activities_template; |
| 495 | | |
| 496 | | // Bail if not a POST action |
| 497 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 498 | | return; |
| 499 | | |
| 500 | | // Check the nonce |
| 501 | | check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' ); |
| 502 | | |
| 503 | | if ( ! is_user_logged_in() ) |
| 504 | | exit( '-1' ); |
| 505 | | |
| 506 | | if ( empty( $_POST['content'] ) ) |
| 507 | | exit( '-1<div id="message" class="error"><p>' . __( 'Please do not leave the comment area blank.', 'buddypress' ) . '</p></div>' ); |
| 508 | | |
| 509 | | if ( empty( $_POST['form_id'] ) || empty( $_POST['comment_id'] ) || ! is_numeric( $_POST['form_id'] ) || ! is_numeric( $_POST['comment_id'] ) ) |
| 510 | | exit( '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>' ); |
| 511 | | |
| 512 | | $comment_id = bp_activity_new_comment( array( |
| 513 | | 'activity_id' => $_POST['form_id'], |
| 514 | | 'content' => $_POST['content'], |
| 515 | | 'parent_id' => $_POST['comment_id'], |
| 516 | | ) ); |
| 517 | | |
| 518 | | if ( ! $comment_id ) |
| 519 | | exit( '-1<div id="message" class="error"><p>' . __( 'There was an error posting that reply, please try again.', 'buddypress' ) . '</p></div>' ); |
| 520 | | |
| 521 | | // Load the new activity item into the $activities_template global |
| 522 | | bp_has_activities( 'display_comments=stream&hide_spam=false&include=' . $comment_id ); |
| 523 | | |
| 524 | | // Swap the current comment with the activity item we just loaded |
| 525 | | $activities_template->activity->id = $activities_template->activities[0]->item_id; |
| 526 | | $activities_template->activity->current_comment = $activities_template->activities[0]; |
| 527 | | |
| 528 | | $template = bp_locate_template( 'activity/comment.php', false, false ); |
| 529 | | |
| 530 | | /** |
| 531 | | * Backward compatibility. In older versions of BP, the markup was |
| 532 | | * generated in the PHP instead of a template. This ensures that |
| 533 | | * older themes (which are not children of bp-legacy and won't |
| 534 | | * have the new template) will still work. |
| 535 | | */ |
| 536 | | if ( empty( $template ) ) |
| 537 | | $template = BP_PLUGIN_DIR . '/bp-themes/bp-legacy/activity/comment.php'; |
| 538 | | |
| 539 | | bp_get_template_part( $template ); |
| 540 | | |
| 541 | | unset( $activities_template ); |
| 542 | | exit; |
| 543 | | } |
| 544 | | |
| 545 | | /** |
| 546 | | * Deletes an Activity item received via a POST request. |
| 547 | | * |
| 548 | | * @return mixed String on error, void on success |
| 549 | | * @since BuddyPress (1.2) |
| 550 | | */ |
| 551 | | function bp_legacy_theme_delete_activity() { |
| 552 | | // Bail if not a POST action |
| 553 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 554 | | return; |
| 555 | | |
| 556 | | // Check the nonce |
| 557 | | check_admin_referer( 'bp_activity_delete_link' ); |
| 558 | | |
| 559 | | if ( ! is_user_logged_in() ) |
| 560 | | exit( '-1' ); |
| 561 | | |
| 562 | | if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) ) |
| 563 | | exit( '-1' ); |
| 564 | | |
| 565 | | $activity = new BP_Activity_Activity( (int) $_POST['id'] ); |
| 566 | | |
| 567 | | // Check access |
| 568 | | if ( empty( $activity->user_id ) || ! bp_activity_user_can_delete( $activity ) ) |
| 569 | | exit( '-1' ); |
| 570 | | |
| 571 | | // Call the action before the delete so plugins can still fetch information about it |
| 572 | | do_action( 'bp_activity_before_action_delete_activity', $activity->id, $activity->user_id ); |
| 573 | | |
| 574 | | if ( ! bp_activity_delete( array( 'id' => $activity->id, 'user_id' => $activity->user_id ) ) ) |
| 575 | | exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' ); |
| 576 | | |
| 577 | | do_action( 'bp_activity_action_delete_activity', $activity->id, $activity->user_id ); |
| 578 | | exit; |
| 579 | | } |
| 580 | | |
| 581 | | /** |
| 582 | | * Deletes an Activity comment received via a POST request |
| 583 | | * |
| 584 | | * @return mixed String on error, void on success |
| 585 | | * @since BuddyPress (1.2) |
| 586 | | */ |
| 587 | | function bp_legacy_theme_delete_activity_comment() { |
| 588 | | // Bail if not a POST action |
| 589 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 590 | | return; |
| 591 | | |
| 592 | | // Check the nonce |
| 593 | | check_admin_referer( 'bp_activity_delete_link' ); |
| 594 | | |
| 595 | | if ( ! is_user_logged_in() ) |
| 596 | | exit( '-1' ); |
| 597 | | |
| 598 | | $comment = new BP_Activity_Activity( $_POST['id'] ); |
| 599 | | |
| 600 | | // Check access |
| 601 | | if ( ! bp_current_user_can( 'bp_moderate' ) && $comment->user_id != bp_loggedin_user_id() ) |
| 602 | | exit( '-1' ); |
| 603 | | |
| 604 | | if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) ) |
| 605 | | exit( '-1' ); |
| 606 | | |
| 607 | | // Call the action before the delete so plugins can still fetch information about it |
| 608 | | do_action( 'bp_activity_before_action_delete_activity', $_POST['id'], $comment->user_id ); |
| 609 | | |
| 610 | | if ( ! bp_activity_delete_comment( $comment->item_id, $comment->id ) ) |
| 611 | | exit( '-1<div id="message" class="error"><p>' . __( 'There was a problem when deleting. Please try again.', 'buddypress' ) . '</p></div>' ); |
| 612 | | |
| 613 | | do_action( 'bp_activity_action_delete_activity', $_POST['id'], $comment->user_id ); |
| 614 | | exit; |
| 615 | | } |
| 616 | | |
| 617 | | /** |
| 618 | | * AJAX spam an activity item or comment |
| 619 | | * |
| 620 | | * @global BuddyPress $bp The one true BuddyPress instance |
| 621 | | * @return mixed String on error, void on success |
| 622 | | * @since BuddyPress (1.6) |
| 623 | | */ |
| 624 | | function bp_legacy_theme_spam_activity() { |
| 625 | | global $bp; |
| 626 | | |
| 627 | | // Bail if not a POST action |
| 628 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 629 | | return; |
| 630 | | |
| 631 | | // Check that user is logged in, Activity Streams are enabled, and Akismet is present. |
| 632 | | if ( ! is_user_logged_in() || ! bp_is_active( 'activity' ) || empty( $bp->activity->akismet ) ) |
| 633 | | exit( '-1' ); |
| 634 | | |
| 635 | | // Check an item ID was passed |
| 636 | | if ( empty( $_POST['id'] ) || ! is_numeric( $_POST['id'] ) ) |
| 637 | | exit( '-1' ); |
| 638 | | |
| 639 | | // Is the current user allowed to spam items? |
| 640 | | if ( ! bp_activity_user_can_mark_spam() ) |
| 641 | | exit( '-1' ); |
| 642 | | |
| 643 | | // Load up the activity item |
| 644 | | $activity = new BP_Activity_Activity( (int) $_POST['id'] ); |
| 645 | | if ( empty( $activity->component ) ) |
| 646 | | exit( '-1' ); |
| 647 | | |
| 648 | | // Check nonce |
| 649 | | check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id ); |
| 650 | | |
| 651 | | // Call an action before the spamming so plugins can modify things if they want to |
| 652 | | do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity ); |
| 653 | | |
| 654 | | // Mark as spam |
| 655 | | bp_activity_mark_as_spam( $activity ); |
| 656 | | $activity->save(); |
| 657 | | |
| 658 | | do_action( 'bp_activity_action_spam_activity', $activity->id, $activity->user_id ); |
| 659 | | exit; |
| 660 | | } |
| 661 | | |
| 662 | | /** |
| 663 | | * Mark an activity as a favourite via a POST request. |
| 664 | | * |
| 665 | | * @return string HTML |
| 666 | | * @since BuddyPress (1.2) |
| 667 | | */ |
| 668 | | function bp_legacy_theme_mark_activity_favorite() { |
| 669 | | // Bail if not a POST action |
| 670 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 671 | | return; |
| 672 | | |
| 673 | | if ( bp_activity_add_user_favorite( $_POST['id'] ) ) |
| 674 | | _e( 'Remove Favorite', 'buddypress' ); |
| 675 | | else |
| 676 | | _e( 'Favorite', 'buddypress' ); |
| 677 | | |
| 678 | | exit; |
| 679 | | } |
| 680 | | |
| 681 | | /** |
| 682 | | * Un-favourite an activity via a POST request. |
| 683 | | * |
| 684 | | * @return string HTML |
| 685 | | * @since BuddyPress (1.2) |
| 686 | | */ |
| 687 | | function bp_legacy_theme_unmark_activity_favorite() { |
| 688 | | // Bail if not a POST action |
| 689 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 690 | | return; |
| 691 | | |
| 692 | | if ( bp_activity_remove_user_favorite( $_POST['id'] ) ) |
| 693 | | _e( 'Favorite', 'buddypress' ); |
| 694 | | else |
| 695 | | _e( 'Remove Favorite', 'buddypress' ); |
| 696 | | |
| 697 | | exit; |
| 698 | | } |
| 699 | | |
| 700 | | /** |
| 701 | | * Fetches full an activity's full, non-excerpted content via a POST request. |
| 702 | | * Used for the 'Read More' link on long activity items. |
| 703 | | * |
| 704 | | * @return string HTML |
| 705 | | * @since BuddyPress (1.5) |
| 706 | | */ |
| 707 | | function bp_legacy_theme_get_single_activity_content() { |
| 708 | | // Bail if not a POST action |
| 709 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 710 | | return; |
| 711 | | |
| 712 | | $activity_array = bp_activity_get_specific( array( |
| 713 | | 'activity_ids' => $_POST['activity_id'], |
| 714 | | 'display_comments' => 'stream' |
| 715 | | ) ); |
| 716 | | |
| 717 | | $activity = ! empty( $activity_array['activities'][0] ) ? $activity_array['activities'][0] : false; |
| 718 | | |
| 719 | | if ( empty( $activity ) ) |
| 720 | | exit; // @todo: error? |
| 721 | | |
| 722 | | do_action_ref_array( 'bp_legacy_theme_get_single_activity_content', array( &$activity ) ); |
| 723 | | |
| 724 | | // Activity content retrieved through AJAX should run through normal filters, but not be truncated |
| 725 | | remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 ); |
| 726 | | $content = apply_filters( 'bp_get_activity_content_body', $activity->content ); |
| 727 | | |
| 728 | | exit( $content ); |
| 729 | | } |
| 730 | | |
| 731 | | /** |
| 732 | | * Invites a friend to join a group via a POST request. |
| 733 | | * |
| 734 | | * @return unknown |
| 735 | | * @since BuddyPress (1.2) |
| 736 | | * @todo Audit return types |
| 737 | | */ |
| 738 | | function bp_legacy_theme_ajax_invite_user() { |
| 739 | | // Bail if not a POST action |
| 740 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 741 | | return; |
| 742 | | |
| 743 | | check_ajax_referer( 'groups_invite_uninvite_user' ); |
| 744 | | |
| 745 | | if ( ! $_POST['friend_id'] || ! $_POST['friend_action'] || ! $_POST['group_id'] ) |
| 746 | | return; |
| 747 | | |
| 748 | | if ( ! bp_groups_user_can_send_invites( $_POST['group_id'] ) ) |
| 749 | | return; |
| 750 | | |
| 751 | | if ( ! friends_check_friendship( bp_loggedin_user_id(), $_POST['friend_id'] ) ) |
| 752 | | return; |
| 753 | | |
| 754 | | if ( 'invite' == $_POST['friend_action'] ) { |
| 755 | | if ( ! groups_invite_user( array( 'user_id' => $_POST['friend_id'], 'group_id' => $_POST['group_id'] ) ) ) |
| 756 | | return; |
| 757 | | |
| 758 | | $user = new BP_Core_User( $_POST['friend_id'] ); |
| 759 | | |
| 760 | | echo '<li id="uid-' . $user->id . '">'; |
| 761 | | echo $user->avatar_thumb; |
| 762 | | echo '<h4>' . $user->user_link . '</h4>'; |
| 763 | | echo '<span class="activity">' . esc_attr( $user->last_active ) . '</span>'; |
| 764 | | echo '<div class="action"> |
| 765 | | <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> |
| 766 | | </div>'; |
| 767 | | echo '</li>'; |
| 768 | | exit; |
| 769 | | |
| 770 | | } elseif ( 'uninvite' == $_POST['friend_action'] ) { |
| 771 | | if ( ! groups_uninvite_user( $_POST['friend_id'], $_POST['group_id'] ) ) |
| 772 | | return; |
| 773 | | |
| 774 | | exit; |
| 775 | | |
| 776 | | } else { |
| 777 | | return; |
| 778 | | } |
| 779 | | } |
| 780 | | |
| 781 | | /** |
| 782 | | * Friend/un-friend a user via a POST request. |
| 783 | | * |
| 784 | | * @return string HTML |
| 785 | | * @since BuddyPress (1.2) |
| 786 | | */ |
| 787 | | function bp_legacy_theme_ajax_addremove_friend() { |
| 788 | | // Bail if not a POST action |
| 789 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 790 | | return; |
| 791 | | |
| 792 | | if ( 'is_friend' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) { |
| 793 | | check_ajax_referer( 'friends_remove_friend' ); |
| 794 | | |
| 795 | | if ( ! friends_remove_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) |
| 796 | | echo __( 'Friendship could not be canceled.', 'buddypress' ); |
| 797 | | else |
| 798 | | 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>'; |
| 799 | | |
| 800 | | } elseif ( 'not_friends' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) { |
| 801 | | check_ajax_referer( 'friends_add_friend' ); |
| 802 | | |
| 803 | | if ( ! friends_add_friend( bp_loggedin_user_id(), $_POST['fid'] ) ) |
| 804 | | echo __(' Friendship could not be requested.', 'buddypress' ); |
| 805 | | else |
| 806 | | 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>'; |
| 807 | | |
| 808 | | } elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), (int) $_POST['fid'] ) ) { |
| 809 | | check_ajax_referer( 'friends_withdraw_friendship' ); |
| 810 | | |
| 811 | | if ( friends_withdraw_friendship( bp_loggedin_user_id(), (int) $_POST['fid'] ) ) |
| 812 | | 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>'; |
| 813 | | else |
| 814 | | echo __("Friendship request could not be cancelled.", 'buddypress'); |
| 815 | | |
| 816 | | } else { |
| 817 | | echo __( 'Request Pending', 'buddypress' ); |
| 818 | | } |
| 819 | | |
| 820 | | exit; |
| 821 | | } |
| 822 | | |
| 823 | | /** |
| 824 | | * Accept a user friendship request via a POST request. |
| 825 | | * |
| 826 | | * @return mixed String on error, void on success |
| 827 | | * @since BuddyPress (1.2) |
| 828 | | */ |
| 829 | | function bp_legacy_theme_ajax_accept_friendship() { |
| 830 | | // Bail if not a POST action |
| 831 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 832 | | return; |
| 833 | | |
| 834 | | check_admin_referer( 'friends_accept_friendship' ); |
| 835 | | |
| 836 | | if ( ! friends_accept_friendship( $_POST['id'] ) ) |
| 837 | | echo "-1<div id='message' class='error'><p>" . __( 'There was a problem accepting that request. Please try again.', 'buddypress' ) . '</p></div>'; |
| 838 | | |
| 839 | | exit; |
| 840 | | } |
| 841 | | |
| 842 | | /** |
| 843 | | * Reject a user friendship request via a POST request. |
| 844 | | * |
| 845 | | * @return mixed String on error, void on success |
| 846 | | * @since BuddyPress (1.2) |
| 847 | | */ |
| 848 | | function bp_legacy_theme_ajax_reject_friendship() { |
| 849 | | // Bail if not a POST action |
| 850 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 851 | | return; |
| 852 | | |
| 853 | | check_admin_referer( 'friends_reject_friendship' ); |
| 854 | | |
| 855 | | if ( ! friends_reject_friendship( $_POST['id'] ) ) |
| 856 | | echo "-1<div id='message' class='error'><p>" . __( 'There was a problem rejecting that request. Please try again.', 'buddypress' ) . '</p></div>'; |
| 857 | | |
| 858 | | exit; |
| 859 | | } |
| 860 | | |
| 861 | | /** |
| 862 | | * Join or leave a group when clicking the "join/leave" button via a POST request. |
| 863 | | * |
| 864 | | * @return string HTML |
| 865 | | * @since BuddyPress (1.2) |
| 866 | | */ |
| 867 | | function bp_legacy_theme_ajax_joinleave_group() { |
| 868 | | // Bail if not a POST action |
| 869 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 870 | | return; |
| 871 | | |
| 872 | | if ( groups_is_user_banned( bp_loggedin_user_id(), $_POST['gid'] ) ) |
| 873 | | return; |
| 874 | | |
| 875 | | if ( ! $group = groups_get_group( array( 'group_id' => $_POST['gid'] ) ) ) |
| 876 | | return; |
| 877 | | |
| 878 | | if ( ! groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) { |
| 879 | | if ( 'public' == $group->status ) { |
| 880 | | check_ajax_referer( 'groups_join_group' ); |
| 881 | | |
| 882 | | if ( ! groups_join_group( $group->id ) ) |
| 883 | | _e( 'Error joining group', 'buddypress' ); |
| 884 | | else |
| 885 | | 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>'; |
| 886 | | |
| 887 | | } elseif ( 'private' == $group->status ) { |
| 888 | | check_ajax_referer( 'groups_request_membership' ); |
| 889 | | |
| 890 | | if ( ! groups_send_membership_request( bp_loggedin_user_id(), $group->id ) ) |
| 891 | | _e( 'Error requesting membership', 'buddypress' ); |
| 892 | | else |
| 893 | | 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>'; |
| 894 | | } |
| 895 | | |
| 896 | | } else { |
| 897 | | check_ajax_referer( 'groups_leave_group' ); |
| 898 | | |
| 899 | | if ( ! groups_leave_group( $group->id ) ) |
| 900 | | _e( 'Error leaving group', 'buddypress' ); |
| 901 | | elseif ( 'public' == $group->status ) |
| 902 | | 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>'; |
| 903 | | elseif ( 'private' == $group->status ) |
| 904 | | 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>'; |
| 905 | | } |
| 906 | | |
| 907 | | exit; |
| 908 | | } |
| 909 | | |
| 910 | | /** |
| 911 | | * Close and keep closed site wide notices from an admin in the sidebar, via a POST request. |
| 912 | | * |
| 913 | | * @return mixed String on error, void on success |
| 914 | | * @since BuddyPress (1.2) |
| 915 | | */ |
| 916 | | function bp_legacy_theme_ajax_close_notice() { |
| 917 | | // Bail if not a POST action |
| 918 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 919 | | return; |
| 920 | | |
| 921 | | if ( ! isset( $_POST['notice_id'] ) ) { |
| 922 | | echo "-1<div id='message' class='error'><p>" . __( 'There was a problem closing the notice.', 'buddypress' ) . '</p></div>'; |
| 923 | | |
| 924 | | } else { |
| 925 | | $user_id = get_current_user_id(); |
| 926 | | $notice_ids = bp_get_user_meta( $user_id, 'closed_notices', true ); |
| 927 | | $notice_ids[] = (int) $_POST['notice_id']; |
| 928 | | |
| 929 | | bp_update_user_meta( $user_id, 'closed_notices', $notice_ids ); |
| 930 | | } |
| 931 | | |
| 932 | | exit; |
| 933 | | } |
| 934 | | |
| 935 | | /** |
| 936 | | * Send a private message reply to a thread via a POST request. |
| 937 | | * |
| 938 | | * @return string HTML |
| 939 | | * @since BuddyPress (1.2) |
| 940 | | */ |
| 941 | | function bp_legacy_theme_ajax_messages_send_reply() { |
| 942 | | // Bail if not a POST action |
| 943 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 944 | | return; |
| 945 | | |
| 946 | | check_ajax_referer( 'messages_send_message' ); |
| 947 | | |
| 948 | | $result = messages_new_message( array( 'thread_id' => $_REQUEST['thread_id'], 'content' => $_REQUEST['content'] ) ); |
| 949 | | |
| 950 | | if ( $result ) { ?> |
| 951 | | <div class="message-box new-message"> |
| 952 | | <div class="message-metadata"> |
| 953 | | <?php do_action( 'bp_before_message_meta' ); ?> |
| 954 | | <?php echo bp_loggedin_user_avatar( 'type=thumb&width=30&height=30' ); ?> |
| 955 | | |
| 956 | | <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> |
| 957 | | |
| 958 | | <?php do_action( 'bp_after_message_meta' ); ?> |
| 959 | | </div> |
| 960 | | |
| 961 | | <?php do_action( 'bp_before_message_content' ); ?> |
| 962 | | |
| 963 | | <div class="message-content"> |
| 964 | | <?php echo stripslashes( apply_filters( 'bp_get_the_thread_message_content', $_REQUEST['content'] ) ); ?> |
| 965 | | </div> |
| 966 | | |
| 967 | | <?php do_action( 'bp_after_message_content' ); ?> |
| 968 | | |
| 969 | | <div class="clear"></div> |
| 970 | | </div> |
| 971 | | <?php |
| 972 | | } else { |
| 973 | | echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'buddypress' ) . '</p></div>'; |
| 974 | | } |
| 975 | | |
| 976 | | exit; |
| 977 | | } |
| 978 | | |
| 979 | | /** |
| 980 | | * Mark a private message as unread in your inbox via a POST request. |
| 981 | | * |
| 982 | | * @return mixed String on error, void on success |
| 983 | | * @since BuddyPress (1.2) |
| 984 | | */ |
| 985 | | function bp_legacy_theme_ajax_message_markunread() { |
| 986 | | // Bail if not a POST action |
| 987 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 988 | | return; |
| 989 | | |
| 990 | | if ( ! isset($_POST['thread_ids']) ) { |
| 991 | | echo "-1<div id='message' class='error'><p>" . __( 'There was a problem marking messages as unread.', 'buddypress' ) . '</p></div>'; |
| 992 | | |
| 993 | | } else { |
| 994 | | $thread_ids = explode( ',', $_POST['thread_ids'] ); |
| 995 | | |
| 996 | | for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { |
| 997 | | BP_Messages_Thread::mark_as_unread($thread_ids[$i]); |
| 998 | | } |
| 999 | | } |
| 1000 | | |
| 1001 | | exit; |
| 1002 | | } |
| 1003 | | |
| 1004 | | /** |
| 1005 | | * Mark a private message as read in your inbox via a POST request. |
| 1006 | | * |
| 1007 | | * @return mixed String on error, void on success |
| 1008 | | * @since BuddyPress (1.2) |
| 1009 | | */ |
| 1010 | | function bp_legacy_theme_ajax_message_markread() { |
| 1011 | | // Bail if not a POST action |
| 1012 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 1013 | | return; |
| 1014 | | |
| 1015 | | if ( ! isset($_POST['thread_ids']) ) { |
| 1016 | | echo "-1<div id='message' class='error'><p>" . __('There was a problem marking messages as read.', 'buddypress' ) . '</p></div>'; |
| 1017 | | |
| 1018 | | } else { |
| 1019 | | $thread_ids = explode( ',', $_POST['thread_ids'] ); |
| 1020 | | |
| 1021 | | for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) { |
| 1022 | | BP_Messages_Thread::mark_as_read($thread_ids[$i]); |
| 1023 | | } |
| 1024 | | } |
| 1025 | | |
| 1026 | | exit; |
| 1027 | | } |
| 1028 | | |
| 1029 | | /** |
| 1030 | | * Delete a private message(s) in your inbox via a POST request. |
| 1031 | | * |
| 1032 | | * @return string HTML |
| 1033 | | * @since BuddyPress (1.2) |
| 1034 | | */ |
| 1035 | | function bp_legacy_theme_ajax_messages_delete() { |
| 1036 | | // Bail if not a POST action |
| 1037 | | if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) |
| 1038 | | return; |
| 1039 | | |
| 1040 | | if ( ! isset($_POST['thread_ids']) ) { |
| 1041 | | echo "-1<div id='message' class='error'><p>" . __( 'There was a problem deleting messages.', 'buddypress' ) . '</p></div>'; |
| 1042 | | |
| 1043 | | } else { |
| 1044 | | $thread_ids = explode( ',', $_POST['thread_ids'] ); |
| 1045 | | |
| 1046 | | for ( $i = 0, $count = count( $thread_ids ); $i < $count; ++$i ) |
| 1047 | | BP_Messages_Thread::delete($thread_ids[$i]); |
| 1048 | | |
| 1049 | | _e( 'Messages deleted.', 'buddypress' ); |
| 1050 | | } |
| 1051 | | |
| 1052 | | exit; |
| 1053 | | } |
| 1054 | | |
| 1055 | | /** |
| 1056 | | * AJAX handler for autocomplete. Displays friends only, unless BP_MESSAGES_AUTOCOMPLETE_ALL is defined. |
| 1057 | | * |
| 1058 | | * @global BuddyPress $bp The one true BuddyPress instance |
| 1059 | | * @return string HTML |
| 1060 | | * @since BuddyPress (1.2) |
| 1061 | | */ |
| 1062 | | function bp_legacy_theme_ajax_messages_autocomplete_results() { |
| 1063 | | global $bp; |
| 1064 | | |
| 1065 | | // Include everyone in the autocomplete, or just friends? |
| 1066 | | if ( bp_is_current_component( bp_get_messages_slug() ) ) |
| 1067 | | $autocomplete_all = $bp->messages->autocomplete_all; |
| 1068 | | |
| 1069 | | $pag_page = 1; |
| 1070 | | $limit = $_GET['limit'] ? $_GET['limit'] : apply_filters( 'bp_autocomplete_max_results', 10 ); |
| 1071 | | |
| 1072 | | // Get the user ids based on the search terms |
| 1073 | | if ( ! empty( $autocomplete_all ) ) { |
| 1074 | | $users = BP_Core_User::search_users( $_GET['q'], $limit, $pag_page ); |
| 1075 | | |
| 1076 | | if ( ! empty( $users['users'] ) ) { |
| 1077 | | // Build an array with the correct format |
| 1078 | | $user_ids = array(); |
| 1079 | | foreach( $users['users'] as $user ) { |
| 1080 | | if ( $user->id != bp_loggedin_user_id() ) |
| 1081 | | $user_ids[] = $user->id; |
| 1082 | | } |
| 1083 | | |
| 1084 | | $user_ids = apply_filters( 'bp_core_autocomplete_ids', $user_ids, $_GET['q'], $limit ); |
| 1085 | | } |
| 1086 | | |
| 1087 | | } else { |
| 1088 | | if ( bp_is_active( 'friends' ) ) { |
| 1089 | | $users = friends_search_friends( $_GET['q'], bp_loggedin_user_id(), $limit, 1 ); |
| 1090 | | |
| 1091 | | // Keeping the bp_friends_autocomplete_list filter for backward compatibility |
| 1092 | | $users = apply_filters( 'bp_friends_autocomplete_list', $users, $_GET['q'], $limit ); |
| 1093 | | |
| 1094 | | if ( ! empty( $users['friends'] ) ) |
| 1095 | | $user_ids = apply_filters( 'bp_friends_autocomplete_ids', $users['friends'], $_GET['q'], $limit ); |
| 1096 | | } |
| 1097 | | } |
| 1098 | | |
| 1099 | | if ( ! empty( $user_ids ) ) { |
| 1100 | | foreach ( $user_ids as $user_id ) { |
| 1101 | | $ud = get_userdata( $user_id ); |
| 1102 | | if ( ! $ud ) |
| 1103 | | continue; |
| 1104 | | |
| 1105 | | if ( bp_is_username_compatibility_mode() ) |
| 1106 | | $username = $ud->user_login; |
| 1107 | | else |
| 1108 | | $username = $ud->user_nicename; |
| 1109 | | |
| 1110 | | // Note that the final line break acts as a delimiter for the |
| 1111 | | // autocomplete javascript and thus should not be removed |
| 1112 | | 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"; |
| 1113 | | } |
| 1114 | | } |
| 1115 | | |
| 1116 | | exit; |
| 1117 | | } |