Skip to:
Content

Changeset 2189


Ignore:
Timestamp:
12/16/2009 09:38:39 AM (9 years ago)
Author:
apeatling
Message:

Added admin option to enable/disable activity comments on blog and forum threads. Moved the "View Thread" link into a more prominent position. Fixed some activity stream spacing issues.

Location:
trunk
Files:
7 edited

Legend:

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

    r2168 r2189  
    343343    }
    344344
    345     if ( !bp_is_activity_permalink() ) {
    346         if ( 'activity_comment' == $activities_template->activity->component_action )
    347             $meta = '</span> <span class="activity-header-meta"> &middot; <a href="' . $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template->activity->item_id . '">' . __( 'View Thread', 'buddypress' ) . '</a>';
    348         else
    349             $meta = '</span> <span class="activity-header-meta"> &middot; <a href="' . $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template->activity->id . '">' . __( 'View Thread', 'buddypress' ) . '</a>';
    350     }
    351 
    352345    /* Add the delete link if the user has permission on this item */
    353346    if ( ( $activities_template->activity->user_id == $bp->loggedin_user->id ) || $bp->is_item_admin || is_site_admin() )
     
    497490
    498491        return apply_filters( 'bp_get_activity_permalink_id', $bp->current_action );
     492    }
     493
     494function bp_activity_thread_permalink() {
     495    echo bp_get_activity_thread_permalink();
     496}
     497    function bp_get_activity_thread_permalink() {
     498        global $bp, $activities_template;
     499
     500        if ( 'new_blog_post' == bp_get_activity_action_name() || 'new_blog_comment' == bp_get_activity_action_name() || 'new_forum_topic' == bp_get_activity_action_name() || 'new_forum_post' == bp_get_activity_action_name() )
     501            $link = bp_activity_feed_item_link();
     502        else {
     503            if ( 'activity_comment' == bp_get_activity_action_name() )
     504                $link = $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template->activity->item_id;
     505            else
     506                $link = $bp->root_domain . '/' . BP_ACTIVITY_SLUG . '/p/' . $activities_template->activity->id;
     507        }
     508
     509        return apply_filters( 'bp_get_activity_thread_permalink', $link );
    499510    }
    500511
     
    514525        ) );
    515526
    516         $mini_class = '';
     527        $class = '';
    517528        if ( in_array( $activities_template->activity->component_action, (array)$mini_activity_actions ) )
    518             $mini_class = ' mini';
    519 
    520         return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component_name . ' ' . $activities_template->activity->component_action . $mini_class );
     529            $class = ' mini';
     530
     531        if ( bp_activity_get_comment_count() && bp_activity_can_comment() )
     532            $class .= ' has-comments';
     533
     534        return apply_filters( 'bp_get_activity_css_class', $activities_template->activity->component_name . ' ' . $activities_template->activity->component_action . $class );
    521535    }
    522536
     
    616630    }
    617631
     632function bp_activity_can_comment() {
     633    global $bp;
     634
     635    if ( false === get_site_option( 'bp-disable-blogforum-comments' ) || (int)get_site_option( 'bp-disable-blogforum-comments' ) ) {
     636        if ( 'new_blog_post' == bp_get_activity_action_name() || 'new_blog_comment' == bp_get_activity_action_name() || 'new_forum_topic' == bp_get_activity_action_name() || 'new_forum_post' == bp_get_activity_action_name() )
     637            return false;
     638    }
     639
     640    if ( 'activity_comment' == bp_get_activity_action_name() )
     641        return false;
     642
     643    return true;
     644}
     645
    618646function bp_sitewide_activity_feed_link() {
    619647    echo bp_get_sitewide_activity_feed_link();
  • trunk/bp-core/bp-core-admin.php

    r2168 r2189  
    8181                    <td>
    8282                        <input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( (int)get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
    83                         <input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( !(int)get_site_option( 'bp-disable-account-deletion' ) || '' == get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
     83                        <input type="radio" name="bp-admin[bp-disable-account-deletion]"<?php if ( !(int)get_site_option( 'bp-disable-account-deletion' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-account-deletion" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
    8484                    </td>
    8585                </tr>
     
    8989                    <td>
    9090                        <input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( (int)get_site_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
    91                         <input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( !(int)get_site_option( 'bp-disable-forum-directory' ) || '' == get_site_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
     91                        <input type="radio" name="bp-admin[bp-disable-forum-directory]"<?php if ( !(int)get_site_option( 'bp-disable-forum-directory' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-forum-directory" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
     92                    </td>
     93                </tr>
     94                <?php endif; ?>
     95                <?php if ( function_exists( 'bp_activity_install') ) : ?>
     96                <tr>
     97                    <th scope="row"><?php _e( 'Disable activity stream commenting on blog and forum posts?', 'buddypress' ) ?>:</th>
     98                    <td>
     99                        <input type="radio" name="bp-admin[bp-disable-blogforum-comments]"<?php if ( (int)get_site_option( 'bp-disable-blogforum-comments' ) || false === get_site_option( 'bp-disable-blogforum-comments' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-blogforum-comments" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> &nbsp;
     100                        <input type="radio" name="bp-admin[bp-disable-blogforum-comments]"<?php if ( !(int)get_site_option( 'bp-disable-blogforum-comments' ) ) : ?> checked="checked"<?php endif; ?> id="bp-disable-blogforum-comments" value="0" /> <?php _e( 'No', 'buddypress' ) ?>
    92101                    </td>
    93102                </tr>
  • trunk/bp-core/bp-core-adminbar.php

    r2168 r2189  
    3737    global $bp;
    3838
    39     if ( !is_user_logged_in() ) {
    40         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>';
    41 
    42         // Show "Sign Up" link if user registrations are allowed
    43         if ( get_site_option( 'registration' ) != 'none' && get_site_option( 'registration' ) != 'blog' ) {
    44             echo '<li class="bp-signup no-arrow"><a href="' . bp_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
    45         }
     39    if ( is_user_logged_in() )
     40        return false;
     41
     42    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>';
     43
     44    // Show "Sign Up" link if user registrations are allowed
     45    if ( get_site_option( 'registration' ) != 'none' && get_site_option( 'registration' ) != 'blog' ) {
     46        echo '<li class="bp-signup no-arrow"><a href="' . bp_signup_page(false) . '">' . __( 'Sign Up', 'buddypress' ) . '</a></li>';
    4647    }
    4748}
     
    5152    global $bp;
    5253
    53     if ( !$bp->bp_nav )
    54         return false;
    55 
    56     if ( is_user_logged_in() ) {
    57 
    58         echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';
    59 
    60         echo __( 'My Account', 'buddypress' ) . '</a>';
    61         echo '<ul>';
    62 
    63         /* Loop through each navigation item */
    64         $counter = 0;
    65         foreach( $bp->bp_nav as $nav_item ) {
    66             $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
    67 
    68             echo '<li' . $alt . '>';
    69             echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
    70 
    71             if ( is_array( $bp->bp_options_nav[$nav_item['css_id']] ) ) {
    72                 echo '<ul>';
    73                 $sub_counter = 0;
    74 
    75                 foreach( $bp->bp_options_nav[$nav_item['css_id']] as $subnav_item ) {
    76                     $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
    77                     echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>';
    78                     $sub_counter++;
    79                 }
    80                 echo '</ul>';
     54    if ( !$bp->bp_nav || !is_user_logged_in() )
     55        return false;
     56
     57    echo '<li id="bp-adminbar-account-menu"><a href="' . bp_loggedin_user_domain() . '">';
     58
     59    echo __( 'My Account', 'buddypress' ) . '</a>';
     60    echo '<ul>';
     61
     62    /* Loop through each navigation item */
     63    $counter = 0;
     64    foreach( $bp->bp_nav as $nav_item ) {
     65        $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
     66
     67        echo '<li' . $alt . '>';
     68        echo '<a id="bp-admin-' . $nav_item['css_id'] . '" href="' . $nav_item['link'] . '">' . $nav_item['name'] . '</a>';
     69
     70        if ( is_array( $bp->bp_options_nav[$nav_item['css_id']] ) ) {
     71            echo '<ul>';
     72            $sub_counter = 0;
     73
     74            foreach( $bp->bp_options_nav[$nav_item['css_id']] as $subnav_item ) {
     75                $alt = ( 0 == $sub_counter % 2 ) ? ' class="alt"' : '';
     76                echo '<li' . $alt . '><a id="bp-admin-' . $subnav_item['css_id'] . '" href="' . $subnav_item['link'] . '">' . $subnav_item['name'] . '</a></li>';
     77                $sub_counter++;
    8178            }
    82 
    83             echo '</li>';
    84 
    85             $counter++;
     79            echo '</ul>';
    8680        }
    8781
    88         $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
    89 
    90         if ( function_exists('wp_logout_url') ) {
    91             echo '<li' . $alt . '><a id="bp-admin-logout" href="' . wp_logout_url(site_url()) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
    92         } else {
    93             echo '<li' . $alt . '><a id="bp-admin-logout" href="' . site_url() . '/wp-login.php?action=logout&amp;redirect_to=' . site_url() . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
    94         }
    95 
    96         echo '</ul>';
    9782        echo '</li>';
    98     }
     83
     84        $counter++;
     85    }
     86
     87    $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
     88
     89    echo '<li' . $alt . '><a id="bp-admin-logout" href="' . wp_logout_url(site_url()) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>';
     90    echo '</ul>';
     91    echo '</li>';
    9992}
    10093
     
    10497    // If the user is a site admin, just display admin.
    10598    if ( is_site_admin() )
    106         return __( 'Admin', 'buddypress');
     99        return __( 'Admin', 'buddypress' );
    107100
    108101    $roles = get_usermeta( $user, 'wp_' . $blog . '_capabilities' );
     
    126119// *** "My Blogs" Menu ********
    127120function bp_adminbar_blogs_menu() {
    128     if ( is_user_logged_in() ) {
    129         global $bp;
    130 
    131         if ( function_exists('bp_blogs_install') ) {
    132 
    133             if ( !$blogs = wp_cache_get( 'bp_blogs_of_user_' . $bp->loggedin_user->id, 'bp' ) ) {
    134                 $blogs = bp_blogs_get_blogs_for_user( $bp->loggedin_user->id );
    135                 wp_cache_set( 'bp_blogs_of_user_' . $bp->loggedin_user->id, $blogs, 'bp' );
     121    global $bp;
     122
     123    if ( !is_user_logged_in() || !function_exists('bp_blogs_install') )
     124        return false;
     125
     126    if ( !$blogs = wp_cache_get( 'bp_blogs_of_user_' . $bp->loggedin_user->id, 'bp' ) ) {
     127        $blogs = bp_blogs_get_blogs_for_user( $bp->loggedin_user->id );
     128        wp_cache_set( 'bp_blogs_of_user_' . $bp->loggedin_user->id, $blogs, 'bp' );
     129    }
     130
     131    echo '<li id="bp-adminbar-blogs-menu"><a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/my-blogs">';
     132
     133    _e( 'My Blogs', 'buddypress' );
     134
     135    echo '</a>';
     136    echo '<ul>';
     137
     138    if ( is_array( $blogs['blogs'] ) && (int)$blogs['count'] ) {
     139        $counter = 0;
     140        foreach ( $blogs['blogs'] as $blog ) {
     141            $role = get_blog_role_for_user( $bp->loggedin_user->id, $blog->id );
     142
     143            $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
     144            echo '<li' . $alt . '>';
     145            echo '<a href="' . $blog->siteurl . '">' . $blog->name . ' (' . $role . ')</a>';
     146            if ( !( 'Subscriber' == $role ) ) { // then they have something to display on the flyout menu
     147                echo '<ul>';
     148                echo '<li class="alt"><a href="' . $blog->siteurl  . 'wp-admin/">' . __('Dashboard', 'buddypress') . '</a></li>';
     149                echo '<li><a href="' . $blog->siteurl  . 'wp-admin/post-new.php">' . __('New Post', 'buddypress') . '</a></li>';
     150                echo '<li class="alt"><a href="' . $blog->siteurl  . 'wp-admin/edit.php">' . __('Manage Posts', 'buddypress') . '</a></li>';
     151                echo '<li><a href="' . $blog->siteurl  . 'wp-admin/edit-comments.php">' . __('Manage Comments', 'buddypress') . '</a></li>';
     152                if ( 'Admin' == $role ) {
     153                    echo '<li class="alt"><a href="' . $blog->siteurl  . 'wp-admin/themes.php">' . __('Switch Theme', 'buddypress') . '</a></li>';
     154                }
     155                echo '</ul>';
    136156            }
    137 
    138             echo '<li id="bp-adminbar-blogs-menu"><a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/my-blogs">';
    139 
    140             _e( 'My Blogs', 'buddypress' );
    141 
     157            echo '</li>';
     158            $counter++;
     159        }
     160    }
     161
     162    $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
     163
     164    if ( bp_blog_signup_enabled() ) {
     165        echo '<li' . $alt . '>';
     166        echo '<a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/create-a-blog">' . __('Create a Blog!', 'buddypress') . '</a>';
     167        echo '</li>';
     168    }
     169
     170    echo '</ul>';
     171    echo '</li>';
     172}
     173
     174// **** "Notifications" Menu *********
     175function bp_adminbar_notifications_menu() {
     176    global $bp;
     177
     178    if ( !is_user_logged_in() )
     179        return false;
     180
     181    echo '<li id="bp-adminbar-notifications-menu"><a href="' . $bp->loggedin_user->domain . '">';
     182    _e( 'Notifications', 'buddypress' );
     183
     184    if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
     185        <span><?php echo count($notifications) ?></span>
     186    <?php
     187    }
     188
     189    echo '</a>';
     190    echo '<ul>';
     191
     192    if ( $notifications ) { ?>
     193        <?php $counter = 0; ?>
     194        <?php for ( $i = 0; $i < count($notifications); $i++ ) { ?>
     195            <?php $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
     196            <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
     197            <?php $counter++; ?>
     198        <?php } ?>
     199    <?php } else { ?>
     200        <li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
     201    <?php
     202    }
     203
     204    echo '</ul>';
     205    echo '</li>';
     206}
     207
     208// **** "Blog Authors" Menu (visible when not logged in) ********
     209function bp_adminbar_authors_menu() {
     210    global $bp, $current_blog;
     211
     212    if ( $current_blog->id == $bp->root_blog || !function_exists( 'bp_blogs_install' ) )
     213        return false;
     214
     215    $authors = get_users_of_blog();
     216
     217    if ( is_array( $authors ) ) {
     218        /* This is a blog, render a menu with links to all authors */
     219        echo '<li id="bp-adminbar-authors-menu"><a href="/">';
     220        _e('Blog Authors', 'buddypress');
     221        echo '</a>';
     222
     223        echo '<ul class="author-list">';
     224        foreach( $authors as $author ) {
     225            $author = new BP_Core_User( $author->user_id );
     226            echo '<li>';
     227
     228            echo '<a href="' . $author->user_url . '">';
     229            echo $author->avatar_mini;
     230            echo ' ' . $author->fullname;
     231            echo '<span class="activity">' . $author->last_active . '</span>';
    142232            echo '</a>';
    143             echo '<ul>';
    144 
    145             if ( is_array( $blogs['blogs'] ) && (int)$blogs['count'] ) {
    146                 $counter = 0;
    147                 foreach ( $blogs['blogs'] as $blog ) {
    148                     $role = get_blog_role_for_user( $bp->loggedin_user->id, $blog->id );
    149 
    150                     $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
    151                     echo '<li' . $alt . '>';
    152                     echo '<a href="' . $blog->siteurl . '">' . $blog->name . ' (' . $role . ')</a>';
    153                     if ( !( 'Subscriber' == $role ) ) { // then they have something to display on the flyout menu
    154                         echo '<ul>';
    155                         echo '<li class="alt"><a href="' . $blog->siteurl  . 'wp-admin/">' . __('Dashboard', 'buddypress') . '</a></li>';
    156                         echo '<li><a href="' . $blog->siteurl  . 'wp-admin/post-new.php">' . __('New Post', 'buddypress') . '</a></li>';
    157                         echo '<li class="alt"><a href="' . $blog->siteurl  . 'wp-admin/edit.php">' . __('Manage Posts', 'buddypress') . '</a></li>';
    158                         echo '<li><a href="' . $blog->siteurl  . 'wp-admin/edit-comments.php">' . __('Manage Comments', 'buddypress') . '</a></li>';
    159                         if ( 'Admin' == $role ) {
    160                             echo '<li class="alt"><a href="' . $blog->siteurl  . 'wp-admin/themes.php">' . __('Switch Theme', 'buddypress') . '</a></li>';
    161                         }
    162                         echo '</ul>';
    163                     }
    164                     echo '</li>';
    165                     $counter++;
    166                 }
    167             }
    168 
    169             $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : '';
    170 
    171             if ( bp_blog_signup_enabled() ) {
    172                 echo '<li' . $alt . '>';
    173                 echo '<a href="' . $bp->loggedin_user->domain . $bp->blogs->slug . '/create-a-blog">' . __('Create a Blog!', 'buddypress') . '</a>';
    174                 echo '</li>';
    175             }
    176 
    177             echo '</ul>';
     233            echo '<div class="admin-bar-clear"></div>';
    178234            echo '</li>';
    179235        }
    180     }
    181 }
    182 
    183 // **** "Notifications" Menu *********
    184 function bp_adminbar_notifications_menu() {
    185     if ( is_user_logged_in() ) {
    186         global $bp;
    187 
    188         echo '<li id="bp-adminbar-notifications-menu"><a href="' . $bp->loggedin_user->domain . '">';
    189         _e( 'Notifications', 'buddypress' );
    190 
    191         if ( $notifications = bp_core_get_notifications_for_user( $bp->loggedin_user->id ) ) { ?>
    192             <span><?php echo count($notifications) ?></span>
    193         <?php
    194         }
    195 
    196         echo '</a>';
    197         echo '<ul>';
    198 
    199         if ( $notifications ) { ?>
    200             <?php $counter = 0; ?>
    201             <?php for ( $i = 0; $i < count($notifications); $i++ ) { ?>
    202                 <?php $alt = ( 0 == $counter % 2 ) ? ' class="alt"' : ''; ?>
    203                 <li<?php echo $alt ?>><?php echo $notifications[$i] ?></li>
    204                 <?php $counter++; ?>
    205             <?php } ?>
    206         <?php } else { ?>
    207             <li><a href="<?php echo $bp->loggedin_user->domain ?>"><?php _e( 'No new notifications.', 'buddypress' ); ?></a></li>
    208         <?php
    209         }
    210 
    211236        echo '</ul>';
    212237        echo '</li>';
    213     }
    214 }
    215 
    216 // **** "Blog Authors" Menu (visible when not logged in) ********
    217 function bp_adminbar_authors_menu() {
    218     global $current_blog;
    219 
    220     if ( $current_blog->blog_id > 1 ) {
    221         $authors = get_users_of_blog();
    222 
    223         if ( is_array( $authors ) ) {
    224             /* This is a blog, render a menu with links to all authors */
    225             echo '<li id="bp-adminbar-authors-menu"><a href="/">';
    226             _e('Blog Authors', 'buddypress');
    227             echo '</a>';
    228 
    229             echo '<ul class="author-list">';
    230             foreach( $authors as $author ) {
    231                 $author = new BP_Core_User( $author->user_id );
    232                 echo '<li>';
    233 
    234                 echo '<a href="' . $author->user_url . '">';
    235                 echo $author->avatar_mini;
    236                 echo ' ' . $author->fullname;
    237                 echo '<span class="activity">' . $author->last_active . '</span>';
    238                 echo '</a>';
    239                 echo '<div class="admin-bar-clear"></div>';
    240                 echo '</li>';
    241             }
    242             echo '</ul>';
    243             echo '</li>';
    244         }
    245238    }
    246239}
     
    271264}
    272265
    273 
    274266add_action( 'bp_adminbar_logo', 'bp_adminbar_logo' );
    275267add_action( 'bp_adminbar_menus', 'bp_adminbar_login_menu', 2 );
    276268add_action( 'bp_adminbar_menus', 'bp_adminbar_account_menu', 4 );
    277 
    278 if ( function_exists('bp_blogs_install') )
    279     add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
    280 
     269add_action( 'bp_adminbar_menus', 'bp_adminbar_blogs_menu', 6 );
    281270add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
    282 
    283 if ( function_exists('bp_blogs_install') )
    284     add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
    285 
     271add_action( 'bp_adminbar_menus', 'bp_adminbar_authors_menu', 12 );
    286272add_action( 'bp_adminbar_menus', 'bp_adminbar_random_menu', 100 );
    287273
  • trunk/bp-groups.php

    r2179 r2189  
    321321
    322322        <ul>
    323             <li><a class="confirm" href="<?php echo wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/delete-group/', 'groups_delete_group' ) ?>&amp;delete-group-button=1&amp;delete-group-understand=1"><?php _e( "Delete Group", 'buddypress' ) ?></a></li>
     323            <li><a class="confirm" href="<?php echo wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/delete-group/', 'groups_delete_group' ) ?>&amp;delete-group-button=1&amp;delete-group-understand=1"><?php _e( "Delete Group", 'buddypress' ) ?></a></li>
    324324
    325325            <?php do_action( 'groups_adminbar_menu_items' ) ?>
     
    447447                    $query_vars = '?' . $_SERVER['QUERY_STRING'];
    448448
    449                 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/forum/topic/' . $topic_slug . '/' . $query_vars );
     449                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' . $query_vars );
    450450            }
    451451
     
    546546
    547547                    do_action( 'groups_edit_forum_topic', $topic_id );
    548                     bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/forum/topic/' . $topic_slug . '/' );
     548                    bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' );
    549549                }
    550550
     
    592592
    593593                    do_action( 'groups_edit_forum_post', $post_id );
    594                     bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/forum/topic/' . $topic_slug . '/' );
     594                    bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic_slug . '/' );
    595595                }
    596596
     
    619619                    bp_core_add_message( __( 'The topic was created successfully', 'buddypress') );
    620620
    621                 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/forum/topic/' . $topic->topic_slug . '/' );
     621                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' );
    622622            }
    623623
     
    648648                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
    649649            else
    650                 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/' . $bp->wire->slug );
     650                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . $bp->wire->slug );
    651651
    652652        } else if ( 'delete' == $wire_action && ( is_site_admin() || groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) ) {
     
    665665                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
    666666            else
    667                 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/' . $bp->wire->slug );
     667                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . $bp->wire->slug );
    668668
    669669        } else if ( ( !$wire_action || 'latest' == $bp->action_variables[1] ) ) {
     
    790790        return false;
    791791
    792     bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/edit-details' );
     792    bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/edit-details/' );
    793793}
    794794
     
    814814                do_action( 'groups_group_details_edited', $bp->groups->current_group->id );
    815815
    816                 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/edit-details' );
     816                bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/edit-details/' );
    817817            }
    818818
     
    855855            do_action( 'groups_group_settings_edited', $bp->groups->current_group->id );
    856856
    857             bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/group-settings' );
     857            bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/group-settings/' );
    858858        }
    859859
     
    948948            do_action( 'groups_promoted_member', $user_id, $bp->groups->current_group->id );
    949949
    950             bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/manage-members' );
     950            bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/manage-members/' );
    951951        }
    952952
     
    973973            do_action( 'groups_demoted_member', $user_id, $bp->groups->current_group->id );
    974974
    975             bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/manage-members' );
     975            bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/manage-members/' );
    976976        }
    977977
     
    998998            do_action( 'groups_banned_member', $user_id, $bp->groups->current_group->id );
    999999
    1000             bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/manage-members' );
     1000            bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/manage-members/' );
    10011001        }
    10021002
     
    10171017            do_action( 'groups_unbanned_member', $user_id, $bp->groups->current_group->id );
    10181018
    1019             bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/manage-members' );
     1019            bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/manage-members/' );
    10201020        }
    10211021
     
    10711071            do_action( 'groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id );
    10721072
    1073             bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/admin/membership-requests' );
     1073            bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/membership-requests/' );
    10741074        }
    10751075
     
    14291429        return false;
    14301430
    1431     /* If the group is not public, hide the activity sitewide, or basically when not looking at the group feed. */
     1431    /* If the group is not public, hide the activity sitewide. */
    14321432    if ( 'public' == $bp->groups->current_group->status )
    14331433        $hide_sitewide = false;
     
    20712071        $topic = bp_forums_get_topic_details( $topic_id );
    20722072
    2073         $activity_content = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '/forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
     2073        $activity_content = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
    20742074        $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $post_text ) ) . '</blockquote>';
    20752075
     
    20772077        groups_record_activity( array(
    20782078            'content' => apply_filters( 'groups_activity_new_forum_post', $activity_content, $post_text, &$topic, &$forum_post ),
    2079             'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ),
     2079            'primary_link' => apply_filters( 'groups_activity_new_forum_post_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ),
    20802080            'component_action' => 'new_forum_post',
    20812081            'item_id' => $bp->groups->current_group->id,
     
    21002100        $topic = bp_forums_get_topic_details( $topic_id );
    21012101
    2102         $activity_content = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '/forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
     2102        $activity_content = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
    21032103        $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $topic_text ) ) . '</blockquote>';
    21042104
     
    21062106        groups_record_activity( array(
    21072107            'content' => apply_filters( 'groups_activity_new_forum_topic', $activity_content, $topic_text, &$topic ),
    2108             'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ),
     2108            'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ),
    21092109            'component_action' => 'new_forum_topic',
    21102110            'item_id' => $bp->groups->current_group->id,
     
    21282128            bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component_name' => $bp->groups->id, 'component_action' => 'new_forum_topic' ) );
    21292129
    2130         $activity_content = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '/forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
     2130        $activity_content = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
    21312131        $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $topic_text ) ) . '</blockquote>';
    21322132
     
    21342134        groups_record_activity( array(
    21352135            'content' => apply_filters( 'groups_activity_new_forum_topic', $activity_content, $topic_text, &$topic ),
    2136             'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ),
     2136            'primary_link' => apply_filters( 'groups_activity_new_forum_topic_primary_link', bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug . '/' ),
    21372137            'component_action' => 'new_forum_topic',
    21382138            'item_id' => (int)$bp->groups->current_group->id,
     
    21622162            bp_activity_delete_by_item_id( array( 'item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $post_id, 'component_name' => $bp->groups->id, 'component_action' => 'new_forum_post' ) );
    21632163
    2164         $activity_content = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '/forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
     2164        $activity_content = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
    21652165        $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $post_text ) ) . '</blockquote>';
    21662166
  • trunk/bp-themes/bp-default/_inc/css/default.css

    r2188 r2189  
    927927-------------------------------------------------------------- */
    928928
     929ul.activity-list li {
     930    padding: 20px 0 0 0;
     931}
     932    ul.activity-list li.has-comments {
     933        padding-bottom: 20px;
     934    }
     935
    929936.activity-list li.mini {
    930937    font-size: 11px;
    931938    min-height: 35px;
     939    padding: 12px 0 0 0;
    932940}
    933941    .activity-list li.mini div.activity-meta {
     
    10871095
    10881096div.activity-meta {
    1089     margin-left: 3px;
    1090 }
    1091 
    1092 .activity-list div.activity-meta a.acomment-reply {
     1097    margin: 0 0 20px 3px;
     1098}
     1099
     1100.activity-list div.activity-meta a {
    10931101    font-size: 11px;
    1094     background: #FFF9DB;
    1095     border-bottom: 1px solid #FFE8C4;
    1096     border-right: 1px solid #FFE8C4;
    1097     color: #ffa200;
     1102    background: #f4f4f4;
     1103    border-bottom: 1px solid #ddd;
     1104    border-right: 1px solid #ddd;
     1105    color: #999;
    10981106    padding: 4px 8px;
    10991107    text-decoration: none;
     
    11011109    -webkit-border-radius: 4px;
    11021110    border-radius: 4px;
    1103 }
    1104     div.activity-meta a.acomment-reply:hover {
    1105         background: #f7740a;
     1111    margin-right: 3px;
     1112}
     1113    .activity-list div.activity-meta a.acomment-reply {
     1114        background: #FFF9DB;
     1115        border-bottom: 1px solid #FFE8C4;
     1116        border-right: 1px solid #FFE8C4;
     1117        color: #ffa200;
     1118    }
     1119
     1120    div.activity-meta a:hover {
     1121        background: #aaa;
    11061122        color: #fff;
    1107         border-color: #f7740a;
    1108     }
     1123        border-color: #aaa;
     1124    }
     1125        div.activity-meta a.acomment-reply:hover {
     1126            background: #f7740a;
     1127            color: #fff;
     1128            border-color: #f7740a;
     1129        }
    11091130
    11101131div.activity-comments {
    1111     margin: 20px 0 5px 75px;
     1132    margin: 0 0 0 75px;
    11121133    background: #f5f5f5;
    11131134    -moz-border-radius: 4px;
  • trunk/bp-themes/bp-default/_inc/global.js

    r2179 r2189  
    290290                            form.parent().children('ul').append(response).hide().fadeIn( 200 );
    291291                            form.children('textarea').val('');
     292                            form.parent().parent().addClass('has-comments');
    292293                        }
    293294                    );
  • trunk/bp-themes/bp-default/activity/activity-loop.php

    r2170 r2189  
    1616                <?php bp_activity_content() ?>
    1717
    18                 <?php if ( is_user_logged_in() && 'activity_comment' != bp_get_activity_action_name() ) : ?>
    1918                <div class="activity-meta">
    20                     <a href="#acomment-<?php bp_activity_id() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Comment', 'buddypress' ) ?> (<?php bp_activity_comment_count() ?>)</a>
     19                    <?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?>
     20                            <a href="#acomment-<?php bp_activity_id() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Comment', 'buddypress' ) ?> (<?php bp_activity_comment_count() ?>)</a>
     21                    <?php endif; ?>
     22
     23                    <?php if ( !bp_is_activity_permalink() ) : ?>
     24                        <a href="<?php bp_activity_thread_permalink() ?>" title="<?php _e( 'View Thread', 'buddypress' ) ?>"><?php _e( 'View Thread', 'buddypress' ) ?></a>
     25                    <?php endif; ?>
    2126                </div>
    22                 <?php endif; ?>
    2327            </div>
    2428
    25             <?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?>
    26                 <div class="activity-inreplyto">
    27                     <strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> - <?php bp_activity_parent_content() ?>
    28                 </div>
    29             <?php else : ?>
    30                 <div class="activity-comments">
    31                     <?php bp_activity_comments() ?>
     29            <?php if ( bp_activity_can_comment() ) : ?>
    3230
    33                     <?php if ( is_user_logged_in() ) : ?>
    34                     <form action="" method="post" name="activity-comment-form" id="ac-form-<?php bp_activity_id() ?>" class="ac-form">
    35                         <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=25&height=25' ) ?></div>
    36                         <div class="ac-reply-content">
    37                             <div class="ac-textarea">
    38                                 <textarea id="ac-input-<?php bp_activity_id() ?>" class="ac-input" name="ac-input-<?php bp_activity_id() ?>"></textarea>
     31                <?php if ( 'activity_comment' == bp_get_activity_action_name() ) : ?>
     32                    <div class="activity-inreplyto">
     33                        <strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> - <?php bp_activity_parent_content() ?>
     34                    </div>
     35                <?php else : ?>
     36                    <div class="activity-comments">
     37                        <?php bp_activity_comments() ?>
     38
     39                        <?php if ( is_user_logged_in() ) : ?>
     40                        <form action="" method="post" name="activity-comment-form" id="ac-form-<?php bp_activity_id() ?>" class="ac-form">
     41                            <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=25&height=25' ) ?></div>
     42                            <div class="ac-reply-content">
     43                                <div class="ac-textarea">
     44                                    <textarea id="ac-input-<?php bp_activity_id() ?>" class="ac-input" name="ac-input-<?php bp_activity_id() ?>"></textarea>
     45                                </div>
     46                                <input type="submit" name="ac-form-submit" value="<?php _e( 'Post', 'buddypress' ) ?> &rarr;" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ) ?>
    3947                            </div>
    40                             <input type="submit" name="ac-form-submit" value="<?php _e( 'Post', 'buddypress' ) ?> &rarr;" /> &nbsp; <?php _e( 'or press esc to cancel.', 'buddypress' ) ?>
    41                         </div>
    42                         <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?>
    43                     </form>
    44                     <?php endif; ?>
    45                 </div>
    46             <?php endif; ?>
     48                            <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?>
     49                        </form>
     50                        <?php endif; ?>
     51                    </div>
     52                <?php endif; ?>
    4753
     54            <?php endif;?>
    4855        </li>
    4956
Note: See TracChangeset for help on using the changeset viewer.