Ticket #3741: 3741.patch

File 3741.patch, 281.8 KB (added by johnjamesjacoby, 10 months ago)

First Pass

  • 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_theme_setup',      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( 'bp_after_theme_setup', 'bp_load_theme_functions', 10 ); 
     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; 
    398  No newline at end of file 
     393                // Kill any other output after this. 
     394                exit(); 
     395 
     396        // No template found, so setup theme compatability 
     397        } else { 
     398                do_action( 'bp_setup_theme_compat' ); 
     399        } 
     400 No newline at end of file 
    399401} 
    400402 
  • 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_theme_setup' 
     168 */ 
     169function bp_after_theme_setup() { 
     170        do_action ( 'bp_after_theme_setup' ); 
     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 * @since BuddyPress (1.7) 
     1065 * 
     1066 * @package BuddyPress 
     1067 * @return bool True if it's a BuddyPress page, false otherwise 
     1068 */ 
     1069function is_buddypress() { 
     1070 
     1071        $retval = false; 
     1072 
     1073        // Generally, we can just check to see that there's no current component. 
     1074        // The one exception is single user home tabs, where $bp->current_component 
     1075        // is unset. Thus the addition of the bp_is_user() check. 
     1076        if ( bp_current_component() || bp_is_user() ) 
     1077                $retval = true; 
     1078 
     1079        return apply_filters( 'is_buddypress', $retval ); 
     1080} 
     1081 
     1082 No newline at end of file 
    10581083/** Components ****************************************************************/ 
    10591084 
    10601085function 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

     
    2020 
    2121                do_action( 'groups_directory_groups_setup' ); 
    2222 
    23                 bp_core_load_template( apply_filters( 'groups_template_directory_groups', 'groups/index' ) ); 
     23                bp_locate_template( apply_filters( 'groups_template_directory_groups', 'groups/index' ), true ); 
    2424        } 
    2525} 
    2626add_action( 'bp_screens', 'groups_directory_groups_setup', 2 ); 
     
    3838 
    3939        do_action( 'groups_screen_my_groups' ); 
    4040 
    41         bp_core_load_template( apply_filters( 'groups_template_my_groups', 'members/single/home' ) ); 
     41        bp_locate_template( apply_filters( 'groups_template_my_groups', 'members/single/home' ), true ); 
    4242} 
    4343 
    4444function groups_screen_group_invites() { 
     
    8484 
    8585        do_action( 'groups_screen_group_invites', $group_id ); 
    8686 
    87         bp_core_load_template( apply_filters( 'groups_template_group_invites', 'members/single/home' ) ); 
     87        bp_locate_template( apply_filters( 'groups_template_group_invites', 'members/single/home' ), true ); 
    8888} 
    8989 
    9090function groups_screen_group_home() { 
     
    100100 
    101101                do_action( 'groups_screen_group_home' ); 
    102102 
    103                 bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); 
     103                bp_locate_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ), true ); 
    104104        } 
    105105} 
    106106 
     
    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 ) ) { 
     
    273273                                        bp_core_redirect( bp_get_group_permalink( groups_get_current_group() ) . 'forum/topic/' . $topic_slug . '/' ); 
    274274                                } 
    275275 
    276                                 bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) ); 
     276                                bp_locate_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ), true ); 
    277277                        } 
    278278 
    279279                        // Delete a post 
     
    326326                                        bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars . '#post-' . $post_id ); 
    327327                                } 
    328328 
    329                                 bp_core_load_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ) ); 
     329                                bp_locate_template( apply_filters( 'groups_template_group_forum_topic_edit', 'groups/single/home' ), true ); 
    330330                        } 
    331331 
    332332                        // Standard topic display 
     
    334334                                if ( !empty( $user_is_banned ) ) 
    335335                                        bp_core_add_message( __( "You have been banned from this group.", 'buddypress' ) ); 
    336336 
    337                                 bp_core_load_template( apply_filters( 'groups_template_group_forum_topic', 'groups/single/home' ) ); 
     337                                bp_locate_template( apply_filters( 'groups_template_group_forum_topic', 'groups/single/home' ), true ); 
    338338                        } 
    339339 
    340340                // Forum topic does not exist 
     
    382382 
    383383                        do_action( 'groups_screen_group_forum', $topic_id, $forum_id ); 
    384384 
    385                         bp_core_load_template( apply_filters( 'groups_template_group_forum', 'groups/single/home' ) ); 
     385                        bp_locate_template( apply_filters( 'groups_template_group_forum', 'groups/single/home' ), true ); 
    386386                } 
    387387        } 
    388388} 
     
    395395                groups_update_groupmeta( $bp->groups->current_group->id, 'total_member_count', groups_get_total_member_count( $bp->groups->current_group->id ) ); 
    396396 
    397397                do_action( 'groups_screen_group_members', $bp->groups->current_group->id ); 
    398                 bp_core_load_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) ); 
     398                bp_locate_template( apply_filters( 'groups_template_group_members', 'groups/single/home' ) ); 
    399399        } 
    400400} 
    401401 
     
    422422 
    423423                } elseif ( !bp_action_variable( 0 ) ) { 
    424424                        // Show send invite page 
    425                         bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) ); 
     425                        bp_locate_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ), true ); 
    426426 
    427427                } else { 
    428428                        bp_do_404(); 
     
    453453 
    454454                do_action( 'groups_screen_group_request_membership', $bp->groups->current_group->id ); 
    455455 
    456                 bp_core_load_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ) ); 
     456                bp_locate_template( apply_filters( 'groups_template_group_request_membership', 'groups/single/home' ), true ); 
    457457        } 
    458458} 
    459459 
     
    465465 
    466466        $bp->is_single_item = true; 
    467467 
    468         bp_core_load_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ) ); 
     468        bp_locate_template( apply_filters( 'groups_template_group_home', 'groups/single/home' ), true ); 
    469469} 
    470470add_action( 'bp_screens', 'groups_screen_group_activity_permalink' ); 
    471471 
     
    505505 
    506506                        do_action( 'groups_screen_group_admin_edit_details', $bp->groups->current_group->id ); 
    507507 
    508                         bp_core_load_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ) ); 
     508                        bp_locate_template( apply_filters( 'groups_template_group_admin', 'groups/single/home' ), true ); 
    509509                } 
    510510        } 
    511511} 
     
    548548 
    549549                do_action( 'groups_screen_group_admin_settings', $bp->groups->current_group->id ); 
    550550 
    551                 bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) ); 
     551                bp_locate_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ), true ); 
    552552        } 
    553553} 
    554554add_action( 'bp_screens', 'groups_screen_group_admin_settings' ); 
     
    607607 
    608608                do_action( 'groups_screen_group_admin_avatar', $bp->groups->current_group->id ); 
    609609 
    610                 bp_core_load_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ) ); 
     610                bp_locate_template( apply_filters( 'groups_template_group_admin_avatar', 'groups/single/home' ), true ); 
    611611        } 
    612612} 
    613613add_action( 'bp_screens', 'groups_screen_group_admin_avatar' ); 
     
    727727 
    728728                do_action( 'groups_screen_group_admin_manage_members', $bp->groups->current_group->id ); 
    729729 
    730                 bp_core_load_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ) ); 
     730                bp_locate_template( apply_filters( 'groups_template_group_admin_manage_members', 'groups/single/home' ), true ); 
    731731        } 
    732732} 
    733733add_action( 'bp_screens', 'groups_screen_group_admin_manage_members' ); 
     
    776776                } 
    777777 
    778778                do_action( 'groups_screen_group_admin_requests', $bp->groups->current_group->id ); 
    779                 bp_core_load_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ) ); 
     779                bp_locate_template( apply_filters( 'groups_template_group_admin_requests', 'groups/single/home' ), true ); 
    780780        } 
    781781} 
    782782add_action( 'bp_screens', 'groups_screen_group_admin_requests' ); 
     
    812812 
    813813                do_action( 'groups_screen_group_admin_delete_group', $bp->groups->current_group->id ); 
    814814 
    815                 bp_core_load_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ) ); 
     815                bp_locate_template( apply_filters( 'groups_template_group_admin_delete_group', 'groups/single/home' ), true ); 
    816816        } 
    817817} 
    818818add_action( 'bp_screens', 'groups_screen_group_admin_delete_group' ); 
     
    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_screens', 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_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                $this->db_version_raw = 0; 
     272 
     273                /** Loading ***********************************************************/ 
     274 
     275                $this->maintenance_mode = ''; 
     276                $this->load_deprecated  = true; 
     277 
     278                /** Toolbar ***********************************************************/ 
     279 
     280                /** 
     281                 * @var string The primary toolbar ID 
     282                 */ 
     283                $this->my_account_menu_id = ''; 
     284 
     285                /** URI's *************************************************************/ 
     286 
     287                /** 
     288                 * @var int The current offset of the URI 
     289                 * @see bp_core_set_uri_globals() 
     290                 */ 
     291                $this->unfiltered_uri_offset = 0; 
     292 
     293                /** 
     294                 * @var bool Are status headers already sent? 
     295                 */ 
     296                $this->no_status_set = false; 
     297 
     298                /** Components ********************************************************/ 
     299 
     300                /** 
     301                 * @var string Name of the current BuddyPress component (primary) 
     302                 */ 
     303                $this->current_component = ''; 
     304 
     305                /** 
     306                 * @var string Name of the current BuddyPress item (secondary) 
     307                 */ 
     308                $this->current_item = ''; 
     309 
     310                /** 
     311                 * @var string Name of the current BuddyPress action (tertiary) 
     312                 */ 
     313                $this->current_action = ''; 
     314 
     315                /** 
     316                 * @var bool Displaying custom 2nd level navigation menu (I.E a group) 
     317                 */ 
     318                $this->is_single_item = false; 
     319         
    318320                /** Root **************************************************************/ 
    319321 
    320322                // BuddyPress Root blog ID 
     
    335337                // Languages 
    336338                $this->lang_dir   = $this->plugin_dir . 'bp-languages'; 
    337339 
     340                /** Theme Compat ******************************************************/ 
     341 
     342                $this->theme_compat   = new stdClass(); // Base theme compatibility class 
     343                $this->filters        = new stdClass(); // Used when adding/removing filters 
     344 
    338345                /** Users *************************************************************/ 
    339346 
    340347                $this->current_user       = new stdClass(); 
     
    367374                        $versions['1.2']        = get_site_option(                      'bp-core-db-version' ); 
    368375                        $versions['1.5-multi']  = get_site_option(                           'bp-db-version' ); 
    369376                        $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' ); 
     377                        $versions['1.5-single'] = get_blog_option( $this->root_blog_id,      'bp-db-version' ); 
    371378 
    372379                        // Remove empty array items 
    373380                        $versions             = array_filter( $versions ); 
     
    411418                // Not in maintenance mode 
    412419                if ( empty( $this->maintenance_mode ) ) { 
    413420 
     421                        // Theme compatability 
     422                        require( $this->plugin_dir . 'bp-core/bp-core-template-loader.php'     ); 
     423                        require( $this->plugin_dir . 'bp-core/bp-core-theme-compatability.php' ); 
     424 
    414425                        // Require all of the BuddyPress core libraries 
     426                        require( $this->plugin_dir . 'bp-core/bp-core-dependency.php' ); 
    415427                        require( $this->plugin_dir . 'bp-core/bp-core-actions.php'    ); 
    416428                        require( $this->plugin_dir . 'bp-core/bp-core-caps.php'       ); 
    417429                        require( $this->plugin_dir . 'bp-core/bp-core-cache.php'      ); 
     
    461473 
    462474                // Array of BuddyPress core actions 
    463475                $actions = array( 
     476                        'setup_theme',              // Setup the default theme compat 
    464477                        'setup_current_user',       // Setup currently logged in user 
    465478                        'register_post_types',      // Register post types 
    466479                        'register_post_statuses',   // Register post statuses 
    467480                        'register_taxonomies',      // Register taxonomies 
    468481                        'register_views',           // Register the views 
    469482                        'register_theme_directory', // Register the theme directory 
     483                        'register_theme_packages',  // Register bundled theme packages (bp-themes) 
    470484                        'load_textdomain',          // Load textdomain 
    471485                        'add_rewrite_tags',         // Add rewrite tags 
    472486                        'generate_rewrite_rules'    // Generate rewrite rules 
     
    479493                // Setup the BuddyPress theme directory 
    480494                register_theme_directory( $this->themes_dir ); 
    481495        } 
     496         
     497        /** Public Methods ********************************************************/ 
     498 
     499        /** 
     500         * Register bundled theme packages 
     501         * 
     502         * Note that since we currently have complete control over bp-themes and 
     503         * the bp-theme-compat folders, it's fine to hardcode these here. If at a 
     504         * later date we need to automate this, an API will need to be built. 
     505         * 
     506         * @since BuddyPress (1.7) 
     507         */ 
     508        public function register_theme_packages() { 
     509                bp_register_theme_package( array( 
     510                        'id'      => 'default', 
     511                        'name'    => __( 'BuddyPress Default', 'buddypress' ), 
     512                        'version' => bp_get_version(), 
     513                        'dir'     => trailingslashit( $this->themes_dir . '/bp-theme-compat' ), 
     514                        'url'     => trailingslashit( $this->themes_url . '/bp-theme-compat' ) 
     515                ) ); 
     516        } 
     517         
     518        /** 
     519         * Setup the default BuddyPress theme compatability location. 
     520         * 
     521         * @since BuddyPress (1.7) 
     522         */ 
     523        public function setup_theme() { 
     524 
     525                // Bail if something already has this under control 
     526                if ( ! empty( $this->theme_compat->theme ) ) 
     527                        return; 
     528 
     529                // Setup the theme package to use for compatibility 
     530                bp_setup_theme_compat( bp_get_theme_package_id() ); 
     531        } 
    482532} 
    483533 
    484 // "And now for something completely different" 
    485 $GLOBALS['bp'] = new BuddyPress; 
     534/** 
     535 * The main function responsible for returning the one true BuddyPress Instance 
     536 * to functions everywhere. 
     537 * 
     538 * Use this function like you would a global variable, except without needing 
     539 * to declare the global. 
     540 * 
     541 * Example: <?php $bp = buddypress(); ?> 
     542 * 
     543 * @return The one true BuddyPress Instance 
     544 */ 
     545function buddypress() { 
     546        return buddypress::instance(); 
     547} 
    486548 
    487 endif; 
     549/** 
     550 * Hook BuddyPress early onto the 'plugins_loaded' action. 
     551 * 
     552 * This gives all other plugins the chance to load before BuddyPress, to get 
     553 * their actions, filters, and overrides setup without BuddyPress being in the 
     554 * way. 
     555 */ 
     556if ( defined( 'BUDDYPRESS_LATE_LOAD' ) ) { 
     557        add_action( 'plugins_loaded', 'buddypress', (int) BUDDYPRESS_LATE_LOAD ); 
    488558 
    489 ?> 
     559// "And now here's something we hope you'll really like!" 
     560} else { 
     561        $GLOBALS['bp'] = &buddypress(); 
     562} 
     563 
     564endif; 
  • 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_screens', 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-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-bbpress'; 
     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-bbpress'; 
     118 
     119                // BuddyPress Theme Compatibility 
     120                } else { 
     121                        $location = trailingslashit( $this->url ); 
     122                        $handle   = 'bp-default-bbpress'; 
     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        } 
     137 
     138        /** 
     139         * Put some scripts in the header, like AJAX url for wp-lists 
     140         * 
     141         * @since BuddyPress (1.7) 
     142         */ 
     143        public function head_scripts() { 
     144        ?> 
     145 
     146                <script type="text/javascript" charset="utf-8"> 
     147                        /* <![CDATA[ */ 
     148                        var ajaxurl = '<?php echo admin_url( 'admin-ajax.php' ); ?>'; 
     149                        /* ]]> */ 
     150                </script> 
     151 
     152        <?php 
     153        } 
     154 
     155        /** 
     156         * Load localizations for topic script 
     157         * 
     158         * These localizations require information that may not be loaded even by init. 
     159         * 
     160         * @since BuddyPress (1.7) 
     161         */ 
     162        public function localize_scripts() { 
     163 
     164        } 
     165} 
     166new BP_Default(); 
     167endif; 
  • 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> 
     54 No newline at end of file 
  • 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<?php do_action( 'bp_before_directory_activity_content' ); ?> 
     4 
     5<?php if ( is_user_logged_in() ) : ?> 
     6 
     7        <?php bp_get_template_part( 'activity/post-form' ); ?> 
     8 
     9<?php endif; ?> 
     10 
     11<?php do_action( 'template_notices' ); ?> 
     12 
     13<div class="item-list-tabs activity-type-tabs" role="navigation"> 
     14        <ul> 
     15                <?php do_action( 'bp_before_activity_type_tab_all' ); ?> 
     16 
     17                <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> 
     18 
     19                <?php if ( is_user_logged_in() ) : ?> 
     20 
     21                        <?php do_action( 'bp_before_activity_type_tab_friends' ); ?> 
     22 
     23                        <?php if ( bp_is_active( 'friends' ) ) : ?> 
     24 
     25                                <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?> 
     26 
     27                                        <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> 
     28 
     29                                <?php endif; ?> 
     30 
     31                        <?php endif; ?> 
     32 
     33                        <?php do_action( 'bp_before_activity_type_tab_groups' ); ?> 
     34 
     35                        <?php if ( bp_is_active( 'groups' ) ) : ?> 
     36 
     37                                <?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?> 
     38 
     39                                        <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> 
     40 
     41                                <?php endif; ?> 
     42 
     43                        <?php endif; ?> 
     44 
     45                        <?php do_action( 'bp_before_activity_type_tab_favorites' ); ?> 
     46 
     47                        <?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?> 
     48 
     49                                <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> 
     50 
     51                        <?php endif; ?> 
     52 
     53                        <?php do_action( 'bp_before_activity_type_tab_mentions' ); ?> 
     54 
     55                        <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> 
     56 
     57                <?php endif; ?> 
     58 
     59                <?php do_action( 'bp_activity_type_tabs' ); ?> 
     60        </ul> 
     61</div><!-- .item-list-tabs --> 
     62 
     63<div class="item-list-tabs no-ajax" id="subnav" role="navigation"> 
     64        <ul> 
     65                <li class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li> 
     66 
     67                <?php do_action( 'bp_activity_syndication_options' ); ?> 
     68 
     69                <li id="activity-filter-select" class="last"> 
     70                        <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label> 
     71                        <select id="activity-filter-by"> 
     72                                <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option> 
     73                                <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option> 
     74 
     75                                <?php if ( bp_is_active( 'blogs' ) ) : ?> 
     76 
     77                                        <option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ); ?></option> 
     78                                        <option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ); ?></option> 
     79 
     80                                <?php endif; ?> 
     81 
     82                                <?php if ( bp_is_active( 'forums' ) ) : ?> 
     83 
     84                                        <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option> 
     85                                        <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option> 
     86 
     87                                <?php endif; ?> 
     88 
     89                                <?php if ( bp_is_active( 'groups' ) ) : ?> 
     90 
     91                                        <option value="created_group"><?php _e( 'New Groups', 'buddypress' ); ?></option> 
     92                                        <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option> 
     93 
     94                                <?php endif; ?> 
     95 
     96                                <?php if ( bp_is_active( 'friends' ) ) : ?> 
     97 
     98                                        <option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option> 
     99 
     100                                <?php endif; ?> 
     101 
     102                                <option value="new_member"><?php _e( 'New Members', 'buddypress' ); ?></option> 
     103 
     104                                <?php do_action( 'bp_activity_filter_options' ); ?> 
     105 
     106                        </select> 
     107                </li> 
     108        </ul> 
     109</div><!-- .item-list-tabs --> 
     110 
     111<?php do_action( 'bp_before_directory_activity_list' ); ?> 
     112 
     113<div class="activity" role="main"> 
     114 
     115        <?php bp_get_template_part( 'activity/activity-loop' ); ?> 
     116 
     117</div><!-- .activity --> 
     118 
     119<?php do_action( 'bp_after_directory_activity_list' ); ?> 
     120 
     121<?php do_action( 'bp_directory_activity_content' ); ?> 
     122 
     123<?php do_action( 'bp_after_directory_activity_content' ); ?> 
     124 
     125<?php do_action( 'bp_after_directory_activity' ); ?> 
  • 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' ); ?> 
     22 No newline at end of file 
  • bp-themes/bp-theme-compat/buddypress/blogs/index.php

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