Skip to:
Content

BuddyPress.org

Ticket #2988: 2988-2.patch

File 2988-2.patch, 11.9 KB (added by DJPaul, 16 years ago)
  • bp-themes/bp-default/functions.php

     
    361361 * @since 1.2
    362362 */
    363363function bp_dtheme_blog_comments( $comment, $args, $depth ) {
    364         $GLOBALS['comment'] = $comment; ?>
     364        $GLOBALS['comment'] = $comment;
    365365
    366         <?php if ( 'pingback' == $comment->comment_type ) return false; ?>
     366        if ( 'pingback' == $comment->comment_type )
     367                return false;
    367368
    368         <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
     369        if ( 1 == $depth )
     370                $avatar_size = 50;
     371        else
     372                $avatar_size = 20;
     373        ?>
     374        <li <?php comment_class() ?> id="comment-<?php comment_ID() ?>">
    369375                <div class="comment-avatar-box">
    370376                        <div class="avb">
    371377                                <a href="<?php echo get_comment_author_url() ?>" rel="nofollow">
    372378                                        <?php if ( $comment->user_id ) : ?>
    373                                                 <?php echo bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'width' => 50, 'height' => 50, 'email' => $comment->comment_author_email ) ); ?>
     379                                                <?php echo bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'width' => $avatar_size, 'height' => $avatar_size, 'email' => $comment->comment_author_email ) ) ?>
    374380                                        <?php else : ?>
    375                                                 <?php echo get_avatar( $comment, 50 ) ?>
     381                                                <?php echo get_avatar( $comment, $avatar_size ) ?>
    376382                                        <?php endif; ?>
    377383                                </a>
    378384                        </div>
    379385                </div>
    380386
    381387                <div class="comment-content">
     388                        <div class="comment-meta">
     389                                <a href="<?php echo get_comment_author_url() ?>" rel="nofollow"><?php echo get_comment_author() ?></a> <?php echo _n( 'said:', 'replied:', $depth, 'buddypress' ) ?></a>
     390                                <span class="time-since">&nbsp; <?php comment_date() ?></span>
    382391
    383                         <div class="comment-meta">
    384                                 <a href="<?php echo get_comment_author_url() ?>" rel="nofollow"><?php echo get_comment_author(); ?></a> <?php _e( 'said:', 'buddypress' ) ?>
    385                                 <em><?php _e( 'On', 'buddypress' ) ?> <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date() ?></a></em>
     392                                <?php if ( 1 == $depth ) : ?>
     393                                        &middot; <a href="#comment-<?php comment_ID() ?>"><?php _e( 'View', 'buddypress' ) ?></a>
     394                                <?php else: ?>
     395                                        &middot; <?php echo comment_reply_link( array( 'depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => __( 'Reply', 'buddypress' ) ) ) ?>
     396                                <?php endif; ?>
     397
     398                                <?php edit_comment_link( __( 'Edit', 'buddypress' ), '&middot; ', '' ) ?>
    386399                        </div>
    387400
    388401                        <?php if ( $comment->comment_approved == '0' ) : ?>
    389                                 <em class="moderate"><?php _e( 'Your comment is awaiting moderation.', 'buddypress' ); ?></em><br />
     402                                <em class="moderate"><?php _e( 'Your comment is awaiting moderation.', 'buddypress' ) ?></em><br />
    390403                        <?php endif; ?>
    391404
    392405                        <?php comment_text() ?>
    393406
    394                         <div class="comment-options">
    395                                 <?php echo comment_reply_link( array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ?>
    396                                 <?php edit_comment_link( __( 'Edit', 'buddypress' ), '', '' ); ?>
    397                         </div>
    398 
     407                        <?php if ( 1 == $depth ) : ?>
     408                                <div class="comment-options">
     409                                        <?php echo comment_reply_link( array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ?>
     410                                </div>
     411                        <?php endif; ?>
    399412                </div>
    400413<?php
    401414}
     
    529542        );
    530543
    531544        $new_labels = array(
    532                 'cancel_reply_link'    => '<p id="cancel-comment-reply">' . __( 'Cancel reply', 'buddypress' ) . '</p>',
    533545                'comment_field'        => '<p class="form-textarea"><label for="comment">' . __( 'Comment', 'buddypress' ) . '</label><textarea name="comment" id="comment" cols="60" rows="10" aria-required="true"></textarea></p>',
    534546                'comment_notes_after'  => '',
    535547                'comment_notes_before' => '',
    536548                'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
    537549                'logged_in_as'         => '<p class="log-in-out">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s">Log out?</a>', 'buddypress' ), bp_loggedin_user_domain(), $user_identity, wp_logout_url( get_permalink() ) ) . '</p>',
    538                 'must_log_in'          => '<p class="alert">' . sprintf( __( 'You must be <a href="%1$s">logged in</a> to post a comment.', 'buddypress' ), wp_login_url( get_permalink() ) )   . '</p>',
    539                 'title_reply'          => '<h3 id="reply" class="comments-header">' . __( 'Leave a reply', 'buddypress' ) . '</h3>',
    540                 'title_reply_to'       => '<h3 id="reply" class="comments-header">' . __( 'Leave a reply to %s', 'buddypress' ) . '</h3>'
     550                'must_log_in'          => '<p class="alert">' . sprintf( __( 'You must be <a href="%1$s">logged in</a> to post a comment.', 'buddypress' ), wp_login_url( get_permalink() ) )   . '</p>'
    541551        );
    542552
    543553        return apply_filters( 'bp_dtheme_comment_form', array_merge( $default_labels, $new_labels ) );
    544554}
    545555add_filter( 'comment_form_defaults', 'bp_dtheme_comment_form', 10 );
    546556
     557/**
     558 * Adds the user's avatar before the comment form box.
     559 *
     560 * The 'comment_form_top' action is used to insert our HTML within <div id="reply">
     561 * so that the nested comments comment-reply javascript moves the entirety of the comment reply area.
     562 *
     563 * @see comment_form()
     564 * @since 1.3
     565 */
     566function bp_dtheme_before_comment_form() {
     567?>
     568        <div class="comment-avatar-box">
     569                <div class="avb">
     570                        <?php if ( bp_loggedin_user_id() ) : ?>
     571                                <a href="<?php echo bp_loggedin_user_domain() ?>">
     572                                        <?php echo get_avatar( bp_loggedin_user_id(), 50 ) ?>
     573                                </a>
     574                        <?php else : ?>
     575                                <?php echo get_avatar( 0, 50 ) ?>
     576                        <?php endif; ?>
     577                </div>
     578        </div>
    547579
     580        <div class="comment-content standard-form">
     581<?php
     582}
     583add_action( 'comment_form_top', 'bp_dtheme_before_comment_form' );
     584
     585/**
     586 * Closes tags opened in bp_dtheme_before_comment_form().
     587 *
     588 * @see bp_dtheme_before_comment_form()
     589 * @see comment_form()
     590 * @since 1.3
     591 */
     592function bp_dtheme_after_comment_form() {
     593?>
     594        </div><!-- .comment-content standard-form -->
     595<?php
     596}
     597add_action( 'comment_form', 'bp_dtheme_after_comment_form' );
     598
     599
    548600// Everything beyond this point is deprecated as of BuddyPress 1.3. This will be removed in a future version.
    549601
    550602/**
  • bp-themes/bp-default/_inc/css/default.css

     
    14831483}
    14841484
    14851485.activity-list .activity-header a:first-child,
     1486.commentlist .depth-1 > .comment-content .comment-meta a:first-child,
    14861487span.highlight {
    14871488        background: #ebf7ff;
    14881489        border-bottom: 1px solid #a1dcfa;
     
    15051506        outline: none;
    15061507}
    15071508
    1508 .activity-list .activity-content span.time-since {
     1509.activity-list .activity-content span.time-since,
     1510.comment-content .comment-meta span.time-since {
    15091511        color: #bbb;
    15101512}
    15111513
     
    16581660        padding: 10px 0 0;
    16591661}
    16601662
    1661 div.activity-comments ul li p:last-child {
     1663div.activity-comments ul li p:last-child,
     1664.commentlist .comment-content a:first-child {
    16621665        margin-bottom: 10px;
    16631666}
    16641667
     
    20332036        border-top: 1px solid #eee;
    20342037}
    20352038
    2036 div.post div.author-box,
    2037 div.comment-avatar-box {
     2039div.post div.author-box {
    20382040        background: #f0f0f0;
    20392041        padding: 10px;
    20402042        float: left;
     
    20582060        text-decoration: none;
    20592061}
    20602062
    2061 div.post div.author-box img,
    2062 div.comment-avatar-box img {
     2063div.post div.author-box img {
    20632064        float: none;
    20642065        border: 4px solid #fff;
    20652066        margin: 0;
    20662067}
    20672068
    2068 div.post div.post-content,
    2069 div.comment-content {
     2069div.post div.post-content {
    20702070        margin-left: 105px;
    20712071}
    20722072
    2073 div.post p.date, div.post p.postmetadata,
    2074 div.comment-meta, div.comment-options {
     2073div.post p.date,
     2074div.post p.postmetadata {
    20752075        color: #888;
    20762076        font-size: 12px;
    20772077        font-family: Georgia, times, serif;
     
    21692169        margin-top: 30px;
    21702170}
    21712171
    2172 #comments h3,
    2173 #trackbacks h3,
    2174 #respond h3 {
    2175         font-size: 20px;
    2176         margin: 5px 0 25px 0;
    2177         font-weight: normal;
    2178         color: #555;
     2172#comments ol.commentlist {
     2173        border-bottom: 1px solid #e4e4e4;
     2174        margin-bottom: 30px;
    21792175}
    21802176
    2181 #comments span.title,
    2182 #trackbacks span.title {
    2183         color: #aaa;
     2177ol.commentlist div.comment-avatar-box {
     2178        float: left;
     2179        margin: 10px 10px 10px 0;
    21842180}
    21852181
    2186 ol.commentlist li {
    2187         margin: 0 0 30px 0;
     2182ul.children div.comment-avatar-box {
     2183        float: left;
     2184        margin: 0px 10px 10px 0;
    21882185}
    21892186
    2190 div.comment-meta {
     2187div.comment-avatar-box img {
     2188        border: 2px solid #eee;
     2189}
     2190
     2191div.comment-content {
     2192        border-top: 1px solid #e4e4e4;
     2193        padding-left: 75px;
     2194}
     2195
     2196.commentlist .children .comment {
     2197        margin-bottom: 5px;
     2198}
     2199
     2200div.comment-meta,
     2201div.comment-options {
     2202        color: #888;
     2203        font-size: 11px;
     2204        margin: 10px 0;
     2205        padding: 0 0 3px;
     2206}
     2207
     2208div.comment-meta em {
     2209        font-style: normal;
     2210}
     2211
     2212div.comment-meta span.comment-highlight a {
     2213        background: #EBF7FF;
     2214        border-bottom: 1px solid #a1dcfa;
     2215        border-radius: 4px;
     2216        border-right: 1px solid #a1dcfa;
     2217        color: #059AE7;
     2218        margin-right: 3px;
     2219        padding: 3px 8px;
     2220        text-decoration: none;
     2221        -moz-border-radius: 4px;
     2222        -webkit-border-radius: 4px;
     2223}
     2224
     2225div.comment-meta .comment-highlight a:hover,
     2226.commentlist .depth-1 > .comment-content .comment-meta a:first-child:hover {
     2227        background: #059AE7;
     2228        border-color: #059AE7;
     2229        color: #fff;
     2230}
     2231
     2232div.comment-options a.comment-reply-link {
     2233        background: #FFF9DB;
     2234        border-bottom: 1px solid #FFE8C4;
     2235        border-radius: 4px;
     2236        border-right: 1px solid #FFE8C4;
     2237        color: #ffa200;
     2238        margin-right: 10px;
     2239        padding: 3px 8px;
     2240        text-decoration: none;
     2241        -moz-border-radius: 4px;
     2242        -webkit-border-radius: 4px;
     2243}
     2244
     2245div.comment-options a.comment-reply-link:hover {
     2246        background: #f7740a;
     2247        border-color: #f7740a;
     2248        color: #fff;
     2249}
     2250
     2251ul.children {
     2252        background: #f5f5f5;
     2253        margin-bottom: 20px;
     2254        margin-left: 75px;
     2255        padding: 1px 10px;
     2256        -moz-border-radius: 4px;
     2257        -webkit-border-radius: 4px;
     2258}
     2259
     2260ul.children ul {
     2261        margin-left: 20px;
     2262        margin-bottom: 0;
     2263        padding: 0;
     2264}
     2265
     2266ul.children img.avatar {
     2267        border-style: none;
     2268        height: 25px;
     2269        margin: 0;
     2270        width: 25px;
     2271}
     2272
     2273ul.children div.comment-content {
    21912274        border-top: none;
    2192         padding-top: 0;
     2275        padding-left: 35px;
    21932276}
    21942277
    2195 div.comment-meta h5 {
    2196         font-weight: normal;
     2278ul.children div.comment-meta {
     2279        font-size: 11px;
     2280        margin-top: 0;
    21972281}
    21982282
    2199 div.comment-meta em {
     2283ul.children div.comment-options {
     2284        margin-bottom: 5px;
     2285        margin-top: 0;
     2286}
     2287
     2288ul.children li {
     2289        border-top: 2px solid #fffeff;
     2290        padding-top: 10px;
     2291}
     2292
     2293ul.children li:first-child {
     2294        border-top: none;
     2295}
     2296
     2297ul.children ul li:first-child {
     2298        border-top: 2px solid #fffeff;
     2299}
     2300
     2301ul.children div.comment-options a.comment-reply-link {
     2302        background: transparent;
     2303        border-style: none;
     2304        color: #1fb3dd;
     2305        margin-right: 0;
     2306        padding: 3px 8px;
     2307        text-decoration: underline;
     2308}
     2309
     2310ul.children div.comment-options a.comment-reply-link:hover {
     2311        background: transparent;
     2312        border-style: none;
     2313        color: #1fb3dd;
     2314}
     2315
     2316#respond {
     2317        background-color: #fafafa;
     2318        border: 1px solid #e5e5e5;
     2319        border-radius: 4px;
     2320        margin-bottom: 20px;
     2321        margin-left: 75px;
     2322        padding: 10px;
     2323        -moz-border-radius: 4px;
     2324        -webkit-border-radius: 4px;
     2325}
     2326
     2327ul.children #respond {
     2328        margin-bottom: 10px;
     2329        margin-left: 35px;
     2330        margin-right: 20px;
     2331}
     2332
     2333h3#reply .comments-header {
     2334        font-size: 14px;
     2335}
     2336
     2337#reply-title small {
    22002338        float: right;
    22012339}
    22022340
    2203 div.comment-options {
    2204         border-bottom: none;
     2341#respond div.comment-avatar-box {
     2342        margin-top: 0;
    22052343}
    22062344
    2207 ol.commentlist ul.children {
    2208         margin-left: 105px;
     2345#respond div.comment-content {
     2346        border-style: none;
    22092347}
    22102348
    22112349
  • bp-themes/bp-default/comments.php

     
    5454<?php endif; ?>
    5555
    5656<?php if ( comments_open() ) : ?>
    57         <div id="respond">
    58 
    59                 <div class="comment-avatar-box">
    60                         <div class="avb">
    61                                 <?php if ( bp_loggedin_user_id() ) : ?>
    62                                         <a href="<?php echo bp_loggedin_user_domain() ?>">
    63                                                 <?php echo get_avatar( bp_loggedin_user_id(), 50 ) ?>
    64                                         </a>
    65                                 <?php else : ?>
    66                                         <?php echo get_avatar( 0, 50 ) ?>
    67                                 <?php endif; ?>
    68                         </div>
    69                 </div>
    70 
    71                 <div class="comment-content standard-form">
    72                         <?php comment_form() ?>
    73                 </div><!-- .comment-content -->
    74 
    75         </div><!-- #respond -->
     57        <?php comment_form() ?>
    7658<?php endif; ?>
    7759
    7860<?php if ( !empty( $num_trackbacks ) ) : ?>