Skip to:
Content

BuddyPress.org

Changeset 1655


Ignore:
Timestamp:
08/13/2009 01:24:21 AM (16 years ago)
Author:
apeatling
Message:

Add first revision of new default BuddyPress parent theme. This theme is designed to be extended from with child themes, not used directly. The original default themes from the old two theme system are deprecated, but will remain compatible with 1.1. Still more work to do there.

Location:
trunk
Files:
124 added
4 deleted
38 edited
47 copied
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-templatetags.php

    r1594 r1655  
    183183
    184184    echo sprintf( __( 'Viewing item %d to %d (of %d items)', 'buddypress' ), $from_num, $to_num, $activities_template->total_activity_count ); ?>  
    185     <img id="ajax-loader-activity" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
     185    <span class="ajax-loader"></span><?php
    186186}
    187187
  • trunk/bp-activity/bp-activity-widgets.php

    r1609 r1655  
    2525   
    2626    <?php if ( bp_has_activities( 'type=sitewide&max=' . $instance['max_items'] . '&per_page=' . $instance['per_page'] ) ) : ?>
    27         <div class="pag-count" id="activity-count">
    28             <?php bp_activity_pagination_count() ?>
     27        <div class="pagination">
     28            <div class="pag-count" id="activity-count">
     29                <?php bp_activity_pagination_count() ?>
     30            </div>
     31       
     32            <div class="pagination-links" id="activity-pag">
     33                &nbsp; <?php bp_activity_pagination_links() ?>
     34            </div>
    2935        </div>
    3036       
    31         <div class="pagination-links" id="activity-pag">
    32             &nbsp; <?php bp_activity_pagination_links() ?>
    33         </div>
    34 
    3537        <ul id="activity-filter-links">
    3638            <?php bp_activity_filter_links() ?>
  • trunk/bp-activity/feeds/bp-activity-friends-feed.php

    r1573 r1655  
    2323    <link><?php echo $bp->displayed_user->domain . $bp->activity->slug . '/my-friends/feed' ?></link>
    2424    <description><?php printf( __( '%s - Friends Activity Feed', 'buddypress' ), $bp->displayed_user->fullname ) ?></description>
    25     <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_activity_get_last_updated(), false); ?></pubDate>
     25    <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
    2626    <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
    2727    <language><?php echo get_option('rss_language'); ?></language>
     
    3434                <title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
    3535                <link><?php echo bp_activity_feed_item_link() ?></link>
    36                 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_get_activity_feed_item_date(), false); ?></pubDate>
     36                <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
    3737
    3838                <description><![CDATA[<?php bp_activity_feed_item_description() ?>]]></description>
  • trunk/bp-activity/feeds/bp-activity-personal-feed.php

    r1573 r1655  
    2323    <link><?php echo $bp->displayed_user->domain . $bp->activity->slug . '/feed' ?></link>
    2424    <description><?php printf( __( '%s - Activity Feed', 'buddypress' ), $bp->displayed_user->fullname ) ?></description>
    25     <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_activity_get_last_updated(), false); ?></pubDate>
     25    <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
    2626    <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
    2727    <language><?php echo get_option('rss_language'); ?></language>
     
    3434                <title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
    3535                <link><?php echo bp_activity_feed_item_link() ?></link>
    36                 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_get_activity_feed_item_date(), false); ?></pubDate>
     36                <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
    3737
    3838                <description><![CDATA[<?php bp_activity_feed_item_description() ?>]]></description>
  • trunk/bp-activity/feeds/bp-activity-sitewide-feed.php

    r1573 r1655  
    2424    <link><?php echo site_url() . '/' . $bp->activity->slug . '/feed' ?></link>
    2525    <description><?php _e( 'Site Wide Activity Feed', 'buddypress' ) ?></description>
    26     <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_activity_get_last_updated(), false); ?></pubDate>
     26    <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_activity_get_last_updated(), false); ?></pubDate>
    2727    <generator>http://buddypress.org/?v=<?php echo BP_VERSION ?></generator>
    2828    <language><?php echo get_option('rss_language'); ?></language>
     
    3535                <title><![CDATA[<?php bp_activity_feed_item_title() ?>]]></title>
    3636                <link><?php bp_activity_feed_item_link() ?></link>
    37                 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', bp_get_activity_feed_item_date(), false); ?></pubDate>
     37                <pubDate><?php echo mysql2date('D, d M Y H:i:s O', bp_get_activity_feed_item_date(), false); ?></pubDate>
    3838
    3939                <description><![CDATA[<?php bp_activity_feed_item_description() ?>]]></description>
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r1556 r1655  
    327327
    328328    echo sprintf( __( 'Viewing blog %d to %d (of %d blogs)', 'buddypress' ), $from_num, $to_num, $blogs_template->total_blog_count ); ?> &nbsp;
    329     <img id="ajax-loader-blogs" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
     329    <span class="ajax-loader"></span><?php
    330330}
    331331
     
    503503
    504504    echo sprintf( __( 'Viewing post %d to %d (of %d posts)', 'buddypress' ), $from_num, $to_num, $posts_template->total_post_count ); ?> &nbsp;
    505     <img id="ajax-loader-blogs" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
     505    <span class="ajax-loader"></span><?php
    506506}
    507507
     
    12061206
    12071207    echo sprintf( __( 'Viewing blog %d to %d (of %d blogs)', 'buddypress' ), $from_num, $to_num, $site_blogs_template->total_blog_count ); ?> &nbsp;
    1208     <img id="ajax-loader-blogs" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
     1208    <span class="ajax-loader"></span><?php
    12091209}
    12101210
  • trunk/bp-blogs/deprecated/bp-blogs-deprecated.php

    r1649 r1655  
    2727
    2828    /* If we are using a BuddyPress 1.1+ theme ignore this. */
    29     if ( file_exists( TEMPLATEPATH . '/groups' ) )
     29    if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) )
    3030        return $template;
    3131       
     
    4444    }
    4545}
    46 add_filter( 'template', 'bp_blogs_force_buddypress_theme', 1, 1 );
     46add_filter( 'template', 'bp_blogs_force_buddypress_theme' );
    4747
    4848function bp_blogs_force_buddypress_stylesheet( $stylesheet ) {
     
    6767    }
    6868}
    69 add_filter( 'stylesheet', 'bp_blogs_force_buddypress_stylesheet', 1, 1 );
     69add_filter( 'stylesheet', 'bp_blogs_force_buddypress_stylesheet' );
    7070
    7171function bp_blogs_add_structure_css() {
  • trunk/bp-core.php

    r1636 r1655  
    3333require ( BP_PLUGIN_DIR . '/bp-core/bp-core-notifications.php' );
    3434require ( BP_PLUGIN_DIR . '/bp-core/bp-core-signup.php' );
     35require ( BP_PLUGIN_DIR . '/bp-core/bp-core-activation.php' );
    3536
    3637/* If BP_DISABLE_ADMIN_BAR is defined, do not load the global admin bar */
     
    559560    if ( empty( $item_css_id ) )
    560561        $item_css_id = $slug;
    561 
     562   
    562563    $bp->bp_options_nav[$parent_slug][] = array(
    563564        'name' => $name,
  • trunk/bp-core/bp-core-activation.php

    r1636 r1655  
    11<?php
    2  // New activation code here next week.
     2
     3function bp_core_screen_activation() {
     4    global $bp, $wpdb;
     5   
     6    if ( BP_ACTIVATION_SLUG != $bp->current_component )
     7        return false;
     8       
     9    /* Check if an activation key has been passed */
     10    if ( isset( $_GET['key'] ) ) {
     11       
     12        require_once( ABSPATH . WPINC . '/registration.php' );
     13       
     14        /* Activate the signup */
     15        $signup = apply_filters( 'bp_core_activate_account', wpmu_activate_signup( $_GET['key'] ) );
     16       
     17        /* If there was errors, add a message and redirect */
     18        if ( $signup->errors ) {
     19            bp_core_add_message( __( 'There was an error activating your account, please try again.', 'buddypress' ), 'error' );
     20            bp_core_redirect( $bp->root_domain . '/' . BP_ACTIVATION_SLUG );
     21        }
     22       
     23        /* Set the password */
     24        if ( !empty( $signup['meta']['password'] ) )
     25            $wpdb->update( $wpdb->users, array( 'user_pass' => $signup['meta']['password'] ), array( 'ID' => $signup['user_id'] ), array( '%s' ), array( '%d' ) );
     26       
     27        /* Set any profile data */
     28        if ( function_exists( 'xprofile_set_field_data' ) ) {
     29           
     30            if ( !empty( $signup['meta']['profile_field_ids'] ) ) {
     31                $profile_field_ids = explode( ',', $signup['meta']['profile_field_ids'] );
     32           
     33                foreach( $profile_field_ids as $field_id ) {
     34                    $current_field = $signup['meta']["field_{$field_id}"];
     35               
     36                    if ( !empty( $current_field ) )
     37                        xprofile_set_field_data( $field_id, $signup['user_id'], $current_field );
     38                }
     39            }
     40           
     41        }
     42       
     43        /* Check for an uploaded avatar and move that to the correct user folder */
     44        $hashed_key = wp_hash( $_GET['key'] );
     45       
     46        /* Check if the avatar folder exists. If it does, move rename it, move it and delete the signup avatar dir */
     47        if ( file_exists( WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/avatars/signups/' . $hashed_key ) ) {
     48            @rename( WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/avatars/signups/' . $hashed_key, WP_CONTENT_DIR . '/blogs.dir/' . BP_ROOT_BLOG . '/files/avatars/' . $signup['user_id'] );
     49        }
     50       
     51        do_action( 'bp_core_account_activated', &$signup, $_GET['key'] );
     52        bp_core_add_message( __( 'Your account is now active!', 'buddypress' ) );
     53       
     54        $bp->activation_complete = true;
     55    }
     56   
     57    bp_core_load_template( 'registration/activate' );
     58}
     59add_action( 'wp', 'bp_core_screen_activation', 3 );
     60
    361?>
  • trunk/bp-core/bp-core-adminbar.php

    r1636 r1655  
    2727    global $bp;
    2828   
    29     echo '<a href="' . $bp->root_domain . '"><img id="admin-bar-logo" src="' . apply_filters( 'bp_admin_bar_logo_src', BP_PLUGIN_URL . '/bp-core/deprecated/images/admin_bar_logo.gif' ) . '" alt="' . apply_filters( 'bp_admin_bar_logo_alt_text', __( 'BuddyPress', 'buddypress' ) ) . '" /></a>';
     29    echo '<a href="' . $bp->root_domain . '" id="admin-bar-logo">' . get_blog_option( BP_ROOT_BLOG, 'blogname') . '</a>';
    3030}
    3131
     
    3737        echo '<li class="bp-login no-arrow"><a href="' . $bp->root_domain . '/wp-login.php?redirect_to=' . urlencode( $bp->root_domain ) . '">' . __( 'Log In', 'buddypress' ) . '</a></li>';
    3838       
    39         // Show "Sign Up" link if registrations are allowed
    40         if ( get_site_option( 'registration' ) != 'none' ) {
     39        // Show "Sign Up" link if user registrations are allowed
     40        if ( get_site_option( 'registration' ) != 'none' && get_site_option( 'registration' ) != 'blog' ) {
    4141            echo '<li class="bp-signup no-arrow"><a href="' . bp_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
    4242        }
  • trunk/bp-core/bp-core-avatars.php

    r1636 r1655  
    6666   
    6767    if ( $width )
    68         $html_width = " width='{$width}";
     68        $html_width = " width='{$width}'";
    6969   
    7070    if ( $height )
  • trunk/bp-core/bp-core-cssjs.php

    r1636 r1655  
    11<?php
     2
     3
    24/**
    35 * bp_core_add_admin_css()
     
    4345 */
    4446function bp_core_add_jquery_cropper() {
    45     wp_enqueue_script( 'jcrop' );
     47    wp_enqueue_script( 'jcrop', array( 'jquery' ) );
    4648    add_action( 'wp_head', 'bp_core_add_cropper_inline_js' );
    4749    add_action( 'wp_head', 'bp_core_add_cropper_inline_css' );
  • trunk/bp-core/bp-core-settings.php

    r1599 r1655  
    7575    <?php } ?>
    7676
    77     <form action="<?php echo $bp->loggedin_user->domain . 'settings/general' ?>" method="post" id="settings-form">
     77    <form action="<?php echo $bp->loggedin_user->domain . 'settings/general' ?>" method="post" class="standard-form" id="settings-form">
    7878        <label for="email"><?php _e( 'Account Email', 'buddypress' ) ?></label>
    7979        <input type="text" name="email" id="email" value="<?php echo attribute_escape( $current_user->user_email ); ?>" class="settings-input" />
    8080           
    8181        <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ) ?></label>
    82         <input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'New Password', 'buddypress' ) ?>
     82        <p><input type="password" name="pass1" id="pass1" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'New Password', 'buddypress' ) ?></p>
    8383        <input type="password" name="pass2" id="pass2" size="16" value="" class="settings-input small" /> &nbsp;<?php _e( 'Repeat New Password', 'buddypress' ) ?>
    8484   
  • trunk/bp-core/bp-core-signup.php

    r1636 r1655  
    1414    if ( function_exists('wp_insert_user') )
    1515        return false;
    16    
     16
     17    /* If signups are disabled, just re-direct */
     18    if ( 'none' == bp_get_signup_allowed() || 'blog' == bp_get_signup_allowed() )
     19        bp_core_redirect( $bp->root_domain );
     20       
    1721    $bp->signup->step = 'request-details';
    1822   
     
    2226        /* Check the nonce */
    2327        check_admin_referer( 'bp_new_signup' );
    24 
     28           
    2529        require_once( ABSPATH . WPINC . '/registration.php' );
    2630       
     
    101105                }
    102106               
     107                /* Store the profile field ID's in usermeta */
     108                $usermeta['profile_field_ids'] = $_POST['signup_profile_field_ids'];
     109               
    103110                /* Hash and store the password */
    104111                $usermeta['password'] = wp_hash_password( $_POST['signup_password'] );
     
    112119               
    113120                $usermeta = apply_filters( 'bp_signup_usermeta', $usermeta );
    114                
    115                 /* Finally, sign up the user */
    116                 wpmu_signup_user( $_POST['signup_username'], $_POST['signup_email'], $usermeta );
     121                               
     122                /* Finally, sign up the user and/or blog*/
     123                if ( isset( $_POST['signup_with_blog'] ) )
     124                    wpmu_signup_blog( $blog_details['domain'], $blog_details['path'], $blog_details['blog_title'], $_POST['signup_username'], $_POST['signup_email'], $usermeta );
     125                else
     126                    wpmu_signup_user( $_POST['signup_username'], $_POST['signup_email'], $usermeta );
    117127               
    118128                $bp->signup->step = 'completed-confirmation';
     
    168178
    169179    }
    170 
    171     bp_core_load_template( 'register' );   
     180    bp_core_load_template( 'registration/register' );   
    172181}
    173182add_action( 'wp', 'bp_core_screen_signup', 3 );
     
    195204}
    196205
     206/* Kill the wp-signup.php if custom registration signup templates are present */
     207function bp_core_wpsignup_redirect() {
     208    if ( false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php') )
     209        return false;
     210       
     211    if ( file_exists( TEMPLATEPATH . '/registration/register.php' ) || file_exists( TEMPLATEPATH . '/register.php' ) )
     212        die;
     213}
     214add_action( 'signup_header', 'bp_core_wpsignup_redirect' );
     215
    197216
    198217
  • trunk/bp-core/bp-core-templatetags.php

    r1648 r1655  
    8181            $link = str_replace( $bp->loggedin_user->domain, $bp->displayed_user->domain, $user_nav_item['link'] );
    8282        else
    83             $link = $user_nav_item['link'];
     83            $link = $bp->displayed_user->domain . $user_nav_item['link'];
    8484       
    8585        echo '<li' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>';
     
    212212        extract( $r, EXTR_SKIP );
    213213       
    214         return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'user_id' => $bp->loggedin_user->id, 'type' => $type, 'width' => $width, 'height' => $height ) ) );
     214        return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->loggedin_user->id, 'type' => $type, 'width' => $width, 'height' => $height ) ) );
    215215    }
    216216
     
    230230        extract( $r, EXTR_SKIP );
    231231       
    232         return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'user_id' => $bp->displayed_user->id, 'type' => $type, 'width' => $width, 'height' => $height ) ) );
     232        return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->displayed_user->id, 'type' => $type, 'width' => $width, 'height' => $height ) ) );
    233233    }
    234234
     
    267267
    268268function bp_site_name() {
    269     echo apply_filters( 'bp_site_name', get_blog_option( 1, 'blogname' ) );
     269    echo apply_filters( 'bp_site_name', get_blog_option( BP_ROOT_BLOG, 'blogname' ) );
    270270}
    271271
     
    317317?>
    318318
    319 <div class="info-group wp-profile">
     319<div class="bp-widget wp-profile">
    320320    <h4><?php _e( 'My Profile' ) ?></h4>
    321321
     
    533533    if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/register.php') )
    534534        return true;
    535    
     535
     536    if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/registration/register.php') )
     537        return true;
     538       
    536539    return false;
    537540}
    538541
    539 function bp_signup_page( $echo = true ) {
    540     global $bp;
    541    
    542     if ( bp_has_custom_signup_page() ) {
    543         if ( $echo )
    544             echo $bp->root_domain . '/' . BP_REGISTER_SLUG;
    545         else
    546             return $bp->root_domain . '/' . BP_REGISTER_SLUG;
    547     } else {
    548         if ( $echo )
    549             echo $bp->root_domain . '/wp-signup.php';
    550         else
    551             return $bp->root_domain . '/wp-signup.php';
    552     }
    553 }
     542function bp_signup_page( $deprecated = true ) {
     543    if ( !$deprecated )
     544        return bp_get_signup_page();
     545    else
     546        echo bp_get_signup_page();
     547}
     548    function bp_get_signup_page() {
     549        global $bp;
     550       
     551        if ( bp_has_custom_signup_page() ) {
     552                return apply_filters( 'bp_get_signup_page', $bp->root_domain . '/' . BP_REGISTER_SLUG );
     553        } else {
     554                return apply_filters( 'bp_get_signup_page', $bp->root_domain . '/wp-signup.php' );
     555        }
     556    }
    554557
    555558function bp_has_custom_activation_page() {
    556     if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( 1, 'template') . '/activate.php') )
     559    if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/activate.php') )
     560        return true;
     561
     562    if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/registration/activate.php') )
    557563        return true;
    558564   
     
    617623}
    618624
    619 function bp_login_bar() {
    620     global $bp;
    621    
    622     if ( !is_user_logged_in() ) : ?>
    623        
    624         <form name="login-form" id="login-form" action="<?php echo $bp->root_domain . '/wp-login.php' ?>" method="post">
    625             <input type="text" name="log" id="user_login" value="<?php _e( 'Username', 'buddypress' ) ?>" onfocus="if (this.value == '<?php _e( 'Username', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Username', 'buddypress' ) ?>';}" />
    626             <input type="password" name="pwd" id="user_pass" class="input" value="" />
    627            
    628             <input type="checkbox" name="rememberme" id="rememberme" value="forever" title="<?php _e( 'Remember Me', 'buddypress' ) ?>" />
    629            
    630             <input type="submit" name="wp-submit" id="wp-submit" value="<?php _e( 'Log In', 'buddypress' ) ?>"/>               
    631             <input type="button" name="signup-submit" id="signup-submit" value="<?php _e( 'Sign Up', 'buddypress' ) ?>" onclick="location.href='<?php echo bp_signup_page() ?>'" />
    632 
    633             <input type="hidden" name="redirect_to" value="http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] ?>" />
    634             <input type="hidden" name="testcookie" value="1" />
    635                        
    636             <?php do_action( 'bp_login_bar_logged_out' ) ?>
    637         </form>
    638    
    639     <?php else : ?>
    640        
    641         <div id="logout-link">
    642             <?php bp_loggedinuser_avatar_thumbnail( 20, 20 ) ?> &nbsp;
    643             <?php bp_loggedinuser_link() ?>
    644             <?php
    645                 if ( function_exists('wp_logout_url') ) {
    646                     $logout_link = '/ <a href="' . wp_logout_url( $bp->root_domain ) . '">' . __( 'Log Out', 'buddypress' ) . '</a>';
    647                 } else {
    648                     $logout_link = '/ <a href="' . $bp->root_domain . '/wp-login.php?action=logout&amp;redirect_to=' . $bp->root_domain . '">' . __( 'Log Out', 'buddypress' ) . '</a>';                   
    649                 }           
    650                
    651                 echo apply_filters( 'bp_logout_link', $logout_link );
    652             ?>
    653            
    654             <?php do_action( 'bp_login_bar_logged_in' ) ?>
    655         </div>
    656        
    657     <?php endif;
     625function bp_log_out_link() {
     626    global $bp;
     627    if ( function_exists('wp_logout_url') )
     628        $logout_link = '<a href="' . wp_logout_url( $bp->root_domain ) . '">' . __( 'Log Out', 'buddypress' ) . '</a>';
     629    else
     630        $logout_link = '<a href="' . $bp->root_domain . '/wp-login.php?action=logout&amp;redirect_to=' . $bp->root_domain . '">' . __( 'Log Out', 'buddypress' ) . '</a>';     
     631
     632    echo apply_filters( 'bp_logout_link', $logout_link );
    658633}
    659634
     
    868843        }
    869844    }
     845
     846function bp_signup_allowed() {
     847    echo bp_get_signup_allowed();
     848}
     849    function bp_get_signup_allowed() {
     850        return get_site_option( 'registration' );
     851    }
     852
     853function bp_account_was_activated() {
     854    global $bp;
     855   
     856    return $bp->activation_complete;
     857}
    870858
    871859
     
    10521040
    10531041    echo sprintf( __( 'Viewing member %d to %d (of %d members)', 'buddypress' ), $from_num, $to_num, $site_members_template->total_member_count ); ?> &nbsp;
    1054     <img id="ajax-loader-members" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
     1042    <span class="ajax-loader"></span><?php
    10551043}
    10561044
     
    12521240}
    12531241
     1242function bp_root_domain() {
     1243    echo bp_get_root_domain();
     1244}
     1245    function bp_get_root_domain() {
     1246        global $bp;
     1247       
     1248        return $bp->root_domain;
     1249    }
     1250
    12541251/* Template is_() functions to determine the current page */
    12551252
     
    13711368}
    13721369
     1370function bp_is_my_groups() {
     1371    global $bp;
     1372   
     1373    if ( BP_GROUPS_SLUG == $bp->current_component && ( !$bp->current_action || 'my-groups' == $bp->current_action ) )
     1374        return true;
     1375   
     1376    return false;       
     1377}
     1378
    13731379function bp_is_group_home() {
    13741380    global $bp;
     
    15521558   
    15531559    return false;
     1560}
     1561
     1562function bp_is_activation_page() {
     1563    global $bp;
     1564   
     1565    if ( BP_ACTIVATION_SLUG == $bp->current_component )
     1566        return true;
     1567   
     1568    return false;   
     1569}
     1570
     1571function bp_is_register_page() {
     1572    global $bp;
     1573   
     1574    if ( BP_REGISTER_SLUG == $bp->current_component )
     1575        return true;
     1576   
     1577    return false;   
    15541578}
    15551579
     
    15621586
    15631587    function bp_get_the_body_class() {
    1564         if ( bp_is_blog_page() )
     1588        if ( bp_is_blog_page() || bp_is_activation_page() || bp_is_register_page() )
    15651589            $class[] = 'blog-page';
    1566         else
    1567             $class[] = 'social-page';
     1590           
     1591        if ( !bp_is_blog_page() && !is_home() && !bp_is_register_page() && !bp_is_activation_page() )
     1592            $class[] = 'internal-page';
     1593       
     1594        if ( bp_is_blog_page() && is_home() )
     1595            $class[] = 'home-page';
    15681596       
    15691597        if ( bp_is_directory() )
    15701598            $class[] = 'directory';
    1571        
    1572         if ( bp_is_activity() )
     1599           
     1600        if ( bp_is_profile() && !bp_is_blog_page() )
     1601            $class[] = 'profile';
     1602       
     1603        if ( bp_is_activity() && !bp_is_blog_page()  )
    15731604            $class[] = 'activity';     
    15741605
    1575         if ( bp_is_blogs() )
     1606        if ( bp_is_blogs() && !bp_is_blog_page()  )
    15761607            $class[] = 'blogs';
    15771608
    1578         if ( bp_is_wire() )
     1609        if ( bp_is_wire() && !bp_is_blog_page()  )
    15791610            $class[] = 'wire';
    15801611
    1581         if ( bp_is_messages() )
     1612        if ( bp_is_messages() && !bp_is_blog_page()  )
    15821613            $class[] = 'messages';                 
    15831614       
    1584         if ( bp_is_friends() )
     1615        if ( bp_is_friends() && !bp_is_blog_page()  )
    15851616            $class[] = 'friends';
    15861617           
    1587         if ( bp_is_groups() )
     1618        if ( bp_is_groups() && !bp_is_blog_page()  )
    15881619            $class[] = 'groups';
    15891620
    1590         if ( bp_is_settings() )
     1621        if ( bp_is_settings() && !bp_is_blog_page()  )
    15911622            $class[] = 'settings';
    15921623           
     
    16121643            $class[] = 'recent-posts';
    16131644           
    1614         if ( bp_is_my_blogs() )
     1645        if ( bp_is_my_blogs() && !bp_is_directory() )
    16151646            $class[] = 'my-blogs';
     1647           
     1648        if ( bp_is_my_groups() && !bp_is_directory() )
     1649            $class[] = 'my-groups';
    16161650           
    16171651        if ( bp_is_group_leave() )
     
    16481682            $class[] = 'change-avatar';
    16491683           
    1650         if ( bp_is_profile() )
    1651             $class[] = 'profile';
    1652            
    16531684        if ( bp_is_profile_edit() )
    16541685            $class[] = 'profile-edit';
     
    16591690        if ( bp_is_my_activity() )
    16601691            $class[] = 'my-activity';
     1692       
     1693        if ( bp_is_register_page() )
     1694            $class[] = 'registration';
     1695       
     1696        if ( bp_is_activation_page() )
     1697            $class[] = 'activation';
    16611698           
    16621699        if ( is_single() )
  • trunk/bp-core/bp-core-widgets.php

    r1631 r1655  
    8888        <?php if ( bp_has_site_members( 'type=newest&max=' . $instance['max_members'] ) ) : ?>
    8989            <div class="item-options" id="members-list-options">
    90                 <img id="ajax-loader-members" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" />
     90                <span class="ajax-loader"></span>
    9191                <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="newest-members" class="selected"><?php _e( 'Newest', 'buddypress' ) ?></a> |
    9292                <a href="<?php echo site_url() . '/' . BP_MEMBERS_SLUG ?>" id="recently-active-members"><?php _e( 'Active', 'buddypress' ) ?></a> |
     
    249249}
    250250
     251/** Widget AJAX ******************/
     252
     253function bp_core_ajax_widget_members() {
     254    global $bp;
     255
     256    check_ajax_referer('bp_core_widget_members');
     257   
     258    switch ( $_POST['filter'] ) {
     259        case 'newest-members':
     260            if ( !$users = wp_cache_get( 'newest_users', 'bp' ) ) {
     261                $users = BP_Core_User::get_newest_users( $_POST['max-members'], 1 );
     262                wp_cache_set( 'newest_users', $users, 'bp' );
     263            }
     264        break;
     265        case 'recently-active-members':
     266            if ( !$users = wp_cache_get( 'active_users', 'bp' ) ) {
     267                $users = BP_Core_User::get_active_users( $_POST['max-members'], 1 );
     268                wp_cache_set( 'active_users', $users, 'bp' );
     269            }
     270        break;
     271        case 'popular-members':
     272            if ( !$users = wp_cache_get( 'popular_users', 'bp' ) ) {
     273                $users = BP_Core_User::get_popular_users( $_POST['max-members'], 1 );
     274                wp_cache_set( 'popular_users', $users, 'bp' );
     275            }
     276        break;
     277    }
     278   
     279    if ( $users['users'] ) {
     280        echo '0[[SPLIT]]'; // return valid result.
     281   
     282        foreach ( (array) $users['users'] as $user ) {
     283        ?>
     284            <li class="vcard">
     285                <div class="item-avatar">
     286                    <a href="<?php echo bp_core_get_userlink( $user->user_id, false, true ) ?>"><?php echo bp_core_get_avatar( $user->user_id, 1 ) ?></a>
     287                </div>
     288
     289                <div class="item">
     290                    <div class="item-title"><?php echo bp_core_get_userlink( $user->user_id ) ?></div>
     291                    <div class="item-meta">
     292                        <span class="activity">
     293                            <?php
     294                            if ( 'newest-members' == $_POST['filter'] ) {
     295                                echo bp_core_get_last_activity( $user->user_registered, __( 'registered %s ago', 'buddypress' ) );
     296                            } else if ( 'recently-active-members' == $_POST['filter'] ) {
     297                                echo bp_core_get_last_activity( get_usermeta( $user->user_id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) );
     298                            } else if ( 'popular-members' == $_POST['filter'] ) {
     299                                if ( 1 == get_usermeta( $user->user_id, 'total_friend_count' ) )
     300                                    echo get_usermeta( $user->user_id, 'total_friend_count' ) . __(' friend', 'buddypress');
     301                                else
     302                                    echo get_usermeta( $user->user_id, 'total_friend_count' ) . __(' friends', 'buddypress');
     303                            }
     304                            ?>
     305                        </span>
     306                    </div>
     307                </div>
     308            </li>
     309            <?php   
     310        }
     311    } else {
     312        echo "-1[[SPLIT]]<li>" . __("No members matched the current filter.", 'buddypress');
     313    }
     314}
     315add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' );
     316
     317
    251318?>
  • trunk/bp-core/deprecated/bp-core-deprecated.php

    r1649 r1655  
    887887/*** END DEPRECATED OLD BUDDYPRESS THEME SUPPORT ************/
    888888
    889 function bp_core_ajax_widget_members() {
    890     global $bp;
    891 
    892     /* If we are using a BuddyPress 1.1+ theme ignore this. */
    893     if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) )
    894         return false;
    895        
    896     check_ajax_referer('bp_core_widget_members');
    897    
    898     switch ( $_POST['filter'] ) {
    899         case 'newest-members':
    900             if ( !$users = wp_cache_get( 'newest_users', 'bp' ) ) {
    901                 $users = BP_Core_User::get_newest_users( $_POST['max-members'], 1 );
    902                 wp_cache_set( 'newest_users', $users, 'bp' );
    903             }
    904         break;
    905         case 'recently-active-members':
    906             if ( !$users = wp_cache_get( 'active_users', 'bp' ) ) {
    907                 $users = BP_Core_User::get_active_users( $_POST['max-members'], 1 );
    908                 wp_cache_set( 'active_users', $users, 'bp' );
    909             }
    910         break;
    911         case 'popular-members':
    912             if ( !$users = wp_cache_get( 'popular_users', 'bp' ) ) {
    913                 $users = BP_Core_User::get_popular_users( $_POST['max-members'], 1 );
    914                 wp_cache_set( 'popular_users', $users, 'bp' );
    915             }
    916         break;
    917     }
    918    
    919     if ( $users['users'] ) {
    920         echo '0[[SPLIT]]'; // return valid result.
    921    
    922         foreach ( (array) $users['users'] as $user ) {
    923         ?>
    924             <li class="vcard">
    925                 <div class="item-avatar">
    926                     <a href="<?php echo bp_core_get_userlink( $user->user_id, false, true ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $user->user_id, 'type' => 'thumb' ) ) ?></a>
    927                 </div>
    928 
    929                 <div class="item">
    930                     <div class="item-title"><?php echo bp_core_get_userlink( $user->user_id ) ?></div>
    931                     <div class="item-meta">
    932                         <span class="activity">
    933                             <?php
    934                             if ( 'newest-members' == $_POST['filter'] ) {
    935                                 echo bp_core_get_last_activity( $user->user_registered, __( 'registered %s ago', 'buddypress' ) );
    936                             } else if ( 'recently-active-members' == $_POST['filter'] ) {
    937                                 echo bp_core_get_last_activity( get_usermeta( $user->user_id, 'last_activity' ), __( 'active %s ago', 'buddypress' ) );
    938                             } else if ( 'popular-members' == $_POST['filter'] ) {
    939                                 if ( 1 == get_usermeta( $user->user_id, 'total_friend_count' ) )
    940                                     echo get_usermeta( $user->user_id, 'total_friend_count' ) . __(' friend', 'buddypress');
    941                                 else
    942                                     echo get_usermeta( $user->user_id, 'total_friend_count' ) . __(' friends', 'buddypress');
    943                             }
    944                             ?>
    945                         </span>
    946                     </div>
    947                 </div>
    948             </li>
    949             <?php   
    950         }
    951     } else {
    952         echo "-1[[SPLIT]]<li>" . __("No members matched the current filter.", 'buddypress');
    953     }
    954 }
    955 add_action( 'wp_ajax_widget_members', 'bp_core_ajax_widget_members' );
    956 
    957 
    958889function bp_core_ajax_directory_members() {
    959890    /* If we are using a BuddyPress 1.1+ theme ignore this. */
     
    967898add_action( 'wp_ajax_directory_members', 'bp_core_ajax_directory_members' );
    968899
     900/* DEPRECATED -- This should now be directly in the template */
     901function bp_login_bar() {
     902    global $bp;
     903   
     904    if ( !is_user_logged_in() ) : ?>
     905       
     906        <form name="login-form" id="login-form" action="<?php echo $bp->root_domain . '/wp-login.php' ?>" method="post">
     907            <input type="text" name="log" id="user_login" value="<?php _e( 'Username', 'buddypress' ) ?>" onfocus="if (this.value == '<?php _e( 'Username', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Username', 'buddypress' ) ?>';}" />
     908            <input type="password" name="pwd" id="user_pass" class="input" value="" />
     909           
     910            <input type="checkbox" name="rememberme" id="rememberme" value="forever" title="<?php _e( 'Remember Me', 'buddypress' ) ?>" />
     911           
     912            <input type="submit" name="wp-submit" id="wp-submit" value="<?php _e( 'Log In', 'buddypress' ) ?>"/>               
     913            <input type="button" name="signup-submit" id="signup-submit" value="<?php _e( 'Sign Up', 'buddypress' ) ?>" onclick="location.href='<?php echo bp_signup_page() ?>'" />
     914
     915            <input type="hidden" name="redirect_to" value="http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] ?>" />
     916            <input type="hidden" name="testcookie" value="1" />
     917                       
     918            <?php do_action( 'bp_login_bar_logged_out' ) ?>
     919        </form>
     920   
     921    <?php else : ?>
     922       
     923        <div id="logout-link">
     924            <?php bp_loggedinuser_avatar_thumbnail( 20, 20 ) ?> &nbsp;
     925            <?php bp_loggedinuser_link() ?>
     926            <?php
     927                if ( function_exists('wp_logout_url') ) {
     928                    $logout_link = '/ <a href="' . wp_logout_url( $bp->root_domain ) . '">' . __( 'Log Out', 'buddypress' ) . '</a>';
     929                } else {
     930                    $logout_link = '/ <a href="' . $bp->root_domain . '/wp-login.php?action=logout&amp;redirect_to=' . $bp->root_domain . '">' . __( 'Log Out', 'buddypress' ) . '</a>';                   
     931                }           
     932               
     933                echo apply_filters( 'bp_logout_link', $logout_link );
     934            ?>
     935           
     936            <?php do_action( 'bp_login_bar_logged_in' ) ?>
     937        </div>
     938       
     939    <?php endif;
     940}
     941
  • trunk/bp-core/deprecated/css/admin-bar.css

    r1636 r1655  
    1717#wp-admin-bar * { z-index: 999 !important; }
    1818
    19 #wp-admin-bar img#admin-bar-logo {
     19#wp-admin-bar div#admin-bar-logo {
    2020    position: absolute !important;
    2121    top: 8px;
    2222    left: 10px;
     23    background: url( ../images/admin_bar_logo.gif) top left no-repeat;
    2324}
    2425
  • trunk/bp-core/deprecated/css/structure.css

    r1639 r1655  
    7272        }
    7373
    74     div.info-group {
     74    div.bp-widget {
    7575        margin-bottom: 2em;
    7676    }   
    77         div.info-group h4 {
     77        div.bp-widget h4 {
    7878            height: 30px;
    7979            padding: 3px 10px;
     
    8181            position: relative;
    8282        }
    83             .left-menu div.info-group {
     83            .left-menu div.bp-widget {
    8484                margin-top: 1.5em;
    8585            }
    8686
    87             div.info-group h4 span {
     87            div.bp-widget h4 span {
    8888                position: absolute;
    8989                top: 0.31em;
     
    9292            }
    9393
    94             .left-menu div.info-group img.avatar {
     94            .left-menu div.bp-widget img.avatar {
    9595                float: left;
    9696                margin-right: 1em;
     
    130130    }
    131131   
    132     div.info-group .pagination-links {
     132    div.bp-widget .pagination-links {
    133133        margin: 0 0 5px 0;
    134134        float: none;
  • trunk/bp-forums/bp-forums-templatetags.php

    r1636 r1655  
    458458    echo apply_filters( 'bp_forum_pagination_count', sprintf( __( 'Viewing topic %d to %d (%d total topics)', 'buddypress' ), $from_num, $to_num, $forum_template->total_topic_count ) );
    459459?>
    460     <img id="ajax-loader-groups" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" />
     460<span class="ajax-loader"></span>
    461461<?php
    462462}
     
    728728    echo apply_filters( 'bp_the_topic_pagination_count', sprintf( __( 'Viewing post %d to %d (%d total posts)', 'buddypress' ), $from_num, $to_num, $topic_template->total_post_count ) );
    729729?>
    730     <img id="ajax-loader-groups" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" />
     730    <span class="ajax-loader"></span>
    731731<?php
    732732}
  • trunk/bp-friends/bp-friends-templatetags.php

    r1636 r1655  
    289289
    290290    echo sprintf( __( 'Viewing friend %d to %d (of %d friends)', 'buddypress' ), $from_num, $to_num, $friends_template->total_friend_count ); ?> &nbsp;
    291     <img id="ajax-loader-friends" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
     291    <span class="ajax-loader"></span><?php
    292292}
    293293
     
    307307    <form action="<?php echo $action ?>" id="friend-search-form" method="post">
    308308
    309         <label for="friend-search-box" id="friend-search-label"><?php echo $label ?> <img id="ajax-loader" src="<?php echo $bp->friends->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" /></label>
     309        <label for="friend-search-box" id="friend-search-label"><?php echo $label ?> <span class="ajax-loader"></span></label>
    310310        <input type="search" name="friend-search-box" id="friend-search-box" value="<?php echo $value ?>"<?php echo $disabled ?> />
    311311       
     
    359359        $friend_status = BP_Friends_Friendship::check_is_friend( $bp->loggedin_user->id, $potential_friend_id );
    360360
    361         echo '<div class="friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">';
     361        echo '<div class="generic-button friendship-button ' . $friend_status . '" id="friendship-button-' . $potential_friend_id . '">';
    362362        if ( 'pending' == $friend_status ) {
    363363            echo '<a class="requested" href="' . $bp->loggedin_user->domain . $bp->friends->slug . '">' . __( 'Friendship Requested', 'buddypress' ) . '</a>';
     
    407407    }
    408408?> 
    409     <div class="info-group">
     409    <div class="bp-widget">
    410410        <h4><?php bp_word_or_name( __( "My Friends", 'buddypress' ), __( "%s's Friends", 'buddypress' ) ) ?>  (<?php echo BP_Friends_Friendship::total_friend_count( $bp->displayed_user->id ) ?>)  <a href="<?php echo $bp->displayed_user->domain . $bp->friends->slug ?>"><?php _e('See All', 'buddypress') ?> &raquo;</a></h4>
    411411       
  • trunk/bp-groups/bp-groups-templatetags.php

    r1636 r1655  
    749749?>
    750750    <form action="<?php echo $action ?>" id="group-search-form" method="post">
    751         <label for="<?php echo $name ?>" id="<?php echo $name ?>-label"><?php echo $label ?> <img id="ajax-loader" src="<?php echo $bp->groups->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" /></label>
     751        <label for="<?php echo $name ?>" id="<?php echo $name ?>-label"><?php echo $label ?> <span class="ajax-loader"></span></label>
    752752        <input type="search" name="<?php echo $name ?>" id="<?php echo $name ?>" value="<?php echo $value ?>"<?php echo $disabled ?> />
    753753   
     
    782782
    783783    echo sprintf( __( 'Viewing group %d to %d (of %d groups)', 'buddypress' ), $from_num, $to_num, $groups_template->total_group_count ); ?> &nbsp;
    784     <img id="ajax-loader-groups" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
     784    <span class="ajax-loader"></span><?php
    785785}
    786786
     
    12171217    if ( !is_user_logged_in() || groups_is_user_banned( $bp->loggedin_user->id, $group->id ) )
    12181218        return false;
    1219    
    1220     echo '<div class="group-button ' . $group->status . '" id="groupbutton-' . $group->id . '">';
     1219
     1220    if ( !$group->status )
     1221        return false;
     1222   
     1223    echo '<div class="generic-button group-button ' . $group->status . '" id="groupbutton-' . $group->id . '">';
    12211224   
    12221225    switch ( $group->status ) {
     
    19641967
    19651968    echo sprintf( __( 'Viewing group %d to %d (of %d groups)', 'buddypress' ), $from_num, $to_num, $site_groups_template->total_group_count ); ?> &nbsp;
    1966     <img id="ajax-loader-groups" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
     1969    <span class="ajax-loader"></span><?php
    19671970}
    19681971
  • trunk/bp-groups/bp-groups-widgets.php

    r1636 r1655  
    2929        <?php if ( bp_has_site_groups( 'type=popular&per_page=' . $instance['max_groups'] . '&max=' . $instance['max_groups'] ) ) : ?>
    3030            <div class="item-options" id="groups-list-options">
    31                 <img id="ajax-loader-groups" src="<?php echo $bp->groups->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" />
     31                <span class="ajax-loader"></span>
    3232                <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="newest-groups"><?php _e("Newest", 'buddypress') ?></a> |
    3333                <a href="<?php echo site_url() . '/' . $bp->groups->slug ?>" id="recently-active-groups"><?php _e("Active", 'buddypress') ?></a> |
     
    8181    }
    8282}
     83
     84function groups_ajax_widget_groups_list() {
     85    global $bp;
     86       
     87    check_ajax_referer('groups_widget_groups_list');
     88
     89    switch ( $_POST['filter'] ) {
     90        case 'newest-groups':
     91            $type = 'newest';
     92        break;
     93        case 'recently-active-groups':
     94            $type = 'active';
     95        break;
     96        case 'popular-groups':
     97            $type = 'popular';
     98        break;
     99    }
     100
     101    if ( bp_has_site_groups( 'type=' . $type . '&per_page=' . $_POST['max_groups'] . '&max=' . $_POST['max_groups'] ) ) : ?>
     102        <?php echo "0[[SPLIT]]"; ?>
     103               
     104        <ul id="groups-list" class="item-list">
     105            <?php while ( bp_site_groups() ) : bp_the_site_group(); ?>
     106                <li>
     107                    <div class="item-avatar">
     108                        <a href="<?php bp_the_site_group_link() ?>"><?php bp_the_site_group_avatar_thumb() ?></a>
     109                    </div>
     110
     111                    <div class="item">
     112                        <div class="item-title"><a href="<?php bp_the_site_group_link() ?>" title="<?php bp_the_site_group_name() ?>"><?php bp_the_site_group_name() ?></a></div>
     113                        <div class="item-meta">
     114                            <span class="activity">
     115                                <?php
     116                                if ( 'newest-groups' == $_POST['filter'] ) {
     117                                    bp_the_site_group_date_created();
     118                                } else if ( 'recently-active-groups' == $_POST['filter'] ) {
     119                                    bp_the_site_group_last_active();
     120                                } else if ( 'popular-groups' == $_POST['filter'] ) {
     121                                    bp_the_site_group_member_count();
     122                                }
     123                                ?>
     124                            </span>
     125                        </div>
     126                    </div>
     127                </li>
     128
     129            <?php endwhile; ?>
     130        </ul>       
     131        <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?>
     132        <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo attribute_escape( $_POST['max_groups'] ); ?>" />
     133       
     134    <?php else: ?>
     135
     136        <?php echo "-1[[SPLIT]]<li>" . __("No groups matched the current filter.", 'buddypress'); ?>
     137
     138    <?php endif;
     139   
     140}
     141add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
    83142?>
  • trunk/bp-groups/deprecated/bp-groups-deprecated.php

    r1649 r1655  
    134134    return $member_theme;
    135135}
    136 add_filter( 'stylesheet', 'groups_force_buddypress_stylesheet', 1, 1 );
     136add_filter( 'stylesheet', 'groups_force_buddypress_stylesheet' );
    137137
    138138function groups_add_js() {
     
    231231   
    232232?> 
    233     <div class="info-group">
     233    <div class="bp-widget">
    234234        <h4><?php bp_word_or_name( __( "My Groups", 'buddypress' ), __( "%s's Groups", 'buddypress' ) ) ?> (<?php echo BP_Groups_Member::total_group_count() ?>) <a href="<?php echo $bp->displayed_user->domain . $bp->groups->slug ?>"><?php _e('See All', 'buddypress') ?> &raquo;</a></h4>
    235235        <?php if ( $group_ids ) { ?>
     
    265265?>
    266266    <div class="left-menu">
    267         <h4><?php _e( 'Select Friends', 'buddypress' ) ?> <img id="ajax-loader" src="<?php echo $bp->groups->image_base ?>/ajax-loader.gif" height="7" alt="Loading" style="display: none;" /></h4>
     267        <h4><?php _e( 'Select Friends', 'buddypress' ) ?> <span class="ajax-loader"></span></h4>
    268268        <?php bp_group_list_invite_friends() ?>
    269269        <?php wp_nonce_field( 'groups_invite_uninvite_user', '_wpnonce_invite_uninvite_user' ) ?>
     
    601601add_action( 'wp_ajax_group_filter', 'groups_ajax_group_filter' );
    602602
    603 function groups_ajax_widget_groups_list() {
    604     global $bp;
    605 
    606     /* If we are using a BuddyPress 1.1+ theme ignore this. */
    607     if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) )
    608         return false;
    609        
    610     check_ajax_referer('groups_widget_groups_list');
    611 
    612     switch ( $_POST['filter'] ) {
    613         case 'newest-groups':
    614             $type = 'newest';
    615         break;
    616         case 'recently-active-groups':
    617             $type = 'active';
    618         break;
    619         case 'popular-groups':
    620             $type = 'popular';
    621         break;
    622     }
    623 
    624     if ( bp_has_site_groups( 'type=' . $type . '&per_page=' . $_POST['max_groups'] . '&max=' . $_POST['max_groups'] ) ) : ?>
    625         <?php echo "0[[SPLIT]]"; ?>
    626                
    627         <ul id="groups-list" class="item-list">
    628             <?php while ( bp_site_groups() ) : bp_the_site_group(); ?>
    629                 <li>
    630                     <div class="item-avatar">
    631                         <a href="<?php bp_the_site_group_link() ?>"><?php bp_the_site_group_avatar_thumb() ?></a>
    632                     </div>
    633 
    634                     <div class="item">
    635                         <div class="item-title"><a href="<?php bp_the_site_group_link() ?>" title="<?php bp_the_site_group_name() ?>"><?php bp_the_site_group_name() ?></a></div>
    636                         <div class="item-meta">
    637                             <span class="activity">
    638                                 <?php
    639                                 if ( 'newest-groups' == $_POST['filter'] ) {
    640                                     bp_the_site_group_date_created();
    641                                 } else if ( 'recently-active-groups' == $_POST['filter'] ) {
    642                                     bp_the_site_group_last_active();
    643                                 } else if ( 'popular-groups' == $_POST['filter'] ) {
    644                                     bp_the_site_group_member_count();
    645                                 }
    646                                 ?>
    647                             </span>
    648                         </div>
    649                     </div>
    650                 </li>
    651 
    652             <?php endwhile; ?>
    653         </ul>       
    654         <?php wp_nonce_field( 'groups_widget_groups_list', '_wpnonce-groups' ); ?>
    655         <input type="hidden" name="groups_widget_max" id="groups_widget_max" value="<?php echo attribute_escape( $_POST['max_groups'] ); ?>" />
    656        
    657     <?php else: ?>
    658 
    659         <?php echo "-1[[SPLIT]]<li>" . __("No groups matched the current filter.", 'buddypress'); ?>
    660 
    661     <?php endif;
    662    
    663 }
    664 add_action( 'wp_ajax_widget_groups_list', 'groups_ajax_widget_groups_list' );
    665 
    666603function groups_ajax_member_list() {
    667604    global $bp;
  • trunk/bp-groups/js/widget-groups.js

    r1366 r1655  
    1111                'cookie': encodeURIComponent(document.cookie),
    1212                '_wpnonce': jQuery("input#_wpnonce-groups").val(),
    13                 'max-groups': jQuery("input#groups_widget_max").val(),
     13                'max_groups': jQuery("input#groups_widget_max").val(),
    1414                'filter': jQuery(this).attr('id')
    1515            },
  • trunk/bp-messages.php

    r1651 r1655  
    284284    $thread_id = $bp->action_variables[0];
    285285   
    286     if ( !$thread_id || ( !messages_check_thread_access($thread_id) && !is_site_admin() ) )
     286    if ( !$thread_id || !messages_is_valid_thread( $thread_id ) || ( !messages_check_thread_access($thread_id) && !is_site_admin() ) )
    287287        bp_core_redirect( $bp->displayed_user->domain . $bp->current_component );
    288288       
     
    291291       
    292292        /* Check the nonce */
    293         check_admin_referer( 'messages_send_message' );
     293        check_admin_referer( 'messages_send_message', 'send_message_nonce' );
    294294       
    295295        /* Send the reply */
     
    310310    global $bp, $thread_id;
    311311   
    312     if ( $bp->current_component != $bp->messages->slug || $bp->action_variables[0] != 'delete' )
     312    if ( $bp->current_component != $bp->messages->slug || 'notices' == $bp->current_action || $bp->action_variables[0] != 'delete' )
    313313        return false;
    314314   
     
    453453    }
    454454   
    455     return $message->send();
     455    if ( $message->send() ) {
     456        require_once( BP_PLUGIN_DIR . '/bp-messages/bp-messages-notifications.php' );
     457
     458        // Send screen notifications to the recipients
     459        foreach ( $message->recipients as $recipient ) {
     460            bp_core_add_notification( $message->id, $recipient, 'messages', 'new_message' );   
     461        }
     462       
     463        // Send email notifications to the recipients
     464        messages_notification_new_message( array( 'item_id' => $message->id, 'recipient_ids' => $message->recipients, 'thread_id' => $message->thread_id, 'component_name' => $bp->messages->slug, 'component_action' => 'message_sent', 'is_private' => 1 ) );
     465   
     466        do_action( 'messages_message_sent', &$message );
     467       
     468        return $message->thread_id;
     469    }
     470   
     471    return false;
    456472}
    457473
     
    537553}
    538554
     555function messages_is_valid_thread( $thread_id ) {
     556    return BP_Messages_Thread::is_valid( $thread_id );
     557}
     558
    539559function messages_ajax_autocomplete_results() {
    540560    global $bp;
     
    545565    if ( function_exists( 'friends_search_friends' ) )
    546566        $friends = friends_search_friends( $_GET['q'], $bp->loggedin_user->id, $_GET['limit'], 1 );
    547    
     567
    548568    $friends = apply_filters( 'bp_friends_autocomplete_list', $friends, $_GET['q'], $_GET['limit'] );
    549569
     
    552572            $ud = get_userdata($user_id);
    553573            $username = $ud->user_login;
    554             echo  bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) )  . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
     574            echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'width' => 15, 'height' => 15 ) )  . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')
    555575            ';
    556576        }       
  • trunk/bp-messages/bp-messages-classes.php

    r1651 r1655  
    286286        return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_recipients} WHERE thread_id = %d AND user_id = %d", $thread_id, $user_id ) );
    287287    }
     288
     289    function is_valid( $thread_id ) {
     290        global $wpdb, $bp;
     291       
     292        return $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_threads} WHERE id = %d", $thread_id ) );
     293    }
    288294   
    289295    function get_recipient_links($recipients) {
  • trunk/bp-messages/bp-messages-templatetags.php

    r1651 r1655  
    276276
    277277    echo sprintf( __( 'Viewing message %d to %d (of %d messages)', 'buddypress' ), $from_num, $to_num, $messages_template->total_thread_count ); ?> &nbsp;
    278     <img id="ajax-loader-messages" src="<?php echo $bp->core->image_base ?>/ajax-loader.gif" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" /><?php
     278    <span class="ajax-loader"></span><?php
    279279}
    280280
  • trunk/bp-status.php

    r1599 r1655  
    55    define ( 'BP_STATUS_SLUG', 'status' );
    66
    7 require ( BP_PLUGIN_DIR . '/bp-status/bp-status-ajax.php' );
    8 require ( BP_PLUGIN_DIR . '/bp-status/bp-status-cssjs.php' );
    97require ( BP_PLUGIN_DIR . '/bp-status/bp-status-templatetags.php' );
    108require ( BP_PLUGIN_DIR . '/bp-status/bp-status-filters.php' );
  • trunk/bp-status/bp-status-filters.php

    r1621 r1655  
    11<?php
    22
    3 add_filter( 'bp_get_the_status', 'bp_status_filter_tags' );
    4 add_filter( 'bp_get_the_status', 'force_balance_tags' );
    5 add_filter( 'bp_get_the_status', 'wptexturize' );
    6 add_filter( 'bp_get_the_status', 'convert_smilies' );
    7 add_filter( 'bp_get_the_status', 'convert_chars' );
    8 add_filter( 'bp_get_the_status', 'make_clickable' );
    9 add_filter( 'bp_get_the_status', 'stripslashes_deep' );
     3add_filter( 'the_status_content', 'bp_status_filter_tags' );
     4add_filter( 'the_status_content', 'force_balance_tags' );
     5add_filter( 'the_status_content', 'wptexturize' );
     6add_filter( 'the_status_content', 'convert_smilies' );
     7add_filter( 'the_status_content', 'convert_chars' );
     8add_filter( 'the_status_content', 'make_clickable' );
     9add_filter( 'the_status_content', 'stripslashes_deep' );
     10
     11add_filter( 'bp_get_the_status', 'wpautop' );
    1012
    1113function bp_status_filter_tags( $status ) {
  • trunk/bp-status/bp-status-templatetags.php

    r1577 r1655  
    3333        $status = get_usermeta( $user_id, 'bp_status' );
    3434       
    35         if ( empty($status) || '' == $status || !$status )
     35        if ( empty($status) )
    3636            return bp_get_update_status_button( 'text=' . $new_button_text );
    3737       
    3838        $time_since = sprintf( __( '%s ago', 'buddypress' ), bp_core_time_since( $status['recorded_time'] ) );
    39         $content = apply_filters( 'bp_get_the_status', $status['content'] );
     39        $content = apply_filters( 'the_status_content', $status['content'] );
    4040       
    4141        if ( !(int)$no_anchor && $user_id == $bp->loggedin_user->id )
     
    4545        $content .= ' ' . bp_get_clear_status_button( 'text=' . $clear_button_text );
    4646       
    47         return $content;
     47        return apply_filters( 'bp_get_the_status', $content );
    4848    }
    4949   
     
    6868            return false;
    6969       
    70         return '<div class="generic-button"><a href="' . bp_core_get_user_domain( $user_id ) . '?status=new" id="status-new-status">' . $text . '</a></div>';
     70        return apply_filters( 'bp_get_update_status_button', '<div class="generic-button"><a href="' . bp_core_get_user_domain( $user_id ) . '?status=new" id="status-new-status">' . $text . '</a></div>' );
    7171    }
    7272
     
    9191            return false;
    9292       
    93         return '<a href="' . bp_core_get_user_domain( $user_id ) . '?status=clear" id="status-clear-status">' . $text . '</a>';
     93        return apply_filters( 'bp_get_clear_status_button', '<a href="' . bp_core_get_user_domain( $user_id ) . '?status=clear" id="status-clear-status">' . $text . '</a>' );
    9494    }
    9595
     
    100100        $user_id = $bp->loggedin_user->id;
    101101       
    102     echo bp_core_get_user_domain( $user_id ) . BP_STATUS_SLUG . '/add';
     102    echo apply_filters( 'bp_status_form_action', bp_core_get_user_domain( $user_id ) . BP_STATUS_SLUG . '/add' );
    103103}
    104104
  • trunk/bp-themes/deprecated/bpmember/groups/create.php

    r1637 r1655  
    113113            <div class="left-menu">
    114114               
    115                 <h4><?php _e( 'Select Friends', 'buddypress' ) ?> <img id="ajax-loader" src="<?php echo $bp->groups->image_base ?>/ajax-loader.gif" height="7" alt="Loading" style="display: none;" /></h4>
     115                <h4><?php _e( 'Select Friends', 'buddypress' ) ?> <span class="ajax-loader"></span></h4>
    116116               
    117117                <div id="invite-list">
  • trunk/bp-themes/deprecated/bpmember/groups/single/send-invite.php

    r1598 r1655  
    2121                <div class="left-menu">
    2222               
    23                     <h4><?php _e( 'Select Friends', 'buddypress' ) ?> <img id="ajax-loader" src="<?php echo $bp->groups->image_base ?>/ajax-loader.gif" height="7" alt="Loading" style="display: none;" /></h4>
     23                    <h4><?php _e( 'Select Friends', 'buddypress' ) ?> <span class="ajax-loader"></span></h4>
    2424               
    2525                    <div id="invite-list">
  • trunk/bp-themes/deprecated/bpmember/wire/post-list.php

    r1653 r1655  
    33
    44    <form name="wire-post-list-form" id="wire-post-list-form" action="" method="post">
    5     <?php if ( bp_has_wire_posts( 'item_id=' . bp_wire_item_id() . '&can_post=' . bp_wire_can_post() ) ) : ?>
     5    <?php if ( bp_has_wire_posts( 'item_id=' . bp_get_wire_item_id() . '&can_post=' . bp_wire_can_post() ) ) : ?>
    66       
    77        <?php if ( bp_wire_needs_pagination() ) : ?>
    88            <div id="wire-count" class="pag-count">
    99                <?php bp_wire_pagination_count() ?> &nbsp;
    10                 <img id="ajax-loader" src="<?php bp_wire_ajax_loader_src() ?>" height="7" alt="<?php _e( "Loading", "buddypress" ) ?>" style="display: none;" />
     10                <span class="ajax-loader"></span>
    1111            </div>
    1212       
  • trunk/bp-themes/readme.txt

    r1454 r1655  
    22'''''''''''''''''
    33
    4 Just as WordPress themes control how your blog looks, BuddyPress themes control how your members'
    5 profile, groups, wire and all other BuddyPress features look.
     4BuddyPress themes are simply just WordPress themes with some extra template files. They follow
     5a very similar coding style and methodology.
    66
    7 A default BuddyPress enabled installation comes with two themes.
    8 
    9 The first theme "bphome" is just a regular WordPress theme. If you do not already have a WordPress
    10 theme that you are using for your root blog, then you can install this theme to get you started. The theme
    11 takes the focus away from the blog, and provides a front page of three columns where you can drop widgets.
    12 
    13 You are not required to install the "bphome" theme, you can use any WordPress theme.
    14 
    15 The second theme "bpmember" is a BuddyPress theme. You are required to install at least one BuddyPress
    16 theme for BuddyPress to function correctly. BuddyPress themes sit in their own directory, so they are not
    17 confused with WordPress blog themes. You should copy the "bpmember" theme into the folder
    18 "wp-content/bp-themes/" - you should create the bp-themes folder if it does not already exist.
    19 
    20 Here are some step by step instuctions for installing both the "bphome" and "bpmember" themes.
    21 
    22 1. Copy "bp-themes/bphome" to "wp-content/themes/bphome/"
    23 
    24 2. Copy "bp-themes/bpmember" to "wp-content/bp-themes/bpmember/" create the bp-themes folder
    25    if needed.
    26 
    27 3. You may need to log in as an administrator and activate the 'bphome' theme in 'Site Admin > Themes'
    28 
    29 4. Activate the bphome theme in the "Appearance" menu for the home blog if you want to use it.
    30 
    31 5. The "bpmember" theme will be activated automatically. However, if you install other BuddyPress themes
    32    in the future, you will need to activate them under the "Site Admin > BuddyPress" menu.
     7Instructions on installing the default BuddyPress theme will be updated here soon.
  • trunk/bp-wire/bp-wire-templatetags.php

    r1636 r1655  
    164164    }
    165165   
    166 function bp_wire_item_id( $deprecated = false ) {
     166function bp_wire_item_id( $deprecated = true ) {
    167167    global $bp_item_id;
    168168   
  • trunk/bp-wire/deprecated/bp-wire-deprecated.php

    r1636 r1655  
    4444        <div id="wire-count" class="pag-count">
    4545            <?php bp_wire_pagination_count() ?> &nbsp;
    46             <img id="ajax-loader" src="<?php bp_wire_ajax_loader_src() ?>" height="7" alt="<?php _e( 'Loading', 'buddypress' ) ?>" style="display: none;" />
     46            <span class="ajax-loader"></span>
    4747        </div>
    4848           
  • trunk/bp-xprofile/bp-xprofile-templatetags.php

    r1643 r1655  
    619619        return false;
    620620    }
     621
     622function bp_current_profile_group_id() {
     623    echo bp_get_current_profile_group_id();
     624}
     625    function bp_get_current_profile_group_id() {
     626        global $bp;
     627       
     628        if ( !$profile_group_id = $bp->action_variables[1] )
     629            $profile_group_id = 1;
     630   
     631        return apply_filters( 'bp_get_current_profile_group_id', $profile_group_id ); // admin/profile/edit/[group-id]
     632    }
    621633   
    622634
Note: See TracChangeset for help on using the changeset viewer.