Skip to:
Content

BuddyPress.org

Ticket #3741: 3741.4.patch

File 3741.4.patch, 364.9 KB (added by johnjamesjacoby, 14 years ago)

Fourth Pass - Bring over dtheme ajax; fix bp-default compatibility

  • bp-activity/bp-activity-screens.php

     
    303303}
    304304add_action( 'bp_notification_settings', 'bp_activity_screen_notification_settings', 1 );
    305305
    306 ?>
     306/** Theme Compatability *******************************************************/
     307
     308/**
     309 * The main theme compat class for BuddyPress Activity
     310 *
     311 * This class sets up the necessary theme compatability actions to safely output
     312 * group template parts to the_title and the_content areas of a theme.
     313 *
     314 * @since BuddyPress (1.7)
     315 */
     316class BP_Activity_Theme_Compat {
     317
     318        /**
     319         * Setup the activity component theme compatibility
     320         *
     321         * @since BuddyPress (1.7)
     322         */
     323        public function __construct() {
     324                add_action( 'bp_setup_theme_compat', array( $this, 'is_activity' ) );
     325        }
     326
     327        /**
     328         * Are we looking at something that needs activity theme compatability?
     329         *
     330         * @since BuddyPress (1.7)
     331         */
     332        public function is_activity() {
     333
     334                // Bail if not looking at a group
     335                if ( ! bp_is_activity_component() )
     336                        return;
     337
     338                // Activity Directory
     339                if ( ! bp_displayed_user_id() && ! bp_current_action() ) {
     340                        bp_update_is_directory( true, 'activity' );
     341
     342                        do_action( 'bp_activity_screen_index' );
     343
     344                        add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
     345                        add_filter( 'bp_replace_the_content',                    array( $this, 'directory_content'    ) );
     346                }
     347        }
     348
     349        /** Directory *************************************************************/
     350
     351        /**
     352         * Update the global $post with directory data
     353         *
     354         * @since BuddyPress (1.7)
     355         */
     356        public function directory_dummy_post() {
     357                bp_theme_compat_reset_post( array(
     358                        'ID'             => 0,
     359                        'post_title'     => __( 'Sitewide Activity', 'buddypress' ),
     360                        'post_author'    => 0,
     361                        'post_date'      => 0,
     362                        'post_content'   => '',
     363                        'post_type'      => 'bp_activity',
     364                        'post_status'    => 'publish',
     365                        'is_archive'     => true,
     366                        'comment_status' => 'closed'
     367                ) );
     368        }
     369
     370        /**
     371         * Filter the_content with the groups index template part
     372         *
     373         * @since BuddyPress (1.7)
     374         */
     375        public function directory_content() {
     376                bp_buffer_template_part( 'activity/index' );
     377        }
     378}
     379new BP_Activity_Theme_Compat();
  • bp-blogs/bp-blogs-screens.php

     
    2020}
    2121
    2222function bp_blogs_screen_create_a_blog() {
     23
    2324        if ( !is_multisite() ||  !bp_is_blogs_component() || !bp_is_current_action( 'create' ) )
    2425                return false;
    2526
     
    4344}
    4445add_action( 'bp_screens', 'bp_blogs_screen_index', 2 );
    4546
    46 ?>
     47/** Theme Compatability *******************************************************/
     48
     49/**
     50 * The main theme compat class for BuddyPress Activity
     51 *
     52 * This class sets up the necessary theme compatability actions to safely output
     53 * group template parts to the_title and the_content areas of a theme.
     54 *
     55 * @since BuddyPress (1.7)
     56 */
     57class BP_Blogs_Theme_Compat {
     58
     59        /**
     60         * Setup the groups component theme compatibility
     61         *
     62         * @since BuddyPress (1.7)
     63         */
     64        public function __construct() {
     65                add_action( 'bp_setup_theme_compat', array( $this, 'is_blogs' ) );
     66        }
     67
     68        /**
     69         * Are we looking at something that needs group theme compatability?
     70         *
     71         * @since BuddyPress (1.7)
     72         */
     73        public function is_blogs() {
     74
     75                // Bail if not looking at a group
     76                if ( ! bp_is_blogs_component() )
     77                        return;
     78
     79                // Blog Directory
     80                if ( is_multisite() && ! bp_current_action() ) {
     81                        bp_update_is_directory( true, 'blogs' );
     82
     83                        do_action( 'bp_blogs_screen_index' );
     84
     85                        add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
     86                        add_filter( 'bp_replace_the_content',                    array( $this, 'directory_content'    ) );
     87
     88                // Create blog
     89                } elseif ( is_user_logged_in() && bp_blog_signup_enabled() ) {
     90                        add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) );
     91                        add_filter( 'bp_replace_the_content',                    array( $this, 'create_content'    ) );                 
     92                }
     93        }
     94
     95        /** Directory *************************************************************/
     96
     97        /**
     98         * Update the global $post with directory data
     99         *
     100         * @since BuddyPress (1.7)
     101         */
     102        public function directory_dummy_post() {
     103
     104                // Title based on ability to create blogs
     105                if ( is_user_logged_in() && bp_blog_signup_enabled() ) {
     106                        $title = __( 'Blogs', 'buddypress' ) . '&nbsp;<a class="button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create' ) . '">' . __( 'Create a Blog', 'buddypress' ) . '</a>';
     107                } else {
     108                        $title = __( 'Blogs', 'buddypress' );
     109                }
     110
     111                bp_theme_compat_reset_post( array(
     112                        'ID'             => 0,
     113                        'post_title'     => $title,
     114                        'post_author'    => 0,
     115                        'post_date'      => 0,
     116                        'post_content'   => '',
     117                        'post_type'      => 'bp_blogs',
     118                        'post_status'    => 'publish',
     119                        'is_archive'     => true,
     120                        'comment_status' => 'closed'
     121                ) );
     122        }
     123
     124        /**
     125         * Filter the_content with the groups index template part
     126         *
     127         * @since BuddyPress (1.7)
     128         */
     129        public function directory_content() {
     130                bp_buffer_template_part( 'blogs/index' );
     131        }
     132       
     133        /** Create ****************************************************************/
     134
     135        /**
     136         * Update the global $post with create screen data
     137         *
     138         * @since BuddyPress (1.7)
     139         */
     140        public function create_dummy_post() {
     141
     142                // Title based on ability to create blogs
     143                if ( is_user_logged_in() && bp_blog_signup_enabled() ) {
     144                        $title = '<a class="button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '">' . __( 'Blogs', 'buddypress' ) . '</a>&nbsp;' . __( 'Create a Blog', 'buddypress' );
     145                } else {
     146                        $title = __( 'Blogs', 'buddypress' );
     147                }
     148
     149                bp_theme_compat_reset_post( array(
     150                        'ID'             => 0,
     151                        'post_title'     => $title,
     152                        'post_author'    => 0,
     153                        'post_date'      => 0,
     154                        'post_content'   => '',
     155                        'post_type'      => 'bp_group',
     156                        'post_status'    => 'publish',
     157                        'is_archive'     => true,
     158                        'comment_status' => 'closed'
     159                ) );
     160        }
     161
     162        /**
     163         * Filter the_content with the create screen template part
     164         *
     165         * @since BuddyPress (1.7)
     166         */
     167        public function create_content() {
     168                bp_buffer_template_part( 'blogs/create' );
     169        }
     170}
     171new BP_Blogs_Theme_Compat();
  • bp-core/bp-core-actions.php

     
    3535add_action( 'init',                    'bp_init',                   10    );
    3636add_action( 'wp',                      'bp_ready',                  10    );
    3737add_action( 'setup_theme',             'bp_setup_theme',            10    );
    38 add_action( 'after_theme_setup',       'bp_after_theme_setup',      10    );
     38add_action( 'after_setup_theme',       'bp_after_setup_theme',      10    );
    3939add_action( 'wp_enqueue_scripts',      'bp_enqueue_scripts',        10    );
    4040add_action( 'admin_bar_menu',          'bp_setup_admin_bar',        20    ); // After WP core
    4141add_action( 'template_redirect',       'bp_template_redirect',      10    );
     
    4848 *
    4949 * Attach various loader actions to the bp_loaded action.
    5050 * The load order helps to execute code at the correct time.
    51  *                                                 v---Load order
     51 *                                                     v---Load order
    5252 */
    53 add_action( 'bp_loaded', 'bp_setup_components',    2  );
    54 add_action( 'bp_loaded', 'bp_include',             4  );
    55 add_action( 'bp_loaded', 'bp_setup_widgets',       6  );
    56 add_action( 'bp_loaded', 'bp_core_load_admin_bar', 10 );
     53add_action( 'bp_loaded', 'bp_setup_components',        2  );
     54add_action( 'bp_loaded', 'bp_include',                 4  );
     55add_action( 'bp_loaded', 'bp_setup_widgets',           6  );
     56add_action( 'bp_loaded', 'bp_core_load_admin_bar',     10 );
     57add_action( 'bp_loaded', 'bp_register_theme_packages', 16 );
    5758
    5859/**
    5960 * bp_init - Attached to 'init' above
     
    7677 * Note that we currently use template_redirect versus template include because
    7778 * BuddyPress is a bully and overrides the existing themes output in many
    7879 * places. This won't always be this way, we promise.
    79  *                                                           v---Load order
     80 *                                                v---Load order
    8081 */
    81 add_action( 'bp_template_redirect', 'bp_redirect_canonical', 2 );
    82 add_action( 'bp_template_redirect', 'bp_actions',            4 );
    83 add_action( 'bp_template_redirect', 'bp_screens',            6 );
     82add_action( 'bp_template_redirect', 'bp_actions', 4 );
     83add_action( 'bp_template_redirect', 'bp_screens', 6 );
    8484
     85/**
     86 * Add the BuddyPress functions file
     87 */
     88add_action( 'after_setup_theme', 'bp_load_theme_functions', 1 );
     89
    8590// Load the admin
    8691if ( is_admin() ) {
    8792        add_action( 'bp_loaded', 'bp_admin' );
    8893}
    89 
    90 /**
    91  * Plugin Dependency
    92  *
    93  * The purpose of the following actions is to mimic the behavior of something
    94  * called 'plugin dependency' which enables a plugin to have plugins of their
    95  * own in a safe and reliable way.
    96  *
    97  * We do this in BuddyPress by mirroring existing WordPress actions in many places
    98  * allowing dependant plugins to hook into the BuddyPress specific ones, thus
    99  * guaranteeing proper code execution only whenBuddyPresss is active.
    100  *
    101  * The following functions are wrappers for their actions, allowing them to be
    102  * manually called and/or piggy-backed on top of other actions if needed.
    103  */
    104 
    105 /** Sub-actions ***************************************************************/
    106 
    107 /**
    108  * Include files on this action
    109  */
    110 function bp_include() {
    111         do_action( 'bp_include' );
    112 }
    113 
    114 /**
    115  * Include files on this action
    116  */
    117 function bp_setup_components() {
    118         do_action( 'bp_setup_components' );
    119 }
    120 
    121 /**
    122  * Setup global variables and objects
    123  */
    124 function bp_setup_globals() {
    125         do_action( 'bp_setup_globals' );
    126 }
    127 
    128 /**
    129  * Set navigation elements
    130  */
    131 function bp_setup_nav() {
    132         do_action( 'bp_setup_nav' );
    133 }
    134 
    135 /**
    136  * Set up BuddyPress implementation of the WP Toolbar
    137  */
    138 function bp_setup_admin_bar() {
    139         if ( bp_use_wp_admin_bar() )
    140                 do_action( 'bp_setup_admin_bar' );
    141 }
    142 
    143 /**
    144  * Set the page title
    145  */
    146 function bp_setup_title() {
    147         do_action( 'bp_setup_title' );
    148 }
    149 
    150 /**
    151  * Register widgets
    152  */
    153 function bp_setup_widgets() {
    154         do_action( 'bp_register_widgets' );
    155 }
    156 
    157 /**
    158  * Initlialize code
    159  */
    160 function bp_init() {
    161         do_action( 'bp_init' );
    162 }
    163 
    164 /**
    165  * Attached to plugins_loaded
    166  */
    167 function bp_loaded() {
    168         do_action( 'bp_loaded' );
    169 }
    170 
    171 /**
    172  * Attached to wp
    173  */
    174 function bp_ready() {
    175         do_action( 'bp_ready' );
    176 }
    177 
    178 /**
    179  * Attach potential template actions
    180  */
    181 function bp_actions() {
    182         do_action( 'bp_actions' );
    183 }
    184 
    185 /**
    186  * Attach potential template screens
    187  */
    188 function bp_screens() {
    189         do_action( 'bp_screens' );
    190 }
    191 
    192 /**
    193  * Initialize widgets
    194  */
    195 function bp_widgets_init() {
    196         do_action ( 'bp_widgets_init' );
    197 }
    198 
    199 /** Theme *********************************************************************/
    200 
    201 /**
    202  * Enqueue BuddyPress specific CSS and JS
    203  *
    204  * @since BuddyPress (1.6)
    205  *
    206  * @uses do_action() Calls 'bp_enqueue_scripts'
    207  */
    208 function bp_enqueue_scripts() {
    209         do_action ( 'bp_enqueue_scripts' );
    210 }
    211 
    212 /**
    213  * Piggy back action for BuddyPress sepecific theme actions before the theme has
    214  * been setup and the theme's functions.php has loaded.
    215  *
    216  * @since BuddyPress (1.6)
    217  *
    218  * @uses do_action() Calls 'bp_setup_theme'
    219  */
    220 function bp_setup_theme() {
    221         do_action ( 'bp_setup_theme' );
    222 }
    223 
    224 /**
    225  * Piggy back action for BuddyPress sepecific theme actions once the theme has
    226  * been setup and the theme's functions.php has loaded.
    227  *
    228  * @since BuddyPress (1.6)
    229  *
    230  * @uses do_action() Calls 'bp_after_theme_setup'
    231  */
    232 function bp_after_theme_setup() {
    233         do_action ( 'bp_after_theme_setup' );
    234 }
    235 
    236 /** Theme Compatibility Filter ************************************************/
    237 
    238 /**
    239  * The main filter used for theme compatibility and displaying custom BuddyPress
    240  * theme files.
    241  *
    242  * @since BuddyPress (1.6)
    243  *
    244  * @uses apply_filters()
    245  *
    246  * @param string $template
    247  * @return string Template file to use
    248  */
    249 function bp_template_include( $template = '' ) {
    250         return apply_filters( 'bp_template_include', $template );
    251 }
    252 
    253 /** Theme Permissions *********************************************************/
    254 
    255 /**
    256  * The main action used for redirecting BuddyPress theme actions that are not
    257  * permitted by the current_user
    258  *
    259  * @since BuddyPress (1.6)
    260  *
    261  * @uses do_action()
    262  */
    263 function bp_template_redirect() {
    264         do_action( 'bp_template_redirect' );
    265 }
    266 
    267 ?>
  • bp-core/bp-core-catchuri.php

     
    369369                $post                        = $wp_query->queried_object;
    370370        }
    371371
    372         // Define local variables
    373         $located_template   = false;
    374         $filtered_templates = array();
    375 
    376372        // Fetch each template and add the php suffix
    377         foreach ( (array) $templates as $template )
     373        $filtered_templates = array();
     374        foreach ( (array) $templates as $template ) {
    378375                $filtered_templates[] = $template . '.php';
     376        }
    379377
    380378        // Filter the template locations so that plugins can alter where they are located
    381379        $located_template = apply_filters( 'bp_located_template', locate_template( (array) $filtered_templates, false ), $filtered_templates );
     
    391389                load_template( apply_filters( 'bp_load_template', $located_template ) );
    392390
    393391                do_action( 'bp_core_post_load_template', $located_template );
    394         }
    395392
    396         // Kill any other output after this.
    397         die;
     393                // Kill any other output after this.
     394                exit();
     395
     396        // No template found, so setup theme compatability
     397        // @todo Some other 404 handling if theme compat doesn't kick in
     398        } else {
     399                do_action( 'bp_setup_theme_compat' );
     400        }
    398401}
    399402
    400403/**
  • bp-core/bp-core-dependency.php

     
     1<?php
     2
     3/**
     4 * Plugin Dependency
     5 *
     6 * The purpose of the following hooks is to mimic the behavior of something
     7 * called 'plugin dependency' which enables a plugin to have plugins of their
     8 * own in a safe and reliable way.
     9 *
     10 * We do this in BuddyPress by mirroring existing WordPress hookss in many places
     11 * allowing dependant plugins to hook into the BuddyPress specific ones, thus
     12 * guaranteeing proper code execution only when BuddyPress is active.
     13 *
     14 * The following functions are wrappers for hookss, allowing them to be
     15 * manually called and/or piggy-backed on top of other hooks if needed.
     16 *
     17 * @todo use anonymous functions when PHP minimun requirement allows (5.3)
     18 */
     19
     20/**
     21 * Include files on this action
     22 */
     23function bp_include() {
     24        do_action( 'bp_include' );
     25}
     26
     27/**
     28 * Include files on this action
     29 */
     30function bp_setup_components() {
     31        do_action( 'bp_setup_components' );
     32}
     33
     34/**
     35 * Setup global variables and objects
     36 */
     37function bp_setup_globals() {
     38        do_action( 'bp_setup_globals' );
     39}
     40
     41/**
     42 * Set navigation elements
     43 */
     44function bp_setup_nav() {
     45        do_action( 'bp_setup_nav' );
     46}
     47
     48/**
     49 * Set up BuddyPress implementation of the WP Toolbar
     50 */
     51function bp_setup_admin_bar() {
     52        if ( bp_use_wp_admin_bar() )
     53                do_action( 'bp_setup_admin_bar' );
     54}
     55
     56/**
     57 * Set the page title
     58 */
     59function bp_setup_title() {
     60        do_action( 'bp_setup_title' );
     61}
     62
     63/**
     64 * Register widgets
     65 */
     66function bp_setup_widgets() {
     67        do_action( 'bp_register_widgets' );
     68}
     69
     70/**
     71 * Initlialize code
     72 */
     73function bp_init() {
     74        do_action( 'bp_init' );
     75}
     76
     77/**
     78 * Attached to plugins_loaded
     79 */
     80function bp_loaded() {
     81        do_action( 'bp_loaded' );
     82}
     83
     84/**
     85 * Attached to wp
     86 */
     87function bp_ready() {
     88        do_action( 'bp_ready' );
     89}
     90
     91/**
     92 * Attach potential template actions
     93 */
     94function bp_actions() {
     95        do_action( 'bp_actions' );
     96}
     97
     98/**
     99 * Attach potential template screens
     100 */
     101function bp_screens() {
     102        do_action( 'bp_screens' );
     103}
     104
     105/**
     106 * Initialize widgets
     107 */
     108function bp_widgets_init() {
     109        do_action ( 'bp_widgets_init' );
     110}
     111
     112/** Theme Permissions *********************************************************/
     113
     114/**
     115 * The main action used for redirecting BuddyPress theme actions that are not
     116 * permitted by the current_user
     117 *
     118 * @since BuddyPress (1.6)
     119 *
     120 * @uses do_action()
     121 */
     122function bp_template_redirect() {
     123        do_action( 'bp_template_redirect' );
     124}
     125
     126/** Theme Helpers *************************************************************/
     127
     128/**
     129 * The main action used registering theme packages
     130 *
     131 * @since BuddyPress (1.7)
     132 * @uses do_action()
     133 */
     134function bp_register_theme_packages() {
     135        do_action( 'bp_register_theme_packages' );
     136}
     137
     138/**
     139 * Enqueue BuddyPress specific CSS and JS
     140 *
     141 * @since BuddyPress (1.6)
     142 *
     143 * @uses do_action() Calls 'bp_enqueue_scripts'
     144 */
     145function bp_enqueue_scripts() {
     146        do_action ( 'bp_enqueue_scripts' );
     147}
     148
     149/**
     150 * Piggy back action for BuddyPress sepecific theme actions before the theme has
     151 * been setup and the theme's functions.php has loaded.
     152 *
     153 * @since BuddyPress (1.6)
     154 *
     155 * @uses do_action() Calls 'bp_setup_theme'
     156 */
     157function bp_setup_theme() {
     158        do_action ( 'bp_setup_theme' );
     159}
     160
     161/**
     162 * Piggy back action for BuddyPress sepecific theme actions once the theme has
     163 * been setup and the theme's functions.php has loaded.
     164 *
     165 * @since BuddyPress (1.6)
     166 *
     167 * @uses do_action() Calls 'bp_after_setup_theme'
     168 */
     169function bp_after_setup_theme() {
     170        do_action ( 'bp_after_setup_theme' );
     171}
     172
     173/** Theme Compatibility Filter ************************************************/
     174
     175/**
     176 * Piggy back filter for WordPress's 'request' filter
     177 *
     178 * @since BuddyPress (1.7)
     179 * @param array $query_vars
     180 * @return array
     181 */
     182function bp_request( $query_vars = array() ) {
     183        return apply_filters( 'bp_request', $query_vars );
     184}
     185
     186/**
     187 * The main filter used for theme compatibility and displaying custom BuddyPress
     188 * theme files.
     189 *
     190 * @since BuddyPress (1.6)
     191 *
     192 * @uses apply_filters()
     193 *
     194 * @param string $template
     195 * @return string Template file to use
     196 */
     197function bp_template_include( $template = '' ) {
     198        return apply_filters( 'bp_template_include', $template );
     199}
     200
     201/**
     202 * Generate BuddyPress-specific rewrite rules
     203 *
     204 * @since BuddyPress (1.7)
     205 * @param WP_Rewrite $wp_rewrite
     206 * @uses do_action() Calls 'bp_generate_rewrite_rules' with {@link WP_Rewrite}
     207 */
     208function bp_generate_rewrite_rules( $wp_rewrite ) {
     209        do_action_ref_array( 'bp_generate_rewrite_rules', array( &$wp_rewrite ) );
     210}
     211
     212/**
     213 * Filter the allowed themes list for BuddyPress specific themes
     214 *
     215 * @since BuddyPress (1.7)
     216 * @uses apply_filters() Calls 'bp_allowed_themes' with the allowed themes list
     217 */
     218function bp_allowed_themes( $themes ) {
     219        return apply_filters( 'bp_allowed_themes', $themes );
     220}
     221
  • bp-core/bp-core-filters.php

     
    11<?php
    22
     3/**
     4 * BuddyPress Filters
     5 *
     6 * @package BuddyPress
     7 * @subpackage Core
     8 *
     9 * This file contains the filters that are used through-out BuddyPress. They are
     10 * consolidated here to make searching for them easier, and to help developers
     11 * understand at a glance the order in which things occur.
     12 *
     13 * There are a few common places that additional filters can currently be found
     14 *
     15 *  - BuddyPress: In {@link BuddyPress::setup_actions()} in bbpress.php
     16 *  - Component: In {@link BBP_Component::setup_actions()} in
     17 *                bbp-includes/bbp-classes.php
     18 *  - Admin: More in {@link BBP_Admin::setup_actions()} in
     19 *            bbp-admin/bbp-admin.php
     20 *
     21 * @see bbp-core-actions.php
     22 */
     23
    324// Exit if accessed directly
    425if ( !defined( 'ABSPATH' ) ) exit;
    526
     27/**
     28 * Attach BuddyPress to WordPress
     29 *
     30 * BuddyPress uses its own internal actions to help aid in third-party plugin
     31 * development, and to limit the amount of potential future code changes when
     32 * updates to WordPress core occur.
     33 *
     34 * These actions exist to create the concept of 'plugin dependencies'. They
     35 * provide a safe way for plugins to execute code *only* when BuddyPress is
     36 * installed and activated, without needing to do complicated guesswork.
     37 *
     38 * For more information on how this works, see the 'Plugin Dependency' section
     39 * near the bottom of this file.
     40 *
     41 *           v--WordPress Actions       v--BuddyPress Sub-actions
     42 */
     43add_filter( 'request',                 'bp_request',            10    );
     44add_filter( 'template_include',        'bp_template_include',   10    );
     45add_filter( 'comments_open',           'bp_comments_open',      10, 2 );
     46
    647// Add some filters to feedback messages
    748add_filter( 'bp_core_render_message_content', 'wptexturize'       );
    849add_filter( 'bp_core_render_message_content', 'convert_smilies'   );
     
    1152add_filter( 'bp_core_render_message_content', 'shortcode_unautop' );
    1253
    1354/**
     55 * Template Compatibility
     56 *
     57 * If you want to completely bypass this and manage your own custom BuddyPress
     58 * template hierarchy, start here by removing this filter, then look at how
     59 * bp_template_include() works and do something similar. :)
     60 */
     61add_filter( 'bp_template_include', 'bp_template_include_theme_supports', 2, 1 );
     62add_filter( 'bp_template_include', 'bp_template_include_theme_compat',   4, 2 );
     63
     64// Run all template parts through additional template locations
     65add_filter( 'bp_get_template_part', 'bp_add_template_locations' );
     66
     67/**
    1468 * bp_core_exclude_pages()
    1569 *
    1670 * Excludes specific pages from showing on page listings, for example the "Activation" page.
  • bp-core/bp-core-options.php

     
    6161                // Allow comments on blog and forum activity items
    6262                'bp-disable-blogforum-comments'   => true,
    6363
     64                // The ID for the current theme packag.
     65                '_bbp_theme_package_id'           => 'default',
     66
    6467                /** Groups ************************************************************/
    6568
    6669                // @todo Move this into the groups component
     
    521524        return (bool) apply_filters( 'bp_is_akismet_active', (bool) bp_get_option( '_bp_enable_akismet', $default ) );
    522525}
    523526
    524 ?>
     527/**
     528 * Get the current theme package ID
     529 *
     530 * @since BuddyPress (1.7)
     531 *
     532 * @param $default string Optional. Default value 'default'
     533 * @uses get_option() To get the subtheme option
     534 * @return string ID of the subtheme
     535 */
     536function bp_get_theme_package_id( $default = 'default' ) {
     537        return apply_filters( 'bp_get_theme_package_id', get_option( '_bp_theme_package_id', $default ) );
     538}
  • bp-core/bp-core-template-loader.php

     
     1<?php
     2
     3/**
     4 * BuddyPress Template Functions
     5 *
     6 * This file contains functions necessary to mirror the WordPress core template
     7 * loading process. Many of those functions are not filterable, and even then
     8 * would not be robust enough to predict where BuddyPress templates might exist.
     9 *
     10 * @package BuddyPress
     11 * @subpackage TemplateFunctions
     12 */
     13
     14// Exit if accessed directly
     15if ( !defined( 'ABSPATH' ) ) exit;
     16
     17/**
     18 * Adds BuddyPress theme support to any active WordPress theme
     19 *
     20 * @since BuddyPress (1.7)
     21 *
     22 * @param string $slug
     23 * @param string $name Optional. Default null
     24 * @uses bp_locate_template()
     25 * @uses load_template()
     26 * @uses get_template_part()
     27 */
     28function bp_get_template_part( $slug, $name = null ) {
     29
     30        // Execute code for this part
     31        do_action( 'get_template_part_' . $slug, $slug, $name );
     32
     33        // Setup possible parts
     34        $templates = array();
     35        if ( isset( $name ) )
     36                $templates[] = $slug . '-' . $name . '.php';
     37        $templates[] = $slug . '.php';
     38
     39        // Allow template parst to be filtered
     40        $templates = apply_filters( 'bp_get_template_part', $templates, $slug, $name );
     41
     42        // Return the part that is found
     43        return bp_locate_template( $templates, true, false );
     44}
     45
     46/**
     47 * Retrieve the name of the highest priority template file that exists.
     48 *
     49 * Searches in the STYLESHEETPATH before TEMPLATEPATH so that themes which
     50 * inherit from a parent theme can just overload one file. If the template is
     51 * not found in either of those, it looks in the theme-compat folder last.
     52 *
     53 * @since BuddyPress (1.7)
     54 *
     55 * @param string|array $template_names Template file(s) to search for, in order.
     56 * @param bool $load If true the template file will be loaded if it is found.
     57 * @param bool $require_once Whether to require_once or require. Default true.
     58 *                            Has no effect if $load is false.
     59 * @return string The template filename if one is located.
     60 */
     61function bp_locate_template( $template_names, $load = false, $require_once = true ) {
     62
     63        // No file found yet
     64        $located = false;
     65
     66        // Try to find a template file
     67        foreach ( (array) $template_names as $template_name ) {
     68
     69                // Continue if template is empty
     70                if ( empty( $template_name ) )
     71                        continue;
     72
     73                // Trim off any slashes from the template name
     74                $template_name = ltrim( $template_name, '/' );
     75
     76                // Check child theme first
     77                if ( file_exists( trailingslashit( STYLESHEETPATH ) . $template_name ) ) {
     78                        $located = trailingslashit( STYLESHEETPATH ) . $template_name;
     79                        break;
     80
     81                // Check parent theme next
     82                } elseif ( file_exists( trailingslashit( TEMPLATEPATH ) . $template_name ) ) {
     83                        $located = trailingslashit( TEMPLATEPATH ) . $template_name;
     84                        break;
     85
     86                // Check theme compatibility last
     87                } elseif ( file_exists( trailingslashit( bp_get_theme_compat_dir() ) . $template_name ) ) {
     88                        $located = trailingslashit( bp_get_theme_compat_dir() ) . $template_name;
     89                        break;
     90                }
     91        }
     92
     93        if ( ( true == $load ) && !empty( $located ) )
     94                load_template( $located, $require_once );
     95
     96        return $located;
     97}
     98
     99/**
     100 * Get a template part in an output buffer, and return it
     101 *
     102 * @since BuddyPress (1.7)
     103 *
     104 * @param string $slug
     105 * @param string $name
     106 * @return string
     107 */
     108function bp_buffer_template_part( $slug, $name = null, $echo = true ) {
     109        ob_start();
     110
     111        // Remove 'bbp_replace_the_content' filter to prevent infinite loops
     112        remove_filter( 'the_content', 'bbp_replace_the_content' );
     113
     114        bp_get_template_part( $slug, $name );
     115
     116        // Remove 'bbp_replace_the_content' filter to prevent infinite loops
     117        add_filter( 'the_content', 'bbp_replace_the_content' );
     118
     119        // Get the output buffer contents
     120        $output = ob_get_contents();
     121
     122        // Flush the output buffer
     123        ob_end_clean();
     124
     125        // Echo or return the output buffer contents
     126        if ( true === $echo ) {
     127                echo $output;
     128        } else {
     129                return $output;
     130        }
     131}
     132
     133/**
     134 * Retrieve path to a template
     135 *
     136 * Used to quickly retrieve the path of a template without including the file
     137 * extension. It will also check the parent theme and theme-compat theme with
     138 * the use of {@link bp_locate_template()}. Allows for more generic template
     139 * locations without the use of the other get_*_template() functions.
     140 *
     141 * @since BuddyPress (1.7)
     142 *
     143 * @param string $type Filename without extension.
     144 * @param array $templates An optional list of template candidates
     145 * @uses bp_set_theme_compat_templates()
     146 * @uses bp_locate_template()
     147 * @uses bp_set_theme_compat_template()
     148 * @return string Full path to file.
     149 */
     150function bp_get_query_template( $type, $templates = array() ) {
     151        $type = preg_replace( '|[^a-z0-9-]+|', '', $type );
     152
     153        if ( empty( $templates ) )
     154                $templates = array( "{$type}.php" );
     155
     156        // Filter possible templates, try to match one, and set any BuddyPress theme
     157        // compat properties so they can be cross-checked later.
     158        $templates = apply_filters( "bp_get_{$type}_template", $templates );
     159        $templates = bp_set_theme_compat_templates( $templates );
     160        $template  = bp_locate_template( $templates );
     161        $template  = bp_set_theme_compat_template( $template );
     162
     163        return apply_filters( "bp_{$type}_template", $template );
     164}
     165
     166/**
     167 * Get the possible subdirectories to check for templates in
     168 *
     169 * @since BuddyPress (1.7)
     170 * @param array $templates Templates we are looking for
     171 * @return array Possible subfolders to look in
     172 */
     173function bp_get_template_locations( $templates = array() ) {
     174        $locations = array(
     175                'buddypress',
     176                'community',
     177                ''
     178        );
     179        return apply_filters( 'bp_get_template_locations', $locations, $templates );
     180}
     181
     182/**
     183 * Add template locations to template files being searched for
     184 *
     185 * @since BuddyPress (1.7)
     186 *
     187 * @param array $templates
     188 * @return array()
     189 */
     190function bp_add_template_locations( $templates = array() ) {
     191        $retval = array();
     192
     193        // Get alternate locations
     194        $locations = bp_get_template_locations( $templates );
     195
     196        // Loop through locations and templates and combine
     197        foreach ( $locations as $location )
     198                foreach ( $templates as $template )
     199                        $retval[] = trailingslashit( $location ) . $template;
     200
     201        return apply_filters( 'bp_add_template_locations', $retval, $templates );
     202}
     203
     204/**
     205 * Add checks for BuddyPress conditions to parse_query action
     206 *
     207 * @since BuddyPress (1.7)
     208 *
     209 * @param WP_Query $posts_query
     210 */
     211function bp_parse_query( $posts_query ) {
     212
     213        // Bail if $posts_query is not the main loop
     214        if ( ! $posts_query->is_main_query() )
     215                return;
     216
     217        // Bail if filters are suppressed on this query
     218        if ( true == $posts_query->get( 'suppress_filters' ) )
     219                return;
     220
     221        // Bail if in admin
     222        if ( is_admin() )
     223                return;
     224
     225        // Allow BuddyPress components to parse the main query
     226        do_action_ref_array( 'bp_parse_query', array( &$posts_query ) );
     227}
     228
     229/**
     230 * Possibly intercept the template being loaded
     231 *
     232 * Listens to the 'template_include' filter and waits for any BuddyPress specific
     233 * template condition to be met. If one is met and the template file exists,
     234 * it will be used; otherwise
     235 *
     236 * Note that the _edit() checks are ahead of their counterparts, to prevent them
     237 * from being stomped on accident.
     238 *
     239 * @since BuddyPress (1.7)
     240 *
     241 * @param string $template
     242 *
     243 * @return string The path to the template file that is being used
     244 */
     245function bp_template_include_theme_supports( $template = '' ) {
     246
     247        // Look for root BuddyPress template files in parent/child themes
     248        $new_template = apply_filters( 'bp_get_root_template', false, $template );
     249
     250        // BuddyPress template file exists
     251        if ( !empty( $new_template ) ) {
     252
     253                // Override the WordPress template with a BuddyPress one
     254                $template = $new_template;
     255
     256                // @see: bp_template_include_theme_compat()
     257                buddypress()->theme_compat->found_template = true;
     258        }
     259
     260        return apply_filters( 'bp_template_include_theme_supports', $template );
     261}
     262
     263/**
     264 * Attempt to load a custom BuddyPress functions file, similar to each themes
     265 * functions.php file.
     266 *
     267 * @since BuddyPress (1.7)
     268 *
     269 * @global string $pagenow
     270 * @uses bp_locate_template()
     271 */
     272function bp_load_theme_functions() {
     273        global $pagenow;
     274
     275        if ( ! defined( 'WP_INSTALLING' ) || ( !empty( $pagenow ) && ( 'wp-activate.php' !== $pagenow ) ) ) {
     276                bp_locate_template( 'buddypress-functions.php', true );
     277        }
     278}
     279
     280/**
     281 * Get the templates to use as the endpoint for BuddyPress template parts
     282 *
     283 * @since BuddyPress (1.7)
     284 *
     285 * @uses apply_filters()
     286 * @return array Of possible root level wrapper template files
     287 */
     288function bp_get_theme_compat_templates() {
     289        $templates = array(
     290                'plugin-buddypress.php',
     291                'buddypress.php',
     292                'community.php',
     293                'generic.php',
     294                'page.php',
     295                'single.php',
     296                'index.php'
     297        );
     298        return bp_get_query_template( 'buddypress', $templates );
     299}
  • bp-core/bp-core-template.php

     
    10551055        return false;
    10561056}
    10571057
     1058/**
     1059 * Is this a BuddyPress component?
     1060 *
     1061 * You can tell if a page is displaying BP content by whether the
     1062 * current_component has been defined
     1063 *
     1064 * Generally, we can just check to see that there's no current component.
     1065 * The one exception is single user home tabs, where $bp->current_component
     1066 * is unset. Thus the addition of the bp_is_user() check.
     1067 *
     1068 * @since BuddyPress (1.7)
     1069 *
     1070 * @package BuddyPress
     1071 * @return bool True if it's a BuddyPress page, false otherwise
     1072 */
     1073function is_buddypress() {
     1074
     1075        $retval = (bool) ( bp_current_component() || bp_is_user() );
     1076
     1077        return apply_filters( 'is_buddypress', $retval );
     1078}
     1079
    10581080/** Components ****************************************************************/
    10591081
    10601082function bp_is_active( $component ) {
  • bp-core/bp-core-theme-compatability.php

     
     1<?php
     2
     3/**
     4 * BuddyPress Core Theme Compatibility
     5 *
     6 * @package BuddyPress
     7 * @subpackage ThemeCompatibility
     8 */
     9
     10// Exit if accessed directly
     11if ( !defined( 'ABSPATH' ) ) exit;
     12
     13/** Theme Compat **************************************************************/
     14
     15/**
     16 * What follows is an attempt at intercepting the natural page load process
     17 * to replace the_content() with the appropriate BuddyPress content.
     18 *
     19 * To do this, BuddyPress does several direct manipulations of global variables
     20 * and forces them to do what they are not supposed to be doing.
     21 *
     22 * Don't try anything you're about to witness here, at home. Ever.
     23 */
     24
     25/** Base Class ****************************************************************/
     26
     27/**
     28 * Theme Compatibility base class
     29 *
     30 * This is only intended to be extended, and is included here as a basic guide
     31 * for future Theme Packs to use. @link BBP_Twenty_Ten is a good example of
     32 * extending this class, as is @link bp_setup_theme_compat()
     33 *
     34 * @since BuddyPress (1.7)
     35 */
     36class BP_Theme_Compat {
     37
     38        /**
     39         * Should be like:
     40         *
     41         * array(
     42         *     'id'      => ID of the theme (should be unique)
     43         *     'name'    => Name of the theme (should match style.css)
     44         *     'version' => Theme version for cache busting scripts and styling
     45         *     'dir'     => Path to theme
     46         *     'url'     => URL to theme
     47         * );
     48         * @var array
     49         */
     50        private $_data = array();
     51
     52        /**
     53         * Pass the $properties to the object on creation.
     54         *
     55         * @since BuddyPress (1.7)
     56         * @param array $properties
     57         */
     58    public function __construct( Array $properties = array() ) {
     59                $this->_data = $properties;
     60        }
     61
     62        /**
     63         * Set a theme's property.
     64         *
     65         * @since BuddyPress (1.7)
     66         * @param string $property
     67         * @param mixed $value
     68         * @return mixed
     69         */
     70        public function __set( $property, $value ) {
     71                return $this->_data[$property] = $value;
     72        }
     73
     74        /**
     75         * Get a theme's property.
     76         *
     77         * @since BuddyPress (1.7)
     78         * @param string $property
     79         * @param mixed $value
     80         * @return mixed
     81         */
     82        public function __get( $property ) {
     83                return array_key_exists( $property, $this->_data ) ? $this->_data[$property] : '';
     84        }
     85}
     86
     87/** Functions *****************************************************************/
     88
     89/**
     90 * Setup the default theme compat theme
     91 *
     92 * @since BuddyPress (1.7)
     93 * @param BBP_Theme_Compat $theme
     94 */
     95function bp_setup_theme_compat( $theme = '' ) {
     96        $bp = buddypress();
     97
     98        // Make sure theme package is available, set to default if not
     99        if ( ! isset( $bp->theme_compat->packages[$theme] ) || ! is_a( $bp->theme_compat->packages[$theme], 'BP_Theme_Compat' ) ) {
     100                $theme = 'default';
     101        }
     102
     103        // Set the active theme compat theme
     104        $bp->theme_compat->theme = $bp->theme_compat->packages[$theme];
     105}
     106
     107/**
     108 * Gets the name of the BuddyPress compatable theme used, in the event the
     109 * currently active WordPress theme does not explicitly support BuddyPress.
     110 * This can be filtered or set manually. Tricky theme authors can override the
     111 * default and include their own BuddyPress compatability layers for their themes.
     112 *
     113 * @since BuddyPress (1.7)
     114 * @uses apply_filters()
     115 * @return string
     116 */
     117function bp_get_theme_compat_id() {
     118        return apply_filters( 'bp_get_theme_compat_id', buddypress()->theme_compat->theme->id );
     119}
     120
     121/**
     122 * Gets the name of the BuddyPress compatable theme used, in the event the
     123 * currently active WordPress theme does not explicitly support BuddyPress.
     124 * This can be filtered or set manually. Tricky theme authors can override the
     125 * default and include their own BuddyPress compatability layers for their themes.
     126 *
     127 * @since BuddyPress (1.7)
     128 * @uses apply_filters()
     129 * @return string
     130 */
     131function bp_get_theme_compat_name() {
     132        return apply_filters( 'bp_get_theme_compat_name', buddypress()->theme_compat->theme->name );
     133}
     134
     135/**
     136 * Gets the version of the BuddyPress compatable theme used, in the event the
     137 * currently active WordPress theme does not explicitly support BuddyPress.
     138 * This can be filtered or set manually. Tricky theme authors can override the
     139 * default and include their own BuddyPress compatability layers for their themes.
     140 *
     141 * @since BuddyPress (1.7)
     142 * @uses apply_filters()
     143 * @return string
     144 */
     145function bp_get_theme_compat_version() {
     146        return apply_filters( 'bp_get_theme_compat_version', buddypress()->theme_compat->theme->version );
     147}
     148
     149/**
     150 * Gets the BuddyPress compatable theme used in the event the currently active
     151 * WordPress theme does not explicitly support BuddyPress. This can be filtered,
     152 * or set manually. Tricky theme authors can override the default and include
     153 * their own BuddyPress compatability layers for their themes.
     154 *
     155 * @since BuddyPress (1.7)
     156 * @uses apply_filters()
     157 * @return string
     158 */
     159function bp_get_theme_compat_dir() {
     160        return apply_filters( 'bp_get_theme_compat_dir', buddypress()->theme_compat->theme->dir );
     161}
     162
     163/**
     164 * Gets the BuddyPress compatable theme used in the event the currently active
     165 * WordPress theme does not explicitly support BuddyPress. This can be filtered,
     166 * or set manually. Tricky theme authors can override the default and include
     167 * their own BuddyPress compatability layers for their themes.
     168 *
     169 * @since BuddyPress (1.7)
     170 * @uses apply_filters()
     171 * @return string
     172 */
     173function bp_get_theme_compat_url() {
     174        return apply_filters( 'bp_get_theme_compat_url', buddypress()->theme_compat->theme->url );
     175}
     176
     177/**
     178 * Gets true/false if page is currently inside theme compatibility
     179 *
     180 * @since BuddyPress (1.7)
     181 * @return bool
     182 */
     183function bp_is_theme_compat_active() {
     184        $bp = buddypress();
     185
     186        if ( empty( $bp->theme_compat->active ) )
     187                return false;
     188
     189        return $bp->theme_compat->active;
     190}
     191
     192/**
     193 * Sets true/false if page is currently inside theme compatibility
     194 *
     195 * @since BuddyPress (1.7)
     196 * @param bool $set
     197 * @return bool
     198 */
     199function bp_set_theme_compat_active( $set = true ) {
     200        buddypress()->theme_compat->active = $set;
     201
     202        return (bool) buddypress()->theme_compat->active;
     203}
     204
     205/**
     206 * Set the theme compat templates global
     207 *
     208 * Stash possible template files for the current query. Useful if plugins want
     209 * to override them, or see what files are being scanned for inclusion.
     210 *
     211 * @since BuddyPress (1.7)
     212 */
     213function bp_set_theme_compat_templates( $templates = array() ) {
     214        buddypress()->theme_compat->templates = $templates;
     215
     216        return buddypress()->theme_compat->templates;
     217}
     218
     219/**
     220 * Set the theme compat template global
     221 *
     222 * Stash the template file for the current query. Useful if plugins want
     223 * to override it, or see what file is being included.
     224 *
     225 * @since BuddyPress (1.7)
     226 */
     227function bp_set_theme_compat_template( $template = '' ) {
     228        buddypress()->theme_compat->template = $template;
     229
     230        return buddypress()->theme_compat->template;
     231}
     232
     233/**
     234 * Set the theme compat original_template global
     235 *
     236 * Stash the original template file for the current query. Useful for checking
     237 * if BuddyPress was able to find a more appropriate template.
     238 *
     239 * @since BuddyPress (1.7)
     240 */
     241function bp_set_theme_compat_original_template( $template = '' ) {
     242        buddypress()->theme_compat->original_template = $template;
     243
     244        return buddypress()->theme_compat->original_template;
     245}
     246
     247/**
     248 * Set the theme compat original_template global
     249 *
     250 * Stash the original template file for the current query. Useful for checking
     251 * if BuddyPress was able to find a more appropriate template.
     252 *
     253 * @since BuddyPress (1.7)
     254 */
     255function bp_is_theme_compat_original_template( $template = '' ) {
     256        $bp = buddypress();
     257
     258        if ( empty( $bp->theme_compat->original_template ) )
     259                return false;
     260
     261        return (bool) ( $bp->theme_compat->original_template == $template );
     262}
     263
     264/**
     265 * Register a new BuddyPress theme package to the active theme packages array
     266 *
     267 * @since BuddyPress (1.7)
     268 * @param array $theme
     269 */
     270function bp_register_theme_package( $theme = array(), $override = true ) {
     271
     272        // Create new BBP_Theme_Compat object from the $theme array
     273        if ( is_array( $theme ) )
     274                $theme = new BP_Theme_Compat( $theme );
     275
     276        // Bail if $theme isn't a proper object
     277        if ( ! is_a( $theme, 'BP_Theme_Compat' ) )
     278                return;
     279
     280        // Load up BuddyPress
     281        $bp = buddypress();
     282
     283        // Only override if the flag is set and not previously registered
     284        if ( empty( $bp->theme_compat->packages[$theme->id] ) || ( true === $override ) ) {
     285                $bp->theme_compat->packages[$theme->id] = $theme;
     286        }
     287}
     288/**
     289 * This fun little function fills up some WordPress globals with dummy data to
     290 * stop your average page template from complaining about it missing.
     291 *
     292 * @since BuddyPress (1.7)
     293 * @global WP_Query $wp_query
     294 * @global object $post
     295 * @param array $args
     296 */
     297function bp_theme_compat_reset_post( $args = array() ) {
     298        global $wp_query, $post;
     299
     300        // Default arguments
     301        $defaults = array(
     302                'ID'                    => -9999,
     303                'post_status'           => 'publish',
     304                'post_author'           => 0,
     305                'post_parent'           => 0,
     306                'post_type'             => 'page',
     307                'post_date'             => 0,
     308                'post_date_gmt'         => 0,
     309                'post_modified'         => 0,
     310                'post_modified_gmt'     => 0,
     311                'post_content'          => '',
     312                'post_title'            => '',
     313                'post_category'         => 0,
     314                'post_excerpt'          => '',
     315                'post_content_filtered' => '',
     316                'post_mime_type'        => '',
     317                'post_password'         => '',
     318                'post_name'             => '',
     319                'guid'                  => '',
     320                'menu_order'            => 0,
     321                'pinged'                => '',
     322                'to_ping'               => '',
     323                'ping_status'           => '',
     324                'comment_status'        => 'closed',
     325                'comment_count'         => 0,
     326
     327                'is_404'          => false,
     328                'is_page'         => false,
     329                'is_single'       => false,
     330                'is_archive'      => false,
     331                'is_tax'          => false,
     332        );
     333
     334        // Switch defaults if post is set
     335        if ( isset( $wp_query->post ) ) {                 
     336                $defaults = array(
     337                        'ID'                    => $wp_query->post->ID,
     338                        'post_status'           => $wp_query->post->post_status,
     339                        'post_author'           => $wp_query->post->post_author,
     340                        'post_parent'           => $wp_query->post->post_parent,
     341                        'post_type'             => $wp_query->post->post_type,
     342                        'post_date'             => $wp_query->post->post_date,
     343                        'post_date_gmt'         => $wp_query->post->post_date_gmt,
     344                        'post_modified'         => $wp_query->post->post_modified,
     345                        'post_modified_gmt'     => $wp_query->post->post_modified_gmt,
     346                        'post_content'          => $wp_query->post->post_content,
     347                        'post_title'            => $wp_query->post->post_title,
     348                        'post_category'         => $wp_query->post->post_category,
     349                        'post_excerpt'          => $wp_query->post->post_excerpt,
     350                        'post_content_filtered' => $wp_query->post->post_content_filtered,
     351                        'post_mime_type'        => $wp_query->post->post_mime_type,
     352                        'post_password'         => $wp_query->post->post_password,
     353                        'post_name'             => $wp_query->post->post_name,
     354                        'guid'                  => $wp_query->post->guid,
     355                        'menu_order'            => $wp_query->post->menu_order,
     356                        'pinged'                => $wp_query->post->pinged,
     357                        'to_ping'               => $wp_query->post->to_ping,
     358                        'ping_status'           => $wp_query->post->ping_status,
     359                        'comment_status'        => $wp_query->post->comment_status,
     360                        'comment_count'         => $wp_query->post->comment_count,
     361
     362                        'is_404'          => false,
     363                        'is_page'         => false,
     364                        'is_single'       => false,
     365                        'is_archive'      => false,
     366                        'is_tax'          => false,
     367                );
     368        }
     369        $dummy = wp_parse_args( $args, $defaults ); //, 'theme_compat_reset_post' );
     370
     371        // Clear out the post related globals
     372        unset( $wp_query->posts );
     373        unset( $wp_query->post  );
     374        unset( $post            );
     375
     376        // Setup the dummy post object
     377        $wp_query->post                        = new stdClass;
     378        $wp_query->post->ID                    = $dummy['ID'];
     379        $wp_query->post->post_status           = $dummy['post_status'];
     380        $wp_query->post->post_author           = $dummy['post_author'];
     381        $wp_query->post->post_parent           = $dummy['post_parent'];
     382        $wp_query->post->post_type             = $dummy['post_type'];
     383        $wp_query->post->post_date             = $dummy['post_date'];
     384        $wp_query->post->post_date_gmt         = $dummy['post_date_gmt'];
     385        $wp_query->post->post_modified         = $dummy['post_modified'];
     386        $wp_query->post->post_modified_gmt     = $dummy['post_modified_gmt'];
     387        $wp_query->post->post_content          = $dummy['post_content'];
     388        $wp_query->post->post_title            = $dummy['post_title'];
     389        $wp_query->post->post_category         = $dummy['post_category'];
     390        $wp_query->post->post_excerpt          = $dummy['post_content_filtered'];
     391        $wp_query->post->post_content_filtered = $dummy['post_content_filtered'];
     392        $wp_query->post->post_mime_type        = $dummy['post_mime_type'];
     393        $wp_query->post->post_password         = $dummy['post_password'];
     394        $wp_query->post->post_name             = $dummy['post_name'];
     395        $wp_query->post->guid                  = $dummy['guid'];
     396        $wp_query->post->menu_order            = $dummy['menu_order'];
     397        $wp_query->post->pinged                = $dummy['pinged'];
     398        $wp_query->post->to_ping               = $dummy['to_ping'];
     399        $wp_query->post->ping_status           = $dummy['ping_status'];
     400        $wp_query->post->comment_status        = $dummy['comment_status'];
     401        $wp_query->post->comment_count         = $dummy['comment_count'];
     402
     403        // Set the $post global
     404        $post = $wp_query->post;
     405
     406        // Setup the dummy post loop
     407        $wp_query->posts[0] = $wp_query->post;
     408
     409        // Prevent comments form from appearing
     410        $wp_query->post_count = 1;
     411        $wp_query->is_404     = $dummy['is_404'];
     412        $wp_query->is_page    = $dummy['is_page'];
     413        $wp_query->is_single  = $dummy['is_single'];
     414        $wp_query->is_archive = $dummy['is_archive'];
     415        $wp_query->is_tax     = $dummy['is_tax'];
     416
     417        // If we are resetting a post, we are in theme compat
     418        bp_set_theme_compat_active();
     419}
     420
     421/**
     422 * Reset main query vars and filter 'the_content' to output a BuddyPress
     423 * template part as needed.
     424 *
     425 * @since BuddyPress (1.7)
     426 *
     427 * @param string $template
     428 * @uses bp_is_single_user() To check if page is single user
     429 * @uses bp_get_single_user_template() To get user template
     430 * @uses bp_is_single_user_edit() To check if page is single user edit
     431 * @uses bp_get_single_user_edit_template() To get user edit template
     432 * @uses bp_is_single_view() To check if page is single view
     433 * @uses bp_get_single_view_template() To get view template
     434 * @uses bp_is_forum_edit() To check if page is forum edit
     435 * @uses bp_get_forum_edit_template() To get forum edit template
     436 * @uses bp_is_topic_merge() To check if page is topic merge
     437 * @uses bp_get_topic_merge_template() To get topic merge template
     438 * @uses bp_is_topic_split() To check if page is topic split
     439 * @uses bp_get_topic_split_template() To get topic split template
     440 * @uses bp_is_topic_edit() To check if page is topic edit
     441 * @uses bp_get_topic_edit_template() To get topic edit template
     442 * @uses bp_is_reply_edit() To check if page is reply edit
     443 * @uses bp_get_reply_edit_template() To get reply edit template
     444 * @uses bp_set_theme_compat_template() To set the global theme compat template
     445 */
     446function bp_template_include_theme_compat( $template = '' ) {
     447
     448        // Bail if the template already matches a BuddyPress template
     449        if ( !empty( buddypress()->theme_compat->found_template ) )
     450                return $template;
     451
     452        /**
     453         * Use this action to execute code that will communicate to BuddyPress's
     454         * theme compatibility layer whether or not we're replacing the_content()
     455         * with some other template part.
     456         */
     457        do_action( 'bp_template_include_reset_dummy_post_data' );
     458
     459        /**
     460         * If we are relying on BuddyPress's built in theme compatibility to load
     461         * the proper content, we need to intercept the_content, replace the
     462         * output, and display ours instead.
     463         *
     464         * To do this, we first remove all filters from 'the_content' and hook
     465         * our own function into it, which runs a series of checks to determine
     466         * the context, and then uses the built in shortcodes to output the
     467         * correct results from inside an output buffer.
     468         *
     469         * Uses bp_get_theme_compat_templates() to provide fall-backs that
     470         * should be coded without superfluous mark-up and logic (prev/next
     471         * navigation, comments, date/time, etc...)
     472         */
     473        if ( bp_is_theme_compat_active() ) {
     474
     475                // Remove all filters from the_content
     476                bp_remove_all_filters( 'the_content' );
     477
     478                // Add a filter on the_content late, which we will later remove
     479                add_filter( 'the_content', 'bp_replace_the_content' );
     480
     481                // Find the appropriate template file
     482                $template = bp_get_theme_compat_templates();
     483        }
     484
     485        return apply_filters( 'bp_template_include_theme_compat', $template );
     486}
     487
     488/**
     489 * Replaces the_content() if the post_type being displayed is one that would
     490 * normally be handled by BuddyPress, but proper single page templates do not
     491 * exist in the currently active theme.
     492 *
     493 * @since BuddyPress (1.7)
     494 * @param string $content
     495 * @return type
     496 */
     497function bp_replace_the_content( $content = '' ) {
     498
     499        $new_content = apply_filters( 'bp_replace_the_content', $content );
     500
     501        // Juggle the content around and try to prevent unsightly comments
     502        if ( !empty( $new_content ) && ( $new_content != $content ) ) {
     503
     504                // Set the content to be the new content
     505                $content = apply_filters( 'bp_replace_the_content', $new_content, $content );
     506
     507                // Clean up after ourselves
     508                unset( $new_content );
     509
     510                // Reset the $post global
     511                wp_reset_postdata();
     512        }
     513
     514        // Return possibly hi-jacked content
     515        return $content;
     516}
     517
     518/** Filters *******************************************************************/
     519
     520/**
     521 * Removes all filters from a WordPress filter, and stashes them in the $bp
     522 * global in the event they need to be restored later.
     523 *
     524 * @since BuddyPress (1.7)
     525 * @global WP_filter $wp_filter
     526 * @global array $merged_filters
     527 * @param string $tag
     528 * @param int $priority
     529 * @return bool
     530 */
     531function bp_remove_all_filters( $tag, $priority = false ) {
     532        global $wp_filter, $merged_filters;
     533
     534        $bp = buddypress();
     535
     536        // Filters exist
     537        if ( isset( $wp_filter[$tag] ) ) {
     538
     539                // Filters exist in this priority
     540                if ( !empty( $priority ) && isset( $wp_filter[$tag][$priority] ) ) {
     541
     542                        // Store filters in a backup
     543                        $bp->filters->wp_filter[$tag][$priority] = $wp_filter[$tag][$priority];
     544
     545                        // Unset the filters
     546                        unset( $wp_filter[$tag][$priority] );
     547
     548                // Priority is empty
     549                } else {
     550
     551                        // Store filters in a backup
     552                        $bp->filters->wp_filter[$tag] = $wp_filter[$tag];
     553
     554                        // Unset the filters
     555                        unset( $wp_filter[$tag] );
     556                }
     557        }
     558
     559        // Check merged filters
     560        if ( isset( $merged_filters[$tag] ) ) {
     561
     562                // Store filters in a backup
     563                $bp->filters->merged_filters[$tag] = $merged_filters[$tag];
     564
     565                // Unset the filters
     566                unset( $merged_filters[$tag] );
     567        }
     568
     569        return true;
     570}
     571
     572/**
     573 * Restores filters from the $bp global that were removed using
     574 * bp_remove_all_filters()
     575 *
     576 * @since BuddyPress (1.7)
     577 * @global WP_filter $wp_filter
     578 * @global array $merged_filters
     579 * @param string $tag
     580 * @param int $priority
     581 * @return bool
     582 */
     583function bp_restore_all_filters( $tag, $priority = false ) {
     584        global $wp_filter, $merged_filters;
     585
     586        $bp = buddypress();
     587
     588        // Filters exist
     589        if ( isset( $bp->filters->wp_filter[$tag] ) ) {
     590
     591                // Filters exist in this priority
     592                if ( !empty( $priority ) && isset( $bp->filters->wp_filter[$tag][$priority] ) ) {
     593
     594                        // Store filters in a backup
     595                        $wp_filter[$tag][$priority] = $bp->filters->wp_filter[$tag][$priority];
     596
     597                        // Unset the filters
     598                        unset( $bp->filters->wp_filter[$tag][$priority] );
     599
     600                // Priority is empty
     601                } else {
     602
     603                        // Store filters in a backup
     604                        $wp_filter[$tag] = $bp->filters->wp_filter[$tag];
     605
     606                        // Unset the filters
     607                        unset( $bp->filters->wp_filter[$tag] );
     608                }
     609        }
     610
     611        // Check merged filters
     612        if ( isset( $bp->filters->merged_filters[$tag] ) ) {
     613
     614                // Store filters in a backup
     615                $merged_filters[$tag] = $bp->filters->merged_filters[$tag];
     616
     617                // Unset the filters
     618                unset( $bp->filters->merged_filters[$tag] );
     619        }
     620
     621        return true;
     622}
     623
     624/**
     625 * Force comments_status to 'closed' for BuddyPress post types
     626 *
     627 * @since BuddyPress (1.7)
     628 * @param bool $open True if open, false if closed
     629 * @param int $post_id ID of the post to check
     630 * @return bool True if open, false if closed
     631 */
     632function bp_comments_open( $open, $post_id = 0 ) {
     633
     634        $retval = is_buddypress() ? false : $open;
     635
     636        // Allow override of the override
     637        return apply_filters( 'bp_force_comment_status', $retval, $open, $post_id );
     638}
  • bp-groups/bp-groups-filters.php

     
    1010// Exit if accessed directly
    1111if ( !defined( 'ABSPATH' ) ) exit;
    1212
     13// Filter bbPress template locations
     14
     15add_filter( 'bp_groups_get_directory_template', 'bp_add_template_locations' );
     16add_filter( 'bp_get_single_group_template',    'bp_add_template_locations' );
     17
    1318/* Apply WordPress defined filters */
    1419add_filter( 'bp_get_group_description',         'wptexturize' );
    1520add_filter( 'bp_get_group_description_excerpt', 'wptexturize' );
  • bp-groups/bp-groups-screens.php

     
    148148                                        groups_join_group( $bp->groups->current_group->id, bp_loggedin_user_id() );
    149149
    150150                                $topic_page = isset( $_GET['topic_page'] ) ? $_GET['topic_page'] : false;
    151                                
     151
    152152                                // Don't allow reply flooding
    153153                                if ( bp_forums_reply_exists( $_POST['reply_text'], $topic_id, bp_loggedin_user_id() ) ) {
    154154                                        bp_core_add_message( __( 'It looks like you\'ve already said that!', 'buddypress' ), 'error' );
    155                                 } else {       
     155                                } else {
    156156                                        if ( !$post_id = groups_new_group_forum_post( $_POST['reply_text'], $topic_id, $topic_page ) )
    157157                                                bp_core_add_message( __( 'There was an error when replying to that topic', 'buddypress'), 'error' );
    158158                                        else
     
    160160                                }
    161161
    162162                                $query_vars = isset( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : '';
    163                                
     163
    164164                                $redirect = bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' . $query_vars;
    165165
    166166                                if ( !empty( $post_id ) ) {
     
    882882}
    883883add_action( 'bp_notification_settings', 'groups_screen_notification_settings' );
    884884
    885 ?>
     885/** Theme Compatability *******************************************************/
     886
     887/**
     888 * The main theme compat class for BuddyPress Groups
     889 *
     890 * This class sets up the necessary theme compatability actions to safely output
     891 * group template parts to the_title and the_content areas of a theme.
     892 *
     893 * @since BuddyPress (1.7)
     894 */
     895class BP_Groups_Theme_Compat {
     896
     897        /**
     898         * Setup the groups component theme compatibility
     899         *
     900         * @since BuddyPress (1.7)
     901         */
     902        public function __construct() {
     903                add_action( 'bp_setup_theme_compat', array( $this, 'is_group' ) );
     904        }
     905
     906        /**
     907         * Are we looking at something that needs group theme compatability?
     908         *
     909         * @since BuddyPress (1.7)
     910         */
     911        public function is_group() {
     912
     913                // Bail if not looking at a group
     914                if ( ! bp_is_groups_component() )
     915                        return;
     916
     917                // Group Directory
     918                if ( ! bp_current_action() && ! bp_current_item() ) {
     919                        bp_update_is_directory( true, 'groups' );
     920
     921                        do_action( 'groups_directory_groups_setup' );
     922
     923                        add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
     924                        add_filter( 'bp_replace_the_content',                    array( $this, 'directory_content'    ) );
     925
     926                // Creating a group
     927                } elseif ( bp_is_groups_component() && bp_is_current_action( 'create' ) ) {
     928                        add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'create_dummy_post' ) );
     929                        add_filter( 'bp_replace_the_content',                    array( $this, 'create_content'    ) );
     930
     931                // Group admin
     932                } elseif ( bp_is_single_item() ) {
     933                        add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'single_dummy_post' ) );
     934                        add_filter( 'bp_replace_the_content',                    array( $this, 'single_content'    ) );
     935
     936                }
     937        }
     938
     939        /** Directory *************************************************************/
     940
     941        /**
     942         * Update the global $post with directory data
     943         *
     944         * @since BuddyPress (1.7)
     945         */
     946        public function directory_dummy_post() {
     947
     948                // Title based on ability to create groups
     949                if ( is_user_logged_in() && bp_user_can_create_groups() ) {
     950                        $title = __( 'Groups', 'buddypress' ) . '&nbsp;<a class="button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ) . '">' . __( 'Create a Group', 'buddypress' ) . '</a>';
     951                } else {
     952                        $title = __( 'Groups', 'buddypress' );
     953                }
     954
     955                bp_theme_compat_reset_post( array(
     956                        'ID'             => 0,
     957                        'post_title'     => $title,
     958                        'post_author'    => 0,
     959                        'post_date'      => 0,
     960                        'post_content'   => '',
     961                        'post_type'      => 'bp_group',
     962                        'post_status'    => 'publish',
     963                        'is_archive'     => true,
     964                        'comment_status' => 'closed'
     965                ) );
     966        }
     967
     968        /**
     969         * Filter the_content with the groups index template part
     970         *
     971         * @since BuddyPress (1.7)
     972         */
     973        public function directory_content() {
     974                bp_buffer_template_part( 'groups/index' );
     975        }
     976
     977        /** Create ****************************************************************/
     978
     979        /**
     980         * Update the global $post with create screen data
     981         *
     982         * @since BuddyPress (1.7)
     983         */
     984        public function create_dummy_post() {
     985
     986                // Title based on ability to create groups
     987                if ( is_user_logged_in() && bp_user_can_create_groups() ) {
     988                        $title = '<a class="button" href="' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ) . '">' . __( 'Groups', 'buddypress' ) . '</a>&nbsp;' . __( 'Create a Group', 'buddypress' );
     989                } else {
     990                        $title = __( 'Groups', 'buddypress' );
     991                }
     992
     993                bp_theme_compat_reset_post( array(
     994                        'ID'             => 0,
     995                        'post_title'     => $title,
     996                        'post_author'    => 0,
     997                        'post_date'      => 0,
     998                        'post_content'   => '',
     999                        'post_type'      => 'bp_group',
     1000                        'post_status'    => 'publish',
     1001                        'is_archive'     => true,
     1002                        'comment_status' => 'closed'
     1003                ) );
     1004        }
     1005
     1006        /**
     1007         * Filter the_content with the create screen template part
     1008         *
     1009         * @since BuddyPress (1.7)
     1010         */
     1011        public function create_content() {
     1012                bp_buffer_template_part( 'groups/create' );
     1013        }
     1014
     1015        /** Single ****************************************************************/
     1016
     1017        /**
     1018         * Update the global $post with single group data
     1019         *
     1020         * @since BuddyPress (1.7)
     1021         */
     1022        public function single_dummy_post() {
     1023                bp_theme_compat_reset_post( array(
     1024                        'ID'             => 0,
     1025                        'post_title'     => bp_get_current_group_name(),
     1026                        'post_author'    => 0,
     1027                        'post_date'      => 0,
     1028                        'post_content'   => '',
     1029                        'post_type'      => 'bp_group',
     1030                        'post_status'    => 'publish',
     1031                        'is_archive'     => true,
     1032                        'comment_status' => 'closed'
     1033                ) );
     1034        }
     1035
     1036        /**
     1037         * Filter the_content with the single group template part
     1038         *
     1039         * @since BuddyPress (1.7)
     1040         */
     1041        public function single_content() {
     1042                bp_buffer_template_part( 'groups/single/home' );
     1043        }
     1044}
     1045new BP_Groups_Theme_Compat();
  • bp-loader.php

     
    3434 */
    3535class BuddyPress {
    3636
    37         /**
    38          * Note to Plugin and Theme authors:
    39          *
    40          * Do not directly reference the variables below in your code. Their names
    41          * and locations in the BuddyPress class are subject to change at any time.
    42          *
    43          * Most of them have reference functions located in bp-core-functions.php.
    44          * The ones that don't can be accessed via their respective WordPress API's.
    45          *
    46          * Components are encouraged to store their data in the $bp global rather
    47          * than new globals to keep all BuddyPress data in one place.
    48          */
     37        /** Magic *****************************************************************/
    4938
    50         /** Version ***************************************************************/
    51 
    5239        /**
    53          * @var string BuddyPress version
    54          */
    55         public $version = '1.7';
    56 
    57         /**
    58          * @var int Database version of current BuddyPress files
    59          */
    60         public $db_version = 6066;
    61 
    62         /**
    63          * @var int Database version raw from database connection
    64          */
    65         public $db_version_raw = 0;
    66 
    67         /**
    68          * @var string State of BuddyPress installation
    69          */
    70         public $maintenance_mode = '';
    71 
    72         /**
    73          * @var bool Include deprecated BuddyPress files or not
    74          */
    75         public $load_deprecated = true;
    76 
    77         /** Root ******************************************************************/
    78 
    79         /**
    80          * @var int The root blog ID
    81          */
    82         public $root_blog_id = 1;
    83 
    84         /** Paths *****************************************************************/
    85 
    86         /**
    87          * The absolute path and filename of this file.
     40         * BuddyPress uses many variables, most of which can be filtered to customize
     41         * the way that it works. To prevent unauthorized access, these variables
     42         * are stored in a private array that is magically updated using PHP 5.2+
     43         * methods. This is to prevent third party plugins from tampering with
     44         * essential information indirectly, which would cause issues later.
    8845         *
    89          * @since BuddyPress (1.6)
    90          * @var string
     46         * @see BuddyPress::setup_globals()
     47         * @var array
    9148         */
    92         public $file;
     49        private $data;
    9350
    94         /**
    95          * @var string Basename of the BuddyPress plugin directory
    96          */
    97         public $basename = '';
     51        /** Not Magic *************************************************************/
    9852
    9953        /**
    100          * @var string Absolute path to the BuddyPress plugin directory
     54         * @var array Primary BuddyPress navigation
    10155         */
    102         public $plugin_dir = '';
     56        public $bp_nav = array();
    10357
    10458        /**
    105          * @var string Absolute path to the BuddyPress themes directory
     59         * @var array Secondary BuddyPress navigation to $bp_nav
    10660         */
    107         public $themes_dir = '';
     61        public $bp_options_nav = array();
    10862
    10963        /**
    110          * @var string Absolute path to the BuddyPress language directory
     64         * @var array The unfiltered URI broken down into chunks
     65         * @see bp_core_set_uri_globals()
    11166         */
    112         public $lang_dir = '';
     67        public $unfiltered_uri = array();
    11368
    114         /** URLs ******************************************************************/
    115 
    11669        /**
    117          * @var string URL to the BuddyPress plugin directory
     70         * @var array The canonical URI stack
     71         * @see bp_redirect_canonical()
     72         * @see bp_core_new_nav_item()
    11873         */
    119         public $plugin_url = '';
     74        public $canonical_stack = array();
    12075
    12176        /**
    122          * @var string URL to the BuddyPress themes directory
     77         * @var array Additional navigation elements (supplemental)
    12378         */
    124         public $themes_url = '';
     79        public $action_variables = array();
    12580
    126         /** Users *****************************************************************/
    127 
    12881        /**
    129          * @var object Current user
     82         * @var array Required components (core, members)
    13083         */
    131         public $current_user = null;
     84        public $required_components = array();
    13285
    13386        /**
    134          * @var object Displayed user
     87         * @var array Additional active components
    13588         */
    136         public $displayed_user = null;
     89        public $loaded_components = array();
    13790
    138         /** Navigation ************************************************************/
     91        /** Option Overload *******************************************************/
    13992
    14093        /**
    141          * @var array Primary BuddyPress navigation
     94         * @var array Optional Overloads default options retrieved from get_option()
    14295         */
    143         public $bp_nav = array();
     96        public $options = array();
    14497
    145         /**
    146          * @var array Secondary BuddyPress navigation to $bp_nav
    147          */
    148         public $bp_options_nav = array();
     98        /** Singleton *************************************************************/
    14999
    150         /** Toolbar ***************************************************************/
    151 
    152100        /**
    153          * @var string The primary toolbar ID
     101         * @var BuddyPress The one true BuddyPress
    154102         */
    155         public $my_account_menu_id = '';
     103        private static $instance;
    156104
    157         /** URI's *****************************************************************/
    158 
    159105        /**
    160          * @var array The unfiltered URI broken down into chunks
    161          * @see bp_core_set_uri_globals()
     106         * Main BuddyPress Instance
     107         *
     108         * BuddyPress is great
     109         * Please load it only one time
     110         * For this, we thank you
     111         *
     112         * Insures that only one instance of BuddyPress exists in memory at any one
     113         * time. Also prevents needing to define globals all over the place.
     114         *
     115         * @since BuddyPress (1.7)
     116         *
     117         * @staticvar array $instance
     118         * @uses BuddyPress::constants() Setup the constants (mostly deprecated)
     119         * @uses BuddyPress::setup_globals() Setup the globals needed
     120         * @uses BuddyPress::includes() Include the required files
     121         * @uses BuddyPress::setup_actions() Setup the hooks and actions
     122         * @see buddypress()
     123         *
     124         * @return The one true BuddyPress
    162125         */
    163         public $unfiltered_uri = array();
     126        public static function instance() {
     127                if ( ! isset( self::$instance ) ) {
     128                        self::$instance = new BuddyPress;
     129                        self::$instance->constants();
     130                        self::$instance->setup_globals();
     131                        self::$instance->includes();
     132                        self::$instance->setup_actions();
     133                }
     134                return self::$instance;
     135        }
    164136
    165         /**
    166          * @var int The current offset of the URI
    167          * @see bp_core_set_uri_globals()
    168          */
    169         public $unfiltered_uri_offset = 0;
     137        /** Magic Methods *********************************************************/
    170138
    171139        /**
    172          * @var bool Are status headers already sent?
     140         * A dummy constructor to prevent BuddyPress from being loaded more than once.
     141         *
     142         * @since BuddyPress (1.7)
     143         * @see BuddyPress::instance()
     144         * @see buddypress()
    173145         */
    174         public $no_status_set = false;
     146        private function __construct() { /* Do nothing here */ }
    175147
    176148        /**
    177          * @var array The canonical URI stack
    178          * @see bp_redirect_canonical()
    179          * @see bp_core_new_nav_item()
     149         * A dummy magic method to prevent BuddyPress from being cloned
     150         *
     151         * @since BuddyPress (1.7)
    180152         */
    181         public $canonical_stack = array();
     153        public function __clone() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'buddypress' ), '1.7' ); }
    182154
    183         /** Components ************************************************************/
    184 
    185155        /**
    186          * @var string Name of the current BuddyPress component (primary)
     156         * A dummy magic method to prevent BuddyPress from being unserialized
     157         *
     158         * @since BuddyPress (1.7)
    187159         */
    188         public $current_component = '';
     160        public function __wakeup() { _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'buddypress' ), '1.7' ); }
    189161
    190162        /**
    191          * @var string Name of the current BuddyPress item (secondary)
     163         * Magic method for checking the existence of a certain custom field
     164         *
     165         * @since BuddyPress (1.7)
    192166         */
    193         public $current_item = '';
     167        public function __isset( $key ) { return isset( $this->data[$key] ); }
    194168
    195169        /**
    196          * @var string Name of the current BuddyPress action (tertiary)
     170         * Magic method for getting BuddyPress varibles
     171         *
     172         * @since BuddyPress (1.7)
    197173         */
    198         public $current_action = '';
     174        public function __get( $key ) { return isset( $this->data[$key] ) ? $this->data[$key] : null; }
    199175
    200176        /**
    201          * @var array Additional navigation elements (supplemental)
     177         * Magic method for setting BuddyPress varibles
     178         *
     179         * @since BuddyPress (1.7)
    202180         */
    203         public $action_variables = array();
     181        public function __set( $key, $value ) { $this->data[$key] = $value; }
    204182
    205         /**
    206          * @var bool Displaying custom 2nd level navigation menu (I.E a group)
    207          */
    208         public $is_single_item = false;
     183        /** Private Methods *******************************************************/
    209184
    210         /** Option Overload *******************************************************/
    211 
    212185        /**
    213          * @var array Optional Overloads default options retrieved from get_option()
    214          */
    215         public $options = array();
    216 
    217         /** Functions *************************************************************/
    218 
    219         /**
    220          * The main BuddyPress loader
    221          *
    222          * @since BuddyPress (1.6)
    223          *
    224          * @uses BuddyPress::constants() Setup legacy constants
    225          * @uses BuddyPress::setup_globals() Setup globals needed
    226          * @uses BuddyPress::includes() Includ required files
    227          * @uses BuddyPress::setup_actions() Setup hooks and actions
    228          */
    229         public function __construct() {
    230                 $this->constants();
    231                 $this->setup_globals();
    232                 $this->includes();
    233                 $this->setup_actions();
    234         }
    235 
    236         /**
    237186         * Legacy BuddyPress constants
    238187         *
    239188         * Try to avoid using these. Their values have been moved into variables
     
    315264         */
    316265        private function setup_globals() {
    317266
     267                /** Versions **********************************************************/
     268
     269                $this->version        = '1.7';
     270                $this->db_version     = 6066;
     271
     272                /** Loading ***********************************************************/
     273
     274                $this->maintenance_mode = '';
     275                $this->load_deprecated  = true;
     276
     277                /** Toolbar ***********************************************************/
     278
     279                /**
     280                 * @var string The primary toolbar ID
     281                 */
     282                $this->my_account_menu_id = '';
     283
     284                /** URI's *************************************************************/
     285
     286                /**
     287                 * @var int The current offset of the URI
     288                 * @see bp_core_set_uri_globals()
     289                 */
     290                $this->unfiltered_uri_offset = 0;
     291
     292                /**
     293                 * @var bool Are status headers already sent?
     294                 */
     295                $this->no_status_set = false;
     296
     297                /** Components ********************************************************/
     298
     299                /**
     300                 * @var string Name of the current BuddyPress component (primary)
     301                 */
     302                $this->current_component = '';
     303
     304                /**
     305                 * @var string Name of the current BuddyPress item (secondary)
     306                 */
     307                $this->current_item = '';
     308
     309                /**
     310                 * @var string Name of the current BuddyPress action (tertiary)
     311                 */
     312                $this->current_action = '';
     313
     314                /**
     315                 * @var bool Displaying custom 2nd level navigation menu (I.E a group)
     316                 */
     317                $this->is_single_item = false;
     318       
    318319                /** Root **************************************************************/
    319320
    320321                // BuddyPress Root blog ID
     
    335336                // Languages
    336337                $this->lang_dir   = $this->plugin_dir . 'bp-languages';
    337338
     339                /** Theme Compat ******************************************************/
     340
     341                $this->theme_compat   = new stdClass(); // Base theme compatibility class
     342                $this->filters        = new stdClass(); // Used when adding/removing filters
     343
    338344                /** Users *************************************************************/
    339345
    340346                $this->current_user       = new stdClass();
     
    367373                        $versions['1.2']        = get_site_option(                      'bp-core-db-version' );
    368374                        $versions['1.5-multi']  = get_site_option(                           'bp-db-version' );
    369375                        $versions['1.6-multi']  = get_site_option(                          '_bp_db_version' );
    370                         $versions['1.5-single'] = get_blog_option( $this->root_blog_id,     'bp-db-version' );
     376                        $versions['1.5-single'] = get_blog_option( $this->root_blog_id,      'bp-db-version' );
    371377
    372378                        // Remove empty array items
    373379                        $versions             = array_filter( $versions );
     
    411417                // Not in maintenance mode
    412418                if ( empty( $this->maintenance_mode ) ) {
    413419
     420                        // Theme compatability
     421                        require( $this->plugin_dir . 'bp-core/bp-core-template-loader.php'     );
     422                        require( $this->plugin_dir . 'bp-core/bp-core-theme-compatability.php' );
     423
    414424                        // Require all of the BuddyPress core libraries
     425                        require( $this->plugin_dir . 'bp-core/bp-core-dependency.php' );
    415426                        require( $this->plugin_dir . 'bp-core/bp-core-actions.php'    );
    416427                        require( $this->plugin_dir . 'bp-core/bp-core-caps.php'       );
    417428                        require( $this->plugin_dir . 'bp-core/bp-core-cache.php'      );
     
    461472
    462473                // Array of BuddyPress core actions
    463474                $actions = array(
     475                        'setup_theme',              // Setup the default theme compat
    464476                        'setup_current_user',       // Setup currently logged in user
    465477                        'register_post_types',      // Register post types
    466478                        'register_post_statuses',   // Register post statuses
    467479                        'register_taxonomies',      // Register taxonomies
    468480                        'register_views',           // Register the views
    469481                        'register_theme_directory', // Register the theme directory
     482                        'register_theme_packages',  // Register bundled theme packages (bp-themes)
    470483                        'load_textdomain',          // Load textdomain
    471484                        'add_rewrite_tags',         // Add rewrite tags
    472485                        'generate_rewrite_rules'    // Generate rewrite rules
     
    479492                // Setup the BuddyPress theme directory
    480493                register_theme_directory( $this->themes_dir );
    481494        }
     495       
     496        /** Public Methods ********************************************************/
     497
     498        /**
     499         * Register bundled theme packages
     500         *
     501         * Note that since we currently have complete control over bp-themes and
     502         * the bp-theme-compat folders, it's fine to hardcode these here. If at a
     503         * later date we need to automate this, an API will need to be built.
     504         *
     505         * @since BuddyPress (1.7)
     506         */
     507        public function register_theme_packages() {
     508                bp_register_theme_package( array(
     509                        'id'      => 'default',
     510                        'name'    => __( 'BuddyPress Default', 'buddypress' ),
     511                        'version' => bp_get_version(),
     512                        'dir'     => trailingslashit( $this->themes_dir . '/bp-theme-compat' ),
     513                        'url'     => trailingslashit( $this->themes_url . '/bp-theme-compat' )
     514                ) );
     515        }
     516       
     517        /**
     518         * Setup the default BuddyPress theme compatability location.
     519         *
     520         * @since BuddyPress (1.7)
     521         */
     522        public function setup_theme() {
     523
     524                // Bail if something already has this under control
     525                if ( ! empty( $this->theme_compat->theme ) )
     526                        return;
     527
     528                // Setup the theme package to use for compatibility
     529                bp_setup_theme_compat( bp_get_theme_package_id() );
     530        }
    482531}
    483532
    484 // "And now for something completely different"
    485 $GLOBALS['bp'] = new BuddyPress;
     533/**
     534 * The main function responsible for returning the one true BuddyPress Instance
     535 * to functions everywhere.
     536 *
     537 * Use this function like you would a global variable, except without needing
     538 * to declare the global.
     539 *
     540 * Example: <?php $bp = buddypress(); ?>
     541 *
     542 * @return The one true BuddyPress Instance
     543 */
     544function buddypress() {
     545        return buddypress::instance();
     546}
    486547
    487 endif;
     548/**
     549 * Hook BuddyPress early onto the 'plugins_loaded' action.
     550 *
     551 * This gives all other plugins the chance to load before BuddyPress, to get
     552 * their actions, filters, and overrides setup without BuddyPress being in the
     553 * way.
     554 */
     555if ( defined( 'BUDDYPRESS_LATE_LOAD' ) ) {
     556        add_action( 'plugins_loaded', 'buddypress', (int) BUDDYPRESS_LATE_LOAD );
    488557
    489 ?>
     558// "And now here's something we hope you'll really like!"
     559} else {
     560        $GLOBALS['bp'] = &buddypress();
     561}
     562
     563endif;
  • bp-members/bp-members-screens.php

     
    260260}
    261261add_action( 'bp_screens', 'bp_core_screen_activation' );
    262262
    263 ?>
     263/** Theme Compatability *******************************************************/
     264
     265/**
     266 * The main theme compat class for BuddyPress Groups
     267 *
     268 * This class sets up the necessary theme compatability actions to safely output
     269 * group template parts to the_title and the_content areas of a theme.
     270 *
     271 * @since BuddyPress (1.7)
     272 */
     273class BP_Members_Theme_Compat {
     274
     275        /**
     276         * Setup the groups component theme compatibility
     277         *
     278         * @since BuddyPress (1.7)
     279         */
     280        public function __construct() {
     281                add_action( 'bp_setup_theme_compat', array( $this, 'is_members' ) );
     282        }
     283
     284        /**
     285         * Are we looking at something that needs group theme compatability?
     286         *
     287         * @since BuddyPress (1.7)
     288         */
     289        public function is_members() {
     290
     291                // Bail if not looking at a group
     292                if ( ! bp_is_members_component() )
     293                        return;
     294
     295                // Group Directory
     296                if ( ! bp_current_action() && ! bp_current_item() ) {
     297                        bp_update_is_directory( true, 'members' );
     298
     299                        do_action( 'members_directory_groups_setup' );
     300
     301                        add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'directory_dummy_post' ) );
     302                        add_filter( 'bp_replace_the_content',                    array( $this, 'directory_content'    ) );
     303                }
     304        }
     305
     306        /** Directory *************************************************************/
     307
     308        /**
     309         * Update the global $post with directory data
     310         *
     311         * @since BuddyPress (1.7)
     312         */
     313        public function directory_dummy_post() {
     314                bp_theme_compat_reset_post( array(
     315                        'ID'             => 0,
     316                        'post_title'     => __( 'Members', 'buddypress' ),
     317                        'post_author'    => 0,
     318                        'post_date'      => 0,
     319                        'post_content'   => '',
     320                        'post_type'      => 'bp_members',
     321                        'post_status'    => 'publish',
     322                        'is_archive'     => true,
     323                        'comment_status' => 'closed'
     324                ) );
     325        }
     326
     327        /**
     328         * Filter the_content with the groups index template part
     329         *
     330         * @since BuddyPress (1.7)
     331         */
     332        public function directory_content() {
     333                bp_buffer_template_part( 'members/index' );
     334        }
     335}
     336new BP_Members_Theme_Compat();
  • bp-themes/bp-default/_inc/ajax.php

     
    7575                add_action( 'wp_ajax_nopriv_' . $name, $function );
    7676        }
    7777}
    78 add_action( 'after_setup_theme', 'bp_dtheme_register_actions', 20 );
     78add_action( 'bp_after_setup_theme', 'bp_dtheme_register_actions', 20 );
    7979
    8080/**
    8181 * This function looks scarier than it actually is. :)
  • bp-themes/bp-theme-compat/buddypress-functions.php

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

     
     1<?php do_action( 'bp_before_activity_loop' ); ?>
     2
     3<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) ) ) : ?>
     4
     5        <?php /* Show pagination if JS is not enabled, since the "Load More" link will do nothing */ ?>
     6        <noscript>
     7                <div class="pagination">
     8                        <div class="pag-count"><?php bp_activity_pagination_count(); ?></div>
     9                        <div class="pagination-links"><?php bp_activity_pagination_links(); ?></div>
     10                </div>
     11        </noscript>
     12
     13        <?php if ( empty( $_POST['page'] ) ) : ?>
     14
     15                <ul id="activity-stream" class="activity-list item-list">
     16
     17        <?php endif; ?>
     18
     19        <?php while ( bp_activities() ) : bp_the_activity(); ?>
     20
     21                <?php bp_get_template_part( 'activity/entry' ); ?>
     22
     23        <?php endwhile; ?>
     24
     25        <?php if ( bp_activity_has_more_items() ) : ?>
     26
     27                <li class="load-more">
     28                        <a href="#more"><?php _e( 'Load More', 'buddypress' ); ?></a>
     29                </li>
     30
     31        <?php endif; ?>
     32
     33        <?php if ( empty( $_POST['page'] ) ) : ?>
     34
     35                </ul>
     36
     37        <?php endif; ?>
     38
     39<?php else : ?>
     40
     41        <div id="message" class="info">
     42                <p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ); ?></p>
     43        </div>
     44
     45<?php endif; ?>
     46
     47<?php do_action( 'bp_after_activity_loop' ); ?>
     48
     49<form action="" name="activity-loop-form" id="activity-loop-form" method="post">
     50
     51        <?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ); ?>
     52
     53</form>
  • bp-themes/bp-theme-compat/buddypress/activity/comment.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Activity Stream Comment
     5 *
     6 * This template is used by bp_activity_comments() functions to show
     7 * each activity.
     8 *
     9 * @package BuddyPress
     10 * @subpackage bp-default
     11 */
     12
     13?>
     14
     15<?php do_action( 'bp_before_activity_comment' ); ?>
     16
     17<li id="acomment-<?php bp_activity_comment_id(); ?>">
     18        <div class="acomment-avatar">
     19                <a href="<?php bp_activity_comment_user_link(); ?>">
     20                        <?php bp_activity_avatar( 'type=thumb&user_id=' . bp_get_activity_comment_user_id() ); ?>
     21                </a>
     22        </div>
     23
     24        <div class="acomment-meta">
     25                <?php
     26                /* translators: 1: user profile link, 2: user name, 3: activity permalink, 4: activity timestamp */
     27                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() );
     28                ?>
     29        </div>
     30
     31        <div class="acomment-content"><?php bp_activity_comment_content(); ?></div>
     32
     33        <div class="acomment-options">
     34
     35                <?php if ( is_user_logged_in() && bp_activity_can_comment_reply( bp_activity_current_comment() ) ) : ?>
     36
     37                        <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>
     38
     39                <?php endif; ?>
     40
     41                <?php if ( bp_activity_user_can_delete() ) : ?>
     42
     43                        <a href="<?php bp_activity_comment_delete_link(); ?>" class="delete acomment-delete confirm bp-secondary-action" rel="nofollow"><?php _e( 'Delete', 'buddypress' ); ?></a>
     44
     45                <?php endif; ?>
     46
     47                <?php do_action( 'bp_activity_comment_options' ); ?>
     48
     49        </div>
     50
     51        <?php bp_activity_recurse_comments( bp_activity_current_comment() ); ?>
     52</li>
     53
     54<?php do_action( 'bp_after_activity_comment' ); ?>
  • bp-themes/bp-theme-compat/buddypress/activity/entry.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Activity Stream (Single Item)
     5 *
     6 * This template is used by activity-loop.php and AJAX functions to show
     7 * each activity.
     8 *
     9 * @package BuddyPress
     10 * @subpackage bp-default
     11 */
     12
     13?>
     14
     15<?php do_action( 'bp_before_activity_entry' ); ?>
     16
     17<li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>">
     18        <div class="activity-avatar">
     19                <a href="<?php bp_activity_user_link(); ?>">
     20
     21                        <?php bp_activity_avatar(); ?>
     22
     23                </a>
     24        </div>
     25
     26        <div class="activity-content">
     27
     28                <div class="activity-header">
     29
     30                        <?php bp_activity_action(); ?>
     31
     32                </div>
     33
     34                <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?>
     35
     36                        <div class="activity-inreplyto">
     37                                <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>
     38                        </div>
     39
     40                <?php endif; ?>
     41
     42                <?php if ( bp_activity_has_content() ) : ?>
     43
     44                        <div class="activity-inner">
     45
     46                                <?php bp_activity_content_body(); ?>
     47
     48                        </div>
     49
     50                <?php endif; ?>
     51
     52                <?php do_action( 'bp_activity_entry_content' ); ?>
     53
     54                <?php if ( is_user_logged_in() ) : ?>
     55
     56                        <div class="activity-meta">
     57
     58                                <?php if ( bp_activity_can_comment() ) : ?>
     59
     60                                        <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>
     61
     62                                <?php endif; ?>
     63
     64                                <?php if ( bp_activity_can_favorite() ) : ?>
     65
     66                                        <?php if ( !bp_get_activity_is_favorite() ) : ?>
     67
     68                                                <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>
     69
     70                                        <?php else : ?>
     71
     72                                                <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>
     73
     74                                        <?php endif; ?>
     75
     76                                <?php endif; ?>
     77
     78                                <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?>
     79
     80                                <?php do_action( 'bp_activity_entry_meta' ); ?>
     81
     82                        </div>
     83
     84                <?php endif; ?>
     85
     86        </div>
     87
     88        <?php do_action( 'bp_before_activity_entry_comments' ); ?>
     89
     90        <?php if ( ( is_user_logged_in() && bp_activity_can_comment() ) || bp_activity_get_comment_count() ) : ?>
     91
     92                <div class="activity-comments">
     93
     94                        <?php bp_activity_comments(); ?>
     95
     96                        <?php if ( is_user_logged_in() ) : ?>
     97
     98                                <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(); ?>>
     99                                        <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div>
     100                                        <div class="ac-reply-content">
     101                                                <div class="ac-textarea">
     102                                                        <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input" name="ac_input_<?php bp_activity_id(); ?>"></textarea>
     103                                                </div>
     104                                                <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ); ?>" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ); ?>
     105                                                <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" />
     106                                        </div>
     107
     108                                        <?php do_action( 'bp_activity_entry_comments' ); ?>
     109
     110                                        <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?>
     111
     112                                </form>
     113
     114                        <?php endif; ?>
     115
     116                </div>
     117
     118        <?php endif; ?>
     119
     120        <?php do_action( 'bp_after_activity_entry_comments' ); ?>
     121
     122</li>
     123
     124<?php do_action( 'bp_after_activity_entry' ); ?>
  • bp-themes/bp-theme-compat/buddypress/activity/index.php

     
     1<?php do_action( 'bp_before_directory_activity' ); ?>
     2
     3<div id="buddypress">
     4
     5        <?php do_action( 'bp_before_directory_activity_content' ); ?>
     6
     7        <?php if ( is_user_logged_in() ) : ?>
     8
     9                <?php bp_get_template_part( 'activity/post-form' ); ?>
     10
     11        <?php endif; ?>
     12
     13        <?php do_action( 'template_notices' ); ?>
     14
     15        <div class="item-list-tabs activity-type-tabs" role="navigation">
     16                <ul>
     17                        <?php do_action( 'bp_before_activity_type_tab_all' ); ?>
     18
     19                        <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>
     20
     21                        <?php if ( is_user_logged_in() ) : ?>
     22
     23                                <?php do_action( 'bp_before_activity_type_tab_friends' ); ?>
     24
     25                                <?php if ( bp_is_active( 'friends' ) ) : ?>
     26
     27                                        <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
     28
     29                                                <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>
     30
     31                                        <?php endif; ?>
     32
     33                                <?php endif; ?>
     34
     35                                <?php do_action( 'bp_before_activity_type_tab_groups' ); ?>
     36
     37                                <?php if ( bp_is_active( 'groups' ) ) : ?>
     38
     39                                        <?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
     40
     41                                                <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>
     42
     43                                        <?php endif; ?>
     44
     45                                <?php endif; ?>
     46
     47                                <?php do_action( 'bp_before_activity_type_tab_favorites' ); ?>
     48
     49                                <?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
     50
     51                                        <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>
     52
     53                                <?php endif; ?>
     54
     55                                <?php do_action( 'bp_before_activity_type_tab_mentions' ); ?>
     56
     57                                <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>
     58
     59                        <?php endif; ?>
     60
     61                        <?php do_action( 'bp_activity_type_tabs' ); ?>
     62                </ul>
     63        </div><!-- .item-list-tabs -->
     64
     65        <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     66                <ul>
     67                        <li class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li>
     68
     69                        <?php do_action( 'bp_activity_syndication_options' ); ?>
     70
     71                        <li id="activity-filter-select" class="last">
     72                                <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
     73                                <select id="activity-filter-by">
     74                                        <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
     75                                        <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
     76
     77                                        <?php if ( bp_is_active( 'blogs' ) ) : ?>
     78
     79                                                <option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ); ?></option>
     80                                                <option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ); ?></option>
     81
     82                                        <?php endif; ?>
     83
     84                                        <?php if ( bp_is_active( 'forums' ) ) : ?>
     85
     86                                                <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option>
     87                                                <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option>
     88
     89                                        <?php endif; ?>
     90
     91                                        <?php if ( bp_is_active( 'groups' ) ) : ?>
     92
     93                                                <option value="created_group"><?php _e( 'New Groups', 'buddypress' ); ?></option>
     94                                                <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option>
     95
     96                                        <?php endif; ?>
     97
     98                                        <?php if ( bp_is_active( 'friends' ) ) : ?>
     99
     100                                                <option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option>
     101
     102                                        <?php endif; ?>
     103
     104                                        <option value="new_member"><?php _e( 'New Members', 'buddypress' ); ?></option>
     105
     106                                        <?php do_action( 'bp_activity_filter_options' ); ?>
     107
     108                                </select>
     109                        </li>
     110                </ul>
     111        </div><!-- .item-list-tabs -->
     112
     113        <?php do_action( 'bp_before_directory_activity_list' ); ?>
     114
     115        <div class="activity" role="main">
     116
     117                <?php bp_get_template_part( 'activity/activity-loop' ); ?>
     118
     119        </div><!-- .activity -->
     120
     121        <?php do_action( 'bp_after_directory_activity_list' ); ?>
     122
     123        <?php do_action( 'bp_directory_activity_content' ); ?>
     124
     125        <?php do_action( 'bp_after_directory_activity_content' ); ?>
     126
     127        <?php do_action( 'bp_after_directory_activity' ); ?>
     128
     129</div>
  • bp-themes/bp-theme-compat/buddypress/activity/post-form.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Activity Post Form
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<form action="<?php bp_activity_post_form_action(); ?>" method="post" id="whats-new-form" name="whats-new-form" role="complementary">
     13
     14        <?php do_action( 'bp_before_activity_post_form' ); ?>
     15
     16        <div id="whats-new-avatar">
     17                <a href="<?php echo bp_loggedin_user_domain(); ?>">
     18                        <?php bp_loggedin_user_avatar( 'width=' . bp_core_avatar_thumb_width() . '&height=' . bp_core_avatar_thumb_height() ); ?>
     19                </a>
     20        </div>
     21
     22        <h5><?php if ( bp_is_group() )
     23                        printf( __( "What's new in %s, %s?", 'buddypress' ), bp_get_group_name(), bp_get_user_firstname() );
     24                else
     25                        printf( __( "What's new, %s?", 'buddypress' ), bp_get_user_firstname() );
     26        ?></h5>
     27
     28        <div id="whats-new-content">
     29                <div id="whats-new-textarea">
     30                        <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>
     31                </div>
     32
     33                <div id="whats-new-options">
     34                        <div id="whats-new-submit">
     35                                <input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php _e( 'Post Update', 'buddypress' ); ?>" />
     36                        </div>
     37
     38                        <?php if ( bp_is_active( 'groups' ) && !bp_is_my_profile() && !bp_is_group() ) : ?>
     39
     40                                <div id="whats-new-post-in-box">
     41
     42                                        <?php _e( 'Post in', 'buddypress' ); ?>:
     43
     44                                        <select id="whats-new-post-in" name="whats-new-post-in">
     45                                                <option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ); ?></option>
     46
     47                                                <?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) :
     48                                                        while ( bp_groups() ) : bp_the_group(); ?>
     49
     50                                                                <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
     51
     52                                                        <?php endwhile;
     53                                                endif; ?>
     54
     55                                        </select>
     56                                </div>
     57                                <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
     58
     59                        <?php elseif ( bp_is_group_home() ) : ?>
     60
     61                                <input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
     62                                <input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id(); ?>" />
     63
     64                        <?php endif; ?>
     65
     66                        <?php do_action( 'bp_activity_post_form_options' ); ?>
     67
     68                </div><!-- #whats-new-options -->
     69        </div><!-- #whats-new-content -->
     70
     71        <?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
     72        <?php do_action( 'bp_after_activity_post_form' ); ?>
     73
     74</form><!-- #whats-new-form -->
  • bp-themes/bp-theme-compat/buddypress/blogs/blogs-loop.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Blogs Loop
     5 *
     6 * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
     7 *
     8 * @package BuddyPress
     9 * @subpackage bp-default
     10 */
     11
     12?>
     13
     14<?php do_action( 'bp_before_blogs_loop' ); ?>
     15
     16<?php if ( bp_has_blogs( bp_ajax_querystring( 'blogs' ) ) ) : ?>
     17
     18        <div id="pag-top" class="pagination">
     19
     20                <div class="pag-count" id="blog-dir-count-top">
     21                        <?php bp_blogs_pagination_count(); ?>
     22                </div>
     23
     24                <div class="pagination-links" id="blog-dir-pag-top">
     25                        <?php bp_blogs_pagination_links(); ?>
     26                </div>
     27
     28        </div>
     29
     30        <?php do_action( 'bp_before_directory_blogs_list' ); ?>
     31
     32        <ul id="blogs-list" class="item-list" role="main">
     33
     34        <?php while ( bp_blogs() ) : bp_the_blog(); ?>
     35
     36                <li>
     37                        <div class="item-avatar">
     38                                <a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_avatar( 'type=thumb' ); ?></a>
     39                        </div>
     40
     41                        <div class="item">
     42                                <div class="item-title"><a href="<?php bp_blog_permalink(); ?>"><?php bp_blog_name(); ?></a></div>
     43                                <div class="item-meta"><span class="activity"><?php bp_blog_last_active(); ?></span></div>
     44
     45                                <?php do_action( 'bp_directory_blogs_item' ); ?>
     46                        </div>
     47
     48                        <div class="action">
     49
     50                                <?php do_action( 'bp_directory_blogs_actions' ); ?>
     51
     52                                <div class="meta">
     53
     54                                        <?php bp_blog_latest_post(); ?>
     55
     56                                </div>
     57
     58                        </div>
     59
     60                        <div class="clear"></div>
     61                </li>
     62
     63        <?php endwhile; ?>
     64
     65        </ul>
     66
     67        <?php do_action( 'bp_after_directory_blogs_list' ); ?>
     68
     69        <?php bp_blog_hidden_fields(); ?>
     70
     71        <div id="pag-bottom" class="pagination">
     72
     73                <div class="pag-count" id="blog-dir-count-bottom">
     74
     75                        <?php bp_blogs_pagination_count(); ?>
     76
     77                </div>
     78
     79                <div class="pagination-links" id="blog-dir-pag-bottom">
     80
     81                        <?php bp_blogs_pagination_links(); ?>
     82
     83                </div>
     84
     85        </div>
     86
     87<?php else: ?>
     88
     89        <div id="message" class="info">
     90                <p><?php _e( 'Sorry, there were no sites found.', 'buddypress' ); ?></p>
     91        </div>
     92
     93<?php endif; ?>
     94
     95<?php do_action( 'bp_after_blogs_loop' ); ?>
  • bp-themes/bp-theme-compat/buddypress/blogs/create.php

     
     1<?php do_action( 'bp_before_create_blog_content_template' ); ?>
     2
     3<?php do_action( 'template_notices' ); ?>
     4
     5<?php do_action( 'bp_before_create_blog_content' ); ?>
     6
     7<?php if ( bp_blog_signup_enabled() ) : ?>
     8
     9        <?php bp_show_blog_signup_form(); ?>
     10
     11<?php else: ?>
     12
     13        <div id="message" class="info">
     14                <p><?php _e( 'Site registration is currently disabled', 'buddypress' ); ?></p>
     15        </div>
     16
     17<?php endif; ?>
     18
     19<?php do_action( 'bp_after_create_blog_content' ); ?>
     20
     21<?php do_action( 'bp_after_create_blog_content_template' ); ?>
  • bp-themes/bp-theme-compat/buddypress/blogs/index.php

     
     1<?php do_action( 'bp_before_directory_blogs' ); ?>
     2
     3<div id="buddypress">
     4        <form action="" method="post" id="blogs-directory-form" class="dir-form">
     5
     6                <?php do_action( 'bp_before_directory_blogs_content' ); ?>
     7
     8                <div id="blog-dir-search" class="dir-search" role="search">
     9
     10                        <?php bp_directory_blogs_search_form(); ?>
     11
     12                </div><!-- #blog-dir-search -->
     13
     14                <div class="item-list-tabs" role="navigation">
     15                        <ul>
     16                                <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>
     17
     18                                <?php if ( is_user_logged_in() && bp_get_total_blog_count_for_user( bp_loggedin_user_id() ) ) : ?>
     19
     20                                        <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>
     21
     22                                <?php endif; ?>
     23
     24                                <?php do_action( 'bp_blogs_directory_blog_types' ); ?>
     25
     26                        </ul>
     27                </div><!-- .item-list-tabs -->
     28
     29                <div class="item-list-tabs" id="subnav" role="navigation">
     30                        <ul>
     31
     32                                <?php do_action( 'bp_blogs_directory_blog_sub_types' ); ?>
     33
     34                                <li id="blogs-order-select" class="last filter">
     35
     36                                        <label for="blogs-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
     37                                        <select id="blogs-order-by">
     38                                                <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     39                                                <option value="newest"><?php _e( 'Newest', 'buddypress' ); ?></option>
     40                                                <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
     41
     42                                                <?php do_action( 'bp_blogs_directory_order_options' ); ?>
     43
     44                                        </select>
     45                                </li>
     46                        </ul>
     47                </div>
     48
     49                <div id="blogs-dir-list" class="blogs dir-list">
     50
     51                        <?php bp_get_template_part( 'blogs/blogs-loop' ); ?>
     52
     53                </div><!-- #blogs-dir-list -->
     54
     55                <?php do_action( 'bp_directory_blogs_content' ); ?>
     56
     57                <?php wp_nonce_field( 'directory_blogs', '_wpnonce-blogs-filter' ); ?>
     58
     59                <?php do_action( 'bp_after_directory_blogs_content' ); ?>
     60
     61        </form><!-- #blogs-directory-form -->
     62
     63        <?php do_action( 'bp_after_directory_blogs' ); ?>
     64
     65</div>
  • bp-themes/bp-theme-compat/buddypress/forums/forums-loop.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Forums Loop
     5 *
     6 * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
     7 *
     8 * @package BuddyPress
     9 * @subpackage bp-default
     10 */
     11
     12?>
     13
     14<?php do_action( 'bp_before_forums_loop' ); ?>
     15
     16<?php if ( bp_has_forum_topics( bp_ajax_querystring( 'forums' ) ) ) : ?>
     17
     18        <div id="pag-top" class="pagination">
     19
     20                <div class="pag-count" id="topic-count-top">
     21
     22                        <?php bp_forum_pagination_count(); ?>
     23
     24                </div>
     25
     26                <div class="pagination-links" id="topic-pag-top">
     27
     28                        <?php bp_forum_pagination(); ?>
     29
     30                </div>
     31
     32        </div>
     33
     34        <?php do_action( 'bp_before_directory_forums_list' ); ?>
     35
     36        <table class="forum">
     37                <thead>
     38                        <tr>
     39                                <th id="th-title"><?php _e( 'Topic', 'buddypress' ); ?></th>
     40                                <th id="th-postcount"><?php _e( 'Posts', 'buddypress' ); ?></th>
     41                                <th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ); ?></th>
     42
     43                                <?php do_action( 'bp_directory_forums_extra_cell_head' ); ?>
     44
     45                        </tr>
     46                </thead>
     47
     48                <tbody>
     49
     50                        <?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?>
     51
     52                        <tr class="<?php bp_the_topic_css_class(); ?>">
     53                                <td class="td-title">
     54                                        <a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php bp_the_topic_title(); ?> - <?php _e( 'Permalink', 'buddypress' ); ?>">
     55
     56                                                <?php bp_the_topic_title(); ?>
     57
     58                                        </a>
     59
     60                                        <p class="topic-meta">
     61                                                <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>
     62
     63                                                <?php if ( !bp_is_group_forum() ) : ?>
     64
     65                                                        <span class="topic-in">
     66
     67                                                                <?php
     68                                                                        $topic_in = '<a href="' . bp_get_the_topic_object_permalink() . '">' . bp_get_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) . '</a>' .
     69                                                                                                        '<a href="' . bp_get_the_topic_object_permalink() . '" title="' . bp_get_the_topic_object_name() . '">' . bp_get_the_topic_object_name() .'</a>';
     70
     71                                                                        /* translators: "started by [poster] in [forum]" */
     72                                                                        printf( __( 'in %1$s', 'buddypress' ), $topic_in );
     73                                                                ?>
     74
     75                                                        </span>
     76
     77                                                <?php endif; ?>
     78
     79                                        </p>
     80                                </td>
     81                                <td class="td-postcount">
     82                                        <?php bp_the_topic_total_posts(); ?>
     83                                </td>
     84                                <td class="td-freshness">
     85                                        <span class="time-since"><?php bp_the_topic_time_since_last_post(); ?></span>
     86                                        <p class="topic-meta">
     87                                                <span class="freshness-author">
     88                                                        <a href="<?php bp_the_topic_permalink(); ?>"><?php bp_the_topic_last_poster_avatar( 'type=thumb&width=20&height=20' ); ?></a>
     89                                                        <?php bp_the_topic_last_poster_name(); ?>
     90                                                </span>
     91                                        </p>
     92                                </td>
     93
     94                                <?php do_action( 'bp_directory_forums_extra_cell' ); ?>
     95
     96                        </tr>
     97
     98                        <?php do_action( 'bp_directory_forums_extra_row' ); ?>
     99
     100                        <?php endwhile; ?>
     101
     102                </tbody>
     103        </table>
     104
     105        <?php do_action( 'bp_after_directory_forums_list' ); ?>
     106
     107        <div id="pag-bottom" class="pagination">
     108
     109                <div class="pag-count" id="topic-count-bottom">
     110                        <?php bp_forum_pagination_count(); ?>
     111                </div>
     112
     113                <div class="pagination-links" id="topic-pag-bottom">
     114                        <?php bp_forum_pagination(); ?>
     115                </div>
     116
     117        </div>
     118
     119<?php else: ?>
     120
     121        <div id="message" class="info">
     122                <p><?php _e( 'Sorry, there were no forum topics found.', 'buddypress' ); ?></p>
     123        </div>
     124
     125<?php endif; ?>
     126
     127<?php do_action( 'bp_after_forums_loop' ); ?>
  • bp-themes/bp-theme-compat/buddypress/forums/index.php

     
     1<?php do_action( 'bp_before_directory_forums' ); ?>
     2
     3<form action="" method="post" id="forums-search-form" class="dir-form">
     4
     5        <?php do_action( 'bp_before_directory_forums_content' ); ?>
     6
     7        <div id="forums-dir-search" class="dir-search" role="search">
     8
     9                <?php bp_directory_forums_search_form(); ?>
     10
     11        </div>
     12</form>
     13
     14<?php do_action( 'bp_before_topics' ); ?>
     15
     16<form action="" method="post" id="forums-directory-form" class="dir-form">
     17
     18        <div class="item-list-tabs" role="navigation">
     19                <ul>
     20                        <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>
     21
     22                        <?php if ( is_user_logged_in() && bp_get_forum_topic_count_for_user( bp_loggedin_user_id() ) ) : ?>
     23
     24                                <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>
     25
     26                        <?php endif; ?>
     27
     28                        <?php do_action( 'bp_forums_directory_group_types' ); ?>
     29
     30                </ul>
     31        </div>
     32
     33        <div class="item-list-tabs" id="subnav" role="navigation">
     34                <ul>
     35
     36                        <?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
     37
     38                        <li id="forums-order-select" class="last filter">
     39
     40                                <label for="forums-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
     41                                <select id="forums-order-by">
     42                                        <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     43                                        <option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
     44                                        <option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
     45
     46                                        <?php do_action( 'bp_forums_directory_order_options' ); ?>
     47
     48                                </select>
     49                        </li>
     50                </ul>
     51        </div>
     52
     53        <div id="forums-dir-list" class="forums dir-list" role="main">
     54
     55                <?php bp_get_template_part( 'forums/forums-loop' ); ?>
     56
     57        </div>
     58
     59        <?php do_action( 'bp_directory_forums_content' ); ?>
     60
     61        <?php wp_nonce_field( 'directory_forums', '_wpnonce-forums-filter' ); ?>
     62
     63</form>
     64
     65<?php do_action( 'bp_after_directory_forums' ); ?>
     66
     67<?php do_action( 'bp_before_new_topic_form' ); ?>
     68
     69<div id="new-topic-post">
     70
     71        <?php if ( is_user_logged_in() ) : ?>
     72
     73                <?php if ( bp_is_active( 'groups' ) && bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100' ) ) : ?>
     74
     75                        <form action="" method="post" id="forum-topic-form" class="standard-form">
     76
     77                                <?php do_action( 'groups_forum_new_topic_before' ); ?>
     78
     79                                <a name="post-new"></a>
     80                                <h5><?php _e( 'Create New Topic:', 'buddypress' ); ?></h5>
     81
     82                                <?php do_action( 'template_notices' ); ?>
     83
     84                                <label><?php _e( 'Title:', 'buddypress' ); ?></label>
     85                                <input type="text" name="topic_title" id="topic_title" value="" maxlength="100" />
     86
     87                                <label><?php _e( 'Content:', 'buddypress' ); ?></label>
     88                                <textarea name="topic_text" id="topic_text"></textarea>
     89
     90                                <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
     91                                <input type="text" name="topic_tags" id="topic_tags" value="" />
     92
     93                                <label><?php _e( 'Post In Group Forum:', 'buddypress' ); ?></label>
     94                                <select id="topic_group_id" name="topic_group_id">
     95
     96                                        <option value=""><?php /* translators: no option picked in select box */ _e( '----', 'buddypress' ); ?></option>
     97
     98                                        <?php while ( bp_groups() ) : bp_the_group(); ?>
     99
     100                                                <?php if ( bp_group_is_forum_enabled() && ( bp_current_user_can( 'bp_moderate' ) || 'public' == bp_get_group_status() || bp_group_is_member() ) ) : ?>
     101
     102                                                        <option value="<?php bp_group_id(); ?>"><?php bp_group_name(); ?></option>
     103
     104                                                <?php endif; ?>
     105
     106                                        <?php endwhile; ?>
     107
     108                                </select><!-- #topic_group_id -->
     109
     110                                <?php do_action( 'groups_forum_new_topic_after' ); ?>
     111
     112                                <div class="submit">
     113                                        <input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ); ?>" />
     114                                        <input type="button" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( 'Cancel', 'buddypress' ); ?>" />
     115                                </div>
     116
     117                                <?php wp_nonce_field( 'bp_forums_new_topic' ); ?>
     118
     119                        </form><!-- #forum-topic-form -->
     120
     121                <?php elseif ( bp_is_active( 'groups' ) ) : ?>
     122
     123                        <div id="message" class="info">
     124
     125                                <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>
     126
     127                        </div>
     128
     129                <?php endif; ?>
     130
     131        <?php endif; ?>
     132</div><!-- #new-topic-post -->
     133
     134<?php do_action( 'bp_after_new_topic_form' ); ?>
     135
     136<?php do_action( 'bp_after_directory_forums_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/groups/create.php

     
     1<?php do_action( 'bp_before_create_group_page' ); ?>
     2
     3<div id="buddypress">
     4
     5        <?php do_action( 'bp_before_create_group_content_template' ); ?>
     6
     7        <form action="<?php bp_group_creation_form_action(); ?>" method="post" id="create-group-form" class="standard-form" enctype="multipart/form-data">
     8
     9                <?php do_action( 'bp_before_create_group' ); ?>
     10
     11                <div class="item-list-tabs no-ajax" id="group-create-tabs" role="navigation">
     12                        <ul>
     13
     14                                <?php bp_group_creation_tabs(); ?>
     15
     16                        </ul>
     17                </div>
     18
     19                <?php do_action( 'template_notices' ); ?>
     20
     21                <div class="item-body" id="group-create-body">
     22
     23                        <?php /* Group creation step 1: Basic group details */ ?>
     24                        <?php if ( bp_is_group_creation_step( 'group-details' ) ) : ?>
     25
     26                                <?php do_action( 'bp_before_group_details_creation_step' ); ?>
     27
     28                                <div>
     29                                        <label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
     30                                        <input type="text" name="group-name" id="group-name" aria-required="true" value="<?php bp_new_group_name(); ?>" />
     31                                </div>
     32
     33                                <div>
     34                                        <label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label>
     35                                        <textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_new_group_description(); ?></textarea>
     36                                </div>
     37
     38                                <?php
     39                                do_action( 'bp_after_group_details_creation_step' );
     40                                do_action( 'groups_custom_group_fields_editable' ); // @Deprecated
     41
     42                                wp_nonce_field( 'groups_create_save_group-details' ); ?>
     43
     44                        <?php endif; ?>
     45
     46                        <?php /* Group creation step 2: Group settings */ ?>
     47                        <?php if ( bp_is_group_creation_step( 'group-settings' ) ) : ?>
     48
     49                                <?php do_action( 'bp_before_group_settings_creation_step' ); ?>
     50
     51                                <h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4>
     52
     53                                <div class="radio">
     54                                        <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 } ?> />
     55                                                <strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong>
     56                                                <ul>
     57                                                        <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li>
     58                                                        <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
     59                                                        <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li>
     60                                                </ul>
     61                                        </label>
     62
     63                                        <label><input type="radio" name="group-status" value="private"<?php if ( 'private' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
     64                                                <strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong>
     65                                                <ul>
     66                                                        <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li>
     67                                                        <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
     68                                                        <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
     69                                                </ul>
     70                                        </label>
     71
     72                                        <label><input type="radio" name="group-status" value="hidden"<?php if ( 'hidden' == bp_get_new_group_status() ) { ?> checked="checked"<?php } ?> />
     73                                                <strong><?php _e('This is a hidden group', 'buddypress' ); ?></strong>
     74                                                <ul>
     75                                                        <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li>
     76                                                        <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li>
     77                                                        <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
     78                                                </ul>
     79                                        </label>
     80                                </div>
     81
     82                                <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4>
     83
     84                                <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>
     85
     86                                <div class="radio">
     87                                        <label>
     88                                                <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> />
     89                                                <strong><?php _e( 'All group members', 'buddypress' ); ?></strong>
     90                                        </label>
     91
     92                                        <label>
     93                                                <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> />
     94                                                <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong>
     95                                        </label>
     96
     97                                        <label>
     98                                                <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> />
     99                                                <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong>
     100                                        </label>
     101                                </div>
     102
     103                                <?php if ( bp_is_active( 'forums' ) ) : ?>
     104
     105                                        <h4><?php _e( 'Group Forums', 'buddypress' ); ?></h4>
     106
     107                                        <?php if ( bp_forums_is_installed_correctly() ) : ?>
     108
     109                                                <p><?php _e( 'Should this group have a forum?', 'buddypress' ); ?></p>
     110
     111                                                <div class="checkbox">
     112                                                        <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>
     113                                                </div>
     114                                        <?php elseif ( is_super_admin() ) : ?>
     115
     116                                                <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>
     117
     118                                        <?php endif; ?>
     119
     120                                <?php endif; ?>
     121
     122                                <?php do_action( 'bp_after_group_settings_creation_step' ); ?>
     123
     124                                <?php wp_nonce_field( 'groups_create_save_group-settings' ); ?>
     125
     126                        <?php endif; ?>
     127
     128                        <?php /* Group creation step 3: Avatar Uploads */ ?>
     129                        <?php if ( bp_is_group_creation_step( 'group-avatar' ) ) : ?>
     130
     131                                <?php do_action( 'bp_before_group_avatar_creation_step' ); ?>
     132
     133                                <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
     134
     135                                        <div class="left-menu">
     136
     137                                                <?php bp_new_group_avatar(); ?>
     138
     139                                        </div><!-- .left-menu -->
     140
     141                                        <div class="main-column">
     142                                                <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>
     143
     144                                                <p>
     145                                                        <input type="file" name="file" id="file" />
     146                                                        <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ); ?>" />
     147                                                        <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
     148                                                </p>
     149
     150                                                <p><?php _e( 'To skip the avatar upload process, hit the "Next Step" button.', 'buddypress' ); ?></p>
     151                                        </div><!-- .main-column -->
     152
     153                                <?php endif; ?>
     154
     155                                <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
     156
     157                                        <h4><?php _e( 'Crop Group Avatar', 'buddypress' ); ?></h4>
     158
     159                                        <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ); ?>" />
     160
     161                                        <div id="avatar-crop-pane">
     162                                                <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ); ?>" />
     163                                        </div>
     164
     165                                        <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ); ?>" />
     166
     167                                        <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
     168                                        <input type="hidden" name="upload" id="upload" />
     169                                        <input type="hidden" id="x" name="x" />
     170                                        <input type="hidden" id="y" name="y" />
     171                                        <input type="hidden" id="w" name="w" />
     172                                        <input type="hidden" id="h" name="h" />
     173
     174                                <?php endif; ?>
     175
     176                                <?php do_action( 'bp_after_group_avatar_creation_step' ); ?>
     177
     178                                <?php wp_nonce_field( 'groups_create_save_group-avatar' ); ?>
     179
     180                        <?php endif; ?>
     181
     182                        <?php /* Group creation step 4: Invite friends to group */ ?>
     183                        <?php if ( bp_is_group_creation_step( 'group-invites' ) ) : ?>
     184
     185                                <?php do_action( 'bp_before_group_invites_creation_step' ); ?>
     186
     187                                <?php if ( bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
     188
     189                                        <div class="left-menu">
     190
     191                                                <div id="invite-list">
     192                                                        <ul>
     193                                                                <?php bp_new_group_invite_friend_list(); ?>
     194                                                        </ul>
     195
     196                                                        <?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?>
     197                                                </div>
     198
     199                                        </div><!-- .left-menu -->
     200
     201                                        <div class="main-column">
     202
     203                                                <div id="message" class="info">
     204                                                        <p><?php _e('Select people to invite from your friends list.', 'buddypress' ); ?></p>
     205                                                </div>
     206
     207                                                <?php /* The ID 'friend-list' is important for AJAX support. */ ?>
     208                                                <ul id="friend-list" class="item-list" role="main">
     209
     210                                                <?php if ( bp_group_has_invites() ) : ?>
     211
     212                                                        <?php while ( bp_group_invites() ) : bp_group_the_invite(); ?>
     213
     214                                                                <li id="<?php bp_group_invite_item_id(); ?>">
     215
     216                                                                        <?php bp_group_invite_user_avatar(); ?>
     217
     218                                                                        <h4><?php bp_group_invite_user_link(); ?></h4>
     219                                                                        <span class="activity"><?php bp_group_invite_user_last_active(); ?></span>
     220
     221                                                                        <div class="action">
     222                                                                                <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>
     223                                                                        </div>
     224                                                                </li>
     225
     226                                                        <?php endwhile; ?>
     227
     228                                                        <?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
     229
     230                                                <?php endif; ?>
     231
     232                                                </ul>
     233
     234                                        </div><!-- .main-column -->
     235
     236                                <?php else : ?>
     237
     238                                        <div id="message" class="info">
     239                                                <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>
     240                                        </div>
     241
     242                                <?php endif; ?>
     243
     244                                <?php wp_nonce_field( 'groups_create_save_group-invites' ); ?>
     245
     246                                <?php do_action( 'bp_after_group_invites_creation_step' ); ?>
     247
     248                        <?php endif; ?>
     249
     250                        <?php do_action( 'groups_custom_create_steps' ); // Allow plugins to add custom group creation steps ?>
     251
     252                        <?php do_action( 'bp_before_group_creation_step_buttons' ); ?>
     253
     254                        <?php if ( 'crop-image' != bp_get_avatar_admin_step() ) : ?>
     255
     256                                <div class="submit" id="previous-next">
     257
     258                                        <?php /* Previous Button */ ?>
     259                                        <?php if ( !bp_is_first_group_creation_step() ) : ?>
     260
     261                                                <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(); ?>'" />
     262
     263                                        <?php endif; ?>
     264
     265                                        <?php /* Next Button */ ?>
     266                                        <?php if ( !bp_is_last_group_creation_step() && !bp_is_first_group_creation_step() ) : ?>
     267
     268                                                <input type="submit" value="<?php _e( 'Next Step', 'buddypress' ); ?>" id="group-creation-next" name="save" />
     269
     270                                        <?php endif;?>
     271
     272                                        <?php /* Create Button */ ?>
     273                                        <?php if ( bp_is_first_group_creation_step() ) : ?>
     274
     275                                                <input type="submit" value="<?php _e( 'Create Group and Continue', 'buddypress' ); ?>" id="group-creation-create" name="save" />
     276
     277                                        <?php endif; ?>
     278
     279                                        <?php /* Finish Button */ ?>
     280                                        <?php if ( bp_is_last_group_creation_step() ) : ?>
     281
     282                                                <input type="submit" value="<?php _e( 'Finish', 'buddypress' ); ?>" id="group-creation-finish" name="save" />
     283
     284                                        <?php endif; ?>
     285                                </div>
     286
     287                        <?php endif;?>
     288
     289                        <?php do_action( 'bp_after_group_creation_step_buttons' ); ?>
     290
     291                        <?php /* Don't leave out this hidden field */ ?>
     292                        <input type="hidden" name="group_id" id="group_id" value="<?php bp_new_group_id(); ?>" />
     293
     294                        <?php do_action( 'bp_directory_groups_content' ); ?>
     295
     296                </div><!-- .item-body -->
     297
     298                <?php do_action( 'bp_after_create_group' ); ?>
     299
     300        </form>
     301
     302        <?php do_action( 'bp_after_create_group_content_template' ); ?>
     303
     304</div>
     305
     306<?php do_action( 'bp_after_create_group_page' ); ?>
  • bp-themes/bp-theme-compat/buddypress/groups/groups-loop.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Groups Loop
     5 *
     6 * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
     7 *
     8 * @package BuddyPress
     9 * @subpackage bp-default
     10 */
     11
     12?>
     13
     14<?php do_action( 'bp_before_groups_loop' ); ?>
     15
     16<?php if ( bp_has_groups( bp_ajax_querystring( 'groups' ) ) ) : ?>
     17
     18        <div id="pag-top" class="pagination">
     19
     20                <div class="pag-count" id="group-dir-count-top">
     21
     22                        <?php bp_groups_pagination_count(); ?>
     23
     24                </div>
     25
     26                <div class="pagination-links" id="group-dir-pag-top">
     27
     28                        <?php bp_groups_pagination_links(); ?>
     29
     30                </div>
     31
     32        </div>
     33
     34        <?php do_action( 'bp_before_directory_groups_list' ); ?>
     35
     36        <ul id="groups-list" class="item-list" role="main">
     37
     38        <?php while ( bp_groups() ) : bp_the_group(); ?>
     39
     40                <li>
     41                        <div class="item-avatar">
     42                                <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
     43                        </div>
     44
     45                        <div class="item">
     46                                <div class="item-title"><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a></div>
     47                                <div class="item-meta"><span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span></div>
     48
     49                                <div class="item-desc"><?php bp_group_description_excerpt(); ?></div>
     50
     51                                <?php do_action( 'bp_directory_groups_item' ); ?>
     52
     53                        </div>
     54
     55                        <div class="action">
     56
     57                                <?php do_action( 'bp_directory_groups_actions' ); ?>
     58
     59                                <div class="meta">
     60
     61                                        <?php bp_group_type(); ?> / <?php bp_group_member_count(); ?>
     62
     63                                </div>
     64
     65                        </div>
     66
     67                        <div class="clear"></div>
     68                </li>
     69
     70        <?php endwhile; ?>
     71
     72        </ul>
     73
     74        <?php do_action( 'bp_after_directory_groups_list' ); ?>
     75
     76        <div id="pag-bottom" class="pagination">
     77
     78                <div class="pag-count" id="group-dir-count-bottom">
     79
     80                        <?php bp_groups_pagination_count(); ?>
     81
     82                </div>
     83
     84                <div class="pagination-links" id="group-dir-pag-bottom">
     85
     86                        <?php bp_groups_pagination_links(); ?>
     87
     88                </div>
     89
     90        </div>
     91
     92<?php else: ?>
     93
     94        <div id="message" class="info">
     95                <p><?php _e( 'There were no groups found.', 'buddypress' ); ?></p>
     96        </div>
     97
     98<?php endif; ?>
     99
     100<?php do_action( 'bp_after_groups_loop' ); ?>
  • bp-themes/bp-theme-compat/buddypress/groups/index.php

     
     1<?php do_action( 'bp_before_directory_groups_page' ); ?>
     2
     3<div id="buddypress">
     4
     5        <?php do_action( 'bp_before_directory_groups' ); ?>
     6
     7        <form action="" method="post" id="groups-directory-form" class="dir-form">
     8
     9                <?php do_action( 'bp_before_directory_groups_content' ); ?>
     10
     11                <div id="group-dir-search" class="dir-search" role="search">
     12
     13                        <?php bp_directory_groups_search_form(); ?>
     14
     15                </div><!-- #group-dir-search -->
     16
     17                <?php do_action( 'template_notices' ); ?>
     18
     19                <div class="item-list-tabs" role="navigation">
     20                        <ul>
     21                                <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>
     22
     23                                <?php if ( is_user_logged_in() && bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
     24
     25                                        <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>
     26
     27                                <?php endif; ?>
     28
     29                                <?php do_action( 'bp_groups_directory_group_filter' ); ?>
     30
     31                        </ul>
     32                </div><!-- .item-list-tabs -->
     33
     34                <div class="item-list-tabs" id="subnav" role="navigation">
     35                        <ul>
     36
     37                                <?php do_action( 'bp_groups_directory_group_types' ); ?>
     38
     39                                <li id="groups-order-select" class="last filter">
     40
     41                                        <label for="groups-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
     42                                        <select id="groups-order-by">
     43                                                <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     44                                                <option value="popular"><?php _e( 'Most Members', 'buddypress' ); ?></option>
     45                                                <option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option>
     46                                                <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
     47
     48                                                <?php do_action( 'bp_groups_directory_order_options' ); ?>
     49
     50                                        </select>
     51                                </li>
     52                        </ul>
     53                </div>
     54
     55                <div id="groups-dir-list" class="groups dir-list">
     56
     57                        <?php bp_get_template_part( 'groups/groups-loop' ); ?>
     58
     59                </div><!-- #groups-dir-list -->
     60
     61                <?php do_action( 'bp_directory_groups_content' ); ?>
     62
     63                <?php wp_nonce_field( 'directory_groups', '_wpnonce-groups-filter' ); ?>
     64
     65                <?php do_action( 'bp_after_directory_groups_content' ); ?>
     66
     67        </form><!-- #groups-directory-form -->
     68
     69        <?php do_action( 'bp_after_directory_groups' ); ?>
     70
     71</div><!-- #buddypress -->
     72
     73<?php do_action( 'bp_after_directory_groups_page' ); ?>
  • bp-themes/bp-theme-compat/buddypress/groups/single/activity.php

     
     1<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     2        <ul>
     3                <li class="feed"><a href="<?php bp_group_activity_feed_link(); ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li>
     4
     5                <?php do_action( 'bp_group_activity_syndication_options' ); ?>
     6
     7                <li id="activity-filter-select" class="last">
     8                        <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
     9                        <select id="activity-filter-by">
     10                                <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
     11                                <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
     12
     13                                <?php if ( bp_is_active( 'forums' ) ) : ?>
     14                                        <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option>
     15                                        <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option>
     16                                <?php endif; ?>
     17
     18                                <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option>
     19
     20                                <?php do_action( 'bp_group_activity_filter_options' ); ?>
     21                        </select>
     22                </li>
     23        </ul>
     24</div><!-- .item-list-tabs -->
     25
     26<?php do_action( 'bp_before_group_activity_post_form' ); ?>
     27
     28<?php if ( is_user_logged_in() && bp_group_is_member() ) : ?>
     29
     30        <?php bp_get_template_part( 'activity/post-form' ); ?>
     31
     32<?php endif; ?>
     33
     34<?php do_action( 'bp_after_group_activity_post_form' ); ?>
     35<?php do_action( 'bp_before_group_activity_content' ); ?>
     36
     37<div class="activity single-group" role="main">
     38
     39        <?php bp_get_template_part( 'activity/activity-loop' ); ?>
     40
     41</div><!-- .activity.single-group -->
     42
     43<?php do_action( 'bp_after_group_activity_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/groups/single/admin.php

     
     1<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     2        <ul>
     3                <?php bp_group_admin_tabs(); ?>
     4        </ul>
     5</div><!-- .item-list-tabs -->
     6
     7<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">
     8
     9<?php do_action( 'bp_before_group_admin_content' ); ?>
     10
     11<?php /* Edit Group Details */ ?>
     12<?php if ( bp_is_group_admin_screen( 'edit-details' ) ) : ?>
     13
     14        <?php do_action( 'bp_before_group_details_admin' ); ?>
     15
     16        <label for="group-name"><?php _e( 'Group Name (required)', 'buddypress' ); ?></label>
     17        <input type="text" name="group-name" id="group-name" value="<?php bp_group_name(); ?>" aria-required="true" />
     18
     19        <label for="group-desc"><?php _e( 'Group Description (required)', 'buddypress' ); ?></label>
     20        <textarea name="group-desc" id="group-desc" aria-required="true"><?php bp_group_description_editable(); ?></textarea>
     21
     22        <?php do_action( 'groups_custom_group_fields_editable' ); ?>
     23
     24        <p>
     25                <label for="group-notifiy-members"><?php _e( 'Notify group members of changes via email', 'buddypress' ); ?></label>
     26                <input type="radio" name="group-notify-members" value="1" /> <?php _e( 'Yes', 'buddypress' ); ?>&nbsp;
     27                <input type="radio" name="group-notify-members" value="0" checked="checked" /> <?php _e( 'No', 'buddypress' ); ?>&nbsp;
     28        </p>
     29
     30        <?php do_action( 'bp_after_group_details_admin' ); ?>
     31
     32        <p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p>
     33        <?php wp_nonce_field( 'groups_edit_group_details' ); ?>
     34
     35<?php endif; ?>
     36
     37<?php /* Manage Group Settings */ ?>
     38<?php if ( bp_is_group_admin_screen( 'group-settings' ) ) : ?>
     39
     40        <?php do_action( 'bp_before_group_settings_admin' ); ?>
     41
     42        <?php if ( bp_is_active( 'forums' ) ) : ?>
     43
     44                <?php if ( bp_forums_is_installed_correctly() ) : ?>
     45
     46                        <div class="checkbox">
     47                                <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>
     48                        </div>
     49
     50                        <hr />
     51
     52                <?php endif; ?>
     53
     54        <?php endif; ?>
     55
     56        <h4><?php _e( 'Privacy Options', 'buddypress' ); ?></h4>
     57
     58        <div class="radio">
     59                <label>
     60                        <input type="radio" name="group-status" value="public"<?php bp_group_show_status_setting( 'public' ); ?> />
     61                        <strong><?php _e( 'This is a public group', 'buddypress' ); ?></strong>
     62                        <ul>
     63                                <li><?php _e( 'Any site member can join this group.', 'buddypress' ); ?></li>
     64                                <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
     65                                <li><?php _e( 'Group content and activity will be visible to any site member.', 'buddypress' ); ?></li>
     66                        </ul>
     67                </label>
     68
     69                <label>
     70                        <input type="radio" name="group-status" value="private"<?php bp_group_show_status_setting( 'private' ); ?> />
     71                        <strong><?php _e( 'This is a private group', 'buddypress' ); ?></strong>
     72                        <ul>
     73                                <li><?php _e( 'Only users who request membership and are accepted can join the group.', 'buddypress' ); ?></li>
     74                                <li><?php _e( 'This group will be listed in the groups directory and in search results.', 'buddypress' ); ?></li>
     75                                <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
     76                        </ul>
     77                </label>
     78
     79                <label>
     80                        <input type="radio" name="group-status" value="hidden"<?php bp_group_show_status_setting( 'hidden' ); ?> />
     81                        <strong><?php _e( 'This is a hidden group', 'buddypress' ); ?></strong>
     82                        <ul>
     83                                <li><?php _e( 'Only users who are invited can join the group.', 'buddypress' ); ?></li>
     84                                <li><?php _e( 'This group will not be listed in the groups directory or search results.', 'buddypress' ); ?></li>
     85                                <li><?php _e( 'Group content and activity will only be visible to members of the group.', 'buddypress' ); ?></li>
     86                        </ul>
     87                </label>
     88        </div>
     89
     90        <hr />
     91         
     92        <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4>
     93
     94        <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>
     95
     96        <div class="radio">
     97                <label>
     98                        <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> />
     99                        <strong><?php _e( 'All group members', 'buddypress' ); ?></strong>
     100                </label>
     101
     102                <label>
     103                        <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> />
     104                        <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong>
     105                </label>
     106               
     107                <label>
     108                        <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> />
     109                        <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong>
     110                </label>
     111        </div>
     112
     113        <hr />
     114
     115        <?php do_action( 'bp_after_group_settings_admin' ); ?>
     116
     117        <p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p>
     118        <?php wp_nonce_field( 'groups_edit_group_settings' ); ?>
     119
     120<?php endif; ?>
     121
     122<?php /* Group Avatar Settings */ ?>
     123<?php if ( bp_is_group_admin_screen( 'group-avatar' ) ) : ?>
     124
     125        <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
     126
     127                        <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>
     128
     129                        <p>
     130                                <input type="file" name="file" id="file" />
     131                                <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ); ?>" />
     132                                <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
     133                        </p>
     134
     135                        <?php if ( bp_get_group_has_avatar() ) : ?>
     136
     137                                <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>
     138
     139                                <?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' ) ) ); ?>
     140
     141                        <?php endif; ?>
     142
     143                        <?php wp_nonce_field( 'bp_avatar_upload' ); ?>
     144
     145        <?php endif; ?>
     146
     147        <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
     148
     149                <h4><?php _e( 'Crop Avatar', 'buddypress' ); ?></h4>
     150
     151                <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ); ?>" />
     152
     153                <div id="avatar-crop-pane">
     154                        <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ); ?>" />
     155                </div>
     156
     157                <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ); ?>" />
     158
     159                <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
     160                <input type="hidden" id="x" name="x" />
     161                <input type="hidden" id="y" name="y" />
     162                <input type="hidden" id="w" name="w" />
     163                <input type="hidden" id="h" name="h" />
     164
     165                <?php wp_nonce_field( 'bp_avatar_cropstore' ); ?>
     166
     167        <?php endif; ?>
     168
     169<?php endif; ?>
     170
     171<?php /* Manage Group Members */ ?>
     172<?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?>
     173
     174        <?php do_action( 'bp_before_group_manage_members_admin' ); ?>
     175       
     176        <div class="bp-widget">
     177                <h4><?php _e( 'Administrators', 'buddypress' ); ?></h4>
     178
     179                <?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?>
     180               
     181                <ul id="admins-list" class="item-list single-line">
     182                       
     183                        <?php while ( bp_members() ) : bp_the_member(); ?>
     184                        <li>
     185                                <?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() ) ) ); ?>
     186                                <h5>
     187                                        <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a>
     188                                        <?php if ( count( bp_group_admin_ids( false, 'array' ) ) > 1 ) : ?>
     189                                        <span class="small">
     190                                                <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>
     191                                        </span>                 
     192                                        <?php endif; ?>
     193                                </h5>           
     194                        </li>
     195                        <?php endwhile; ?>
     196               
     197                </ul>
     198               
     199                <?php endif; ?>
     200
     201        </div>
     202       
     203        <?php if ( bp_group_has_moderators() ) : ?>
     204                <div class="bp-widget">
     205                        <h4><?php _e( 'Moderators', 'buddypress' ); ?></h4>             
     206                       
     207                        <?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?>
     208                                <ul id="mods-list" class="item-list single-line">
     209                               
     210                                        <?php while ( bp_members() ) : bp_the_member(); ?>                                     
     211                                        <li>
     212                                                <?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() ) ) ); ?>
     213                                                <h5>
     214                                                        <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a>
     215                                                        <span class="small">
     216                                                                <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>
     217                                                                <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>
     218                                                        </span>         
     219                                                </h5>           
     220                                        </li>   
     221                                        <?php endwhile; ?>                     
     222                               
     223                                </ul>
     224                       
     225                        <?php endif; ?>
     226                </div>
     227        <?php endif ?>
     228
     229
     230        <div class="bp-widget">
     231                <h4><?php _e("Members", "buddypress"); ?></h4>
     232
     233                <?php if ( bp_group_has_members( 'per_page=15&exclude_banned=false' ) ) : ?>
     234
     235                        <?php if ( bp_group_member_needs_pagination() ) : ?>
     236
     237                                <div class="pagination no-ajax">
     238
     239                                        <div id="member-count" class="pag-count">
     240                                                <?php bp_group_member_pagination_count(); ?>
     241                                        </div>
     242
     243                                        <div id="member-admin-pagination" class="pagination-links">
     244                                                <?php bp_group_member_admin_pagination(); ?>
     245                                        </div>
     246
     247                                </div>
     248
     249                        <?php endif; ?>
     250
     251                        <ul id="members-list" class="item-list single-line">
     252                                <?php while ( bp_group_members() ) : bp_group_the_member(); ?>
     253
     254                                        <li class="<?php bp_group_member_css_class(); ?>">
     255                                                <?php bp_group_member_avatar_mini(); ?>
     256
     257                                                <h5>
     258                                                        <?php bp_group_member_link(); ?>
     259
     260                                                        <?php if ( bp_get_group_member_is_banned() ) _e( '(banned)', 'buddypress' ); ?>
     261
     262                                                        <span class="small">
     263
     264                                                        <?php if ( bp_get_group_member_is_banned() ) : ?>
     265
     266                                                                <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>
     267
     268                                                        <?php else : ?>
     269
     270                                                                <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 &amp; Ban', 'buddypress' ); ?></a>
     271                                                                <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>
     272                                                                <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>
     273
     274                                                        <?php endif; ?>
     275
     276                                                                <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>
     277
     278                                                                <?php do_action( 'bp_group_manage_members_admin_item' ); ?>
     279
     280                                                        </span>
     281                                                </h5>
     282                                        </li>
     283
     284                                <?php endwhile; ?>
     285                        </ul>
     286
     287                <?php else: ?>
     288
     289                        <div id="message" class="info">
     290                                <p><?php _e( 'This group has no members.', 'buddypress' ); ?></p>
     291                        </div>
     292
     293                <?php endif; ?>
     294
     295        </div>
     296
     297        <?php do_action( 'bp_after_group_manage_members_admin' ); ?>
     298
     299<?php endif; ?>
     300
     301<?php /* Manage Membership Requests */ ?>
     302<?php if ( bp_is_group_admin_screen( 'membership-requests' ) ) : ?>
     303
     304        <?php do_action( 'bp_before_group_membership_requests_admin' ); ?>
     305
     306        <?php if ( bp_group_has_membership_requests() ) : ?>
     307
     308                <ul id="request-list" class="item-list">
     309                        <?php while ( bp_group_membership_requests() ) : bp_group_the_membership_request(); ?>
     310
     311                                <li>
     312                                        <?php bp_group_request_user_avatar_thumb(); ?>
     313                                        <h4><?php bp_group_request_user_link(); ?> <span class="comments"><?php bp_group_request_comment(); ?></span></h4>
     314                                        <span class="activity"><?php bp_group_request_time_since_requested(); ?></span>
     315
     316                                        <?php do_action( 'bp_group_membership_requests_admin_item' ); ?>
     317
     318                                        <div class="action">
     319
     320                                                <?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' ) ) ); ?>
     321
     322                                                <?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' ) ) ); ?>
     323
     324                                                <?php do_action( 'bp_group_membership_requests_admin_item_action' ); ?>
     325
     326                                        </div>
     327                                </li>
     328
     329                        <?php endwhile; ?>
     330                </ul>
     331
     332        <?php else: ?>
     333
     334                <div id="message" class="info">
     335                        <p><?php _e( 'There are no pending membership requests.', 'buddypress' ); ?></p>
     336                </div>
     337
     338        <?php endif; ?>
     339
     340        <?php do_action( 'bp_after_group_membership_requests_admin' ); ?>
     341
     342<?php endif; ?>
     343
     344<?php do_action( 'groups_custom_edit_steps' ) // Allow plugins to add custom group edit screens ?>
     345
     346<?php /* Delete Group Option */ ?>
     347<?php if ( bp_is_group_admin_screen( 'delete-group' ) ) : ?>
     348
     349        <?php do_action( 'bp_before_group_delete_admin' ); ?>
     350
     351        <div id="message" class="info">
     352                <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>
     353        </div>
     354
     355        <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>
     356
     357        <?php do_action( 'bp_after_group_delete_admin' ); ?>
     358
     359        <div class="submit">
     360                <input type="submit" disabled="disabled" value="<?php _e( 'Delete Group', 'buddypress' ); ?>" id="delete-group-button" name="delete-group-button" />
     361        </div>
     362
     363        <?php wp_nonce_field( 'groups_delete_group' ); ?>
     364
     365<?php endif; ?>
     366
     367<?php /* This is important, don't forget it */ ?>
     368        <input type="hidden" name="group-id" id="group-id" value="<?php bp_group_id(); ?>" />
     369
     370<?php do_action( 'bp_after_group_admin_content' ); ?>
     371
     372</form><!-- #group-settings-form -->
     373
  • bp-themes/bp-theme-compat/buddypress/groups/single/forum.php

     
     1<?php
     2
     3do_action( 'bp_before_group_forum_content' );
     4
     5if ( bp_is_group_forum_topic_edit() ) :
     6        bp_get_template_part( 'groups/single/forum/edit' );
     7
     8elseif ( bp_is_group_forum_topic() ) :
     9        bp_get_template_part( 'groups/single/forum/topic' );
     10
     11else : ?>
     12
     13        <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     14                <ul>
     15
     16                        <?php if ( is_user_logged_in() ) : ?>
     17
     18                                <li>
     19                                        <a href="#post-new" class="show-hide-new"><?php _e( 'New Topic', 'buddypress' ); ?></a>
     20                                </li>
     21
     22                        <?php endif; ?>
     23
     24                        <?php if ( bp_forums_has_directory() ) : ?>
     25
     26                                <li>
     27                                        <a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress' ); ?></a>
     28                                </li>
     29
     30                        <?php endif; ?>
     31
     32                        <?php do_action( 'bp_forums_directory_group_sub_types' ); ?>
     33
     34                        <li id="forums-order-select" class="last filter">
     35
     36                                <label for="forums-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
     37                                <select id="forums-order-by">
     38                                        <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     39                                        <option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
     40                                        <option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
     41
     42                                        <?php do_action( 'bp_forums_directory_order_options' ); ?>
     43
     44                                </select>
     45                        </li>
     46                </ul>
     47        </div>
     48
     49        <div class="forums single-forum" role="main">
     50
     51                <?php bp_get_template_part( 'forums/forums-loop' ) ?>
     52
     53        </div><!-- .forums.single-forum -->
     54
     55<?php endif; ?>
     56
     57<?php do_action( 'bp_after_group_forum_content' ); ?>
     58
     59<?php if ( !bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic() ) : ?>
     60
     61        <?php if ( !bp_group_is_user_banned() && ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) ) : ?>
     62
     63                <form action="" method="post" id="forum-topic-form" class="standard-form">
     64                        <div id="new-topic-post">
     65
     66                                <?php do_action( 'bp_before_group_forum_post_new' ); ?>
     67
     68                                <?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
     69                                        <p><?php _e( 'You will auto join this group when you start a new topic.', 'buddypress' ); ?></p>
     70                                <?php endif; ?>
     71
     72                                <p id="post-new"></p>
     73                                <h4><?php _e( 'Post a New Topic:', 'buddypress' ); ?></h4>
     74
     75                                <label><?php _e( 'Title:', 'buddypress' ); ?></label>
     76                                <input type="text" name="topic_title" id="topic_title" value="" maxlength="100" />
     77
     78                                <label><?php _e( 'Content:', 'buddypress' ); ?></label>
     79                                <textarea name="topic_text" id="topic_text"></textarea>
     80
     81                                <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
     82                                <input type="text" name="topic_tags" id="topic_tags" value="" />
     83
     84                                <?php do_action( 'bp_after_group_forum_post_new' ); ?>
     85
     86                                <div class="submit">
     87                                        <input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ); ?>" />
     88                                </div>
     89
     90                                <?php wp_nonce_field( 'bp_forums_new_topic' ); ?>
     91                        </div><!-- #new-topic-post -->
     92                </form><!-- #forum-topic-form -->
     93
     94        <?php endif; ?>
     95
     96<?php endif; ?>
     97
  • bp-themes/bp-theme-compat/buddypress/groups/single/forum/edit.php

     
     1<?php do_action( 'bp_before_group_forum_edit_form' ); ?>
     2
     3<?php if ( bp_has_forum_topic_posts() ) : ?>
     4
     5        <form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form">
     6
     7                <div class="item-list-tabs" id="subnav" role="navigation">
     8                        <ul>
     9                                <li>
     10                                        <a href="#post-topic-reply"><?php _e( 'Reply', 'buddypress' ); ?></a>
     11                                </li>
     12
     13                                <?php if ( bp_forums_has_directory() ) : ?>
     14
     15                                        <li>
     16                                                <a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress' ); ?></a>
     17                                        </li>
     18
     19                                <?php endif; ?>
     20
     21                        </ul>
     22                </div>
     23
     24                <div id="topic-meta">
     25                        <h3><?php _e( 'Edit:', 'buddypress' ); ?> <?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3>
     26
     27                        <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
     28
     29                                <div class="last admin-links">
     30
     31                                        <?php bp_the_topic_admin_links(); ?>
     32
     33                                </div>
     34
     35                        <?php endif; ?>
     36
     37                        <?php do_action( 'bp_group_forum_topic_meta' ); ?>
     38
     39                </div>
     40
     41                <?php if ( bp_is_edit_topic() ) : ?>
     42
     43                        <div id="edit-topic">
     44
     45                                <?php do_action( 'bp_group_before_edit_forum_topic' ); ?>
     46
     47                                <label for="topic_title"><?php _e( 'Title:', 'buddypress' ); ?></label>
     48                                <input type="text" name="topic_title" id="topic_title" value="<?php bp_the_topic_title(); ?>" maxlength="100" />
     49
     50                                <label for="topic_text"><?php _e( 'Content:', 'buddypress' ); ?></label>
     51                                <textarea name="topic_text" id="topic_text"><?php bp_the_topic_text(); ?></textarea>
     52
     53                                <label><?php _e( 'Tags (comma separated):', 'buddypress' ); ?></label>
     54                                <input type="text" name="topic_tags" id="topic_tags" value="<?php bp_forum_topic_tag_list(); ?>" />
     55
     56                                <?php do_action( 'bp_group_after_edit_forum_topic' ); ?>
     57
     58                                <p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
     59
     60                                <?php wp_nonce_field( 'bp_forums_edit_topic' ); ?>
     61
     62                        </div>
     63
     64                <?php else : ?>
     65
     66                        <div id="edit-post">
     67
     68                                <?php do_action( 'bp_group_before_edit_forum_post' ); ?>
     69
     70                                <textarea name="post_text" id="post_text"><?php bp_the_topic_post_edit_text(); ?></textarea>
     71
     72                                <?php do_action( 'bp_group_after_edit_forum_post' ); ?>
     73
     74                                <p class="submit"><input type="submit" name="save_changes" id="save_changes" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" /></p>
     75
     76                                <?php wp_nonce_field( 'bp_forums_edit_post' ); ?>
     77
     78                        </div>
     79
     80                <?php endif; ?>
     81
     82        </form><!-- #forum-topic-form -->
     83
     84<?php else: ?>
     85
     86        <div id="message" class="info">
     87                <p><?php _e( 'This topic does not exist.', 'buddypress' ); ?></p>
     88        </div>
     89
     90<?php endif;?>
     91
     92<?php do_action( 'bp_after_group_forum_edit_form' ); ?>
  • bp-themes/bp-theme-compat/buddypress/groups/single/forum/topic.php

     
     1<?php do_action( 'bp_before_group_forum_topic' ); ?>
     2
     3<form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form">
     4        <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     5                <ul>
     6                        <?php if ( is_user_logged_in() ) : ?>
     7       
     8                                <li>
     9                                        <a href="<?php bp_forum_topic_new_reply_link(); ?>" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ); ?></a>
     10                                </li>
     11       
     12                        <?php endif; ?>
     13       
     14                        <?php if ( bp_forums_has_directory() ) : ?>
     15       
     16                                <li>
     17                                        <a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress' ); ?></a>
     18                                </li>
     19       
     20                        <?php endif; ?>
     21       
     22                </ul>
     23        </div>
     24       
     25        <div id="topic-meta">
     26                <h3><?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3>
     27       
     28                <?php if ( bp_forum_topic_has_tags() ) : ?>
     29       
     30                        <div class="topic-tags">
     31       
     32                                <?php _e( 'Topic tags:', 'buddypress' ); ?> <?php bp_forum_topic_tag_list(); ?>
     33       
     34                        </div>
     35       
     36                <?php endif; ?>
     37       
     38                <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
     39       
     40                        <div class="last admin-links">
     41       
     42                                <?php bp_the_topic_admin_links(); ?>
     43       
     44                        </div>
     45       
     46                <?php endif; ?>
     47       
     48                <?php do_action( 'bp_group_forum_topic_meta' ); ?>
     49       
     50        </div>
     51
     52
     53        <?php if ( bp_has_forum_topic_posts() ) : ?>
     54
     55                <div class="pagination no-ajax">
     56
     57                        <div id="post-count-top" class="pag-count">
     58
     59                                <?php bp_the_topic_pagination_count(); ?>
     60
     61                        </div>
     62
     63                        <div class="pagination-links" id="topic-pag-top">
     64
     65                                <?php bp_the_topic_pagination(); ?>
     66
     67                        </div>
     68
     69                </div>
     70
     71                <?php do_action( 'bp_before_group_forum_topic_posts' ); ?>
     72
     73                <ul id="topic-post-list" class="item-list" role="main">
     74                        <?php while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?>
     75
     76                                <li id="post-<?php bp_the_topic_post_id(); ?>" class="<?php bp_the_topic_post_css_class(); ?>">
     77                                        <div class="poster-meta">
     78                                                <a href="<?php bp_the_topic_post_poster_link(); ?>">
     79                                                        <?php bp_the_topic_post_poster_avatar( 'width=40&height=40' ); ?>
     80                                                </a>
     81                                                <?php echo sprintf( __( '%1$s said %2$s:', 'buddypress' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ); ?>
     82                                        </div>
     83
     84                                        <div class="post-content">
     85                                                <?php bp_the_topic_post_content(); ?>
     86                                        </div>
     87
     88                                        <div class="admin-links">
     89                                                <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?>
     90                                                        <?php bp_the_topic_post_admin_links(); ?>
     91                                                <?php endif; ?>
     92
     93                                                <?php do_action( 'bp_group_forum_post_meta' ); ?>
     94
     95                                                <a href="#post-<?php bp_the_topic_post_id(); ?>" title="<?php _e( 'Permanent link to this post', 'buddypress' ); ?>">#</a>
     96                                        </div>
     97                                </li>
     98
     99                        <?php endwhile; ?>
     100                </ul><!-- #topic-post-list -->
     101
     102                <?php do_action( 'bp_after_group_forum_topic_posts' ); ?>
     103
     104                <div class="pagination no-ajax">
     105
     106                        <div id="post-count-bottom" class="pag-count">
     107                                <?php bp_the_topic_pagination_count(); ?>
     108                        </div>
     109
     110                        <div class="pagination-links" id="topic-pag-bottom">
     111                                <?php bp_the_topic_pagination(); ?>
     112                        </div>
     113
     114                </div>
     115
     116        <?php else: ?>
     117       
     118                <div id="message" class="info">
     119                        <p><?php _e( 'There are no posts for this topic.', 'buddypress' ); ?></p>
     120                </div>
     121       
     122        <?php endif;?>
     123
     124        <?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?>
     125
     126                <?php if ( bp_get_the_topic_is_last_page() ) : ?>
     127
     128                        <?php if ( bp_get_the_topic_is_topic_open() && !bp_group_is_user_banned() ) : ?>
     129
     130                                <div id="post-topic-reply">
     131                                        <p id="post-reply"></p>
     132
     133                                        <?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
     134                                                <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ); ?></p>
     135                                        <?php endif; ?>
     136
     137                                        <?php do_action( 'groups_forum_new_reply_before' ); ?>
     138
     139                                        <h4><?php _e( 'Add a reply:', 'buddypress' ); ?></h4>
     140
     141                                        <textarea name="reply_text" id="reply_text"></textarea>
     142
     143                                        <div class="submit">
     144                                                <input type="submit" name="submit_reply" id="submit" value="<?php _e( 'Post Reply', 'buddypress' ); ?>" />
     145                                        </div>
     146
     147                                        <?php do_action( 'groups_forum_new_reply_after' ); ?>
     148
     149                                        <?php wp_nonce_field( 'bp_forums_new_reply' ); ?>
     150                                </div>
     151
     152                        <?php elseif ( !bp_group_is_user_banned() ) : ?>
     153
     154                                <div id="message" class="info">
     155                                        <p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ); ?></p>
     156                                </div>
     157
     158                        <?php endif; ?>
     159
     160                <?php endif; ?>
     161
     162        <?php endif; ?>
     163
     164</form><!-- #forum-topic-form -->
     165
     166<?php do_action( 'bp_after_group_forum_topic' ); ?>
  • bp-themes/bp-theme-compat/buddypress/groups/single/group-header.php

     
     1<?php
     2
     3do_action( 'bp_before_group_header' );
     4
     5?>
     6
     7<div id="item-actions">
     8
     9        <?php if ( bp_group_is_visible() ) : ?>
     10
     11                <h3><?php _e( 'Group Admins', 'buddypress' ); ?></h3>
     12
     13                <?php bp_group_list_admins();
     14
     15                do_action( 'bp_after_group_menu_admins' );
     16
     17                if ( bp_group_has_moderators() ) :
     18                        do_action( 'bp_before_group_menu_mods' ); ?>
     19
     20                        <h3><?php _e( 'Group Mods' , 'buddypress' ); ?></h3>
     21
     22                        <?php bp_group_list_mods();
     23
     24                        do_action( 'bp_after_group_menu_mods' );
     25
     26                endif;
     27
     28        endif; ?>
     29
     30</div><!-- #item-actions -->
     31
     32<div id="item-header-avatar">
     33        <a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>">
     34
     35                <?php bp_group_avatar(); ?>
     36
     37        </a>
     38</div><!-- #item-header-avatar -->
     39
     40<div id="item-header-content">
     41        <h2><a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>"><?php bp_group_name(); ?></a></h2>
     42        <span class="highlight"><?php bp_group_type(); ?></span> <span class="activity"><?php printf( __( 'active %s', 'buddypress' ), bp_get_group_last_active() ); ?></span>
     43
     44        <?php do_action( 'bp_before_group_header_meta' ); ?>
     45
     46        <div id="item-meta">
     47
     48                <?php bp_group_description(); ?>
     49
     50                <div id="item-buttons">
     51
     52                        <?php do_action( 'bp_group_header_actions' ); ?>
     53
     54                </div><!-- #item-buttons -->
     55
     56                <?php do_action( 'bp_group_header_meta' ); ?>
     57
     58        </div>
     59</div><!-- #item-header-content -->
     60
     61<?php
     62do_action( 'bp_after_group_header' );
     63do_action( 'template_notices' );
     64?>
  • bp-themes/bp-theme-compat/buddypress/groups/single/home.php

     
     1<div id="buddypress">
     2
     3        <?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>
     4
     5        <?php do_action( 'bp_before_group_home_content' ); ?>
     6
     7        <div id="item-header" role="complementary">
     8
     9                <?php bp_get_template_part( 'groups/single/group-header' ); ?>
     10
     11        </div><!-- #item-header -->
     12
     13        <div id="item-nav">
     14                <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
     15                        <ul>
     16
     17                                <?php bp_get_options_nav(); ?>
     18
     19                                <?php do_action( 'bp_group_options_nav' ); ?>
     20
     21                        </ul>
     22                </div>
     23        </div><!-- #item-nav -->
     24
     25        <div id="item-body">
     26
     27                <?php do_action( 'bp_before_group_body' );
     28
     29                if ( bp_is_group_admin_page() && bp_group_is_visible() ) :
     30                        bp_get_template_part( 'groups/single/admin' );
     31
     32                elseif ( bp_is_group_members() && bp_group_is_visible() ) :
     33                        bp_get_template_part( 'groups/single/members' );
     34
     35                elseif ( bp_is_group_invites() && bp_group_is_visible() ) :
     36                        bp_get_template_part( 'groups/single/send-invites' );
     37
     38                elseif ( bp_is_group_forum() && bp_group_is_visible() && bp_is_active( 'forums' ) && bp_forums_is_installed_correctly() ) :
     39                        bp_get_template_part( 'groups/single/forum' );
     40
     41                elseif ( bp_is_group_membership_request() ) :
     42                        bp_get_template_part( 'groups/single/request-membership' );
     43
     44                elseif ( bp_group_is_visible() && bp_is_active( 'activity' ) ) :
     45                        bp_get_template_part( 'groups/single/activity' );
     46
     47                elseif ( bp_group_is_visible() ) :
     48                        bp_get_template_part( 'groups/single/members' );
     49
     50                // The group is not visible, show the status message
     51                elseif ( !bp_group_is_visible() ) :
     52
     53                        do_action( 'bp_before_group_status_message' ); ?>
     54
     55                        <div id="message" class="info">
     56                                <p><?php bp_group_status_message(); ?></p>
     57                        </div>
     58
     59                        <?php do_action( 'bp_after_group_status_message' );
     60
     61                // If nothing sticks, just load a group front template if one exists.
     62                else :
     63                        bp_get_template_part( 'groups/single/front' );
     64
     65                endif;
     66
     67                do_action( 'bp_after_group_body' ); ?>
     68
     69        </div><!-- #item-body -->
     70
     71        <?php do_action( 'bp_after_group_home_content' ); ?>
     72
     73        <?php endwhile; endif; ?>
     74
     75</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/buddypress/groups/single/members.php

     
     1<?php if ( bp_group_has_members( 'exclude_admins_mods=0' ) ) : ?>
     2
     3        <?php do_action( 'bp_before_group_members_content' ); ?>
     4
     5        <div class="item-list-tabs" id="subnav" role="navigation">
     6                <ul>
     7
     8                        <?php do_action( 'bp_members_directory_member_sub_types' ); ?>
     9
     10                </ul>
     11        </div>
     12
     13        <div id="pag-top" class="pagination no-ajax">
     14
     15                <div class="pag-count" id="member-count-top">
     16
     17                        <?php bp_members_pagination_count(); ?>
     18
     19                </div>
     20
     21                <div class="pagination-links" id="member-pag-top">
     22
     23                        <?php bp_members_pagination_links(); ?>
     24
     25                </div>
     26
     27        </div>
     28
     29        <?php do_action( 'bp_before_group_members_list' ); ?>
     30
     31        <ul id="member-list" class="item-list" role="main">
     32
     33                <?php while ( bp_group_members() ) : bp_group_the_member(); ?>
     34
     35                        <li>
     36                                <a href="<?php bp_group_member_domain(); ?>">
     37
     38                                        <?php bp_group_member_avatar_thumb(); ?>
     39
     40                                </a>
     41
     42                                <h5><?php bp_group_member_link(); ?></h5>
     43                                <span class="activity"><?php bp_group_member_joined_since(); ?></span>
     44
     45                                <?php do_action( 'bp_group_members_list_item' ); ?>
     46
     47                                <?php if ( bp_is_active( 'friends' ) ) : ?>
     48
     49                                        <div class="action">
     50
     51                                                <?php bp_add_friend_button( bp_get_group_member_id(), bp_get_group_member_is_friend() ); ?>
     52
     53                                                <?php do_action( 'bp_group_members_list_item_action' ); ?>
     54
     55                                        </div>
     56
     57                                <?php endif; ?>
     58                        </li>
     59
     60                <?php endwhile; ?>
     61
     62        </ul>
     63
     64        <?php do_action( 'bp_after_group_members_list' ); ?>
     65
     66        <div id="pag-bottom" class="pagination no-ajax">
     67
     68                <div class="pag-count" id="member-count-bottom">
     69
     70                        <?php bp_members_pagination_count(); ?>
     71
     72                </div>
     73
     74                <div class="pagination-links" id="member-pag-bottom">
     75
     76                        <?php bp_members_pagination_links(); ?>
     77
     78                </div>
     79
     80        </div>
     81
     82        <?php do_action( 'bp_after_group_members_content' ); ?>
     83
     84<?php else: ?>
     85
     86        <div id="message" class="info">
     87                <p><?php _e( 'This group has no members.', 'buddypress' ); ?></p>
     88        </div>
     89
     90<?php endif; ?>
  • bp-themes/bp-theme-compat/buddypress/groups/single/plugins.php

     
     1<div id="buddypress">
     2
     3        <?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?>
     4
     5                <?php do_action( 'bp_before_group_plugin_template' ); ?>
     6
     7                <div id="item-header">
     8
     9                        <?php bp_get_template_part( 'groups/single/group-header' ); ?>
     10
     11                </div><!-- #item-header -->
     12
     13                <div id="item-nav">
     14                        <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
     15                                <ul>
     16                                        <?php bp_get_options_nav(); ?>
     17
     18                                        <?php do_action( 'bp_group_plugin_options_nav' ); ?>
     19                                </ul>
     20                        </div>
     21                </div><!-- #item-nav -->
     22
     23                <div id="item-body">
     24
     25                        <?php do_action( 'bp_before_group_body' ); ?>
     26
     27                        <?php do_action( 'bp_template_content' ); ?>
     28
     29                        <?php do_action( 'bp_after_group_body' ); ?>
     30                </div><!-- #item-body -->
     31
     32                <?php do_action( 'bp_after_group_plugin_template' ); ?>
     33
     34        <?php endwhile; endif; ?>
     35
     36</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/buddypress/groups/single/request-membership.php

     
     1<?php do_action( 'bp_before_group_request_membership_content' ); ?>
     2
     3<?php if ( !bp_group_has_requested_membership() ) : ?>
     4        <p><?php printf( __( "You are requesting to become a member of the group '%s'.", "buddypress" ), bp_get_group_name( false ) ); ?></p>
     5
     6        <form action="<?php bp_group_form_action('request-membership' ); ?>" method="post" name="request-membership-form" id="request-membership-form" class="standard-form">
     7                <label for="group-request-membership-comments"><?php _e( 'Comments (optional)', 'buddypress' ); ?></label>
     8                <textarea name="group-request-membership-comments" id="group-request-membership-comments"></textarea>
     9
     10                <?php do_action( 'bp_group_request_membership_content' ); ?>
     11
     12                <p><input type="submit" name="group-request-send" id="group-request-send" value="<?php _e( 'Send Request', 'buddypress' ); ?>" />
     13
     14                <?php wp_nonce_field( 'groups_request_membership' ); ?>
     15        </form><!-- #request-membership-form -->
     16<?php endif; ?>
     17
     18<?php do_action( 'bp_after_group_request_membership_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/groups/single/send-invites.php

     
     1<?php do_action( 'bp_before_group_send_invites_content' ); ?>
     2
     3<?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
     4
     5        <form action="<?php bp_group_send_invite_form_action(); ?>" method="post" id="send-invite-form" class="standard-form" role="main">
     6
     7                <div class="left-menu">
     8
     9                        <div id="invite-list">
     10                                <ul>
     11                                        <?php bp_new_group_invite_friend_list(); ?>
     12                                </ul>
     13
     14                                <?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ); ?>
     15                        </div>
     16
     17                </div><!-- .left-menu -->
     18
     19                <div class="main-column">
     20
     21                        <div id="message" class="info">
     22                                <p><?php _e('Select people to invite from your friends list.', 'buddypress' ); ?></p>
     23                        </div>
     24
     25                        <?php do_action( 'bp_before_group_send_invites_list' ); ?>
     26
     27                        <?php /* The ID 'friend-list' is important for AJAX support. */ ?>
     28                        <ul id="friend-list" class="item-list">
     29                        <?php if ( bp_group_has_invites() ) : ?>
     30
     31                                <?php while ( bp_group_invites() ) : bp_group_the_invite(); ?>
     32
     33                                        <li id="<?php bp_group_invite_item_id(); ?>">
     34                                                <?php bp_group_invite_user_avatar(); ?>
     35
     36                                                <h4><?php bp_group_invite_user_link(); ?></h4>
     37                                                <span class="activity"><?php bp_group_invite_user_last_active(); ?></span>
     38
     39                                                <?php do_action( 'bp_group_send_invites_item' ); ?>
     40
     41                                                <div class="action">
     42                                                        <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>
     43
     44                                                        <?php do_action( 'bp_group_send_invites_item_action' ); ?>
     45                                                </div>
     46                                        </li>
     47
     48                                <?php endwhile; ?>
     49
     50                        <?php endif; ?>
     51                        </ul><!-- #friend-list -->
     52
     53                        <?php do_action( 'bp_after_group_send_invites_list' ); ?>
     54
     55                </div><!-- .main-column -->
     56
     57                <div class="clear"></div>
     58
     59                <div class="submit">
     60                        <input type="submit" name="submit" id="submit" value="<?php _e( 'Send Invites', 'buddypress' ); ?>" />
     61                </div>
     62
     63                <?php wp_nonce_field( 'groups_send_invites', '_wpnonce_send_invites' ); ?>
     64
     65                <?php /* This is important, don't forget it */ ?>
     66                <input type="hidden" name="group_id" id="group_id" value="<?php bp_group_id(); ?>" />
     67
     68        </form><!-- #send-invite-form -->
     69
     70<?php else : ?>
     71
     72        <div id="message" class="info" role="main">
     73                <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>
     74        </div>
     75
     76<?php endif; ?>
     77
     78<?php do_action( 'bp_after_group_send_invites_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/index.php

     
     1<?php do_action( 'bp_before_directory_members_page' ); ?>
     2
     3<div id="buddypress">
     4
     5        <?php do_action( 'bp_before_directory_members' ); ?>
     6
     7        <form action="" method="post" id="members-directory-form" class="dir-form">
     8
     9                <?php do_action( 'bp_before_directory_members_content' ); ?>
     10
     11                <div id="members-dir-search" class="dir-search" role="search">
     12
     13                        <?php bp_directory_members_search_form(); ?>
     14
     15                </div><!-- #members-dir-search -->
     16
     17                <div class="item-list-tabs" role="navigation">
     18                        <ul>
     19                                <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>
     20
     21                                <?php if ( is_user_logged_in() && bp_is_active( 'friends' ) && bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
     22
     23                                        <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>
     24
     25                                <?php endif; ?>
     26
     27                                <?php do_action( 'bp_members_directory_member_types' ); ?>
     28
     29                        </ul>
     30                </div><!-- .item-list-tabs -->
     31
     32                <div class="item-list-tabs" id="subnav" role="navigation">
     33                        <ul>
     34
     35                                <?php do_action( 'bp_members_directory_member_sub_types' ); ?>
     36
     37                                <li id="members-order-select" class="last filter">
     38
     39                                        <label for="members-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
     40                                        <select id="members-order-by">
     41                                                <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     42                                                <option value="newest"><?php _e( 'Newest Registered', 'buddypress' ); ?></option>
     43
     44                                                <?php if ( bp_is_active( 'xprofile' ) ) : ?>
     45
     46                                                        <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
     47
     48                                                <?php endif; ?>
     49
     50                                                <?php do_action( 'bp_members_directory_order_options' ); ?>
     51
     52                                        </select>
     53                                </li>
     54                        </ul>
     55                </div>
     56
     57                <div id="members-dir-list" class="members dir-list">
     58
     59                        <?php bp_get_template_part( 'members/members-loop' ); ?>
     60
     61                </div><!-- #members-dir-list -->
     62
     63                <?php do_action( 'bp_directory_members_content' ); ?>
     64
     65                <?php wp_nonce_field( 'directory_members', '_wpnonce-member-filter' ); ?>
     66
     67                <?php do_action( 'bp_after_directory_members_content' ); ?>
     68
     69        </form><!-- #members-directory-form -->
     70
     71        <?php do_action( 'bp_after_directory_members' ); ?>
     72
     73</div><!-- #buddypress -->
     74
     75<?php do_action( 'bp_after_directory_members_page' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/members-loop.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Members Loop
     5 *
     6 * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter()
     7 *
     8 * @package BuddyPress
     9 * @subpackage bp-default
     10 */
     11
     12?>
     13
     14<?php do_action( 'bp_before_members_loop' ); ?>
     15
     16<?php if ( bp_has_members( bp_ajax_querystring( 'members' ) ) ) : ?>
     17
     18        <div id="pag-top" class="pagination">
     19
     20                <div class="pag-count" id="member-dir-count-top">
     21
     22                        <?php bp_members_pagination_count(); ?>
     23
     24                </div>
     25
     26                <div class="pagination-links" id="member-dir-pag-top">
     27
     28                        <?php bp_members_pagination_links(); ?>
     29
     30                </div>
     31
     32        </div>
     33
     34        <?php do_action( 'bp_before_directory_members_list' ); ?>
     35
     36        <ul id="members-list" class="item-list" role="main">
     37
     38        <?php while ( bp_members() ) : bp_the_member(); ?>
     39
     40                <li>
     41                        <div class="item-avatar">
     42                                <a href="<?php bp_member_permalink(); ?>"><?php bp_member_avatar(); ?></a>
     43                        </div>
     44
     45                        <div class="item">
     46                                <div class="item-title">
     47                                        <a href="<?php bp_member_permalink(); ?>"><?php bp_member_name(); ?></a>
     48
     49                                        <?php if ( bp_get_member_latest_update() ) : ?>
     50
     51                                                <span class="update"> <?php bp_member_latest_update(); ?></span>
     52
     53                                        <?php endif; ?>
     54
     55                                </div>
     56
     57                                <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
     58
     59                                <?php do_action( 'bp_directory_members_item' ); ?>
     60
     61                                <?php
     62                                 /***
     63                                  * If you want to show specific profile fields here you can,
     64                                  * but it'll add an extra query for each member in the loop
     65                                  * (only one regardless of the number of fields you show):
     66                                  *
     67                                  * bp_member_profile_data( 'field=the field name' );
     68                                  */
     69                                ?>
     70                        </div>
     71
     72                        <div class="action">
     73
     74                                <?php do_action( 'bp_directory_members_actions' ); ?>
     75
     76                        </div>
     77
     78                        <div class="clear"></div>
     79                </li>
     80
     81        <?php endwhile; ?>
     82
     83        </ul>
     84
     85        <?php do_action( 'bp_after_directory_members_list' ); ?>
     86
     87        <?php bp_member_hidden_fields(); ?>
     88
     89        <div id="pag-bottom" class="pagination">
     90
     91                <div class="pag-count" id="member-dir-count-bottom">
     92
     93                        <?php bp_members_pagination_count(); ?>
     94
     95                </div>
     96
     97                <div class="pagination-links" id="member-dir-pag-bottom">
     98
     99                        <?php bp_members_pagination_links(); ?>
     100
     101                </div>
     102
     103        </div>
     104
     105<?php else: ?>
     106
     107        <div id="message" class="info">
     108                <p><?php _e( "Sorry, no members were found.", 'buddypress' ); ?></p>
     109        </div>
     110
     111<?php endif; ?>
     112
     113<?php do_action( 'bp_after_members_loop' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/activity.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Users Activity
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     13        <ul>
     14
     15                <?php bp_get_options_nav(); ?>
     16
     17                <li id="activity-filter-select" class="last">
     18                        <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
     19                        <select id="activity-filter-by">
     20                                <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
     21                                <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
     22
     23                                <?php
     24                                if ( !bp_is_current_action( 'groups' ) ) :
     25                                        if ( bp_is_active( 'blogs' ) ) : ?>
     26
     27                                                <option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ); ?></option>
     28                                                <option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ); ?></option>
     29
     30                                        <?php
     31                                        endif;
     32
     33                                        if ( bp_is_active( 'friends' ) ) : ?>
     34
     35                                                <option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option>
     36
     37                                        <?php endif;
     38
     39                                endif;
     40
     41                                if ( bp_is_active( 'forums' ) ) : ?>
     42
     43                                        <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option>
     44                                        <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option>
     45
     46                                <?php endif;
     47
     48                                if ( bp_is_active( 'groups' ) ) : ?>
     49
     50                                        <option value="created_group"><?php _e( 'New Groups', 'buddypress' ); ?></option>
     51                                        <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option>
     52
     53                                <?php endif;
     54
     55                                do_action( 'bp_member_activity_filter_options' ); ?>
     56
     57                        </select>
     58                </li>
     59        </ul>
     60</div><!-- .item-list-tabs -->
     61
     62<?php do_action( 'bp_before_member_activity_post_form' ); ?>
     63
     64<?php
     65if ( is_user_logged_in() && bp_is_my_profile() && ( !bp_current_action() || bp_is_current_action( 'just-me' ) ) )
     66        bp_get_template_part( 'activity/post-form' );
     67
     68do_action( 'bp_after_member_activity_post_form' );
     69do_action( 'bp_before_member_activity_content' ); ?>
     70
     71<div class="activity" role="main">
     72
     73        <?php bp_get_template_part( 'activity/activity-loop' ) ?>
     74
     75</div><!-- .activity -->
     76
     77<?php do_action( 'bp_after_member_activity_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/activity/permalink.php

     
     1<div id="buddypress">
     2        <?php do_action( 'template_notices' ); ?>
     3
     4        <div class="activity no-ajax" role="main">
     5                <?php if ( bp_has_activities( 'display_comments=threaded&show_hidden=true&include=' . bp_current_action() ) ) : ?>
     6
     7                        <ul id="activity-stream" class="activity-list item-list">
     8                        <?php while ( bp_activities() ) : bp_the_activity(); ?>
     9
     10                                <?php bp_get_template_part( 'activity/entry' ); ?>
     11
     12                        <?php endwhile; ?>
     13                        </ul>
     14
     15                <?php endif; ?>
     16        </div>
     17</div>
  • bp-themes/bp-theme-compat/buddypress/members/single/blogs.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Users Blogs
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<div class="item-list-tabs" id="subnav" role="navigation">
     13        <ul>
     14
     15                <?php bp_get_options_nav(); ?>
     16
     17                <li id="blogs-order-select" class="last filter">
     18
     19                        <label for="blogs-all"><?php _e( 'Order By:', 'buddypress' ); ?></label>
     20                        <select id="blogs-all">
     21                                <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     22                                <option value="newest"><?php _e( 'Newest', 'buddypress' ); ?></option>
     23                                <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
     24
     25                                <?php do_action( 'bp_member_blog_order_options' ); ?>
     26
     27                        </select>
     28                </li>
     29        </ul>
     30</div><!-- .item-list-tabs -->
     31
     32<?php do_action( 'bp_before_member_blogs_content' ); ?>
     33
     34<div class="blogs myblogs" role="main">
     35
     36        <?php bp_get_template_part( 'blogs/blogs-loop' ) ?>
     37
     38</div><!-- .blogs.myblogs -->
     39
     40<?php do_action( 'bp_after_member_blogs_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/forums.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Users Forums
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     13        <ul>
     14                <?php bp_get_options_nav(); ?>
     15
     16                <li id="forums-order-select" class="last filter">
     17
     18                        <label for="forums-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
     19                        <select id="forums-order-by">
     20                                <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     21                                <option value="popular"><?php _e( 'Most Posts', 'buddypress' ); ?></option>
     22                                <option value="unreplied"><?php _e( 'Unreplied', 'buddypress' ); ?></option>
     23
     24                                <?php do_action( 'bp_forums_directory_order_options' ); ?>
     25
     26                        </select>
     27                </li>
     28        </ul>
     29</div><!-- .item-list-tabs -->
     30
     31<?php
     32
     33if ( bp_is_current_action( 'favorites' ) ) :
     34        bp_get_template_part( 'members/single/forums/topics' );
     35
     36else :
     37        do_action( 'bp_before_member_forums_content' ); ?>
     38
     39        <div class="forums myforums">
     40
     41                <?php bp_get_template_part( 'forums/forums-loop' ) ?>
     42
     43        </div>
     44
     45        <?php do_action( 'bp_after_member_forums_content' ); ?>
     46
     47<?php endif; ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/forums/topics.php

     
     1<?php
     2/*
     3 * To change this template, choose Tools | Templates
     4 * and open the template in the editor.
     5 */
     6
     7?>
  • bp-themes/bp-theme-compat/buddypress/members/single/friends.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Users Friends
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     13        <ul>
     14                <?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>
     15
     16                <?php if ( !bp_is_current_action( 'requests' ) ) : ?>
     17
     18                        <li id="members-order-select" class="last filter">
     19
     20                                <label for="members-friends"><?php _e( 'Order By:', 'buddypress' ); ?></label>
     21                                <select id="members-friends">
     22                                        <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     23                                        <option value="newest"><?php _e( 'Newest Registered', 'buddypress' ); ?></option>
     24                                        <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
     25
     26                                        <?php do_action( 'bp_member_blog_order_options' ); ?>
     27
     28                                </select>
     29                        </li>
     30
     31                <?php endif; ?>
     32
     33        </ul>
     34</div>
     35
     36<?php
     37
     38if ( bp_is_current_action( 'requests' ) ) :
     39         bp_get_template_part( 'members/single/friends/requests' );
     40
     41else :
     42        do_action( 'bp_before_member_friends_content' ); ?>
     43
     44        <div class="members friends">
     45
     46                <?php bp_get_template_part( 'members/members-loop' ) ?>
     47
     48        </div><!-- .members.friends -->
     49
     50        <?php do_action( 'bp_after_member_friends_content' ); ?>
     51
     52<?php endif; ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/friends/requests.php

     
     1<?php do_action( 'bp_before_member_friend_requests_content' ); ?>
     2
     3<?php if ( bp_has_members( 'type=alphabetical&include=' . bp_get_friendship_requests() ) ) : ?>
     4
     5        <div id="pag-top" class="pagination no-ajax">
     6
     7                <div class="pag-count" id="member-dir-count-top">
     8
     9                        <?php bp_members_pagination_count(); ?>
     10
     11                </div>
     12
     13                <div class="pagination-links" id="member-dir-pag-top">
     14
     15                        <?php bp_members_pagination_links(); ?>
     16
     17                </div>
     18
     19        </div>
     20
     21        <ul id="friend-list" class="item-list" role="main">
     22                <?php while ( bp_members() ) : bp_the_member(); ?>
     23
     24                        <li id="friendship-<?php bp_friend_friendship_id(); ?>">
     25                                <div class="item-avatar">
     26                                        <a href="<?php bp_member_link(); ?>"><?php bp_member_avatar(); ?></a>
     27                                </div>
     28
     29                                <div class="item">
     30                                        <div class="item-title"><a href="<?php bp_member_link(); ?>"><?php bp_member_name(); ?></a></div>
     31                                        <div class="item-meta"><span class="activity"><?php bp_member_last_active(); ?></span></div>
     32                                </div>
     33
     34                                <?php do_action( 'bp_friend_requests_item' ); ?>
     35
     36                                <div class="action">
     37                                        <a class="button accept" href="<?php bp_friend_accept_request_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> &nbsp;
     38                                        <a class="button reject" href="<?php bp_friend_reject_request_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
     39
     40                                        <?php do_action( 'bp_friend_requests_item_action' ); ?>
     41                                </div>
     42                        </li>
     43
     44                <?php endwhile; ?>
     45        </ul>
     46
     47        <?php do_action( 'bp_friend_requests_content' ); ?>
     48
     49        <div id="pag-bottom" class="pagination no-ajax">
     50
     51                <div class="pag-count" id="member-dir-count-bottom">
     52
     53                        <?php bp_members_pagination_count(); ?>
     54
     55                </div>
     56
     57                <div class="pagination-links" id="member-dir-pag-bottom">
     58
     59                        <?php bp_members_pagination_links(); ?>
     60
     61                </div>
     62
     63        </div>
     64
     65<?php else: ?>
     66
     67        <div id="message" class="info">
     68                <p><?php _e( 'You have no pending friendship requests.', 'buddypress' ); ?></p>
     69        </div>
     70
     71<?php endif;?>
     72
     73<?php do_action( 'bp_after_member_friend_requests_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/groups.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Users Groups
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     13        <ul>
     14                <?php if ( bp_is_my_profile() ) bp_get_options_nav(); ?>
     15
     16                <?php if ( !bp_is_current_action( 'invites' ) ) : ?>
     17
     18                        <li id="groups-order-select" class="last filter">
     19
     20                                <label for="groups-sort-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>
     21                                <select id="groups-sort-by">
     22                                        <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
     23                                        <option value="popular"><?php _e( 'Most Members', 'buddypress' ); ?></option>
     24                                        <option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option>
     25                                        <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
     26
     27                                        <?php do_action( 'bp_member_group_order_options' ); ?>
     28
     29                                </select>
     30                        </li>
     31
     32                <?php endif; ?>
     33
     34        </ul>
     35</div><!-- .item-list-tabs -->
     36
     37<?php
     38
     39if ( bp_is_current_action( 'invites' ) ) :
     40        bp_get_template_part( 'members/single/groups/invites' );
     41
     42else :
     43        do_action( 'bp_before_member_groups_content' ); ?>
     44
     45        <div class="groups mygroups">
     46
     47                <?php bp_get_template_part( 'groups/groups-loop' ); ?>
     48
     49        </div>
     50
     51        <?php do_action( 'bp_after_member_groups_content' ); ?>
     52
     53<?php endif; ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/groups/invites.php

     
     1<?php do_action( 'bp_before_group_invites_content' ); ?>
     2
     3<?php if ( bp_has_groups( 'type=invites&user_id=' . bp_loggedin_user_id() ) ) : ?>
     4
     5        <ul id="group-list" class="invites item-list" role="main">
     6
     7                <?php while ( bp_groups() ) : bp_the_group(); ?>
     8
     9                        <li>
     10                                <div class="item-avatar">
     11                                        <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
     12                                </div>
     13
     14                                <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>
     15
     16                                <p class="desc">
     17                                        <?php bp_group_description_excerpt(); ?>
     18                                </p>
     19
     20                                <?php do_action( 'bp_group_invites_item' ); ?>
     21
     22                                <div class="action">
     23                                        <a class="button accept" href="<?php bp_group_accept_invite_link(); ?>"><?php _e( 'Accept', 'buddypress' ); ?></a> &nbsp;
     24                                        <a class="button reject confirm" href="<?php bp_group_reject_invite_link(); ?>"><?php _e( 'Reject', 'buddypress' ); ?></a>
     25
     26                                        <?php do_action( 'bp_group_invites_item_action' ); ?>
     27
     28                                </div>
     29                        </li>
     30
     31                <?php endwhile; ?>
     32        </ul>
     33
     34<?php else: ?>
     35
     36        <div id="message" class="info" role="main">
     37                <p><?php _e( 'You have no outstanding group invites.', 'buddypress' ); ?></p>
     38        </div>
     39
     40<?php endif;?>
     41
     42<?php do_action( 'bp_after_group_invites_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/home.php

     
     1<div id="buddypress">
     2
     3        <?php do_action( 'bp_before_member_home_content' ); ?>
     4
     5        <div id="item-header" role="complementary">
     6
     7                <?php bp_get_template_part( 'members/single/member-header' ) ?>
     8
     9        </div><!-- #item-header -->
     10
     11        <div id="item-nav">
     12                <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
     13                        <ul>
     14
     15                                <?php bp_get_displayed_user_nav(); ?>
     16
     17                                <?php do_action( 'bp_member_options_nav' ); ?>
     18
     19                        </ul>
     20                </div>
     21        </div><!-- #item-nav -->
     22
     23        <div id="item-body">
     24
     25                <?php do_action( 'bp_before_member_body' );
     26
     27                if ( bp_is_user_activity() || !bp_current_component() ) :
     28                        bp_get_template_part( 'members/single/activity' );
     29
     30                elseif ( bp_is_user_blogs() ) :
     31                        bp_get_template_part( 'members/single/blogs'    );
     32
     33                elseif ( bp_is_user_friends() ) :
     34                        bp_get_template_part( 'members/single/friends'  );
     35
     36                elseif ( bp_is_user_groups() ) :
     37                        bp_get_template_part( 'members/single/groups'   );
     38
     39                elseif ( bp_is_user_messages() ) :
     40                        bp_get_template_part( 'members/single/messages' );
     41
     42                elseif ( bp_is_user_profile() ) :
     43                        bp_get_template_part( 'members/single/profile'  );
     44
     45                elseif ( bp_is_user_forums() ) :
     46                        bp_get_template_part( 'members/single/forums'   );
     47
     48                elseif ( bp_is_user_settings() ) :
     49                        bp_get_template_part( 'members/single/settings' );
     50
     51                // If nothing sticks, load a generic template
     52                else :
     53                        bp_get_template_part( 'members/single/plugins'  );
     54
     55                endif;
     56
     57                do_action( 'bp_after_member_body' ); ?>
     58
     59        </div><!-- #item-body -->
     60
     61        <?php do_action( 'bp_after_member_home_content' ); ?>
     62
     63</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/buddypress/members/single/member-header.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Users Header
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<?php do_action( 'bp_before_member_header' ); ?>
     13
     14<div id="item-header-avatar">
     15        <a href="<?php bp_displayed_user_link(); ?>">
     16
     17                <?php bp_displayed_user_avatar( 'type=full' ); ?>
     18
     19        </a>
     20</div><!-- #item-header-avatar -->
     21
     22<div id="item-header-content">
     23
     24        <h2>
     25                <a href="<?php bp_displayed_user_link(); ?>"><?php bp_displayed_user_fullname(); ?></a>
     26        </h2>
     27
     28        <span class="user-nicename">@<?php bp_displayed_user_username(); ?></span>
     29        <span class="activity"><?php bp_last_activity( bp_displayed_user_id() ); ?></span>
     30
     31        <?php do_action( 'bp_before_member_header_meta' ); ?>
     32
     33        <div id="item-meta">
     34
     35                <?php if ( bp_is_active( 'activity' ) ) : ?>
     36
     37                        <div id="latest-update">
     38
     39                                <?php bp_activity_latest_update( bp_displayed_user_id() ); ?>
     40
     41                        </div>
     42
     43                <?php endif; ?>
     44
     45                <div id="item-buttons">
     46
     47                        <?php do_action( 'bp_member_header_actions' ); ?>
     48
     49                </div><!-- #item-buttons -->
     50
     51                <?php
     52                /***
     53                 * If you'd like to show specific profile fields here use:
     54                 * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
     55                 */
     56                 do_action( 'bp_profile_header_meta' );
     57
     58                 ?>
     59
     60        </div><!-- #item-meta -->
     61
     62</div><!-- #item-header-content -->
     63
     64<?php do_action( 'bp_after_member_header' ); ?>
     65
     66<?php do_action( 'template_notices' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/messages.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Users Messages
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     13        <ul>
     14
     15                <?php bp_get_options_nav(); ?>
     16
     17        </ul>
     18       
     19        <?php if ( bp_is_messages_inbox() || bp_is_messages_sentbox() ) : ?>
     20
     21                <div class="message-search"><?php bp_message_search_form(); ?></div>
     22
     23        <?php endif; ?>
     24
     25</div><!-- .item-list-tabs -->
     26
     27<?php
     28
     29        if ( bp_is_current_action( 'compose' ) ) :
     30                bp_get_template_part( 'members/single/messages/compose' );
     31
     32        elseif ( bp_is_current_action( 'view' ) ) :
     33                bp_get_template_part( 'members/single/messages/single' );
     34
     35        else :
     36                do_action( 'bp_before_member_messages_content' ); ?>
     37
     38        <div class="messages" role="main">
     39
     40                <?php
     41                        if ( bp_is_current_action( 'notices' ) )
     42                                bp_get_template_part( 'members/single/messages/notices-loop' );
     43                        else
     44                                bp_get_template_part( 'members/single/messages/messages-loop' );
     45                ?>
     46
     47        </div><!-- .messages -->
     48
     49        <?php do_action( 'bp_after_member_messages_content' ); ?>
     50
     51<?php endif; ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/messages/compose.php

     
     1<form action="<?php bp_messages_form_action('compose' ); ?>" method="post" id="send_message_form" class="standard-form" role="main">
     2
     3        <?php do_action( 'bp_before_messages_compose_content' ); ?>
     4
     5        <label for="send-to-input"><?php _e("Send To (Username or Friend's Name)", 'buddypress' ); ?></label>
     6        <ul class="first acfb-holder">
     7                <li>
     8                        <?php bp_message_get_recipient_tabs(); ?>
     9                        <input type="text" name="send-to-input" class="send-to-input" id="send-to-input" />
     10                </li>
     11        </ul>
     12
     13        <?php if ( bp_current_user_can( 'bp_moderate' ) ) : ?>
     14                <input type="checkbox" id="send-notice" name="send-notice" value="1" /> <?php _e( "This is a notice to all users.", "buddypress" ); ?>
     15        <?php endif; ?>
     16
     17        <label for="subject"><?php _e( 'Subject', 'buddypress' ); ?></label>
     18        <input type="text" name="subject" id="subject" value="<?php bp_messages_subject_value(); ?>" />
     19
     20        <label for="content"><?php _e( 'Message', 'buddypress' ); ?></label>
     21        <textarea name="content" id="message_content" rows="15" cols="40"><?php bp_messages_content_value(); ?></textarea>
     22
     23        <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(); ?>" />
     24
     25        <?php do_action( 'bp_after_messages_compose_content' ); ?>
     26
     27        <div class="submit">
     28                <input type="submit" value="<?php _e( "Send Message", 'buddypress' ); ?>" name="send" id="send" />
     29        </div>
     30
     31        <?php wp_nonce_field( 'messages_send_message' ); ?>
     32</form>
     33
     34<script type="text/javascript">
     35        document.getElementById("send-to-input").focus();
     36</script>
     37
  • bp-themes/bp-theme-compat/buddypress/members/single/messages/messages-loop.php

     
     1<?php do_action( 'bp_before_member_messages_loop' ); ?>
     2
     3<?php if ( bp_has_message_threads( bp_ajax_querystring( 'messages' ) ) ) : ?>
     4
     5        <div class="pagination no-ajax" id="user-pag">
     6
     7                <div class="pag-count" id="messages-dir-count">
     8                        <?php bp_messages_pagination_count(); ?>
     9                </div>
     10
     11                <div class="pagination-links" id="messages-dir-pag">
     12                        <?php bp_messages_pagination(); ?>
     13                </div>
     14
     15        </div><!-- .pagination -->
     16
     17        <?php do_action( 'bp_after_member_messages_pagination' ); ?>
     18
     19        <?php do_action( 'bp_before_member_messages_threads'   ); ?>
     20
     21        <table id="message-threads" class="messages-notices">
     22                <?php while ( bp_message_threads() ) : bp_message_thread(); ?>
     23
     24                        <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; ?>>
     25                                <td width="1%" class="thread-count">
     26                                        <span class="unread-count"><?php bp_message_thread_unread_count(); ?></span>
     27                                </td>
     28                                <td width="1%" class="thread-avatar"><?php bp_message_thread_avatar(); ?></td>
     29
     30                                <?php if ( 'sentbox' != bp_current_action() ) : ?>
     31                                        <td width="30%" class="thread-from">
     32                                                <?php _e( 'From:', 'buddypress' ); ?> <?php bp_message_thread_from(); ?><br />
     33                                                <span class="activity"><?php bp_message_thread_last_post_date(); ?></span>
     34                                        </td>
     35                                <?php else: ?>
     36                                        <td width="30%" class="thread-from">
     37                                                <?php _e( 'To:', 'buddypress' ); ?> <?php bp_message_thread_to(); ?><br />
     38                                                <span class="activity"><?php bp_message_thread_last_post_date(); ?></span>
     39                                        </td>
     40                                <?php endif; ?>
     41
     42                                <td width="50%" class="thread-info">
     43                                        <p><a href="<?php bp_message_thread_view_link(); ?>" title="<?php _e( "View Message", "buddypress" ); ?>"><?php bp_message_thread_subject(); ?></a></p>
     44                                        <p class="thread-excerpt"><?php bp_message_thread_excerpt(); ?></p>
     45                                </td>
     46
     47                                <?php do_action( 'bp_messages_inbox_list_item' ); ?>
     48
     49                                <td width="13%" class="thread-options">
     50                                        <input type="checkbox" name="message_ids[]" value="<?php bp_message_thread_id(); ?>" />
     51                                        <a class="button confirm" href="<?php bp_message_thread_delete_link(); ?>" title="<?php _e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> &nbsp;
     52                                </td>
     53                        </tr>
     54
     55                <?php endwhile; ?>
     56        </table><!-- #message-threads -->
     57
     58        <div class="messages-options-nav">
     59                <?php bp_messages_options(); ?>
     60        </div><!-- .messages-options-nav -->
     61
     62        <?php do_action( 'bp_after_member_messages_threads' ); ?>
     63
     64        <?php do_action( 'bp_after_member_messages_options' ); ?>
     65
     66<?php else: ?>
     67
     68        <div id="message" class="info">
     69                <p><?php _e( 'Sorry, no messages were found.', 'buddypress' ); ?></p>
     70        </div>
     71
     72<?php endif;?>
     73
     74<?php do_action( 'bp_after_member_messages_loop' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/messages/notices-loop.php

     
     1<?php do_action( 'bp_before_notices_loop' ); ?>
     2
     3<?php if ( bp_has_message_threads() ) : ?>
     4
     5        <div class="pagination no-ajax" id="user-pag">
     6
     7                <div class="pag-count" id="messages-dir-count">
     8                        <?php bp_messages_pagination_count(); ?>
     9                </div>
     10
     11                <div class="pagination-links" id="messages-dir-pag">
     12                        <?php bp_messages_pagination(); ?>
     13                </div>
     14
     15        </div><!-- .pagination -->
     16
     17        <?php do_action( 'bp_after_notices_pagination' ); ?>
     18        <?php do_action( 'bp_before_notices' ); ?>
     19
     20        <table id="message-threads" class="messages-notices">
     21                <?php while ( bp_message_threads() ) : bp_message_thread(); ?>
     22                        <tr id="notice-<?php bp_message_notice_id(); ?>" class="<?php bp_message_css_class(); ?>">
     23                                <td width="1%"></td>
     24                                <td width="38%">
     25                                        <strong><?php bp_message_notice_subject(); ?></strong>
     26                                        <?php bp_message_notice_text(); ?>
     27                                </td>
     28                                <td width="21%">
     29
     30                                        <?php if ( bp_messages_is_active_notice() ) : ?>
     31
     32                                                <strong><?php bp_messages_is_active_notice(); ?></strong>
     33
     34                                        <?php endif; ?>
     35
     36                                        <span class="activity"><?php _e( 'Sent:', 'buddypress' ); ?> <?php bp_message_notice_post_date(); ?></span>
     37                                </td>
     38
     39                                <?php do_action( 'bp_notices_list_item' ); ?>
     40
     41                                <td width="10%">
     42                                        <a class="button" href="<?php bp_message_activate_deactivate_link(); ?>" class="confirm"><?php bp_message_activate_deactivate_text(); ?></a>
     43                                        <a class="button" href="<?php bp_message_notice_delete_link(); ?>" class="confirm" title="<?php _e( "Delete Message", "buddypress" ); ?>">x</a>
     44                                </td>
     45                        </tr>
     46                <?php endwhile; ?>
     47        </table><!-- #message-threads -->
     48
     49        <?php do_action( 'bp_after_notices' ); ?>
     50
     51<?php else: ?>
     52
     53        <div id="message" class="info">
     54                <p><?php _e( 'Sorry, no notices were found.', 'buddypress' ); ?></p>
     55        </div>
     56
     57<?php endif;?>
     58
     59<?php do_action( 'bp_after_notices_loop' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/messages/single.php

     
     1<div id="message-thread" role="main">
     2
     3        <?php do_action( 'bp_before_message_thread_content' ); ?>
     4
     5        <?php if ( bp_thread_has_messages() ) : ?>
     6
     7                <h3 id="message-subject"><?php bp_the_thread_subject(); ?></h3>
     8
     9                <p id="message-recipients">
     10                        <span class="highlight">
     11
     12                                <?php if ( !bp_get_the_thread_recipients() ) : ?>
     13
     14                                        <?php _e( 'You are alone in this conversation.', 'buddypress' ); ?>
     15
     16                                <?php else : ?>
     17
     18                                        <?php printf( __( 'Conversation between %s and you.', 'buddypress' ), bp_get_the_thread_recipients() ); ?>
     19
     20                                <?php endif; ?>
     21
     22                        </span>
     23
     24                        <a class="button confirm" href="<?php bp_the_thread_delete_link(); ?>" title="<?php _e( "Delete Message", "buddypress" ); ?>"><?php _e( 'Delete', 'buddypress' ); ?></a> &nbsp;
     25                </p>
     26
     27                <?php do_action( 'bp_before_message_thread_list' ); ?>
     28
     29                <?php while ( bp_thread_messages() ) : bp_thread_the_message(); ?>
     30
     31                        <div class="message-box <?php bp_the_thread_message_alt_class(); ?>">
     32
     33                                <div class="message-metadata">
     34
     35                                        <?php do_action( 'bp_before_message_meta' ); ?>
     36
     37                                        <?php bp_the_thread_message_sender_avatar( 'type=thumb&width=30&height=30' ); ?>
     38                                        <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>
     39
     40                                        <?php do_action( 'bp_after_message_meta' ); ?>
     41
     42                                </div><!-- .message-metadata -->
     43
     44                                <?php do_action( 'bp_before_message_content' ); ?>
     45
     46                                <div class="message-content">
     47
     48                                        <?php bp_the_thread_message_content(); ?>
     49
     50                                </div><!-- .message-content -->
     51
     52                                <?php do_action( 'bp_after_message_content' ); ?>
     53
     54                                <div class="clear"></div>
     55
     56                        </div><!-- .message-box -->
     57
     58                <?php endwhile; ?>
     59
     60                <?php do_action( 'bp_after_message_thread_list' ); ?>
     61
     62                <?php do_action( 'bp_before_message_thread_reply' ); ?>
     63
     64                <form id="send-reply" action="<?php bp_messages_form_action(); ?>" method="post" class="standard-form">
     65
     66                        <div class="message-box">
     67
     68                                <div class="message-metadata">
     69
     70                                        <?php do_action( 'bp_before_message_meta' ); ?>
     71
     72                                        <div class="avatar-box">
     73                                                <?php bp_loggedin_user_avatar( 'type=thumb&height=30&width=30' ); ?>
     74
     75                                                <strong><?php _e( 'Send a Reply', 'buddypress' ); ?></strong>
     76                                        </div>
     77
     78                                        <?php do_action( 'bp_after_message_meta' ); ?>
     79
     80                                </div><!-- .message-metadata -->
     81
     82                                <div class="message-content">
     83
     84                                        <?php do_action( 'bp_before_message_reply_box' ); ?>
     85
     86                                        <textarea name="content" id="message_content" rows="15" cols="40"></textarea>
     87
     88                                        <?php do_action( 'bp_after_message_reply_box' ); ?>
     89
     90                                        <div class="submit">
     91                                                <input type="submit" name="send" value="<?php _e( 'Send Reply', 'buddypress' ); ?>" id="send_reply_button"/>
     92                                        </div>
     93
     94                                        <input type="hidden" id="thread_id" name="thread_id" value="<?php bp_the_thread_id(); ?>" />
     95                                        <input type="hidden" id="messages_order" name="messages_order" value="<?php bp_thread_messages_order(); ?>" />
     96                                        <?php wp_nonce_field( 'messages_send_message', 'send_message_nonce' ); ?>
     97
     98                                </div><!-- .message-content -->
     99
     100                        </div><!-- .message-box -->
     101
     102                </form><!-- #send-reply -->
     103
     104                <?php do_action( 'bp_after_message_thread_reply' ); ?>
     105
     106        <?php endif; ?>
     107
     108        <?php do_action( 'bp_after_message_thread_content' ); ?>
     109
     110</div>
  • bp-themes/bp-theme-compat/buddypress/members/single/plugins.php

     
     1<div id="buddypress">
     2
     3        <?php do_action( 'bp_before_member_plugin_template' ); ?>
     4
     5        <div id="item-header">
     6
     7                <?php bp_get_template_part( 'members/single/member-header' ) ?>
     8
     9        </div><!-- #item-header -->
     10
     11        <div id="item-nav">
     12                <div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
     13                        <ul>
     14
     15                                <?php bp_get_displayed_user_nav(); ?>
     16
     17                                <?php do_action( 'bp_member_options_nav' ); ?>
     18
     19                        </ul>
     20                </div>
     21        </div><!-- #item-nav -->
     22
     23        <div id="item-body" role="main">
     24
     25                <?php do_action( 'bp_before_member_body' ); ?>
     26
     27                <div class="item-list-tabs no-ajax" id="subnav">
     28                        <ul>
     29
     30                                <?php bp_get_options_nav(); ?>
     31
     32                                <?php do_action( 'bp_member_plugin_options_nav' ); ?>
     33
     34                        </ul>
     35                </div><!-- .item-list-tabs -->
     36
     37                <h3><?php do_action( 'bp_template_title' ); ?></h3>
     38
     39                <?php do_action( 'bp_template_content' ); ?>
     40
     41                <?php do_action( 'bp_after_member_body' ); ?>
     42
     43        </div><!-- #item-body -->
     44
     45        <?php do_action( 'bp_after_member_plugin_template' ); ?>
     46
     47</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/buddypress/members/single/profile.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Users Profile
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<?php if ( bp_is_my_profile() ) : ?>
     13
     14        <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     15                <ul>
     16
     17                        <?php bp_get_options_nav(); ?>
     18
     19                </ul>
     20        </div><!-- .item-list-tabs -->
     21
     22<?php endif; ?>
     23
     24<?php do_action( 'bp_before_profile_content' ); ?>
     25
     26<div class="profile" role="main">
     27
     28        <?php
     29                // Profile Edit
     30                if ( bp_is_current_action( 'edit' ) )
     31                        bp_get_template_part( 'members/single/profile/edit' );
     32
     33                // Change Avatar
     34                elseif ( bp_is_current_action( 'change-avatar' ) )
     35                        bp_get_template_part( 'members/single/profile/change-avatar' );
     36
     37                // Display XProfile
     38                elseif ( bp_is_active( 'xprofile' ) )
     39                        bp_get_template_part( 'members/single/profile/profile-loop' );
     40
     41                // Display WordPress profile (fallback)
     42                else
     43                        bp_get_template_part( 'members/single/profile/profile-wp' )
     44        ?>
     45
     46</div><!-- .profile -->
     47
     48<?php do_action( 'bp_after_profile_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/profile/change-avatar.php

     
     1<h4><?php _e( 'Change Avatar', 'buddypress' ); ?></h4>
     2
     3<?php do_action( 'bp_before_profile_avatar_upload_content' ); ?>
     4
     5<?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
     6
     7        <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>
     8
     9        <form action="" method="post" id="avatar-upload-form" class="standard-form" enctype="multipart/form-data">
     10
     11                <?php if ( 'upload-image' == bp_get_avatar_admin_step() ) : ?>
     12
     13                        <?php wp_nonce_field( 'bp_avatar_upload' ); ?>
     14                        <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>
     15
     16                        <p id="avatar-upload">
     17                                <input type="file" name="file" id="file" />
     18                                <input type="submit" name="upload" id="upload" value="<?php _e( 'Upload Image', 'buddypress' ); ?>" />
     19                                <input type="hidden" name="action" id="action" value="bp_avatar_upload" />
     20                        </p>
     21
     22                        <?php if ( bp_get_user_has_avatar() ) : ?>
     23                                <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>
     24                                <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>
     25                        <?php endif; ?>
     26
     27                <?php endif; ?>
     28
     29                <?php if ( 'crop-image' == bp_get_avatar_admin_step() ) : ?>
     30
     31                        <h5><?php _e( 'Crop Your New Avatar', 'buddypress' ); ?></h5>
     32
     33                        <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-to-crop" class="avatar" alt="<?php _e( 'Avatar to crop', 'buddypress' ); ?>" />
     34
     35                        <div id="avatar-crop-pane">
     36                                <img src="<?php bp_avatar_to_crop(); ?>" id="avatar-crop-preview" class="avatar" alt="<?php _e( 'Avatar preview', 'buddypress' ); ?>" />
     37                        </div>
     38
     39                        <input type="submit" name="avatar-crop-submit" id="avatar-crop-submit" value="<?php _e( 'Crop Image', 'buddypress' ); ?>" />
     40
     41                        <input type="hidden" name="image_src" id="image_src" value="<?php bp_avatar_to_crop_src(); ?>" />
     42                        <input type="hidden" id="x" name="x" />
     43                        <input type="hidden" id="y" name="y" />
     44                        <input type="hidden" id="w" name="w" />
     45                        <input type="hidden" id="h" name="h" />
     46
     47                        <?php wp_nonce_field( 'bp_avatar_cropstore' ); ?>
     48
     49                <?php endif; ?>
     50
     51        </form>
     52
     53<?php else : ?>
     54
     55        <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>
     56
     57<?php endif; ?>
     58
     59<?php do_action( 'bp_after_profile_avatar_upload_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/profile/edit.php

     
     1<?php do_action( 'bp_before_profile_edit_content' );
     2
     3if ( bp_has_profile( 'profile_group_id=' . bp_get_current_profile_group_id() ) ) :
     4        while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
     5
     6<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(); ?>">
     7
     8        <?php do_action( 'bp_before_profile_field_content' ); ?>
     9
     10                <h4><?php printf( __( "Editing '%s' Profile Group", "buddypress" ), bp_get_the_profile_group_name() ); ?></h4>
     11
     12                <ul class="button-nav">
     13
     14                        <?php bp_profile_group_tabs(); ?>
     15
     16                </ul>
     17
     18                <div class="clear"></div>
     19
     20                <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
     21
     22                        <div<?php bp_field_css_class( 'editfield' ); ?>>
     23
     24                                <?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
     25
     26                                        <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>
     27                                        <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; ?>/>
     28
     29                                <?php endif; ?>
     30
     31                                <?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?>
     32
     33                                        <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>
     34                                        <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>
     35
     36                                <?php endif; ?>
     37
     38                                <?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?>
     39
     40                                        <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>
     41                                        <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; ?>>
     42                                                <?php bp_the_profile_field_options(); ?>
     43                                        </select>
     44
     45                                <?php endif; ?>
     46
     47                                <?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?>
     48
     49                                        <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>
     50                                        <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; ?>>
     51
     52                                                <?php bp_the_profile_field_options(); ?>
     53
     54                                        </select>
     55
     56                                        <?php if ( !bp_get_the_profile_field_is_required() ) : ?>
     57
     58                                                <a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name(); ?>' );"><?php _e( 'Clear', 'buddypress' ); ?></a>
     59
     60                                        <?php endif; ?>
     61
     62                                <?php endif; ?>
     63
     64                                <?php if ( 'radio' == bp_get_the_profile_field_type() ) : ?>
     65
     66                                        <div class="radio">
     67                                                <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>
     68
     69                                                <?php bp_the_profile_field_options(); ?>
     70
     71                                                <?php if ( !bp_get_the_profile_field_is_required() ) : ?>
     72
     73                                                        <a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name(); ?>' );"><?php _e( 'Clear', 'buddypress' ); ?></a>
     74
     75                                                <?php endif; ?>
     76                                        </div>
     77
     78                                <?php endif; ?>
     79
     80                                <?php if ( 'checkbox' == bp_get_the_profile_field_type() ) : ?>
     81
     82                                        <div class="checkbox">
     83                                                <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>
     84
     85                                                <?php bp_the_profile_field_options(); ?>
     86                                        </div>
     87
     88                                <?php endif; ?>
     89
     90                                <?php if ( 'datebox' == bp_get_the_profile_field_type() ) : ?>
     91
     92                                        <div class="datebox">
     93                                                <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>
     94
     95                                                <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; ?>>
     96
     97                                                        <?php bp_the_profile_field_options( 'type=day' ); ?>
     98
     99                                                </select>
     100
     101                                                <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; ?>>
     102
     103                                                        <?php bp_the_profile_field_options( 'type=month' ); ?>
     104
     105                                                </select>
     106
     107                                                <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; ?>>
     108
     109                                                        <?php bp_the_profile_field_options( 'type=year' ); ?>
     110
     111                                                </select>
     112                                        </div>
     113
     114                                <?php endif; ?>
     115
     116                                <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
     117                                        <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
     118                                                <?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>
     119                                        </p>
     120
     121                                        <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
     122                                                <fieldset>
     123                                                        <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
     124
     125                                                        <?php bp_profile_visibility_radio_buttons() ?>
     126
     127                                                </fieldset>
     128                                                <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
     129                                        </div>
     130                                <?php else : ?>
     131                                        <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
     132                                                <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
     133                                        </div>
     134                                <?php endif ?>
     135
     136                                <?php do_action( 'bp_custom_profile_edit_fields' ); ?>
     137
     138                                <p class="description"><?php bp_the_profile_field_description(); ?></p>
     139                        </div>
     140
     141                <?php endwhile; ?>
     142
     143        <?php do_action( 'bp_after_profile_field_content' ); ?>
     144
     145        <div class="submit">
     146                <input type="submit" name="profile-group-edit-submit" id="profile-group-edit-submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?> " />
     147        </div>
     148
     149        <input type="hidden" name="field_ids" id="field_ids" value="<?php bp_the_profile_group_field_ids(); ?>" />
     150
     151        <?php wp_nonce_field( 'bp_xprofile_edit' ); ?>
     152
     153</form>
     154
     155<?php endwhile; endif; ?>
     156
     157<?php do_action( 'bp_after_profile_edit_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/profile/profile-loop.php

     
     1<?php do_action( 'bp_before_profile_loop_content' ); ?>
     2
     3<?php if ( bp_has_profile() ) : ?>
     4
     5        <?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
     6
     7                <?php if ( bp_profile_group_has_fields() ) : ?>
     8
     9                        <?php do_action( 'bp_before_profile_field_content' ); ?>
     10
     11                        <div class="bp-widget <?php bp_the_profile_group_slug(); ?>">
     12
     13                                <h4><?php bp_the_profile_group_name(); ?></h4>
     14
     15                                <table class="profile-fields">
     16
     17                                        <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
     18
     19                                                <?php if ( bp_field_has_data() ) : ?>
     20
     21                                                        <tr<?php bp_field_css_class(); ?>>
     22
     23                                                                <td class="label"><?php bp_the_profile_field_name(); ?></td>
     24
     25                                                                <td class="data"><?php bp_the_profile_field_value(); ?></td>
     26
     27                                                        </tr>
     28
     29                                                <?php endif; ?>
     30
     31                                                <?php do_action( 'bp_profile_field_item' ); ?>
     32
     33                                        <?php endwhile; ?>
     34
     35                                </table>
     36                        </div>
     37
     38                        <?php do_action( 'bp_after_profile_field_content' ); ?>
     39
     40                <?php endif; ?>
     41
     42        <?php endwhile; ?>
     43
     44        <?php do_action( 'bp_profile_field_buttons' ); ?>
     45
     46<?php endif; ?>
     47
     48<?php do_action( 'bp_after_profile_loop_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/profile/profile-wp.php

     
     1<?php do_action( 'bp_before_profile_loop_content' ); ?>
     2
     3<?php $ud = get_userdata( bp_displayed_user_id() ); ?>
     4
     5<?php do_action( 'bp_before_profile_field_content' ); ?>
     6
     7        <div class="bp-widget wp-profile">
     8                <h4><?php bp_is_my_profile() ? _e( 'My Profile', 'buddypress' ) : printf( __( "%s's Profile", 'buddypress' ), bp_get_displayed_user_fullname() ); ?></h4>
     9
     10                <table class="wp-profile-fields">
     11
     12                        <?php if ( $ud->display_name ) : ?>
     13
     14                                <tr id="wp_displayname">
     15                                        <td class="label"><?php _e( 'Name', 'buddypress' ); ?></td>
     16                                        <td class="data"><?php echo $ud->display_name; ?></td>
     17                                </tr>
     18
     19                        <?php endif; ?>
     20
     21                        <?php if ( $ud->user_description ) : ?>
     22
     23                                <tr id="wp_desc">
     24                                        <td class="label"><?php _e( 'About Me', 'buddypress' ); ?></td>
     25                                        <td class="data"><?php echo $ud->user_description; ?></td>
     26                                </tr>
     27
     28                        <?php endif; ?>
     29
     30                        <?php if ( $ud->user_url ) : ?>
     31
     32                                <tr id="wp_website">
     33                                        <td class="label"><?php _e( 'Website', 'buddypress' ); ?></td>
     34                                        <td class="data"><?php echo make_clickable( $ud->user_url ); ?></td>
     35                                </tr>
     36
     37                        <?php endif; ?>
     38
     39                        <?php if ( $ud->jabber ) : ?>
     40
     41                                <tr id="wp_jabber">
     42                                        <td class="label"><?php _e( 'Jabber', 'buddypress' ); ?></td>
     43                                        <td class="data"><?php echo $ud->jabber; ?></td>
     44                                </tr>
     45
     46                        <?php endif; ?>
     47
     48                        <?php if ( $ud->aim ) : ?>
     49
     50                                <tr id="wp_aim">
     51                                        <td class="label"><?php _e( 'AOL Messenger', 'buddypress' ); ?></td>
     52                                        <td class="data"><?php echo $ud->aim; ?></td>
     53                                </tr>
     54
     55                        <?php endif; ?>
     56
     57                        <?php if ( $ud->yim ) : ?>
     58
     59                                <tr id="wp_yim">
     60                                        <td class="label"><?php _e( 'Yahoo Messenger', 'buddypress' ); ?></td>
     61                                        <td class="data"><?php echo $ud->yim; ?></td>
     62                                </tr>
     63
     64                        <?php endif; ?>
     65
     66                </table>
     67        </div>
     68
     69<?php do_action( 'bp_after_profile_field_content' ); ?>
     70
     71<?php do_action( 'bp_profile_field_buttons' ); ?>
     72
     73<?php do_action( 'bp_after_profile_loop_content' ); ?>
  • bp-themes/bp-theme-compat/buddypress/members/single/settings.php

     
     1<?php
     2
     3/**
     4 * BuddyPress - Users Settings
     5 *
     6 * @package BuddyPress
     7 * @subpackage bp-default
     8 */
     9
     10?>
     11
     12<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
     13        <ul>
     14                <?php if ( bp_is_my_profile() ) : ?>
     15               
     16                        <?php bp_get_options_nav(); ?>
     17               
     18                <?php endif; ?>
     19        </ul>
     20</div>
     21
     22<?php
     23
     24if ( bp_is_current_action( 'notifications' ) ) :
     25         bp_get_template_part( 'members/single/settings/notifications' );
     26
     27elseif ( bp_is_current_action( 'delete-account' ) ) :
     28         bp_get_template_part( 'members/single/settings/delete-account' );
     29
     30elseif ( bp_is_current_action( 'general' ) ) :
     31        bp_get_template_part( 'members/single/settings/general' );
     32
     33else :
     34        bp_get_template_part( 'members/single/plugins' );
     35
     36endif;
     37
     38?>
  • bp-themes/bp-theme-compat/buddypress/members/single/settings/capabilities.php

     
     1<div id="buddypress">
     2
     3        <?php do_action( 'bp_before_member_settings_template' ); ?>
     4
     5        <div id="item-body" role="main">
     6
     7                <?php do_action( 'bp_before_member_body' ); ?>
     8
     9                <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">
     10
     11                        <?php do_action( 'bp_members_capabilities_account_before_submit' ); ?>
     12
     13                        <label>
     14                                <input type="checkbox" name="user-spammer" id="user-spammer" value="1" <?php checked( bp_is_user_spammer( bp_displayed_user_id() ) ); ?> />
     15                                 <?php _e( 'This user is a spammer.', 'buddypress' ); ?>
     16                        </label>
     17
     18                        <div class="submit">
     19                                <input type="submit" value="<?php _e( 'Save', 'buddypress' ); ?>" id="capabilities-submit" name="capabilities-submit" />
     20                        </div>
     21
     22                        <?php do_action( 'bp_members_capabilities_account_after_submit' ); ?>
     23
     24                        <?php wp_nonce_field( 'capabilities' ); ?>
     25
     26                </form>
     27
     28                <?php do_action( 'bp_after_member_body' ); ?>
     29
     30        </div><!-- #item-body -->
     31
     32        <?php do_action( 'bp_after_member_settings_template' ); ?>
     33
     34</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/buddypress/members/single/settings/delete-account.php

     
     1<div id="buddypress">
     2
     3        <?php do_action( 'bp_before_member_settings_template' ); ?>
     4
     5        <div id="item-body" role="main">
     6
     7                <?php do_action( 'bp_before_member_body' ); ?>
     8
     9                <div id="message" class="info">
     10
     11                        <?php if ( bp_is_my_profile() ) : ?>
     12
     13                                <p><?php _e( 'Deleting your account will delete all of the content you have created. It will be completely irrecoverable.', 'buddypress' ); ?></p>
     14
     15                        <?php else : ?>
     16
     17                                <p><?php _e( 'Deleting this account will delete all of the content it has created. It will be completely irrecoverable.', 'buddypress' ); ?></p>
     18
     19                        <?php endif; ?>
     20
     21                </div>
     22
     23                <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">
     24
     25                        <?php do_action( 'bp_members_delete_account_before_submit' ); ?>
     26
     27                        <label>
     28                                <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'; }" />
     29                                 <?php _e( 'I understand the consequences.', 'buddypress' ); ?>
     30                        </label>
     31
     32                        <div class="submit">
     33                                <input type="submit" disabled="disabled" value="<?php _e( 'Delete Account', 'buddypress' ); ?>" id="delete-account-button" name="delete-account-button" />
     34                        </div>
     35
     36                        <?php do_action( 'bp_members_delete_account_after_submit' ); ?>
     37
     38                        <?php wp_nonce_field( 'delete-account' ); ?>
     39
     40                </form>
     41
     42                <?php do_action( 'bp_after_member_body' ); ?>
     43
     44        </div><!-- #item-body -->
     45
     46        <?php do_action( 'bp_after_member_settings_template' ); ?>
     47
     48</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/buddypress/members/single/settings/general.php

     
     1<div id="buddypress">
     2
     3        <?php do_action( 'bp_before_member_settings_template' ); ?>
     4
     5        <div id="item-body" role="main">
     6
     7                <?php do_action( 'bp_before_member_body' ); ?>
     8
     9                <?php do_action( 'bp_template_content' ); ?>
     10
     11                <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/general'; ?>" method="post" class="standard-form" id="settings-form">
     12
     13                        <?php if ( !is_super_admin() ) : ?>
     14
     15                                <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ); ?></label>
     16                                <input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" /> &nbsp;<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>
     17
     18                        <?php endif; ?>
     19
     20                        <label for="email"><?php _e( 'Account Email', 'buddypress' ); ?></label>
     21                        <input type="text" name="email" id="email" value="<?php echo bp_get_displayed_user_email(); ?>" class="settings-input" />
     22
     23                        <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ); ?></label>
     24                        <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'New Password', 'buddypress' ); ?><br />
     25                        <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ); ?>
     26
     27                        <?php do_action( 'bp_core_general_settings_before_submit' ); ?>
     28
     29                        <div class="submit">
     30                                <input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="submit" class="auto" />
     31                        </div>
     32
     33                        <?php do_action( 'bp_core_general_settings_after_submit' ); ?>
     34
     35                        <?php wp_nonce_field( 'bp_settings_general' ); ?>
     36
     37                </form>
     38
     39                <?php do_action( 'bp_after_member_body' ); ?>
     40
     41        </div><!-- #item-body -->
     42
     43        <?php do_action( 'bp_after_member_settings_template' ); ?>
     44
     45</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/buddypress/members/single/settings/notifications.php

     
     1<div id="buddypress">
     2
     3        <?php do_action( 'bp_before_member_settings_template' ); ?>
     4
     5        <div id="item-body" role="main">
     6
     7                <?php do_action( 'bp_before_member_body' ); ?>
     8
     9                <?php do_action( 'bp_template_content' ); ?>
     10
     11                <form action="<?php echo bp_displayed_user_domain() . bp_get_settings_slug() . '/notifications'; ?>" method="post" class="standard-form" id="settings-form">
     12                        <p><?php _e( 'Send a notification by email when:', 'buddypress' ); ?></p>
     13
     14                        <?php do_action( 'bp_notification_settings' ); ?>
     15
     16                        <?php do_action( 'bp_members_notification_settings_before_submit' ); ?>
     17
     18                        <div class="submit">
     19                                <input type="submit" name="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="submit" class="auto" />
     20                        </div>
     21
     22                        <?php do_action( 'bp_members_notification_settings_after_submit' ); ?>
     23
     24                        <?php wp_nonce_field('bp_settings_notifications' ); ?>
     25
     26                </form>
     27
     28                <?php do_action( 'bp_after_member_body' ); ?>
     29
     30        </div><!-- #item-body -->
     31
     32        <?php do_action( 'bp_after_member_settings_template' ); ?>
     33
     34</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/buddypress/registration/activate.php

     
     1<div id="buddypress">
     2
     3        <?php do_action( 'bp_before_activation_page' ); ?>
     4
     5        <div class="page" id="activate-page">
     6
     7                <?php if ( bp_account_was_activated() ) : ?>
     8
     9                        <h2 class="widgettitle"><?php _e( 'Account Activated', 'buddypress' ); ?></h2>
     10
     11                        <?php do_action( 'bp_before_activate_content' ); ?>
     12
     13                        <?php if ( isset( $_GET['e'] ) ) : ?>
     14                                <p><?php _e( 'Your account was activated successfully! Your account details have been sent to you in a separate email.', 'buddypress' ); ?></p>
     15                        <?php else : ?>
     16                                <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>
     17                        <?php endif; ?>
     18
     19                <?php else : ?>
     20
     21                        <h3><?php _e( 'Activate your Account', 'buddypress' ); ?></h3>
     22
     23                        <?php do_action( 'bp_before_activate_content' ); ?>
     24
     25                        <p><?php _e( 'Please provide a valid activation key.', 'buddypress' ); ?></p>
     26
     27                        <form action="" method="get" class="standard-form" id="activation-form">
     28
     29                                <label for="key"><?php _e( 'Activation Key:', 'buddypress' ); ?></label>
     30                                <input type="text" name="key" id="key" value="" />
     31
     32                                <p class="submit">
     33                                        <input type="submit" name="submit" value="<?php _e( 'Activate', 'buddypress' ); ?>" />
     34                                </p>
     35
     36                        </form>
     37
     38                <?php endif; ?>
     39
     40                <?php do_action( 'bp_after_activate_content' ); ?>
     41
     42        </div><!-- .page -->
     43
     44        <?php do_action( 'bp_after_activation_page' ); ?>
     45
     46</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/buddypress/registration/register.php

     
     1<div id="buddypress">
     2
     3        <?php do_action( 'bp_before_register_page' ); ?>
     4
     5        <div class="page" id="register-page">
     6
     7                <form action="" name="signup_form" id="signup_form" class="standard-form" method="post" enctype="multipart/form-data">
     8
     9                <?php if ( 'registration-disabled' == bp_get_current_signup_step() ) : ?>
     10                        <?php do_action( 'template_notices' ); ?>
     11                        <?php do_action( 'bp_before_registration_disabled' ); ?>
     12
     13                                <p><?php _e( 'User registration is currently not allowed.', 'buddypress' ); ?></p>
     14
     15                        <?php do_action( 'bp_after_registration_disabled' ); ?>
     16                <?php endif; // registration-disabled signup setp ?>
     17
     18                <?php if ( 'request-details' == bp_get_current_signup_step() ) : ?>
     19
     20                        <h2><?php _e( 'Create an Account', 'buddypress' ); ?></h2>
     21
     22                        <?php do_action( 'template_notices' ); ?>
     23
     24                        <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>
     25
     26                        <?php do_action( 'bp_before_account_details_fields' ); ?>
     27
     28                        <div class="register-section" id="basic-details-section">
     29
     30                                <?php /***** Basic Account Details ******/ ?>
     31
     32                                <h4><?php _e( 'Account Details', 'buddypress' ); ?></h4>
     33
     34                                <label for="signup_username"><?php _e( 'Username', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
     35                                <?php do_action( 'bp_signup_username_errors' ); ?>
     36                                <input type="text" name="signup_username" id="signup_username" value="<?php bp_signup_username_value(); ?>" />
     37
     38                                <label for="signup_email"><?php _e( 'Email Address', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
     39                                <?php do_action( 'bp_signup_email_errors' ); ?>
     40                                <input type="text" name="signup_email" id="signup_email" value="<?php bp_signup_email_value(); ?>" />
     41
     42                                <label for="signup_password"><?php _e( 'Choose a Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
     43                                <?php do_action( 'bp_signup_password_errors' ); ?>
     44                                <input type="password" name="signup_password" id="signup_password" value="" />
     45
     46                                <label for="signup_password_confirm"><?php _e( 'Confirm Password', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
     47                                <?php do_action( 'bp_signup_password_confirm_errors' ); ?>
     48                                <input type="password" name="signup_password_confirm" id="signup_password_confirm" value="" />
     49
     50                        </div><!-- #basic-details-section -->
     51
     52                        <?php do_action( 'bp_after_account_details_fields' ); ?>
     53
     54                        <?php /***** Extra Profile Details ******/ ?>
     55
     56                        <?php if ( bp_is_active( 'xprofile' ) ) : ?>
     57
     58                                <?php do_action( 'bp_before_signup_profile_fields' ); ?>
     59
     60                                <div class="register-section" id="profile-details-section">
     61
     62                                        <h4><?php _e( 'Profile Details', 'buddypress' ); ?></h4>
     63
     64                                        <?php /* Use the profile field loop to render input fields for the 'base' profile field group */ ?>
     65                                        <?php if ( bp_is_active( 'xprofile' ) ) : if ( bp_has_profile( 'profile_group_id=1' ) ) : while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
     66
     67                                        <?php while ( bp_profile_fields() ) : bp_the_profile_field(); ?>
     68
     69                                                <div class="editfield">
     70
     71                                                        <?php if ( 'textbox' == bp_get_the_profile_field_type() ) : ?>
     72
     73                                                                <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>
     74                                                                <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
     75                                                                <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(); ?>" />
     76
     77                                                        <?php endif; ?>
     78
     79                                                        <?php if ( 'textarea' == bp_get_the_profile_field_type() ) : ?>
     80
     81                                                                <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>
     82                                                                <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
     83                                                                <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>
     84
     85                                                        <?php endif; ?>
     86
     87                                                        <?php if ( 'selectbox' == bp_get_the_profile_field_type() ) : ?>
     88
     89                                                                <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>
     90                                                                <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
     91                                                                <select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>">
     92                                                                        <?php bp_the_profile_field_options(); ?>
     93                                                                </select>
     94
     95                                                        <?php endif; ?>
     96
     97                                                        <?php if ( 'multiselectbox' == bp_get_the_profile_field_type() ) : ?>
     98
     99                                                                <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>
     100                                                                <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
     101                                                                <select name="<?php bp_the_profile_field_input_name(); ?>" id="<?php bp_the_profile_field_input_name(); ?>" multiple="multiple">
     102                                                                        <?php bp_the_profile_field_options(); ?>
     103                                                                </select>
     104
     105                                                        <?php endif; ?>
     106
     107                                                        <?php if ( 'radio' == bp_get_the_profile_field_type() ) : ?>
     108
     109                                                                <div class="radio">
     110                                                                        <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>
     111
     112                                                                        <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
     113                                                                        <?php bp_the_profile_field_options(); ?>
     114
     115                                                                        <?php if ( !bp_get_the_profile_field_is_required() ) : ?>
     116                                                                                <a class="clear-value" href="javascript:clear( '<?php bp_the_profile_field_input_name(); ?>' );"><?php _e( 'Clear', 'buddypress' ); ?></a>
     117                                                                        <?php endif; ?>
     118                                                                </div>
     119
     120                                                        <?php endif; ?>
     121
     122                                                        <?php if ( 'checkbox' == bp_get_the_profile_field_type() ) : ?>
     123
     124                                                                <div class="checkbox">
     125                                                                        <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>
     126
     127                                                                        <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
     128                                                                        <?php bp_the_profile_field_options(); ?>
     129                                                                </div>
     130
     131                                                        <?php endif; ?>
     132
     133                                                        <?php if ( 'datebox' == bp_get_the_profile_field_type() ) : ?>
     134
     135                                                                <div class="datebox">
     136                                                                        <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>
     137                                                                        <?php do_action( 'bp_' . bp_get_the_profile_field_input_name() . '_errors' ); ?>
     138
     139                                                                        <select name="<?php bp_the_profile_field_input_name(); ?>_day" id="<?php bp_the_profile_field_input_name(); ?>_day">
     140                                                                                <?php bp_the_profile_field_options( 'type=day' ); ?>
     141                                                                        </select>
     142
     143                                                                        <select name="<?php bp_the_profile_field_input_name(); ?>_month" id="<?php bp_the_profile_field_input_name(); ?>_month">
     144                                                                                <?php bp_the_profile_field_options( 'type=month' ); ?>
     145                                                                        </select>
     146
     147                                                                        <select name="<?php bp_the_profile_field_input_name(); ?>_year" id="<?php bp_the_profile_field_input_name(); ?>_year">
     148                                                                                <?php bp_the_profile_field_options( 'type=year' ); ?>
     149                                                                        </select>
     150                                                                </div>
     151
     152                                                        <?php endif; ?>
     153
     154                                                        <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
     155                                                                <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
     156                                                                        <?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>
     157                                                                </p>
     158
     159                                                                <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
     160                                                                        <fieldset>
     161                                                                                <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
     162
     163                                                                                <?php bp_profile_visibility_radio_buttons() ?>
     164
     165                                                                        </fieldset>
     166                                                                        <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
     167
     168                                                                </div>
     169                                                        <?php else : ?>
     170                                                                <p class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
     171                                                                        <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
     172                                                                </p>                   
     173                                                        <?php endif ?>
     174
     175
     176                                                        <?php do_action( 'bp_custom_profile_edit_fields' ); ?>
     177
     178                                                        <p class="description"><?php bp_the_profile_field_description(); ?></p>
     179
     180                                                </div>
     181
     182                                        <?php endwhile; ?>
     183
     184                                        <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="<?php bp_the_profile_group_field_ids(); ?>" />
     185
     186                                        <?php endwhile; endif; endif; ?>
     187
     188                                </div><!-- #profile-details-section -->
     189
     190                                <?php do_action( 'bp_after_signup_profile_fields' ); ?>
     191
     192                        <?php endif; ?>
     193
     194                        <?php if ( bp_get_blog_signup_allowed() ) : ?>
     195
     196                                <?php do_action( 'bp_before_blog_details_fields' ); ?>
     197
     198                                <?php /***** Blog Creation Details ******/ ?>
     199
     200                                <div class="register-section" id="blog-details-section">
     201
     202                                        <h4><?php _e( 'Blog Details', 'buddypress' ); ?></h4>
     203
     204                                        <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>
     205
     206                                        <div id="blog-details"<?php if ( (int) bp_get_signup_with_blog_value() ) : ?>class="show"<?php endif; ?>>
     207
     208                                                <label for="signup_blog_url"><?php _e( 'Blog URL', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
     209                                                <?php do_action( 'bp_signup_blog_url_errors' ); ?>
     210
     211                                                <?php if ( is_subdomain_install() ) : ?>
     212                                                        http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> .<?php bp_blogs_subdomain_base(); ?>
     213                                                <?php else : ?>
     214                                                        <?php echo site_url(); ?>/ <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" />
     215                                                <?php endif; ?>
     216
     217                                                <label for="signup_blog_title"><?php _e( 'Site Title', 'buddypress' ); ?> <?php _e( '(required)', 'buddypress' ); ?></label>
     218                                                <?php do_action( 'bp_signup_blog_title_errors' ); ?>
     219                                                <input type="text" name="signup_blog_title" id="signup_blog_title" value="<?php bp_signup_blog_title_value(); ?>" />
     220
     221                                                <span class="label"><?php _e( 'I would like my site to appear in search engines, and in public listings around this network.', 'buddypress' ); ?>:</span>
     222                                                <?php do_action( 'bp_signup_blog_privacy_errors' ); ?>
     223
     224                                                <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>
     225                                                <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>
     226
     227                                        </div>
     228
     229                                </div><!-- #blog-details-section -->
     230
     231                                <?php do_action( 'bp_after_blog_details_fields' ); ?>
     232
     233                        <?php endif; ?>
     234
     235                        <?php do_action( 'bp_before_registration_submit_buttons' ); ?>
     236
     237                        <div class="submit">
     238                                <input type="submit" name="signup_submit" id="signup_submit" value="<?php _e( 'Complete Sign Up', 'buddypress' ); ?>" />
     239                        </div>
     240
     241                        <?php do_action( 'bp_after_registration_submit_buttons' ); ?>
     242
     243                        <?php wp_nonce_field( 'bp_new_signup' ); ?>
     244
     245                <?php endif; // request-details signup step ?>
     246
     247                <?php if ( 'completed-confirmation' == bp_get_current_signup_step() ) : ?>
     248
     249                        <h2><?php _e( 'Sign Up Complete!', 'buddypress' ); ?></h2>
     250
     251                        <?php do_action( 'template_notices' ); ?>
     252                        <?php do_action( 'bp_before_registration_confirmed' ); ?>
     253
     254                        <?php if ( bp_registration_needs_activation() ) : ?>
     255                                <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>
     256                        <?php else : ?>
     257                                <p><?php _e( 'You have successfully created your account! Please log in using the username and password you have just created.', 'buddypress' ); ?></p>
     258                        <?php endif; ?>
     259
     260                        <?php do_action( 'bp_after_registration_confirmed' ); ?>
     261
     262                <?php endif; // completed-confirmation signup step ?>
     263
     264                <?php do_action( 'bp_custom_signup_steps' ); ?>
     265
     266                </form>
     267
     268        </div>
     269
     270        <?php do_action( 'bp_after_register_page' ); ?>
     271
     272</div><!-- #buddypress -->
  • bp-themes/bp-theme-compat/css/buddypress.css

     
     1/*--------------------------------------------------------------
     2Hello, this is the BuddyPress Default theme stylesheet.
     3
     4----------------------------------------------------------------
     5>>> TABLE OF CONTENTS:
     6----------------------------------------------------------------
     74.0 - Navigation
     8        4.1 - Pagination
     95.0 - WordPress
     10        5.1 - Alignments
     11        5.2 - Comments
     12        5.3 - Gallery
     13        5.4 - Images
     14        5.5 - Posts
     156.0 - BuddyPress
     16        6.1 - Activity
     17                6.1.1 - Activity Listing
     18                6.1.2 - Activity Comments
     19        6.2 - Toolbar
     20        6.3 - Directories - Members, Groups, Blogs, Forums
     21        6.4 - Error / Success Messages
     22        6.5 - Forms
     23        6.6 - Ajax Loading
     24        6.7 - Topics and Tables - Forums and General
     25        6.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums
     26        6.9 - Private Messaging Threads
     27        6.10 - Extended Profiles
     28--------------------------------------------------------------*/
     29
     30/*--------------------------------------------------------------
     314.1 - Pagination
     32--------------------------------------------------------------*/
     33#buddypress div.pagination {
     34        background: #f4f4f4;
     35        border: none;
     36        color: #888;
     37        font-size: 11px;
     38        margin: -20px 0 20px 0;
     39        position: relative;
     40        display: block;
     41        float: left;
     42        width: 100%;
     43        padding: 10px 0;
     44}
     45#buddypress div.pagination .pag-count {
     46        float: left;
     47        margin-left: 10px;
     48}
     49#buddypress div.pagination .pagination-links {
     50        float: right;
     51        margin-right: 10px;
     52}
     53#buddypress div.pagination .pagination-links span,
     54#buddypress div.pagination .pagination-links a {
     55        font-size: 12px;
     56        padding: 0 5px;
     57}
     58#buddypress div.pagination .pagination-links a:hover {
     59        font-weight: bold;
     60}
     61#buddypress noscript div.pagination {
     62        margin-bottom: 15px;
     63}
     64#buddypress div#pag-bottom {
     65        margin-top: -1px;
     66}
     67#buddypress #nav-above {
     68        display: none;
     69}
     70#buddypress .paged #nav-above {
     71        display: block;
     72}
     73
     74/*--------------------------------------------------------------
     755.4 - Images
     76--------------------------------------------------------------*/
     77#buddypress img.wp-smiley {
     78        border: none !important;
     79        clear: none !important;
     80        float: none !important;
     81        margin: 0 !important;
     82        padding: 0 !important;
     83}
     84
     85/*--------------------------------------------------------------
     866.0 - BuddyPress
     87--------------------------------------------------------------*/
     88/*--------------------------------------------------------------
     896.1 - Activity
     90--------------------------------------------------------------*/
     91#buddypress #activity-stream {
     92        margin-top: -5px;
     93}
     94#buddypress #item-body form#whats-new-form {
     95        border-bottom: 1px solid #ddd;
     96        margin: 20px 0 10px;
     97        padding-bottom: 20px;
     98}
     99#buddypress .home-page form#whats-new-form {
     100        border-bottom: none;
     101        padding-bottom: 0;
     102}
     103#buddypress form#whats-new-form h5 {
     104        font-weight: normal;
     105        font-size: 12px;
     106        color: #888;
     107        margin: 0;
     108        margin-left: 76px;
     109        padding: 0 0 3px 0;
     110}
     111#buddypress form#whats-new-form #whats-new-avatar {
     112        float: left;
     113}
     114#buddypress form#whats-new-form #whats-new-content {
     115        margin-left: 54px;
     116        padding-left: 22px;
     117}
     118#buddypress form#whats-new-form textarea {
     119        background: #fff;
     120        border: 1px inset #ccc;
     121        -moz-border-radius: 3px;
     122        -webkit-border-radius: 3px;
     123        border-radius: 3px;
     124        color: #555;
     125        font-family: inherit;
     126        font-size: 14px;
     127        height: 20px;
     128        padding: 6px;
     129        width: 98%;
     130}
     131body.no-js #buddypress form#whats-new-form textarea {
     132        height: 50px;
     133}
     134#buddypress form#whats-new-form #whats-new-options select {
     135        max-width: 200px;
     136        margin-top: 12px;
     137}
     138#buddypress form#whats-new-form #whats-new-submit {
     139        float: right;
     140        margin-top: 12px;
     141}
     142#buddypress #whats-new-options {
     143        overflow: auto;
     144        height: 0;
     145}
     146body.no-js #buddypress #whats-new-options {
     147        height: auto;
     148}
     149#buddypress #whats-new:focus {
     150        border-color: rgba(31, 179, 221, 0.9) !important;
     151        outline-color: rgba(31, 179, 221, 0.9);
     152        box-shadow: 0 0 7px         rgba(31, 179, 221, 0.7);
     153        -moz-box-shadow: 0 0 7px    rgba(31, 179, 221, 0.7);
     154        -webkit-box-shadow: 0 0 7px rgba(31, 179, 221, 0.7);
     155}
     156
     157/*--------------------------------------------------------------
     1586.1.1 - Activity Listing
     159--------------------------------------------------------------*/
     160#buddypress ul.activity-list li {
     161        overflow: hidden;
     162        padding: 15px 0 0;
     163}
     164#buddypress .activity-list .activity-avatar {
     165        float: left;
     166}
     167#buddypress ul.activity-list > li:first-child {
     168        padding-top: 5px;
     169}
     170#buddypress ul.item-list.activity-list li.has-comments {
     171        padding-bottom: 15px;
     172}
     173body.activity-permalink #buddypress ul.activity-list li.has-comments {
     174        padding-bottom: 0;
     175}
     176#buddypress .activity-list li.mini {
     177        font-size: 11px;
     178        min-height: 35px;
     179        padding: 15px 0 0 0;
     180        position: relative;
     181}
     182#buddypress .activity-list li.mini .activity-avatar img.avatar,
     183#buddypress .activity-list li.mini .activity-avatar img.FB_profile_pic {
     184        height: 20px;
     185        margin-left: 30px;
     186        width: 20px;
     187}
     188#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.avatar,
     189#buddypress .activity-permalink .activity-list li.mini .activity-avatar img.FB_profile_pic {
     190        height: auto;
     191        margin-left: 0;
     192        width: auto;
     193}
     194body.activity-permalink #buddypress .activity-list > li:first-child {
     195        padding-top: 0;
     196}
     197#buddypress .activity-list li .activity-content {
     198        position: relative;
     199}
     200#buddypress .activity-list li.mini .activity-content p {
     201        margin: 0;
     202}
     203#buddypress .activity-list li.mini .activity-comments {
     204        clear: both;
     205        font-size: 12px;
     206}
     207body.activity-permalink #buddypress li.mini .activity-meta {
     208        margin-top: 4px;
     209}
     210#buddypress .activity-list li .activity-inreplyto {
     211        color: #888;
     212        font-size: 11px;
     213        margin-left: 5px;
     214        margin-top: 5px;
     215        padding-left: 25px;
     216}
     217#buddypress .activity-list li .activity-inreplyto > p {
     218        margin: 0;
     219        display: inline;
     220}
     221#buddypress .activity-list li .activity-inreplyto blockquote,
     222#buddypress .activity-list li .activity-inreplyto div.activity-inner {
     223        background: none;
     224        border: none;
     225        display: inline;
     226        margin: 0;
     227        overflow: hidden;
     228        padding: 0;
     229}
     230#buddypress .activity-list .activity-content {
     231        margin-left: 70px;
     232        margin-bottom: 15px;
     233}
     234body.activity-permalink #buddypress .activity-list li .activity-content {
     235        background: #fff;
     236        border-bottom: 1px solid #ddd;
     237        border-right: 1px solid #ddd;
     238        border-radius: 4px;
     239        font-size: 16px;
     240        line-height: 150%;
     241        min-height: 35px;
     242        margin-left: 185px;
     243        margin-right: 0;
     244        padding: 15px;
     245}
     246body.activity-permalink #buddypress .activity-list li .activity-header > p {
     247        height: 35px;
     248        margin-bottom: 0;
     249        margin-left: -35px;
     250        padding: 5px 0 0 35px;
     251}
     252#buddypress .activity-list .activity-content .activity-header,
     253#buddypress .activity-list .activity-content .comment-header {
     254        color: #888;
     255        font-size: 11px;
     256        line-height: 220%;
     257}
     258#buddypress .activity-header {
     259        margin-right: 20px;
     260}
     261#buddypress .activity-header a,
     262#buddypress .comment-meta a,
     263#buddypress .acomment-meta a {
     264        text-decoration: none;
     265}
     266#buddypress .activity-list .activity-content .activity-header img.avatar {
     267        float: none !important;
     268        margin: 0 5px -8px 0 !important;
     269}
     270#buddypress a.bp-secondary-action,
     271#buddypress span.highlight {
     272        font-size: 11px;
     273        padding: 0;
     274        margin-right: 5px;
     275        text-decoration: none;
     276}
     277#buddypress .activity-list .activity-content .activity-inner,
     278#buddypress .activity-list .activity-content blockquote {
     279        margin: 10px 10px 5px 0;
     280        overflow: hidden;
     281}
     282#buddypress .activity-list li.new_forum_post .activity-content .activity-inner,
     283#buddypress .activity-list li.new_forum_topic .activity-content .activity-inner {
     284        border-left: 2px solid #EAEAEA;
     285        margin-left: 5px;
     286        padding-left: 10px;
     287}
     288body.activity-permalink #buddypress .activity-content .activity-inner,
     289body.activity-permalink #buddypress .activity-content blockquote {
     290        margin-left: 0;
     291        margin-top: 5px;
     292}
     293#buddypress .activity-inner > p {
     294        word-wrap: break-word;
     295}
     296#buddypress .activity-inner > .activity-inner {
     297        margin: 0 !important;
     298}
     299#buddypress .activity-inner > blockquote {
     300        margin: 0 !important;
     301}
     302#buddypress .activity-list .activity-content img.thumbnail {
     303        border: 2px solid #eee;
     304        float: left;
     305        margin: 0 10px 5px 0;
     306}
     307#buddypress .activity-read-more {
     308        margin-left: 1em;
     309        white-space: nowrap;
     310}
     311#buddypress .activity-list li.load-more {
     312        background: #f0f0f0 !important;
     313        border-right: 1px solid #ddd;
     314        border-bottom: 1px solid #ddd;
     315        -moz-border-radius: 4px;
     316        -webkit-border-radius: 4px;
     317        border-radius: 4px;
     318        font-size: 1.2em;
     319        margin: 15px 0 !important;
     320        padding: 10px 15px !important;
     321        text-align: center;
     322}
     323#buddypress .activity-list li.load-more a {
     324        color: #4D4D4D;
     325}
     326
     327
     328/*--------------------------------------------------------------
     3296.1.2 - Activity Comments
     330--------------------------------------------------------------*/
     331#buddypress div.activity-meta {
     332        margin: 18px 0;
     333}
     334body.activity-permalink #buddypress div.activity-meta {
     335        margin-bottom: 6px;
     336}
     337#buddypress div.activity-meta a {
     338        font: normal 11px/20px Arial, Tahoma, Verdana, sans-serif;
     339        padding: 4px 8px;
     340}
     341#buddypress a.activity-time-since {
     342        color: #aaa;
     343        text-decoration: none;
     344}
     345#buddypress a.activity-time-since:hover {
     346        color: #888;
     347        text-decoration: underline;
     348}
     349#buddypress a.bp-primary-action,
     350#buddypress #reply-title small a {
     351        font-size: 11px;
     352        margin-right: 5px;
     353        text-decoration: none;
     354}
     355#buddypress a.bp-primary-action span,
     356#buddypress #reply-title small a span {
     357        background: #999;
     358        border-radius: 3px;
     359        color: #fff;
     360        font-size: 90%;
     361        margin-left: 2px;
     362        padding: 0 5px;
     363}
     364#buddypress a.bp-primary-action:hover span,
     365#buddypress #reply-title small a:hover span {
     366        background: #555;
     367        color: #fff;
     368}
     369#buddypress div.activity-comments {
     370        margin: 0 0 0 70px;
     371        overflow: hidden; /* IE fix */
     372        position: relative;
     373        width: auto;
     374        clear: both;
     375}
     376body.activity-permalink #buddypress div.activity-comments {
     377        background: none;
     378        margin-left: 185px;
     379        width: auto;
     380}
     381#buddypress div.activity-comments > ul {
     382        background: #f5f5f5;
     383        border-radius: 4px;
     384        padding: 0 0 0 10px;
     385}
     386#buddypress div.activity-comments ul,
     387#buddypress div.activity-comments ul li {
     388        border: none;
     389        list-style: none;
     390}
     391#buddypress div.activity-comments ul {
     392        clear: both;
     393}
     394#buddypress div.activity-comments ul li {
     395        border-top: 2px solid #fff;
     396        padding: 10px 0 0;
     397}
     398body.activity-permalink #buddypress .activity-list li.mini .activity-comments {
     399        clear: none;
     400        margin-top: 0;
     401}
     402body.activity-permalink #buddypress div.activity-comments ul li {
     403        border-width: 1px;
     404        padding: 10px 0 0 0;
     405}
     406#buddypress div.activity-comments > ul > li:first-child {
     407        border-top: none;
     408}
     409#buddypress div.activity-comments ul li:last-child {
     410        margin-bottom: 0;
     411}
     412#buddypress div.activity-comments ul li > ul {
     413        margin-left: 30px;
     414        margin-top: 0;
     415        padding-left: 10px;
     416}
     417body.activity-permalink #buddypress div.activity-comments ul li > ul {
     418        margin-top: 10px;
     419}
     420body.activity-permalink #buddypress div.activity-comments > ul {
     421        padding: 0 10px 0 15px;
     422}
     423#buddypress div.activity-comments div.acomment-avatar img {
     424        border-width: 2px !important;
     425        float: left;
     426        height: 25px;
     427        margin-right: 10px;
     428        width: 25px;
     429}
     430#buddypress div.activity-comments div.acomment-content {
     431        font-size: 11px;
     432        margin: 5px 0 0 40px;
     433}
     434#buddypress div.acomment-content .time-since,
     435#buddypress div.acomment-content .activity-delete-link,
     436#buddypress div.acomment-content .comment-header {
     437        display: none;
     438}
     439body.activity-permalink #buddypress div.activity-comments div.acomment-content {
     440        font-size: 14px;
     441}
     442#buddypress div.activity-comments div.acomment-meta {
     443        color: #888;
     444        font-size: 11px;
     445}
     446#buddypress div.activity-comments form.ac-form {
     447        background: #fafafa;
     448        border: 1px solid #ddd;
     449        border-radius: 4px;
     450        display: none;
     451        margin: 0 0 15px 33px;
     452        padding: 8px;
     453}
     454#buddypress div.activity-comments li form.ac-form {
     455        margin-right: 15px;
     456        clear: both;
     457}
     458#buddypress div.activity-comments form.root {
     459        margin-left: 0;
     460}
     461#buddypress div.activity-comments div#message {
     462        margin-top: 15px;
     463        margin-bottom: 0;
     464}
     465#buddypress div.activity-comments form .ac-textarea {
     466        background: #fff;
     467        border: 1px inset #ccc;
     468        border-radius: 3px;
     469        margin-bottom: 10px;
     470        padding: 8px;
     471}
     472#buddypress div.activity-comments form textarea {
     473        border: none;
     474        color: #555;
     475        font-family: inherit;
     476        font-size: 11px;
     477        height: 60px;
     478        padding: 0;
     479        width: 100%;
     480}
     481#buddypress div.activity-comments form input {
     482        margin-top: 5px;
     483}
     484#buddypress div.activity-comments form div.ac-reply-avatar {
     485        float: left;
     486}
     487#buddypress div.ac-reply-avatar img {
     488        border: 2px solid #fff !important;
     489}
     490#buddypress div.activity-comments form div.ac-reply-content {
     491        color: #888;
     492        font-size: 11px;
     493        margin-left: 50px;
     494        padding-left: 15px;
     495}
     496#buddypress .acomment-options {
     497        float: left;
     498        margin: 5px 0 5px 40px;
     499}
     500#buddypress .acomment-options a {
     501        color: #999;
     502}
     503#buddypress .acomment-options a:hover {
     504        color: inherit;
     505}
     506
     507/*--------------------------------------------------------------
     5086.3 - Directories - Members, Groups, Blogs, Forums
     509--------------------------------------------------------------*/
     510#buddypress div.dir-search {
     511        float: right;
     512        margin: -39px 0 0 0;
     513}
     514#buddypress div.dir-search input[type=text] {
     515        font-size: 12px;
     516        padding: 1px 3px;
     517}
     518
     519/*--------------------------------------------------------------
     5206.4 - Errors / Success Messages
     521--------------------------------------------------------------*/
     522#buddypress div#message {
     523        margin: 0 0 15px;
     524}
     525#buddypress #message.info {
     526        margin-bottom: 0;
     527}
     528#buddypress div#message.updated {
     529        clear: both;
     530}
     531#buddypress div#message p {
     532        font-size: 12px;
     533        display: block;
     534        padding: 10px 15px;
     535}
     536#buddypress div#message.error p {
     537        background-color: #db1717;
     538        border-color: #a71a1a;
     539        clear: left;
     540        color: #fff;
     541}
     542#buddypress div#message.updated p {
     543        background-color: #8ff57a;
     544        border-color: #80cf70;
     545        color: #1a6a00;
     546}
     547#buddypress .standard-form#signup_form div div.error {
     548        background: #e41717;
     549        -moz-border-radius: 3px;
     550        -webkit-border-radius: 3px;
     551        border-radius: 3px;
     552        color: #fff;
     553        margin: 0 0 10px 0;
     554        padding: 6px;
     555        width: 90%;
     556}
     557#buddypress div.accept,
     558#buddypress div.reject {
     559        float: left;
     560        margin-left: 10px;
     561}
     562#buddypress ul.button-nav li {
     563        float: left;
     564        margin: 0 10px 10px 0;
     565}
     566#buddypress ul.button-nav li.current a {
     567        font-weight: bold;
     568}
     569
     570
     571/*--------------------------------------------------------------
     5726.5 - Forms
     573--------------------------------------------------------------*/
     574#buddypress .standard-form textarea,
     575#buddypress .standard-form input[type=text],
     576#buddypress .standard-form select,
     577#buddypress .standard-form input[type=password],
     578#buddypress .dir-search input[type=text] {
     579        border: 1px inset #ccc;
     580        border-radius: 3px;
     581        color: #888;
     582        font: inherit;
     583        font-size: 14px;
     584        padding: 6px;
     585}
     586#buddypress .standard-form select {
     587        padding: 3px;
     588}
     589#buddypress .standard-form input[type=password] {
     590        margin-bottom: 5px;
     591}
     592#buddypress .standard-form label,
     593#buddypress .standard-form span.label {
     594        display: block;
     595        font-weight: bold;
     596        margin: 15px 0 5px 0;
     597}
     598#buddypress .standard-form div.checkbox label,
     599#buddypress .standard-form div.radio label {
     600        color: #888;
     601        font-size: 14px;
     602        font-weight: normal;
     603        margin: 5px 0 0 0;
     604}
     605#buddypress .standard-form#sidebar-login-form label {
     606        margin-top: 5px;
     607}
     608#buddypress .standard-form input[type=text] {
     609        width: 75%;
     610}
     611#buddypress .standard-form#sidebar-login-form input[type=text],
     612#buddypress .standard-form#sidebar-login-form input[type=password] {
     613        padding: 4px;
     614        width: 95%;
     615}
     616#buddypress .standard-form #basic-details-section input[type=password],
     617#buddypress .standard-form #blog-details-section input#signup_blog_url {
     618        width: 35%;
     619}
     620#buddypress .standard-form#signup_form input[type=text],
     621#buddypress .standard-form#signup_form textarea,
     622#buddypress .form-allowed-tags,
     623#buddypress #commentform input[type=text],
     624#buddypress #commentform textarea {
     625        width: 90%;
     626}
     627#buddypress .standard-form#signup_form div.submit {
     628        float: right;
     629}
     630#buddypress div#signup-avatar img {
     631        margin: 0 15px 10px 0;
     632}
     633#buddypress .standard-form textarea {
     634        width: 75%;
     635        height: 120px;
     636}
     637#buddypress .standard-form textarea#message_content {
     638        height: 200px;
     639}
     640#buddypress .standard-form#send-reply textarea {
     641        width: 97.5%;
     642}
     643#buddypress .standard-form p.description {
     644        color: #888;
     645        font-size: 11px;
     646        margin: 5px 0;
     647}
     648#buddypress .standard-form div.submit {
     649        clear: both;
     650        padding: 15px 0 0 0;
     651}
     652#buddypress .standard-form p.submit {
     653        margin-bottom: 0;
     654        padding: 15px 0 0 0;
     655}
     656#buddypress .standard-form div.submit input {
     657        margin-right: 15px;
     658}
     659#buddypress .standard-form div.radio ul {
     660        margin: 10px 0 15px 38px;
     661        list-style: disc;
     662}
     663#buddypress .standard-form div.radio ul li {
     664        margin-bottom: 5px;
     665}
     666#buddypress .standard-form a.clear-value {
     667        display: block;
     668        margin-top: 5px;
     669        outline: none;
     670}
     671#buddypress .standard-form #basic-details-section,
     672#buddypress .standard-form #blog-details-section,
     673#buddypress .standard-form #profile-details-section {
     674        float: left;
     675        width: 48%;
     676}
     677#buddypress .standard-form #profile-details-section {
     678        float: right;
     679}
     680#buddypress .standard-form #blog-details-section {
     681        clear: left;
     682}
     683#buddypress .standard-form input:focus,
     684#buddypress .standard-form textarea:focus,
     685#buddypress .standard-form select:focus {
     686        background: #fafafa;
     687        color: #555;
     688}
     689#buddypress form#send-invite-form {
     690        margin-top: 20px;
     691}
     692#buddypress div#invite-list {
     693        background: #f5f5f5;
     694        border: 1px solid #e4e4e4;
     695        border-radius: 3px;
     696        height: 400px;
     697        margin: 0 0 10px;
     698        overflow: auto;
     699        padding: 5px;
     700        width: 160px;
     701}
     702#buddypress button,
     703#buddypress a.button,
     704#buddypress input[type=submit],
     705#buddypress input[type=button],
     706#buddypress input[type=reset],
     707#buddypress ul.button-nav li a,
     708#buddypress div.generic-button a,
     709#buddypress .comment-reply-link {
     710        background: #fff; /* Old browsers */
     711        background: -moz-linear-gradient(top, #ffffff 0%, #ededed 100%); /* FF3.6+ */
     712        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
     713        background: -webkit-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */
     714        background: -o-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Opera11.10+ */
     715        background: -ms-linear-gradient(top, #ffffff 0%,#ededed 100%); /* IE10+ */
     716        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
     717        background: linear-gradient(top, #ffffff 0%,#ededed 100%); /* W3C */
     718        border: 1px solid #ccc;
     719        -moz-border-radius: 3px;
     720        -webkit-border-radius: 3px;
     721        border-radius: 3px;
     722        color: #777;
     723        cursor: pointer;
     724        font: normal 12px/20px Arial, Tahoma, Verdana, sans-serif;
     725        outline: none;
     726        padding: 4px 10px;
     727        text-align: center;
     728        text-decoration: none;
     729        line-height: 14px;
     730}
     731#buddypress button:hover,
     732#buddypress a.button:hover,
     733#buddypress a.button:focus,
     734#buddypress input[type=submit]:hover,
     735#buddypress input[type=button]:hover,
     736#buddypress input[type=reset]:hover,
     737#buddypress ul.button-nav li a:hover,
     738#buddypress ul.button-nav li.current a,
     739#buddypress div.generic-button a:hover,
     740#buddypress .comment-reply-link:hover {
     741        background: #ededed;
     742        background: -moz-linear-gradient(top, #ffffff 0%, #e0e0e0 100%); /* FF3.6+ */
     743        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#e0e0e0)); /* Chrome,Safari4+ */
     744        background: -webkit-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Chrome10+,Safari5.1+ */
     745        background: -o-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* Opera11.10+ */
     746        background: -ms-linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* IE10+ */
     747        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e0e0e0',GradientType=0 ); /* IE6-9 */
     748        background: linear-gradient(top, #ffffff 0%,#e0e0e0 100%); /* W3C */
     749        border: 1px solid #bbb;
     750        color: #555;
     751        outline: none;
     752        text-decoration: none;
     753}
     754
     755/*--------------------------------------------------------------
     7566.6 - Ajax Loading
     757--------------------------------------------------------------*/
     758#buddypress a.loading,
     759#buddypress input.loading {
     760    padding-right: 25px;
     761}
     762#buddypress a.loading:hover,
     763#buddypress input.loading:hover {
     764    padding-right: 25px;
     765    color: #777;
     766}
     767#buddypress input[type="submit"].pending,
     768#buddypress input[type="button"].pending,
     769#buddypress input[type="reset"].pending,
     770#buddypress input[type="submit"].disabled,
     771#buddypress input[type="button"].disabled,
     772#buddypress input[type="reset"].disabled,
     773#buddypress button.pending,
     774#buddypress button.disabled,
     775#buddypress div.pending a,
     776#buddypress a.disabled {
     777    border-color: #eee;
     778    color: #bbb;
     779    cursor: default;
     780}
     781#buddypress input[type="submit"]:hover.pending,
     782#buddypress input[type="button"]:hover.pending,
     783#buddypress input[type="reset"]:hover.pending,
     784#buddypress input[type="submit"]:hover.disabled,
     785#buddypress input[type="button"]:hover.disabled,
     786#buddypress input[type="reset"]:hover.disabled,
     787#buddypress button.pending:hover,
     788#buddypress button.disabled:hover,
     789#buddypress div.pending a:hover,
     790#buddypress a.disabled:hover {
     791        background: -moz-linear-gradient(top, #ffffff 0%, #ededed 100%); /* FF3.6+ */
     792        background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
     793        background: -webkit-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Chrome10+,Safari5.1+ */
     794        background: -o-linear-gradient(top, #ffffff 0%,#ededed 100%); /* Opera11.10+ */
     795        background: -ms-linear-gradient(top, #ffffff 0%,#ededed 100%); /* IE10+ */
     796        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
     797        background: linear-gradient(top, #ffffff 0%,#ededed 100%); /* W3C */
     798    border-color: #eee;
     799    color: #bbb;
     800}
     801
     802/*--------------------------------------------------------------
     8036.7 - Forums, Tables and Topics
     804--------------------------------------------------------------*/
     805#buddypress ul#topic-post-list {
     806        margin: 0px -19px 15px;
     807        width: auto;
     808}
     809#buddypress ul#topic-post-list li {
     810        padding: 15px;
     811        position: relative;
     812}
     813#buddypress ul#topic-post-list li.alt {
     814        background: #f5f5f5;
     815}
     816#buddypress ul#topic-post-list li div.poster-meta {
     817        color: #888;
     818        margin-bottom: 10px;
     819}
     820#buddypress ul#topic-post-list li div.post-content {
     821        margin-left: 54px;
     822}
     823#buddypress div.topic-tags {
     824        font-size: 11px;
     825}
     826#buddypress div.admin-links {
     827        color: #888;
     828        font-size: 11px;
     829        position: absolute;
     830        top: 15px;
     831        right: 25px;
     832}
     833#buddypress div#topic-meta {
     834        margin: -10px -19px;
     835        padding: 5px 19px 30px;
     836        position: relative;
     837}
     838#buddypress div#topic-meta div.admin-links {
     839        right: 19px;
     840        top: -36px;
     841}
     842#buddypress div#topic-meta h3 {
     843        font-size: 20px;
     844        margin: 5px 0;
     845}
     846#buddypress div#new-topic-post {
     847        display: none;
     848        margin: 20px 0 0 0;
     849        padding: 1px 0 0 0;
     850}
     851#buddypress table {
     852        width: 100%;
     853}
     854#buddypress table thead tr {
     855        background: #eaeaea;
     856}
     857#buddypress table#message-threads {
     858        margin: 0 -19px;
     859        width: auto;
     860}
     861#buddypress table.profile-fields {
     862        margin-bottom: 20px;
     863}
     864#buddypress table.profile-fields:last-child {
     865        margin-bottom: 0;
     866}
     867#buddypress table.profile-fields p {
     868        margin: 0;
     869}
     870#buddypress table.profile-fields p:last-child {
     871        margin-top: 0;
     872}
     873#buddypress table tr td,
     874#buddypress table tr th {
     875        padding: 8px;
     876        vertical-align: middle;
     877}
     878#buddypress table tr td.label {
     879        border-right: 1px solid #eaeaea;
     880        font-weight: bold;
     881        width: 25%;
     882}
     883#buddypress table tr td.thread-info p {
     884        margin: 0;
     885}
     886#buddypress table tr td.thread-info p.thread-excerpt {
     887        color: #888;
     888        font-size: 11px;
     889        margin-top: 3px;
     890}
     891#buddypress table.forum td {
     892        text-align: center;
     893}
     894#buddypress table tr.alt td {
     895        background: #f5f5f5;
     896}
     897#buddypress table.notification-settings {
     898        margin-bottom: 20px;
     899        text-align: left;
     900}
     901#buddypress #groups-notification-settings {
     902        margin-bottom: 0;
     903}
     904#buddypress table.notification-settings th.icon,
     905#buddypress table.notification-settings td:first-child {
     906        display: none;
     907}
     908#buddypress table.notification-settings th.title {
     909        width: 80%;
     910}
     911#buddypress table.notification-settings .yes,
     912#buddypress table.notification-settings .no {
     913        text-align: center;
     914        width: 40px;
     915}
     916#buddypress table.forum {
     917        margin: 0 -19px;
     918        width: auto;
     919}
     920#buddypress table.forum tr.sticky td {
     921        font-size: 1.2em;
     922        background: #fff9db;
     923        border-top: 1px solid #ffe8c4;
     924        border-bottom: 1px solid #ffe8c4;
     925}
     926#buddypress table.forum tr.closed td.td-title {
     927        padding-left: 35px;
     928}
     929#buddypress table.forum td p.topic-text {
     930        color: #888;
     931        font-size: 13px;
     932}
     933#buddypress table.forum tr > td:first-child,
     934#buddypress table.forum tr > th:first-child {
     935        padding-left: 15px;
     936}
     937#buddypress table.forum tr > td:last-child,
     938#buddypress table.forum tr > th:last-child {
     939        padding-right: 15px;
     940}
     941#buddypress table.forum tr th#th-title,
     942#buddypress table.forum tr th#th-poster,
     943#buddypress table.forum tr th#th-group,
     944#buddypress table.forum td.td-poster,
     945#buddypress table.forum td.td-group,
     946#buddypress table.forum td.td-title {
     947        text-align: left;
     948}
     949#buddypress table.forum tr td.td-title a.topic-title {
     950        font-size: 1.2em;
     951}
     952#buddypress table.forum td.td-freshness {
     953        white-space: nowrap;
     954}
     955#buddypress table.forum td.td-freshness span.time-since {
     956        font-size: 0.9em;
     957        color: #888;
     958}
     959#buddypress table.forum td img.avatar {
     960        float: none;
     961        margin: 0 5px -8px 0;
     962}
     963#buddypress table.forum td.td-poster,
     964#buddypress table.forum td.td-group {
     965        min-width: 140px;
     966}
     967#buddypress table.forum th#th-title {
     968        width: 80%;
     969}
     970#buddypress table.forum th#th-freshness {
     971        width: 25%;
     972}
     973#buddypress table.forum th#th-postcount {
     974        width: 15%;
     975}
     976#buddypress table.forum p.topic-meta {
     977        font-size: 0.9em;
     978        margin: 5px 0 0 0;
     979}
     980
     981/*-------------------------------------------------------------------------
     9826.8 - Headers, Lists and Tabs - Activity, Groups, Blogs, Forums, Profiles
     983-------------------------------------------------------------------------*/
     984#buddypress .item-body {
     985        margin: 20px 0;
     986}
     987#buddypress span.activity {
     988        display: inline-block;
     989        font-size: 11px;
     990        opacity: 0.8;
     991        padding: 1px 8px;
     992}
     993#buddypress span.user-nicename {
     994        color: #777;
     995        display: inline-block;
     996        font-size: 16px;
     997        font-weight: bold;
     998}
     999#buddypress span.activity,
     1000#buddypress div#message p {
     1001        border: 1px solid #e1ca82;
     1002        -moz-border-radius: 3px;
     1003        -webkit-border-radius: 3px;
     1004        border-radius: 3px;
     1005        font-weight: normal;
     1006        margin-top: 3px;
     1007        text-decoration: none;
     1008        background: #ffeaa6;
     1009        background-image: -webkit-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
     1010        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+ */
     1011        background-image: -moz-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
     1012        background-image: -ms-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
     1013        background-image: -o-linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
     1014        background-image: linear-gradient(rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
     1015}
     1016#buddypress div#item-header {
     1017        overflow: hidden;
     1018}
     1019#buddypress div#item-header div#item-header-content {
     1020        float: left;
     1021        margin-left: 0;
     1022}
     1023#buddypress div#item-header h2 {
     1024        font-size: 28px;
     1025        line-height: 120%;
     1026        margin: 0 0 15px 0;
     1027}
     1028#buddypress div#item-header h2 a {
     1029        color: #777;
     1030        text-decoration: none;
     1031}
     1032#buddypress div#item-header img.avatar {
     1033        float: left;
     1034        margin: 0 15px 19px 0;
     1035}
     1036#buddypress div#item-header h2 {
     1037        margin-bottom: 5px;
     1038}
     1039#buddypress div#item-header span.activity,
     1040#buddypress div#item-header h2 span.highlight {
     1041        font-size: 11px;
     1042        font-weight: normal;
     1043        line-height: 170%;
     1044        margin-bottom: 7px;
     1045        vertical-align: middle;
     1046}
     1047#buddypress div#item-header h2 span.highlight {
     1048        font-size: 16px;
     1049}
     1050#buddypress div#item-header h2 span.highlight span {
     1051        background: #a1dcfa;
     1052        -moz-border-radius: 3px;
     1053        -webkit-border-radius: 3px;
     1054        border-radius: 3px;
     1055        color: #fff;
     1056        cursor: pointer;
     1057        font-weight: bold;
     1058        font-size: 11px;
     1059        margin-bottom: 2px;
     1060        padding: 1px 4px;
     1061        position: relative;
     1062        right: -2px;
     1063        top: -2px;
     1064        vertical-align: middle;
     1065}
     1066#buddypress div#item-header div#item-meta {
     1067        font-size: 14px;
     1068        color: #aaa;
     1069        overflow: hidden;
     1070        margin: 15px 0 5px 0;
     1071        padding-bottom: 10px;
     1072}
     1073#buddypress div#item-header div#item-actions {
     1074        float: right;
     1075        margin: 0 0 15px 15px;
     1076        text-align: right;
     1077        width: 20%;
     1078}
     1079#buddypress div#item-header div#item-actions h3 {
     1080        font-size: 12px;
     1081        margin: 0 0 5px 0;
     1082}
     1083#buddypress div#item-header ul {
     1084        margin-bottom: 15px;
     1085        overflow: hidden;
     1086}
     1087#buddypress div#item-header ul h5,
     1088#buddypress div#item-header ul span,
     1089#buddypress div#item-header ul hr {
     1090        display: none;
     1091}
     1092#buddypress div#item-header ul li {
     1093        float: right;
     1094}
     1095#buddypress div#item-header ul img.avatar,
     1096#buddypress div#item-header ul.avatars img.avatar {
     1097        height: 30px;
     1098        margin: 2px;
     1099        width: 30px;
     1100}
     1101#buddypress div#item-header div.generic-button,
     1102#buddypress div#item-header a.button {
     1103        float: left;
     1104        margin: 10px 10px 0 0;
     1105}
     1106#buddypress div#item-header div#message.info {
     1107        line-height: 80%;
     1108}
     1109#buddypress ul.item-list {
     1110        width: 100%;
     1111        list-style: none;
     1112        clear: both;
     1113}
     1114#buddypress ul.item-list li {
     1115        border-bottom: 1px solid #eaeaea;
     1116        padding: 15px 0;
     1117        position: relative;
     1118        list-style: none;
     1119}
     1120#buddypress ul.item-list.activity-list li {
     1121        padding-bottom: 0;
     1122}
     1123#buddypress ul.single-line li {
     1124        border: none;
     1125}
     1126#buddypress ul.item-list li img.avatar {
     1127        float: left;
     1128        margin: 0 10px 0 0;
     1129}
     1130#buddypress ul.item-list li div.item-title,
     1131#buddypress ul.item-list li h4 {
     1132        font-weight: normal;
     1133        font-size: 14px;
     1134        margin: 0;
     1135        width: 75%;
     1136}
     1137#buddypress ul.item-list li div.item-title span {
     1138        color: #999;
     1139        font-size: 12px;
     1140}
     1141#buddypress ul.item-list li div.item-desc {
     1142        color: #888;
     1143        font-size: 11px;
     1144        margin: 10px 0 0 64px;
     1145        width: 50%;
     1146}
     1147#buddypress ul.item-list li div.action {
     1148        position: absolute;
     1149        top: 15px;
     1150        right: 0;
     1151        text-align: right;
     1152}
     1153#buddypress ul.item-list li div.meta {
     1154        color: #888;
     1155        font-size: 11px;
     1156        margin-top: 10px;
     1157}
     1158#buddypress ul.item-list li h5 span.small {
     1159        float: right;
     1160        font-size: 11px;
     1161        font-weight: normal;
     1162}
     1163#buddypress div.item-list-tabs {
     1164        background: #e6e6e6;
     1165        clear: left;
     1166        overflow: hidden;
     1167}
     1168#buddypress div.item-list-tabs ul li a {
     1169        text-decoration: none;
     1170        height: 20px;
     1171}
     1172#buddypress div.item-list-tabs ul {
     1173        width: 100%;
     1174}
     1175#buddypress div.item-list-tabs ul li {
     1176        float: left;
     1177        margin: 5px 0 0 5px;
     1178        list-style: none;
     1179}
     1180#buddypress div.item-list-tabs#subnav ul li {
     1181        margin-top: 0;
     1182}
     1183#buddypress div.item-list-tabs ul li.last {
     1184        float: right;
     1185        margin: 7px 10px 0 0;
     1186}
     1187#buddypress div.item-list-tabs#subnav ul li.last {
     1188        margin-top: 4px;
     1189}
     1190#buddypress div.item-list-tabs ul li.last select {
     1191        max-width: 175px;
     1192}
     1193#buddypress div.item-list-tabs ul li a,
     1194#buddypress div.item-list-tabs ul li span {
     1195        display: block;
     1196        padding: 5px 10px 10px;
     1197        text-decoration: none;
     1198}
     1199#buddypress div.item-list-tabs ul li a span {
     1200        background: #1fb3dd;
     1201        border-radius: 3px;
     1202        color: #fff;
     1203        display: inline;
     1204        font-size: 90%;
     1205        margin-left: 2px;
     1206        padding: 1px 6px;
     1207}
     1208#buddypress div.item-list-tabs ul li.selected a,
     1209#buddypress div.item-list-tabs ul li.current a {
     1210        background-color: #fff;
     1211        border-top-left-radius: 3px;
     1212        border-top-right-radius: 3px;
     1213        color: #555;
     1214        font-weight: bold;
     1215}
     1216#buddypress div.item-list-tabs ul li.selected a span,
     1217#buddypress div.item-list-tabs ul li.current a span,
     1218#buddypress div.item-list-tabs ul li a:hover span {
     1219        background-color: #999;
     1220}
     1221#buddypress div.item-list-tabs ul li.selected a span,
     1222#buddypress div.item-list-tabs ul li.current a span {
     1223        background-color: #555;
     1224}
     1225#buddypress div#item-nav ul li.loading a {
     1226        background-position: 88% 50%;
     1227}
     1228#buddypress div.item-list-tabs#object-nav {
     1229        margin-top: 0;
     1230}
     1231#buddypress div.item-list-tabs#subnav {
     1232        background: #fff;
     1233        border-bottom: 1px solid #eaeaea;
     1234        margin: 0 0 20px;
     1235        overflow: hidden;
     1236}
     1237#buddypress #admins-list li,
     1238#buddypress #mods-list li,
     1239#buddypress #members-list li {
     1240        overflow: auto;
     1241}
     1242
     1243
     1244/*--------------------------------------------------------------
     12456.9 - Private Messaging Threads
     1246--------------------------------------------------------------*/
     1247#buddypress table#message-threads tr.unread td {
     1248        background: #fff9db;
     1249        border-top: 1px solid #ffe8c4;
     1250        border-bottom: 1px solid #ffe8c4;
     1251        font-weight: bold;
     1252}
     1253#buddypress li span.unread-count,
     1254#buddypress tr.unread span.unread-count {
     1255        background: #dd0000;
     1256        border-radius: 3px;
     1257        color: #fff;
     1258        font-weight: bold;
     1259        padding: 2px 8px;
     1260}
     1261#buddypress div.item-list-tabs ul li a span.unread-count {
     1262        padding: 1px 6px;
     1263        color: #fff;
     1264}
     1265#buddypress div.messages-options-nav {
     1266        background: #eee;
     1267        font-size: 11px;
     1268        margin: 0 -19px;
     1269        padding: 5px 15px;
     1270        text-align: right;
     1271}
     1272#buddypress div#message-thread div.message-box {
     1273        margin: 0 -19px;
     1274        padding: 15px;
     1275}
     1276#buddypress div#message-thread div.alt {
     1277        background: #f4f4f4;
     1278}
     1279#buddypress div#message-thread p#message-recipients {
     1280        margin: 10px 0 20px 0;
     1281}
     1282#buddypress div#message-thread img.avatar {
     1283        float: left;
     1284        margin: 0 10px 0 0;
     1285        vertical-align: middle;
     1286}
     1287#buddypress div#message-thread strong {
     1288        font-size: 16px;
     1289        margin: 0;
     1290}
     1291#buddypress div#message-thread strong a {
     1292        text-decoration: none;
     1293}
     1294#buddypress div#message-thread strong span.activity {
     1295        margin: 4px 0 0 10px;
     1296}
     1297#buddypress div#message-thread div.message-metadata {
     1298        overflow: hidden;
     1299}
     1300#buddypress div#message-thread div.message-content {
     1301        margin-left: 45px;
     1302}
     1303#buddypress div#message-thread div.message-options {
     1304        text-align: right;
     1305}
     1306
     1307#buddypress div.message-search {
     1308        float: right;
     1309        margin: 0 20px;
     1310}
     1311
     1312/*--------------------------------------------------------------
     13136.9 - Extended Profiles
     1314--------------------------------------------------------------*/
     1315
     1316#buddypress div.profile h4 {
     1317        margin-bottom: auto;
     1318        margin-top: 15px;
     1319}
     1320#buddypress #profile-edit-form ul.button-nav {
     1321        margin-top: 15px;
     1322}
     1323body.no-js #buddypress .field-visibility-settings-toggle,
     1324body.no-js #buddypress .field-visibility-settings-close {
     1325        display: none;
     1326}
     1327#buddypress .field-visibility-settings {
     1328        display: none;
     1329        margin-top: 10px;
     1330}
     1331        body.no-js #buddypress .field-visibility-settings {
     1332                display: block;
     1333        }
     1334#buddypress .current-visibility-level {
     1335        font-weight: bold;
     1336        font-style: normal;
     1337}
     1338#buddypress .field-visibility-settings,
     1339#buddypress .field-visibility-settings-toggle,
     1340#buddypress .field-visibility-settings-notoggle {
     1341        color: #888;
     1342}
     1343#buddypress .field-visibility-settings-toggle a,
     1344#buddypress .field-visibility-settings a {
     1345        font-size: .9em;
     1346}
     1347body.register #buddypress div.page ul {
     1348        list-style: none;
     1349}
     1350#buddypress .standard-form .field-visibility-settings label {
     1351        margin: 0;
     1352        font-weight: normal;
     1353}
     1354#buddypress .field-visibility-settings legend,
     1355#buddypress .field-visibility-settings-toggle {
     1356        font-style: italic;
     1357}
  • bp-themes/bp-theme-compat/js/buddypress.js

     
     1// AJAX Functions
     2var jq = jQuery;
     3
     4// Global variable to prevent multiple AJAX requests
     5var bp_ajax_request = null;
     6
     7jq(document).ready( function() {
     8        /**** Page Load Actions *******************************************************/
     9
     10        /* Hide Forums Post Form */
     11        if ( '-1' == window.location.search.indexOf('new') && jq('div.forums').length )
     12                jq('#new-topic-post').hide();
     13        else
     14                jq('#new-topic-post').show();
     15
     16        /* Activity filter and scope set */
     17        bp_init_activity();
     18
     19        /* Object filter and scope set. */
     20        var objects = [ 'members', 'groups', 'blogs', 'forums' ];
     21        bp_init_objects( objects );
     22
     23        /* @mention Compose Scrolling */
     24        if ( jq.query.get('r') && jq('textarea#whats-new').length ) {
     25                jq('#whats-new-options').animate({
     26                        height:'40px'
     27                });
     28                jq("form#whats-new-form textarea").animate({
     29                        height:'50px'
     30                });
     31                jq.scrollTo( jq('textarea#whats-new'), 500, {
     32                        offset:-125,
     33                        easing:'easeOutQuad'
     34                } );
     35                jq('textarea#whats-new').focus();
     36        }
     37
     38        /**** Activity Posting ********************************************************/
     39
     40        /* Textarea focus */
     41        jq('#whats-new').focus( function(){
     42                jq("#whats-new-options").animate({
     43                        height:'40px'
     44                });
     45                jq("form#whats-new-form textarea").animate({
     46                        height:'50px'
     47                });
     48                jq("#aw-whats-new-submit").prop("disabled", false);
     49        });
     50
     51        /* New posts */
     52        jq("input#aw-whats-new-submit").click( function() {
     53                var button = jq(this);
     54                var form = button.parent().parent().parent().parent();
     55
     56                form.children().each( function() {
     57                        if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") )
     58                                jq(this).prop( 'disabled', true );
     59                });
     60
     61                /* Remove any errors */
     62                jq('div.error').remove();
     63                button.addClass('loading');
     64                button.prop('disabled', true);
     65
     66                /* Default POST values */
     67                var object = '';
     68                var item_id = jq("#whats-new-post-in").val();
     69                var content = jq("textarea#whats-new").val();
     70
     71                /* Set object for non-profile posts */
     72                if ( item_id > 0 ) {
     73                        object = jq("#whats-new-post-object").val();
     74                }
     75
     76                jq.post( ajaxurl, {
     77                        action: 'post_update',
     78                        'cookie': encodeURIComponent(document.cookie),
     79                        '_wpnonce_post_update': jq("input#_wpnonce_post_update").val(),
     80                        'content': content,
     81                        'object': object,
     82                        'item_id': item_id,
     83                        '_bp_as_nonce': jq('#_bp_as_nonce').val() || ''
     84                },
     85                function(response) {
     86
     87                        form.children().each( function() {
     88                                if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") ) {
     89                                        jq(this).prop( 'disabled', false );
     90                                }
     91                        });
     92
     93                        /* Check for errors and append if found. */
     94                        if ( response[0] + response[1] == '-1' ) {
     95                                form.prepend( response.substr( 2, response.length ) );
     96                                jq( 'form#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
     97                        } else {
     98                                if ( 0 == jq("ul.activity-list").length ) {
     99                                        jq("div.error").slideUp(100).remove();
     100                                        jq("div#message").slideUp(100).remove();
     101                                        jq("div.activity").append( '<ul id="activity-stream" class="activity-list item-list">' );
     102                                }
     103
     104                                jq("ul#activity-stream").prepend(response);
     105                                jq("ul#activity-stream li:first").addClass('new-update');
     106
     107                                if ( 0 != jq("#latest-update").length ) {
     108                                        var l = jq("ul#activity-stream li.new-update .activity-content .activity-inner p").html();
     109                                        var v = jq("ul#activity-stream li.new-update .activity-content .activity-header p a.view").attr('href');
     110
     111                                        var ltext = jq("ul#activity-stream li.new-update .activity-content .activity-inner p").text();
     112
     113                                        var u = '';
     114                                        if ( ltext != '' )
     115                                                u = l + ' ';
     116
     117                                        u += '<a href="' + v + '" rel="nofollow">' + BP_DTheme.view + '</a>';
     118
     119                                        jq("#latest-update").slideUp(300,function(){
     120                                                jq("#latest-update").html( u );
     121                                                jq("#latest-update").slideDown(300);
     122                                        });
     123                                }
     124
     125                                jq("li.new-update").hide().slideDown( 300 );
     126                                jq("li.new-update").removeClass( 'new-update' );
     127                                jq("textarea#whats-new").val('');
     128                        }
     129
     130                        jq("#whats-new-options").animate({
     131                                height:'0px'
     132                        });
     133                        jq("form#whats-new-form textarea").animate({
     134                                height:'20px'
     135                        });
     136                        jq("#aw-whats-new-submit").prop("disabled", true).removeClass('loading');
     137                });
     138
     139                return false;
     140        });
     141
     142        /* List tabs event delegation */
     143        jq('div.activity-type-tabs').click( function(event) {
     144                var target = jq(event.target).parent();
     145
     146                if ( event.target.nodeName == 'STRONG' || event.target.nodeName == 'SPAN' )
     147                        target = target.parent();
     148                else if ( event.target.nodeName != 'A' )
     149                        return false;
     150
     151                /* Reset the page */
     152                jq.cookie( 'bp-activity-oldestpage', 1, {
     153                        path: '/'
     154                } );
     155
     156                /* Activity Stream Tabs */
     157                var scope = target.attr('id').substr( 9, target.attr('id').length );
     158                var filter = jq("#activity-filter-select select").val();
     159
     160                if ( scope == 'mentions' )
     161                        jq( 'li#' + target.attr('id') + ' a strong' ).remove();
     162
     163                bp_activity_request(scope, filter);
     164
     165                return false;
     166        });
     167
     168        /* Activity filter select */
     169        jq('#activity-filter-select select').change( function() {
     170                var selected_tab = jq( 'div.activity-type-tabs li.selected' );
     171
     172                if ( !selected_tab.length )
     173                        var scope = null;
     174                else
     175                        var scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length );
     176
     177                var filter = jq(this).val();
     178
     179                bp_activity_request(scope, filter);
     180
     181                return false;
     182        });
     183
     184        /* Stream event delegation */
     185        jq('div.activity').click( function(event) {
     186                var target = jq(event.target);
     187
     188                /* Favoriting activity stream items */
     189                if ( target.hasClass('fav') || target.hasClass('unfav') ) {
     190                        var type = target.hasClass('fav') ? 'fav' : 'unfav';
     191                        var parent = target.closest('.activity-item');
     192                        var parent_id = parent.attr('id').substr( 9, parent.attr('id').length );
     193
     194                        target.addClass('loading');
     195
     196                        jq.post( ajaxurl, {
     197                                action: 'activity_mark_' + type,
     198                                'cookie': encodeURIComponent(document.cookie),
     199                                'id': parent_id
     200                        },
     201                        function(response) {
     202                                target.removeClass('loading');
     203
     204                                target.fadeOut( 100, function() {
     205                                        jq(this).html(response);
     206                                        jq(this).attr('title', 'fav' == type ? BP_DTheme.remove_fav : BP_DTheme.mark_as_fav);
     207                                        jq(this).fadeIn(100);
     208                                });
     209
     210                                if ( 'fav' == type ) {
     211                                        if ( !jq('.item-list-tabs li#activity-favorites').length )
     212                                                jq('.item-list-tabs ul li#activity-mentions').before( '<li id="activity-favorites"><a href="#">' + BP_DTheme.my_favs + ' <span>0</span></a></li>');
     213
     214                                        target.removeClass('fav');
     215                                        target.addClass('unfav');
     216
     217                                        jq('.item-list-tabs ul li#activity-favorites span').html( Number( jq('.item-list-tabs ul li#activity-favorites span').html() ) + 1 );
     218                                } else {
     219                                        target.removeClass('unfav');
     220                                        target.addClass('fav');
     221
     222                                        jq('.item-list-tabs ul li#activity-favorites span').html( Number( jq('.item-list-tabs ul li#activity-favorites span').html() ) - 1 );
     223
     224                                        if ( !Number( jq('.item-list-tabs ul li#activity-favorites span').html() ) ) {
     225                                                if ( jq('.item-list-tabs ul li#activity-favorites').hasClass('selected') )
     226                                                        bp_activity_request( null, null );
     227
     228                                                jq('.item-list-tabs ul li#activity-favorites').remove();
     229                                        }
     230                                }
     231
     232                                if ( 'activity-favorites' == jq( '.item-list-tabs li.selected').attr('id') )
     233                                        target.parent().parent().parent().slideUp(100);
     234                        });
     235
     236                        return false;
     237                }
     238
     239                /* Delete activity stream items */
     240                if ( target.hasClass('delete-activity') ) {
     241                        var li        = target.parents('div.activity ul li');
     242                        var id        = li.attr('id').substr( 9, li.attr('id').length );
     243                        var link_href = target.attr('href');
     244                        var nonce     = link_href.split('_wpnonce=');
     245
     246                        nonce = nonce[1];
     247
     248                        target.addClass('loading');
     249
     250                        jq.post( ajaxurl, {
     251                                action: 'delete_activity',
     252                                'cookie': encodeURIComponent(document.cookie),
     253                                'id': id,
     254                                '_wpnonce': nonce
     255                        },
     256                        function(response) {
     257
     258                                if ( response[0] + response[1] == '-1' ) {
     259                                        li.prepend( response.substr( 2, response.length ) );
     260                                        li.children('div#message').hide().fadeIn(300);
     261                                } else {
     262                                        li.slideUp(300);
     263                                }
     264                        });
     265
     266                        return false;
     267                }
     268
     269                // Spam activity stream items
     270                if ( target.hasClass( 'spam-activity' ) ) {
     271                        var li = target.parents( 'div.activity ul li' );
     272                        target.addClass( 'loading' );
     273
     274                        jq.post( ajaxurl, {
     275                                action: 'bp_spam_activity',
     276                                'cookie': encodeURIComponent( document.cookie ),
     277                                'id': li.attr( 'id' ).substr( 9, li.attr( 'id' ).length ),
     278                                '_wpnonce': target.attr( 'href' ).split( '_wpnonce=' )[1]
     279                        },
     280
     281                        function(response) {
     282                                if ( response[0] + response[1] === '-1' ) {
     283                                        li.prepend( response.substr( 2, response.length ) );
     284                                        li.children( 'div#message' ).hide().fadeIn(300);
     285                                } else {
     286                                        li.slideUp( 300 );
     287                                }
     288                        });
     289
     290                        return false;
     291                }
     292
     293                /* Load more updates at the end of the page */
     294                if ( target.parent().hasClass('load-more') ) {
     295                        jq("#content li.load-more").addClass('loading');
     296
     297                        if ( null == jq.cookie('bp-activity-oldestpage') )
     298                                jq.cookie('bp-activity-oldestpage', 1, {
     299                                        path: '/'
     300                                } );
     301
     302                        var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
     303
     304                        jq.post( ajaxurl, {
     305                                action: 'activity_get_older_updates',
     306                                'cookie': encodeURIComponent(document.cookie),
     307                                'page': oldest_page
     308                        },
     309                        function(response)
     310                        {
     311                                jq("#content li.load-more").removeClass('loading');
     312                                jq.cookie( 'bp-activity-oldestpage', oldest_page, {
     313                                        path: '/'
     314                                } );
     315                                jq("#content ul.activity-list").append(response.contents);
     316
     317                                target.parent().hide();
     318                        }, 'json' );
     319
     320                        return false;
     321                }
     322        });
     323
     324        // Activity "Read More" links
     325        jq('.activity-read-more a').live('click', function(event) {
     326                var target = jq(event.target);
     327                var link_id = target.parent().attr('id').split('-');
     328                var a_id = link_id[3];
     329                var type = link_id[0]; /* activity or acomment */
     330
     331                var inner_class = type == 'acomment' ? 'acomment-content' : 'activity-inner';
     332                var a_inner = jq('li#' + type + '-' + a_id + ' .' + inner_class + ':first' );
     333                jq(target).addClass('loading');
     334
     335                jq.post( ajaxurl, {
     336                        action: 'get_single_activity_content',
     337                        'activity_id': a_id
     338                },
     339                function(response) {
     340                        jq(a_inner).slideUp(300).html(response).slideDown(300);
     341                });
     342
     343                return false;
     344        });
     345
     346        /**** Activity Comments *******************************************************/
     347
     348        /* Hide all activity comment forms */
     349        jq('form.ac-form').hide();
     350
     351        /* Hide excess comments */
     352        if ( jq('.activity-comments').length )
     353                bp_dtheme_hide_comments();
     354
     355        /* Activity list event delegation */
     356        jq('div.activity').click( function(event) {
     357                var target = jq(event.target);
     358
     359                /* Comment / comment reply links */
     360                if ( target.hasClass('acomment-reply') || target.parent().hasClass('acomment-reply') ) {
     361                        if ( target.parent().hasClass('acomment-reply') )
     362                                target = target.parent();
     363
     364                        var id = target.attr('id');
     365                        ids = id.split('-');
     366
     367                        var a_id = ids[2]
     368                        var c_id = target.attr('href').substr( 10, target.attr('href').length );
     369                        var form = jq( '#ac-form-' + a_id );
     370
     371                        form.css( 'display', 'none' );
     372                        form.removeClass('root');
     373                        jq('.ac-form').hide();
     374
     375                        /* Hide any error messages */
     376                        form.children('div').each( function() {
     377                                if ( jq(this).hasClass( 'error' ) )
     378                                        jq(this).hide();
     379                        });
     380
     381                        if ( ids[1] != 'comment' ) {
     382                                jq('.activity-comments li#acomment-' + c_id).append( form );
     383                        } else {
     384                                jq('li#activity-' + a_id + ' .activity-comments').append( form );
     385                        }
     386
     387                        if ( form.parent().hasClass( 'activity-comments' ) )
     388                                form.addClass('root');
     389
     390                        form.slideDown( 200 );
     391                        jq.scrollTo( form, 500, {
     392                                offset:-100,
     393                                easing:'easeOutQuad'
     394                        } );
     395                        jq('#ac-form-' + ids[2] + ' textarea').focus();
     396
     397                        return false;
     398                }
     399
     400                /* Activity comment posting */
     401                if ( target.attr('name') == 'ac_form_submit' ) {
     402                        var form = target.parent().parent();
     403                        var form_parent = form.parent();
     404                        var form_id = form.attr('id').split('-');
     405
     406                        if ( !form_parent.hasClass('activity-comments') ) {
     407                                var tmp_id = form_parent.attr('id').split('-');
     408                                var comment_id = tmp_id[1];
     409                        } else {
     410                                var comment_id = form_id[2];
     411                        }
     412
     413                        /* Hide any error messages */
     414                        jq( 'form#' + form + ' div.error').hide();
     415                        target.addClass('loading').prop('disabled', true);
     416
     417                        var ajaxdata = {
     418                                action: 'new_activity_comment',
     419                                'cookie': encodeURIComponent(document.cookie),
     420                                '_wpnonce_new_activity_comment': jq("input#_wpnonce_new_activity_comment").val(),
     421                                'comment_id': comment_id,
     422                                'form_id': form_id[2],
     423                                'content': jq('form#' + form.attr('id') + ' textarea').val()
     424                        };
     425
     426                        // Akismet
     427                        var ak_nonce = jq('#_bp_as_nonce_' + comment_id).val();
     428                        if ( ak_nonce ) {
     429                                ajaxdata['_bp_as_nonce_' + comment_id] = ak_nonce;
     430                        }
     431
     432                        jq.post( ajaxurl, ajaxdata,
     433                                function(response)
     434                                {
     435                                        target.removeClass('loading');
     436
     437                                        /* Check for errors and append if found. */
     438                                        if ( response[0] + response[1] == '-1' ) {
     439                                                form.append( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
     440                                        } else {
     441                                                form.fadeOut( 200,
     442                                                        function() {
     443                                                                if ( 0 == form.parent().children('ul').length ) {
     444                                                                        if ( form.parent().hasClass('activity-comments') )
     445                                                                                form.parent().prepend('<ul></ul>');
     446                                                                        else
     447                                                                                form.parent().append('<ul></ul>');
     448                                                                }
     449
     450                                                                form.parent().children('ul').append(response).hide().fadeIn( 200 );
     451                                                                form.children('textarea').val('');
     452                                                                form.parent().parent().addClass('has-comments');
     453                                                        }
     454                                                        );
     455                                                jq( 'form#' + form + ' textarea').val('');
     456
     457                                                /* Increase the "Reply (X)" button count */
     458                                                jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 );
     459                                        }
     460
     461                                        jq(target).prop("disabled", false);
     462                                });
     463
     464                        return false;
     465                }
     466
     467                /* Deleting an activity comment */
     468                if ( target.hasClass('acomment-delete') ) {
     469                        var link_href = target.attr('href');
     470                        var comment_li = target.parent().parent();
     471                        var form = comment_li.parents('div.activity-comments').children('form');
     472
     473                        var nonce = link_href.split('_wpnonce=');
     474                        nonce = nonce[1];
     475
     476                        var comment_id = link_href.split('cid=');
     477                        comment_id = comment_id[1].split('&');
     478                        comment_id = comment_id[0];
     479
     480                        target.addClass('loading');
     481
     482                        /* Remove any error messages */
     483                        jq('.activity-comments ul .error').remove();
     484
     485                        /* Reset the form position */
     486                        comment_li.parents('.activity-comments').append(form);
     487
     488                        jq.post( ajaxurl, {
     489                                action: 'delete_activity_comment',
     490                                'cookie': encodeURIComponent(document.cookie),
     491                                '_wpnonce': nonce,
     492                                'id': comment_id
     493                        },
     494                        function(response)
     495                        {
     496                                /* Check for errors and append if found. */
     497                                if ( response[0] + response[1] == '-1' ) {
     498                                        comment_li.prepend( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
     499                                } else {
     500                                        var children = jq( 'li#' + comment_li.attr('id') + ' ul' ).children('li');
     501                                        var child_count = 0;
     502                                        jq(children).each( function() {
     503                                                if ( !jq(this).is(':hidden') )
     504                                                        child_count++;
     505                                        });
     506                                        comment_li.fadeOut(200);
     507
     508                                        /* Decrease the "Reply (X)" button count */
     509                                        var count_span = jq('li#' + comment_li.parents('ul#activity-stream > li').attr('id') + ' a.acomment-reply span');
     510                                        var new_count = count_span.html() - ( 1 + child_count );
     511                                        count_span.html(new_count);
     512
     513                                        /* If that was the last comment for the item, remove the has-comments class to clean up the styling */
     514                                        if ( 0 == new_count ) {
     515                                                jq(comment_li.parents('ul#activity-stream > li')).removeClass('has-comments');
     516                                        }
     517                                }
     518                        });
     519
     520                        return false;
     521                }
     522
     523                // Spam an activity stream comment
     524                if ( target.hasClass( 'spam-activity-comment' ) ) {
     525                        var link_href  = target.attr( 'href' );
     526                        var comment_li = target.parent().parent();
     527
     528                        target.addClass('loading');
     529
     530                        // Remove any error messages
     531                        jq( '.activity-comments ul div.error' ).remove();
     532
     533                        // Reset the form position
     534                        comment_li.parents( '.activity-comments' ).append( comment_li.parents( '.activity-comments' ).children( 'form' ) );
     535
     536                        jq.post( ajaxurl, {
     537                                action: 'bp_spam_activity_comment',
     538                                'cookie': encodeURIComponent( document.cookie ),
     539                                '_wpnonce': link_href.split( '_wpnonce=' )[1],
     540                                'id': link_href.split( 'cid=' )[1].split( '&' )[0]
     541                        },
     542
     543                        function ( response ) {
     544                                // Check for errors and append if found.
     545                                if ( response[0] + response[1] == '-1' ) {
     546                                        comment_li.prepend( response.substr( 2, response.length ) ).hide().fadeIn( 200 );
     547
     548                                } else {
     549                                        var children = jq( 'li#' + comment_li.attr( 'id' ) + ' ul' ).children( 'li' );
     550                                        var child_count = 0;
     551                                        jq(children).each( function() {
     552                                                if ( !jq( this ).is( ':hidden' ) ) {
     553                                                        child_count++;
     554                                                }
     555                                        });
     556                                        comment_li.fadeOut( 200 );
     557
     558                                        // Decrease the "Reply (X)" button count
     559                                        var parent_li = comment_li.parents( 'ul#activity-stream > li' );
     560                                        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 ) );
     561                                }
     562                        });
     563
     564                        return false;
     565                }
     566
     567                /* Showing hidden comments - pause for half a second */
     568                if ( target.parent().hasClass('show-all') ) {
     569                        target.parent().addClass('loading');
     570
     571                        setTimeout( function() {
     572                                target.parent().parent().children('li').fadeIn(200, function() {
     573                                        target.parent().remove();
     574                                });
     575                        }, 600 );
     576
     577                        return false;
     578                }
     579        });
     580
     581        /* Escape Key Press for cancelling comment forms */
     582        jq(document).keydown( function(e) {
     583                e = e || window.event;
     584                if (e.target)
     585                        element = e.target;
     586                else if (e.srcElement)
     587                        element = e.srcElement;
     588
     589                if( element.nodeType == 3)
     590                        element = element.parentNode;
     591
     592                if( e.ctrlKey == true || e.altKey == true || e.metaKey == true )
     593                        return;
     594
     595                var keyCode = (e.keyCode) ? e.keyCode : e.which;
     596
     597                if ( keyCode == 27 ) {
     598                        if (element.tagName == 'TEXTAREA') {
     599                                if ( jq(element).hasClass('ac-input') )
     600                                        jq(element).parent().parent().parent().slideUp( 200 );
     601                        }
     602                }
     603        });
     604
     605        /**** Directory Search ****************************************************/
     606
     607        /* The search form on all directory pages */
     608        jq('.dir-search').click( function(event) {
     609                if ( jq(this).hasClass('no-ajax') )
     610                        return;
     611
     612                var target = jq(event.target);
     613
     614                if ( target.attr('type') == 'submit' ) {
     615                        var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' );
     616                        var object = css_id[0];
     617
     618                        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') );
     619
     620                        return false;
     621                }
     622        });
     623
     624        /**** Tabs and Filters ****************************************************/
     625
     626        /* When a navigation tab is clicked - e.g. | All Groups | My Groups | */
     627        jq('div.item-list-tabs').click( function(event) {
     628                if ( jq(this).hasClass('no-ajax') )
     629                        return;
     630
     631                var target = jq(event.target).parent();
     632
     633                if ( 'LI' == event.target.parentNode.nodeName && !target.hasClass('last') ) {
     634                        var css_id = target.attr('id').split( '-' );
     635                        var object = css_id[0];
     636
     637                        if ( 'activity' == object )
     638                                return false;
     639
     640                        var scope = css_id[1];
     641                        var filter = jq("#" + object + "-order-select select").val();
     642                        var search_terms = jq("#" + object + "_search").val();
     643
     644                        bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') );
     645
     646                        return false;
     647                }
     648        });
     649
     650        /* When the filter select box is changed re-query */
     651        jq('li.filter select').change( function() {
     652                if ( jq('.item-list-tabs li.selected').length )
     653                        var el = jq('.item-list-tabs li.selected');
     654                else
     655                        var el = jq(this);
     656
     657                var css_id = el.attr('id').split('-');
     658                var object = css_id[0];
     659                var scope = css_id[1];
     660                var filter = jq(this).val();
     661                var search_terms = false;
     662
     663                if ( jq('.dir-search input').length )
     664                        search_terms = jq('.dir-search input').val();
     665
     666                if ( 'friends' == object )
     667                        object = 'members';
     668
     669                bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') );
     670
     671                return false;
     672        });
     673
     674        /* All pagination links run through this function */
     675        jq('div#content').click( function(event) {
     676                var target = jq(event.target);
     677
     678                if ( target.hasClass('button') )
     679                        return true;
     680
     681                if ( target.parent().parent().hasClass('pagination') && !target.parent().parent().hasClass('no-ajax') ) {
     682                        if ( target.hasClass('dots') || target.hasClass('current') )
     683                                return false;
     684
     685                        if ( jq('.item-list-tabs li.selected').length )
     686                                var el = jq('.item-list-tabs li.selected');
     687                        else
     688                                var el = jq('li.filter select');
     689
     690                        var page_number = 1;
     691                        var css_id = el.attr('id').split( '-' );
     692                        var object = css_id[0];
     693                        var search_terms = false;
     694
     695                        if ( jq('div.dir-search input').length )
     696                                search_terms = jq('.dir-search input').val();
     697
     698                        if ( jq(target).hasClass('next') )
     699                                var page_number = Number( jq('.pagination span.current').html() ) + 1;
     700                        else if ( jq(target).hasClass('prev') )
     701                                var page_number = Number( jq('.pagination span.current').html() ) - 1;
     702                        else
     703                                var page_number = Number( jq(target).html() );
     704
     705                        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') );
     706
     707                        return false;
     708                }
     709
     710        });
     711
     712        /**** New Forum Directory Post **************************************/
     713
     714        /* Hit the "New Topic" button on the forums directory page */
     715        jq('a.show-hide-new').click( function() {
     716                if ( !jq('#new-topic-post').length )
     717                        return false;
     718
     719                if ( jq('#new-topic-post').is(":visible") )
     720                        jq('#new-topic-post').slideUp(200);
     721                else
     722                        jq('#new-topic-post').slideDown(200, function() {
     723                                jq('#topic_title').focus();
     724                        } );
     725
     726                return false;
     727        });
     728
     729        /* Cancel the posting of a new forum topic */
     730        jq('input#submit_topic_cancel').click( function() {
     731                if ( !jq('#new-topic-post').length )
     732                        return false;
     733
     734                jq('#new-topic-post').slideUp(200);
     735                return false;
     736        });
     737
     738        /* Clicking a forum tag */
     739        jq('#forum-directory-tags a').click( function() {
     740                bp_filter_request( 'forums', 'tags', jq.cookie('bp-forums-scope'), 'div.forums', jq(this).html().replace( /&nbsp;/g, '-' ), 1, jq.cookie('bp-forums-extras') );
     741                return false;
     742        });
     743
     744        /** Invite Friends Interface ****************************************/
     745
     746        /* Select a user from the list of friends and add them to the invite list */
     747        jq("div#invite-list input").click( function() {
     748                jq('.ajax-loader').toggle();
     749
     750                var friend_id = jq(this).val();
     751
     752                if ( jq(this).prop('checked') == true )
     753                        var friend_action = 'invite';
     754                else
     755                        var friend_action = 'uninvite';
     756
     757                jq('.item-list-tabs li.selected').addClass('loading');
     758
     759                jq.post( ajaxurl, {
     760                        action: 'groups_invite_user',
     761                        'friend_action': friend_action,
     762                        'cookie': encodeURIComponent(document.cookie),
     763                        '_wpnonce': jq("input#_wpnonce_invite_uninvite_user").val(),
     764                        'friend_id': friend_id,
     765                        'group_id': jq("input#group_id").val()
     766                },
     767                function(response)
     768                {
     769                        if ( jq("#message") )
     770                                jq("#message").hide();
     771
     772                        jq('.ajax-loader').toggle();
     773
     774                        if ( friend_action == 'invite' ) {
     775                                jq('#friend-list').append(response);
     776                        } else if ( friend_action == 'uninvite' ) {
     777                                jq('#friend-list li#uid-' + friend_id).remove();
     778                        }
     779
     780                        jq('.item-list-tabs li.selected').removeClass('loading');
     781                });
     782        });
     783
     784        /* Remove a user from the list of users to invite to a group */
     785        jq("#friend-list li a.remove").live('click', function() {
     786                jq('.ajax-loader').toggle();
     787
     788                var friend_id = jq(this).attr('id');
     789                friend_id = friend_id.split('-');
     790                friend_id = friend_id[1];
     791
     792                jq.post( ajaxurl, {
     793                        action: 'groups_invite_user',
     794                        'friend_action': 'uninvite',
     795                        'cookie': encodeURIComponent(document.cookie),
     796                        '_wpnonce': jq("input#_wpnonce_invite_uninvite_user").val(),
     797                        'friend_id': friend_id,
     798                        'group_id': jq("input#group_id").val()
     799                },
     800                function(response)
     801                {
     802                        jq('.ajax-loader').toggle();
     803                        jq('#friend-list li#uid-' + friend_id).remove();
     804                        jq('#invite-list input#f-' + friend_id).prop('checked', false);
     805                });
     806
     807                return false;
     808        });
     809
     810        /** Profile Visibility Settings *********************************/
     811        jq('.field-visibility-settings').hide();
     812        jq('.visibility-toggle-link').on( 'click', function() {
     813                var toggle_div = jq(this).parent();
     814               
     815                jq(toggle_div).fadeOut( 600, function(){
     816                        jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
     817                });
     818               
     819                return false;
     820        } );
     821
     822        jq('.field-visibility-settings-close').on( 'click', function() {
     823                var settings_div = jq(this).parent();
     824               
     825                jq(settings_div).slideUp( 400, function(){
     826                        jq(settings_div).siblings('.field-visibility-settings-toggle').fadeIn(800);
     827                });
     828               
     829                return false;
     830        } );
     831
     832
     833        /** Friendship Requests **************************************/
     834
     835        /* Accept and Reject friendship request buttons */
     836        jq("ul#friend-list a.accept, ul#friend-list a.reject").click( function() {
     837                var button = jq(this);
     838                var li = jq(this).parents('ul#friend-list li');
     839                var action_div = jq(this).parents('li div.action');
     840
     841                var id = li.attr('id').substr( 11, li.attr('id').length );
     842                var link_href = button.attr('href');
     843
     844                var nonce = link_href.split('_wpnonce=');
     845                nonce = nonce[1];
     846
     847                if ( jq(this).hasClass('accepted') || jq(this).hasClass('rejected') )
     848                        return false;
     849
     850                if ( jq(this).hasClass('accept') ) {
     851                        var action = 'accept_friendship';
     852                        action_div.children('a.reject').css( 'visibility', 'hidden' );
     853                } else {
     854                        var action = 'reject_friendship';
     855                        action_div.children('a.accept').css( 'visibility', 'hidden' );
     856                }
     857
     858                button.addClass('loading');
     859
     860                jq.post( ajaxurl, {
     861                        action: action,
     862                        'cookie': encodeURIComponent(document.cookie),
     863                        'id': id,
     864                        '_wpnonce': nonce
     865                },
     866                function(response) {
     867                        button.removeClass('loading');
     868
     869                        if ( response[0] + response[1] == '-1' ) {
     870                                li.prepend( response.substr( 2, response.length ) );
     871                                li.children('div#message').hide().fadeIn(200);
     872                        } else {
     873                                button.fadeOut( 100, function() {
     874                                        if ( jq(this).hasClass('accept') ) {
     875                                                action_div.children('a.reject').hide();
     876                                                jq(this).html( BP_DTheme.accepted ).fadeIn(50);
     877                                                jq(this).addClass('accepted');
     878                                        } else {
     879                                                action_div.children('a.accept').hide();
     880                                                jq(this).html( BP_DTheme.rejected ).fadeIn(50);
     881                                                jq(this).addClass('rejected');
     882                                        }
     883                                });
     884                        }
     885                });
     886
     887                return false;
     888        });
     889
     890        /* Add / Remove friendship buttons */
     891        jq(".friendship-button a").live('click', function() {
     892                jq(this).parent().addClass('loading');
     893                var fid = jq(this).attr('id');
     894                fid = fid.split('-');
     895                fid = fid[1];
     896
     897                var nonce = jq(this).attr('href');
     898                nonce = nonce.split('?_wpnonce=');
     899                nonce = nonce[1].split('&');
     900                nonce = nonce[0];
     901
     902                var thelink = jq(this);
     903
     904                jq.post( ajaxurl, {
     905                        action: 'addremove_friend',
     906                        'cookie': encodeURIComponent(document.cookie),
     907                        'fid': fid,
     908                        '_wpnonce': nonce
     909                },
     910                function(response)
     911                {
     912                        var action = thelink.attr('rel');
     913                        var parentdiv = thelink.parent();
     914
     915                        if ( action == 'add' ) {
     916                                jq(parentdiv).fadeOut(200,
     917                                        function() {
     918                                                parentdiv.removeClass('add_friend');
     919                                                parentdiv.removeClass('loading');
     920                                                parentdiv.addClass('pending_friend');
     921                                                parentdiv.fadeIn(200).html(response);
     922                                        }
     923                                        );
     924
     925                        } else if ( action == 'remove' ) {
     926                                jq(parentdiv).fadeOut(200,
     927                                        function() {
     928                                                parentdiv.removeClass('remove_friend');
     929                                                parentdiv.removeClass('loading');
     930                                                parentdiv.addClass('add');
     931                                                parentdiv.fadeIn(200).html(response);
     932                                        }
     933                                        );
     934                        }
     935                });
     936                return false;
     937        } );
     938
     939        /** Group Join / Leave Buttons **************************************/
     940
     941        jq(".group-button a").live('click', function() {
     942                var gid = jq(this).parent().attr('id');
     943                gid = gid.split('-');
     944                gid = gid[1];
     945
     946                var nonce = jq(this).attr('href');
     947                nonce = nonce.split('?_wpnonce=');
     948                nonce = nonce[1].split('&');
     949                nonce = nonce[0];
     950
     951                var thelink = jq(this);
     952
     953                jq.post( ajaxurl, {
     954                        action: 'joinleave_group',
     955                        'cookie': encodeURIComponent(document.cookie),
     956                        'gid': gid,
     957                        '_wpnonce': nonce
     958                },
     959                function(response)
     960                {
     961                        var parentdiv = thelink.parent();
     962
     963                        if ( !jq('body.directory').length )
     964                                location.href = location.href;
     965                        else {
     966                                jq(parentdiv).fadeOut(200,
     967                                        function() {
     968                                                parentdiv.fadeIn(200).html(response);
     969                                        }
     970                                        );
     971                        }
     972                });
     973                return false;
     974        } );
     975
     976        /** Button disabling ************************************************/
     977
     978        jq('.pending').click(function() {
     979                return false;
     980        });
     981
     982        /** Private Messaging ******************************************/
     983
     984        /** Message search*/
     985        jq('.message-search').click( function(event) {
     986                if ( jq(this).hasClass('no-ajax') )
     987                        return;
     988
     989                var target = jq(event.target);
     990
     991                if ( target.attr('type') == 'submit' ) {
     992                        //var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' );
     993                        var object = 'messages';
     994
     995                        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') );
     996
     997                        return false;
     998                }
     999        });
     1000
     1001        /* AJAX send reply functionality */
     1002        jq("input#send_reply_button").click(
     1003                function() {
     1004                        var order = jq('#messages_order').val() || 'ASC',
     1005                        offset = jq('#message-recipients').offset();
     1006
     1007                        var button = jq("input#send_reply_button");
     1008                        jq(button).addClass('loading');
     1009
     1010                        jq.post( ajaxurl, {
     1011                                action: 'messages_send_reply',
     1012                                'cookie': encodeURIComponent(document.cookie),
     1013                                '_wpnonce': jq("input#send_message_nonce").val(),
     1014
     1015                                'content': jq("#message_content").val(),
     1016                                'send_to': jq("input#send_to").val(),
     1017                                'subject': jq("input#subject").val(),
     1018                                'thread_id': jq("input#thread_id").val()
     1019                        },
     1020                        function(response)
     1021                        {
     1022                                if ( response[0] + response[1] == "-1" ) {
     1023                                        jq('form#send-reply').prepend( response.substr( 2, response.length ) );
     1024                                } else {
     1025                                        jq('form#send-reply div#message').remove();
     1026                                        jq("#message_content").val('');
     1027
     1028                                        if ( 'ASC' == order ) {
     1029                                                jq('form#send-reply').before( response );
     1030                                        } else {
     1031                                                jq('#message-recipients').after( response );
     1032                                                jq(window).scrollTop(offset.top);
     1033                                        }
     1034
     1035                                        jq(".new-message").hide().slideDown( 200, function() {
     1036                                                jq('.new-message').removeClass('new-message');
     1037                                        });
     1038                                }
     1039                                jq(button).removeClass('loading');
     1040                        });
     1041
     1042                        return false;
     1043                }
     1044        );
     1045
     1046        /* Marking private messages as read and unread */
     1047        jq("a#mark_as_read, a#mark_as_unread").click(function() {
     1048                var checkboxes_tosend = '';
     1049                var checkboxes = jq("#message-threads tr td input[type='checkbox']");
     1050
     1051                if ( 'mark_as_unread' == jq(this).attr('id') ) {
     1052                        var currentClass = 'read'
     1053                        var newClass = 'unread'
     1054                        var unreadCount = 1;
     1055                        var inboxCount = 0;
     1056                        var unreadCountDisplay = 'inline';
     1057                        var action = 'messages_markunread';
     1058                } else {
     1059                        var currentClass = 'unread'
     1060                        var newClass = 'read'
     1061                        var unreadCount = 0;
     1062                        var inboxCount = 1;
     1063                        var unreadCountDisplay = 'none';
     1064                        var action = 'messages_markread';
     1065                }
     1066
     1067                checkboxes.each( function(i) {
     1068                        if(jq(this).is(':checked')) {
     1069                                if ( jq('tr#m-' + jq(this).attr('value')).hasClass(currentClass) ) {
     1070                                        checkboxes_tosend += jq(this).attr('value');
     1071                                        jq('tr#m-' + jq(this).attr('value')).removeClass(currentClass);
     1072                                        jq('tr#m-' + jq(this).attr('value')).addClass(newClass);
     1073                                        var thread_count = jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').html();
     1074
     1075                                        jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').html(unreadCount);
     1076                                        jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay);
     1077
     1078                                        var inboxcount = jq('tr.unread').length;
     1079
     1080                                        jq('a#user-messages span').html( inboxcount );
     1081
     1082                                        if ( i != checkboxes.length - 1 ) {
     1083                                                checkboxes_tosend += ','
     1084                                        }
     1085                                }
     1086                        }
     1087                });
     1088                jq.post( ajaxurl, {
     1089                        action: action,
     1090                        'thread_ids': checkboxes_tosend
     1091                });
     1092                return false;
     1093        });
     1094
     1095        /* Selecting unread and read messages in inbox */
     1096        jq("select#message-type-select").change(
     1097                function() {
     1098                        var selection = jq("select#message-type-select").val();
     1099                        var checkboxes = jq("td input[type='checkbox']");
     1100                        checkboxes.each( function(i) {
     1101                                checkboxes[i].checked = "";
     1102                        });
     1103
     1104                        switch(selection) {
     1105                                case 'unread':
     1106                                        var checkboxes = jq("tr.unread td input[type='checkbox']");
     1107                                        break;
     1108                                case 'read':
     1109                                        var checkboxes = jq("tr.read td input[type='checkbox']");
     1110                                        break;
     1111                        }
     1112                        if ( selection != '' ) {
     1113                                checkboxes.each( function(i) {
     1114                                        checkboxes[i].checked = "checked";
     1115                                });
     1116                        } else {
     1117                                checkboxes.each( function(i) {
     1118                                        checkboxes[i].checked = "";
     1119                                });
     1120                        }
     1121                }
     1122        );
     1123
     1124        /* Bulk delete messages */
     1125        jq("a#delete_inbox_messages, a#delete_sentbox_messages").click( function() {
     1126                checkboxes_tosend = '';
     1127                checkboxes = jq("#message-threads tr td input[type='checkbox']");
     1128
     1129                jq('div#message').remove();
     1130                jq(this).addClass('loading');
     1131
     1132                jq(checkboxes).each( function(i) {
     1133                        if( jq(this).is(':checked') )
     1134                                checkboxes_tosend += jq(this).attr('value') + ',';
     1135                });
     1136
     1137                if ( '' == checkboxes_tosend ) {
     1138                        jq(this).removeClass('loading');
     1139                        return false;
     1140                }
     1141
     1142                jq.post( ajaxurl, {
     1143                        action: 'messages_delete',
     1144                        'thread_ids': checkboxes_tosend
     1145                }, function(response) {
     1146                        if ( response[0] + response[1] == "-1" ) {
     1147                                jq('#message-threads').prepend( response.substr( 2, response.length ) );
     1148                        } else {
     1149                                jq('#message-threads').before( '<div id="message" class="updated"><p>' + response + '</p></div>' );
     1150
     1151                                jq(checkboxes).each( function(i) {
     1152                                        if( jq(this).is(':checked') )
     1153                                                jq(this).parent().parent().fadeOut(150);
     1154                                });
     1155                        }
     1156
     1157                        jq('div#message').hide().slideDown(150);
     1158                        jq("a#delete_inbox_messages, a#delete_sentbox_messages").removeClass('loading');
     1159                });
     1160                return false;
     1161        });
     1162
     1163        /* Close site wide notices in the sidebar */
     1164        jq("a#close-notice").click( function() {
     1165                jq(this).addClass('loading');
     1166                jq('div#sidebar div.error').remove();
     1167
     1168                jq.post( ajaxurl, {
     1169                        action: 'messages_close_notice',
     1170                        'notice_id': jq('.notice').attr('rel').substr( 2, jq('.notice').attr('rel').length )
     1171                },
     1172                function(response) {
     1173                        jq("a#close-notice").removeClass('loading');
     1174
     1175                        if ( response[0] + response[1] == '-1' ) {
     1176                                jq('.notice').prepend( response.substr( 2, response.length ) );
     1177                                jq( 'div#sidebar div.error').hide().fadeIn( 200 );
     1178                        } else {
     1179                                jq('.notice').slideUp( 100 );
     1180                        }
     1181                });
     1182                return false;
     1183        });
     1184
     1185        /* Toolbar & wp_list_pages Javascript IE6 hover class */
     1186        jq("#wp-admin-bar ul.main-nav li, #nav li").mouseover( function() {
     1187                jq(this).addClass('sfhover');
     1188        });
     1189
     1190        jq("#wp-admin-bar ul.main-nav li, #nav li").mouseout( function() {
     1191                jq(this).removeClass('sfhover');
     1192        });
     1193
     1194        /* Clear BP cookies on logout */
     1195        jq('a.logout').click( function() {
     1196                jq.cookie('bp-activity-scope', null, {
     1197                        path: '/'
     1198                });
     1199                jq.cookie('bp-activity-filter', null, {
     1200                        path: '/'
     1201                });
     1202                jq.cookie('bp-activity-oldestpage', null, {
     1203                        path: '/'
     1204                });
     1205
     1206                var objects = [ 'members', 'groups', 'blogs', 'forums' ];
     1207                jq(objects).each( function(i) {
     1208                        jq.cookie('bp-' + objects[i] + '-scope', null, {
     1209                                path: '/'
     1210                        } );
     1211                        jq.cookie('bp-' + objects[i] + '-filter', null, {
     1212                                path: '/'
     1213                        } );
     1214                        jq.cookie('bp-' + objects[i] + '-extras', null, {
     1215                                path: '/'
     1216                        } );
     1217                });
     1218        });
     1219});
     1220
     1221/* Setup activity scope and filter based on the current cookie settings. */
     1222function bp_init_activity() {
     1223        /* Reset the page */
     1224        jq.cookie( 'bp-activity-oldestpage', 1, {
     1225                path: '/'
     1226        } );
     1227
     1228        if ( null != jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length )
     1229                jq('#activity-filter-select select option[value="' + jq.cookie('bp-activity-filter') + '"]').prop( 'selected', true );
     1230
     1231        /* Activity Tab Set */
     1232        if ( null != jq.cookie('bp-activity-scope') && jq('.activity-type-tabs').length ) {
     1233                jq('.activity-type-tabs li').each( function() {
     1234                        jq(this).removeClass('selected');
     1235                });
     1236                jq('li#activity-' + jq.cookie('bp-activity-scope') + ', .item-list-tabs li.current').addClass('selected');
     1237        }
     1238}
     1239
     1240/* Setup object scope and filter based on the current cookie settings for the object. */
     1241function bp_init_objects(objects) {
     1242        jq(objects).each( function(i) {
     1243                if ( null != jq.cookie('bp-' + objects[i] + '-filter') && jq('li#' + objects[i] + '-order-select select').length )
     1244                        jq('li#' + objects[i] + '-order-select select option[value="' + jq.cookie('bp-' + objects[i] + '-filter') + '"]').prop( 'selected', true );
     1245
     1246                if ( null != jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
     1247                        jq('.item-list-tabs li').each( function() {
     1248                                jq(this).removeClass('selected');
     1249                        });
     1250                        jq('.item-list-tabs li#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', div.item-list-tabs#object-nav li.current').addClass('selected');
     1251                }
     1252        });
     1253}
     1254
     1255/* Filter the current content list (groups/members/blogs/topics) */
     1256function bp_filter_request( object, filter, scope, target, search_terms, page, extras ) {
     1257        if ( 'activity' == object )
     1258                return false;
     1259
     1260        if ( jq.query.get('s') && !search_terms )
     1261                search_terms = jq.query.get('s');
     1262
     1263        if ( null == scope )
     1264                scope = 'all';
     1265
     1266        /* Save the settings we want to remain persistent to a cookie */
     1267        jq.cookie( 'bp-' + object + '-scope', scope, {
     1268                path: '/'
     1269        } );
     1270        jq.cookie( 'bp-' + object + '-filter', filter, {
     1271                path: '/'
     1272        } );
     1273        jq.cookie( 'bp-' + object + '-extras', extras, {
     1274                path: '/'
     1275        } );
     1276
     1277        /* Set the correct selected nav and filter */
     1278        jq('.item-list-tabs li').each( function() {
     1279                jq(this).removeClass('selected');
     1280        });
     1281        jq('.item-list-tabs li#' + object + '-' + scope + ', .item-list-tabs#object-nav li.current').addClass('selected');
     1282        jq('.item-list-tabs li.selected').addClass('loading');
     1283        jq('.item-list-tabs select option[value="' + filter + '"]').prop( 'selected', true );
     1284
     1285        if ( 'friends' == object )
     1286                object = 'members';
     1287
     1288        if ( bp_ajax_request )
     1289                bp_ajax_request.abort();
     1290
     1291        bp_ajax_request = jq.post( ajaxurl, {
     1292                action: object + '_filter',
     1293                'cookie': encodeURIComponent(document.cookie),
     1294                'object': object,
     1295                'filter': filter,
     1296                'search_terms': search_terms,
     1297                'scope': scope,
     1298                'page': page,
     1299                'extras': extras
     1300        },
     1301        function(response)
     1302        {
     1303                jq(target).fadeOut( 100, function() {
     1304                        jq(this).html(response);
     1305                        jq(this).fadeIn(100);
     1306                });
     1307                jq('.item-list-tabs li.selected').removeClass('loading');
     1308        });
     1309}
     1310
     1311/* Activity Loop Requesting */
     1312function bp_activity_request(scope, filter) {
     1313        /* Save the type and filter to a session cookie */
     1314        jq.cookie( 'bp-activity-scope', scope, {
     1315                path: '/'
     1316        } );
     1317        jq.cookie( 'bp-activity-filter', filter, {
     1318                path: '/'
     1319        } );
     1320        jq.cookie( 'bp-activity-oldestpage', 1, {
     1321                path: '/'
     1322        } );
     1323
     1324        /* Remove selected and loading classes from tabs */
     1325        jq('.item-list-tabs li').each( function() {
     1326                jq(this).removeClass('selected loading');
     1327        });
     1328        /* Set the correct selected nav and filter */
     1329        jq('li#activity-' + scope + ', .item-list-tabs li.current').addClass('selected');
     1330        jq('#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading');
     1331        jq('#activity-filter-select select option[value="' + filter + '"]').prop( 'selected', true );
     1332
     1333        /* Reload the activity stream based on the selection */
     1334        jq('.widget_bp_activity_widget h2 span.ajax-loader').show();
     1335
     1336        if ( bp_ajax_request )
     1337                bp_ajax_request.abort();
     1338
     1339        bp_ajax_request = jq.post( ajaxurl, {
     1340                action: 'activity_widget_filter',
     1341                'cookie': encodeURIComponent(document.cookie),
     1342                '_wpnonce_activity_filter': jq("input#_wpnonce_activity_filter").val(),
     1343                'scope': scope,
     1344                'filter': filter
     1345        },
     1346        function(response)
     1347        {
     1348                jq('.widget_bp_activity_widget h2 span.ajax-loader').hide();
     1349
     1350                jq('div.activity').fadeOut( 100, function() {
     1351                        jq(this).html(response.contents);
     1352                        jq(this).fadeIn(100);
     1353
     1354                        /* Selectively hide comments */
     1355                        bp_dtheme_hide_comments();
     1356                });
     1357
     1358                /* Update the feed link */
     1359                if ( null != response.feed_url )
     1360                        jq('.directory #subnav li.feed a, .home-page #subnav li.feed a').attr('href', response.feed_url);
     1361
     1362                jq('.item-list-tabs li.selected').removeClass('loading');
     1363
     1364        }, 'json' );
     1365}
     1366
     1367/* Hide long lists of activity comments, only show the latest five root comments. */
     1368function bp_dtheme_hide_comments() {
     1369        var comments_divs = jq('div.activity-comments');
     1370
     1371        if ( !comments_divs.length )
     1372                return false;
     1373
     1374        comments_divs.each( function() {
     1375                if ( jq(this).children('ul').children('li').length < 5 ) return;
     1376
     1377                var comments_div = jq(this);
     1378                var parent_li = comments_div.parents('ul#activity-stream > li');
     1379                var comment_lis = jq(this).children('ul').children('li');
     1380                var comment_count = ' ';
     1381
     1382                if ( jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').length )
     1383                        var comment_count = jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html();
     1384
     1385                comment_lis.each( function(i) {
     1386                        /* Show the latest 5 root comments */
     1387                        if ( i < comment_lis.length - 5 ) {
     1388                                jq(this).addClass('hidden');
     1389                                jq(this).toggle();
     1390
     1391                                if ( !i )
     1392                                        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>' );
     1393                        }
     1394                });
     1395
     1396        });
     1397}
     1398
     1399/* Helper Functions */
     1400
     1401function checkAll() {
     1402        var checkboxes = document.getElementsByTagName("input");
     1403        for(var i=0; i<checkboxes.length; i++) {
     1404                if(checkboxes[i].type == "checkbox") {
     1405                        if($("check_all").checked == "") {
     1406                                checkboxes[i].checked = "";
     1407                        }
     1408                        else {
     1409                                checkboxes[i].checked = "checked";
     1410                        }
     1411                }
     1412        }
     1413}
     1414
     1415function clear(container) {
     1416        if( !document.getElementById(container) ) return;
     1417
     1418        var container = document.getElementById(container);
     1419
     1420        if ( radioButtons = container.getElementsByTagName('INPUT') ) {
     1421                for(var i=0; i<radioButtons.length; i++) {
     1422                        radioButtons[i].checked = '';
     1423                }
     1424        }
     1425
     1426        if ( options = container.getElementsByTagName('OPTION') ) {
     1427                for(var i=0; i<options.length; i++) {
     1428                        options[i].selected = false;
     1429                }
     1430        }
     1431
     1432        return;
     1433}
     1434
     1435/* ScrollTo plugin - just inline and minified */
     1436;(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);
     1437
     1438/* jQuery Easing Plugin, v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */
     1439jQuery.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}});
     1440
     1441/* jQuery Cookie plugin */
     1442jQuery.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;}};
     1443
     1444/* jQuery querystring plugin */
     1445eval(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,{}))
  • bp-xprofile/bp-xprofile-screens.php

     
    189189        bp_core_load_template( apply_filters( 'xprofile_template_change_avatar', 'members/single/home' ) );
    190190}
    191191
    192 ?>
     192/** Theme Compatability *******************************************************/
     193
     194/**
     195 * The main theme compat class for BuddyPress Profiles
     196 *
     197 * This class sets up the necessary theme compatability actions to safely output
     198 * group template parts to the_title and the_content areas of a theme.
     199 *
     200 * @since BuddyPress (1.7)
     201 */
     202class BP_XProfile_Theme_Compat {
     203
     204        /**
     205         * Setup the xprofile component theme compatibility
     206         *
     207         * @since BuddyPress (1.7)
     208         *
     209         * @todo is 'bp_screens' correct here?
     210         */
     211        public function __construct() {
     212                add_action( 'bp_setup_theme_compat', array( $this, 'is_xprofile' ) );
     213        }
     214
     215        /**
     216         * Are we looking at something that needs group theme compatability?
     217         *
     218         * @since BuddyPress (1.7)
     219         */
     220        public function is_xprofile() {
     221
     222                // Bail if not looking at a profile
     223                if ( ! bp_displayed_user_id() )
     224                        return;
     225
     226                // Creating a group
     227                add_action( 'bp_template_include_reset_dummy_post_data', array( $this, 'dummy_post'    ) );
     228                add_filter( 'bp_replace_the_content',                    array( $this, 'dummy_content' ) );
     229        }
     230
     231        /** Directory *************************************************************/
     232
     233        /**
     234         * Update the global $post with directory data
     235         *
     236         * @since BuddyPress (1.7)
     237         */
     238        public function dummy_post() {
     239                bp_theme_compat_reset_post( array(
     240                        'ID'             => 0,
     241                        'post_title'     => bp_get_displayed_user_fullname(),
     242                        'post_author'    => 0,
     243                        'post_date'      => 0,
     244                        'post_content'   => '',
     245                        'post_type'      => 'bp_xprofile',
     246                        'post_status'    => 'publish',
     247                        'is_archive'     => true,
     248                        'comment_status' => 'closed'
     249                ) );
     250        }
     251
     252        /**
     253         * Filter the_content with the groups index template part
     254         *
     255         * @since BuddyPress (1.7)
     256         */
     257        public function dummy_content() {
     258                bp_buffer_template_part( 'members/single/home' );
     259        }
     260}
     261new BP_XProfile_Theme_Compat();