Skip to:
Content

BuddyPress.org

Ticket #2988: 2988-3.patch

File 2988-3.patch, 12.1 KB (added by DJPaul, 16 years ago)

I hate mouldy bread

  • bp-themes/bp-default/functions.php

     
    371371 * @since 1.2
    372372 */
    373373function bp_dtheme_blog_comments( $comment, $args, $depth ) {
    374         $GLOBALS['comment'] = $comment; ?>
     374        $GLOBALS['comment'] = $comment;
    375375
    376         <?php if ( 'pingback' == $comment->comment_type ) return false; ?>
     376        if ( 'pingback' == $comment->comment_type )
     377                return false;
    377378
    378         <li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
     379        if ( 1 == $depth )
     380                $avatar_size = 50;
     381        else
     382                $avatar_size = 20;
     383        ?>
     384        <li <?php comment_class() ?> id="comment-<?php comment_ID() ?>">
    379385                <div class="comment-avatar-box">
    380386                        <div class="avb">
    381387                                <a href="<?php echo get_comment_author_url() ?>" rel="nofollow">
    382388                                        <?php if ( $comment->user_id ) : ?>
    383                                                 <?php echo bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'width' => 50, 'height' => 50, 'email' => $comment->comment_author_email ) ); ?>
     389                                                <?php echo bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'width' => $avatar_size, 'height' => $avatar_size, 'email' => $comment->comment_author_email ) ) ?>
    384390                                        <?php else : ?>
    385                                                 <?php echo get_avatar( $comment, 50 ) ?>
     391                                                <?php echo get_avatar( $comment, $avatar_size ) ?>
    386392                                        <?php endif; ?>
    387393                                </a>
    388394                        </div>
    389395                </div>
    390396
    391397                <div class="comment-content">
     398                        <div class="comment-meta">
     399                                <a href="<?php echo get_comment_author_url() ?>" rel="nofollow"><?php echo get_comment_author() ?></a> <?php echo _n( 'said:', 'replied:', $depth, 'buddypress' ) ?></a>
     400                                <span class="time-since">&nbsp; <?php comment_date() ?></span>
    392401
    393                         <div class="comment-meta">
    394                                 <?php printf( __( '%s said:', 'buddypress' ), '<a href="' . get_comment_author_url() . '" rel="nofollow">' . get_comment_author() . '</a>' ) ?>
    395                                 <em><?php _e( 'On', 'buddypress' ) ?> <a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date() ?></a></em>
     402                                <?php if ( 1 == $depth ) : ?>
     403                                        &middot; <a href="#comment-<?php comment_ID() ?>"><?php _e( 'View', 'buddypress' ) ?></a>
     404                                <?php else: ?>
     405                                        &middot; <?php echo comment_reply_link( array( 'depth' => $depth, 'max_depth' => $args['max_depth'], 'reply_text' => __( 'Reply', 'buddypress' ) ) ) ?>
     406                                <?php endif; ?>
     407
     408                                <?php edit_comment_link( __( 'Edit', 'buddypress' ), '&middot; ', '' ) ?>
    396409                        </div>
    397410
    398411                        <?php if ( $comment->comment_approved == '0' ) : ?>
    399                                 <em class="moderate"><?php _e( 'Your comment is awaiting moderation.', 'buddypress' ); ?></em><br />
     412                                <em class="moderate"><?php _e( 'Your comment is awaiting moderation.', 'buddypress' ) ?></em><br />
    400413                        <?php endif; ?>
    401414
    402415                        <?php comment_text() ?>
    403416
    404                         <div class="comment-options">
    405                                 <?php echo comment_reply_link( array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ?>
    406                                 <?php edit_comment_link( __( 'Edit', 'buddypress' ), '', '' ); ?>
    407                         </div>
    408 
     417                        <?php if ( 1 == $depth ) : ?>
     418                                <div class="comment-options">
     419                                        <?php echo comment_reply_link( array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ?>
     420                                </div>
     421                        <?php endif; ?>
    409422                </div>
    410423<?php
    411424}
     
    539552        );
    540553
    541554        $new_labels = array(
    542                 'cancel_reply_link'    => '<p id="cancel-comment-reply">' . __( 'Cancel reply', 'buddypress' ) . '</p>',
    543555                '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>',
    544556                'comment_notes_after'  => '',
    545557                'comment_notes_before' => '',
    546558                'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
    547559                '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>',
    548                 '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>',
    549                 'title_reply'          => '<h3 id="reply" class="comments-header">' . __( 'Leave a reply', 'buddypress' ) . '</h3>',
    550                 'title_reply_to'       => '<h3 id="reply" class="comments-header">' . __( 'Leave a reply to %s', 'buddypress' ) . '</h3>'
     560                '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>'
    551561        );
    552562
    553563        return apply_filters( 'bp_dtheme_comment_form', array_merge( $default_labels, $new_labels ) );
    554564}
    555565add_filter( 'comment_form_defaults', 'bp_dtheme_comment_form', 10 );
    556566
     567/**
     568 * Adds the user's avatar before the comment form box.
     569 *
     570 * The 'comment_form_top' action is used to insert our HTML within <div id="reply">
     571 * so that the nested comments comment-reply javascript moves the entirety of the comment reply area.
     572 *
     573 * @see comment_form()
     574 * @since 1.3
     575 */
     576function bp_dtheme_before_comment_form() {
     577?>
     578        <div class="comment-avatar-box">
     579                <div class="avb">
     580                        <?php if ( bp_loggedin_user_id() ) : ?>
     581                                <a href="<?php echo bp_loggedin_user_domain() ?>">
     582                                        <?php echo get_avatar( bp_loggedin_user_id(), 50 ) ?>
     583                                </a>
     584                        <?php else : ?>
     585                                <?php echo get_avatar( 0, 50 ) ?>
     586                        <?php endif; ?>
     587                </div>
     588        </div>
    557589
     590        <div class="comment-content standard-form">
     591<?php
     592}
     593add_action( 'comment_form_top', 'bp_dtheme_before_comment_form' );
     594
     595/**
     596 * Closes tags opened in bp_dtheme_before_comment_form().
     597 *
     598 * @see bp_dtheme_before_comment_form()
     599 * @see comment_form()
     600 * @since 1.3
     601 */
     602function bp_dtheme_after_comment_form() {
     603?>
     604        </div><!-- .comment-content standard-form -->
     605<?php
     606}
     607add_action( 'comment_form', 'bp_dtheme_after_comment_form' );
     608
     609
    558610// Everything beyond this point is deprecated as of BuddyPress 1.3. This will be removed in a future version.
    559611
    560612/**
  • bp-themes/bp-default/_inc/css/default.css

     
    14941494}
    14951495
    14961496.activity-list .activity-header a:first-child,
     1497.commentlist .depth-1 > .comment-content .comment-meta a:first-child,
    14971498span.highlight {
    14981499        background: #ebf7ff;
    14991500        border-bottom: 1px solid #a1dcfa;
     
    15161517        outline: none;
    15171518}
    15181519
    1519 .activity-list .activity-content span.time-since {
     1520.activity-list .activity-content span.time-since,
     1521.comment-content .comment-meta span.time-since {
    15201522        color: #bbb;
    15211523}
    15221524
     
    16691671        padding: 10px 0 0;
    16701672}
    16711673
    1672 div.activity-comments ul li p:last-child {
     1674div.activity-comments ul li p:last-child,
     1675.commentlist .comment-content a:first-child {
    16731676        margin-bottom: 10px;
    16741677}
    16751678
     
    20522055        border-top: 1px solid #eee;
    20532056}
    20542057
    2055 div.post div.author-box,
    2056 div.comment-avatar-box {
     2058div.post div.author-box {
    20572059        background: #f0f0f0;
    20582060        padding: 10px;
    20592061        float: left;
     
    20772079        text-decoration: none;
    20782080}
    20792081
    2080 div.post div.author-box img,
    2081 div.comment-avatar-box img {
     2082div.post div.author-box img {
    20822083        float: none;
    20832084        border: 4px solid #fff;
    20842085        margin: 0;
    20852086}
    20862087
    2087 div.post div.post-content,
    2088 div.comment-content {
     2088div.post div.post-content {
    20892089        margin-left: 105px;
    20902090}
    20912091
    2092 div.post p.date, div.post p.postmetadata,
    2093 div.comment-meta, div.comment-options {
     2092div.post p.date,
     2093div.post p.postmetadata {
    20942094        color: #888;
    20952095        font-size: 12px;
    20962096        font-family: Georgia, times, serif;
     
    21882188        margin-top: 30px;
    21892189}
    21902190
    2191 #comments h3,
    2192 #trackbacks h3,
    2193 #respond h3 {
    2194         font-size: 20px;
    2195         margin: 5px 0 25px 0;
    2196         font-weight: normal;
    2197         color: #555;
     2191.commentlist .bypostauthor {
    21982192}
    21992193
    2200 #comments span.title,
    2201 #trackbacks span.title {
    2202         color: #aaa;
     2194#comments ol.commentlist {
     2195        border-bottom: 1px solid #e4e4e4;
     2196        margin-bottom: 30px;
    22032197}
    22042198
    2205 .commentlist .bypostauthor {
     2199ol.commentlist div.comment-avatar-box {
     2200        float: left;
     2201        margin: 10px 10px 10px 0;
    22062202}
    22072203
    2208 ol.commentlist li {
    2209         margin: 0 0 30px 0;
     2204ul.children div.comment-avatar-box {
     2205        float: left;
     2206        margin: 0px 10px 10px 0;
    22102207}
    22112208
    2212 ol.commentlist ul.children {
    2213         margin-left: 105px;
     2209div.comment-avatar-box img {
     2210        border: 2px solid #eee;
    22142211}
    22152212
    2216 div.comment-meta {
     2213div.comment-content {
     2214        border-top: 1px solid #e4e4e4;
     2215        padding-left: 75px;
     2216}
     2217
     2218.commentlist .children .comment {
     2219        margin-bottom: 5px;
     2220}
     2221
     2222div.comment-meta,
     2223div.comment-options {
     2224        color: #888;
     2225        font-size: 11px;
     2226        margin: 10px 0;
     2227        padding: 0 0 3px;
     2228}
     2229
     2230div.comment-meta em {
     2231        font-style: normal;
     2232}
     2233
     2234div.comment-meta span.comment-highlight a {
     2235        background: #EBF7FF;
     2236        border-bottom: 1px solid #a1dcfa;
     2237        border-radius: 4px;
     2238        border-right: 1px solid #a1dcfa;
     2239        color: #059AE7;
     2240        margin-right: 3px;
     2241        padding: 3px 8px;
     2242        text-decoration: none;
     2243        -moz-border-radius: 4px;
     2244        -webkit-border-radius: 4px;
     2245}
     2246
     2247div.comment-meta .comment-highlight a:hover,
     2248.commentlist .depth-1 > .comment-content .comment-meta a:first-child:hover {
     2249        background: #059AE7;
     2250        border-color: #059AE7;
     2251        color: #fff;
     2252}
     2253
     2254div.comment-options a.comment-reply-link {
     2255        background: #FFF9DB;
     2256        border-bottom: 1px solid #FFE8C4;
     2257        border-radius: 4px;
     2258        border-right: 1px solid #FFE8C4;
     2259        color: #ffa200;
     2260        margin-right: 10px;
     2261        padding: 3px 8px;
     2262        text-decoration: none;
     2263        -moz-border-radius: 4px;
     2264        -webkit-border-radius: 4px;
     2265}
     2266
     2267div.comment-options a.comment-reply-link:hover {
     2268        background: #f7740a;
     2269        border-color: #f7740a;
     2270        color: #fff;
     2271}
     2272
     2273ul.children {
     2274        background: #f5f5f5;
     2275        margin-bottom: 20px;
     2276        margin-left: 75px;
     2277        padding: 1px 10px;
     2278        -moz-border-radius: 4px;
     2279        -webkit-border-radius: 4px;
     2280}
     2281
     2282ul.children ul {
     2283        margin-left: 20px;
     2284        margin-bottom: 0;
     2285        padding: 0;
     2286}
     2287
     2288ul.children img.avatar {
     2289        border-style: none;
     2290        height: 25px;
     2291        margin: 0;
     2292        width: 25px;
     2293}
     2294
     2295ul.children div.comment-content {
    22172296        border-top: none;
    2218         padding-top: 0;
     2297        padding-left: 35px;
    22192298}
    22202299
    2221 div.comment-meta h5 {
    2222         font-weight: normal;
     2300ul.children div.comment-meta {
     2301        font-size: 11px;
     2302        margin-top: 0;
    22232303}
    22242304
    2225 div.comment-meta em {
     2305ul.children div.comment-options {
     2306        margin-bottom: 5px;
     2307        margin-top: 0;
     2308}
     2309
     2310ul.children li {
     2311        border-top: 2px solid #fffeff;
     2312        padding-top: 10px;
     2313}
     2314
     2315ul.children li:first-child {
     2316        border-top: none;
     2317}
     2318
     2319ul.children ul li:first-child {
     2320        border-top: 2px solid #fffeff;
     2321}
     2322
     2323ul.children div.comment-options a.comment-reply-link {
     2324        background: transparent;
     2325        border-style: none;
     2326        color: #1fb3dd;
     2327        margin-right: 0;
     2328        padding: 3px 8px;
     2329        text-decoration: underline;
     2330}
     2331
     2332ul.children div.comment-options a.comment-reply-link:hover {
     2333        background: transparent;
     2334        border-style: none;
     2335        color: #1fb3dd;
     2336}
     2337
     2338#respond {
     2339        background-color: #fafafa;
     2340        border: 1px solid #e5e5e5;
     2341        border-radius: 4px;
     2342        margin-bottom: 20px;
     2343        margin-left: 75px;
     2344        padding: 10px;
     2345        -moz-border-radius: 4px;
     2346        -webkit-border-radius: 4px;
     2347}
     2348
     2349ul.children #respond {
     2350        margin-bottom: 10px;
     2351        margin-left: 35px;
     2352        margin-right: 20px;
     2353}
     2354
     2355h3#reply .comments-header {
     2356        font-size: 14px;
     2357}
     2358
     2359#reply-title small {
    22262360        float: right;
    22272361}
    22282362
    2229 div.comment-options {
    2230         border-bottom: none;
     2363#respond div.comment-avatar-box {
     2364        margin-top: 0;
    22312365}
    22322366
     2367#respond div.comment-content {
     2368        border-style: none;
     2369}
    22332370
     2371
    22342372/* > Footer
    22352373-------------------------------------------------------------- */
    22362374
  • 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 ) ) : ?>