Skip to:
Content

BuddyPress.org

Ticket #2978: comments.patch

File comments.patch, 6.1 KB (added by denis.ogun, 14 years ago)
  • bp-themes/bp-default/comments.php

     
    8686
    8787                        <div class="comment-content">
    8888
    89                                 <h3 id="reply" class="comments-header">
    90                                         <?php comment_form_title( __( 'Leave a Reply', 'buddypress' ), __( 'Leave a Reply to %s', 'buddypress' ), true ); ?>
    91                                 </h3>
    92 
    93                                 <p id="cancel-comment-reply">
    94                                         <?php cancel_comment_reply_link( __( 'Click here to cancel reply.', 'buddypress' ) ); ?>
    95                                 </p>
    96 
    97                                 <?php if ( get_option( 'comment_registration' ) && !$user_ID ) : ?>
    98 
    99                                         <p class="alert">
    100                                                 <?php printf( __('You must be <a href="%1$s" title="Log in">logged in</a> to post a comment.', 'buddypress'), wp_login_url( get_permalink() ) ); ?>
    101                                         </p>
    102 
    103                                 <?php else : ?>
    104 
    105                                         <?php do_action( 'bp_before_blog_comment_form' ) ?>
    106 
    10789                                        <form action="<?php echo site_url( 'wp-comments-post.php' ) ?>" method="post" id="commentform" class="standard-form">
     90                                               
     91                                                        <?php
     92                                $fields = array(
     93                                                        'author'                                => '<p class="form-author">' . '<label for="author">' . __('Name', 'buddypress') . ( $req ? '<span                                                                                                                                              class="required">' . __(' *', 'buddypress') . '</span>' : '' ) . '</label> ' . '<input id="author"                                                                                                                                      name="author" type="text" class="text-input" value="' . $comment_author . '" size="40" tabindex="1"' . ' /></                                                                                                           p>',
     94                                                        'email  '                               => '<p class="form-email">' . '<label for="email">' . __('Email', 'buddypress') . ( $req ? '<span                                                                                                                                               class="required">' . __(' *', 'buddypress') . '</span>' : '' ) . '</label> ' . '<input id="email"                                                                                                                                       name="email" type="text" class="text-input" value="' . $comment_author_email . '" size="40" tabindex="2"' .                                                                                                             ' /></p>',     
     95                                                        'url    '                               => '<p class="form-url">' . '<label for="url">' . __('Website', 'buddypress') . '</label> ' . '<input id="url"                                                                                                                  name="url" type="text"  class="text-input" value="' . $comment_author_url . '" size="40" tabindex="3"' .                                                                                                                        ' /></p>'                                               
     96                                                );
     97                               
     98               
     99                                $defaults = array(
     100                                                        'label_submit'                  => __('Submit', 'buddypress'),
     101                                                        'id_submit'                     => 'submit',
     102                                                        'comment_field'                 => '<p class="form-textarea"><label for="comment">' . __( 'Comment', 'buddypress' ) . '</label><textarea                                                                                                                                name="comment" id="comment" cols="60" rows="10" tabindex="4"></textarea></p>',
     103                                                        'id_form'                       => 'commentform',
     104                                                        'comment_notes_after'   => '',
     105                                                        'comment_notes_before'  => '',
     106                                                        'must_log_in'                   => '<p class="alert">' . sprintf( __('You must be <a href="%1$s" title="Log in">logged in</a> to post a                                                                                                                                 comment.', 'buddypress'), wp_login_url( get_permalink() ) )     . '</p>',
     107                                                        'logged_in_as'                  => '<p class="log-in-out">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out                                                                                                                 of this account">Log out &rarr;</a>' ), bp_loggedin_user_domain(), $user_identity,                                                                                                                                                                      wp_logout_url( get_permalink() ) ) . '</p>',
     108                                                        'fields'                =>  apply_filters( 'comment_form_default_fields', $fields ),
     109                                                        'cancel_reply_link'     =>  '<p id="cancel-comment-reply">' . __( 'Click here to cancel reply.', 'buddypress') . '</p>',
     110                                                        'title_reply'               =>  '<h3 id="reply" class="comments-header">' . __( 'Leave a Reply', 'buddypress' ) . '</h3>',
     111                                                        'title_reply_to'                =>  '<h3 id="reply" class="comments-header">' . __( 'Leave a reply to %s', 'buddypress') . '</h3>'
     112                                               
     113                                                );
     114                                               
     115                                               
     116                                                ?>
    108117
    109                                                 <?php if ( $user_ID ) : ?>
     118                                        <?php comment_form($defaults); ?>
    110119
    111                                                         <p class="log-in-out">
    112                                                                 <?php printf( __('Logged in as <a href="%1$s" title="%2$s">%2$s</a>.', 'buddypress'), bp_loggedin_user_domain(), $user_identity ); ?> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="<?php _e('Log out of this account', 'buddypress'); ?>"><?php _e('Log out &rarr;', 'buddypress'); ?></a>
    113                                                         </p>
    114 
    115                                                 <?php else : ?>
    116 
    117                                                         <?php $req = get_option( 'require_name_email' ); ?>
    118 
    119                                                         <p class="form-author">
    120                                                                 <label for="author"><?php _e('Name', 'buddypress'); ?> <?php if ( $req ) : ?><span class="required"><?php _e('*', 'buddypress'); ?></span><?php endif; ?></label>
    121                                                                 <input type="text" class="text-input" name="author" id="author" value="<?php echo $comment_author; ?>" size="40" tabindex="1" />
    122                                                         </p>
    123 
    124                                                         <p class="form-email">
    125                                                                 <label for="email"><?php _e('Email', 'buddypress'); ?>  <?php if ( $req ) : ?><span class="required"><?php _e('*', 'buddypress'); ?></span><?php endif; ?></label>
    126                                                                 <input type="text" class="text-input" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" />
    127                                                         </p>
    128 
    129                                                         <p class="form-url">
    130                                                                 <label for="url"><?php _e('Website', 'buddypress'); ?></label>
    131                                                                 <input type="text" class="text-input" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="40" tabindex="3" />
    132                                                         </p>
    133 
    134                                                 <?php endif; ?>
    135 
    136                                                 <p class="form-textarea">
    137                                                         <label for="comment"><?php _e('Comment', 'buddypress'); ?></label>
    138                                                         <textarea name="comment" id="comment" cols="60" rows="10" tabindex="4"></textarea>
    139                                                 </p>
    140 
    141                                                 <?php do_action( 'bp_blog_comment_form' ) ?>
    142 
    143                                                 <p class="form-submit">
    144                                                         <input class="submit-comment button" name="submit" type="submit" id="submit" tabindex="5" value="<?php _e('Submit', 'buddypress'); ?>" />
    145                                                         <?php comment_id_fields(); ?>
    146                                                 </p>
    147 
    148                                                 <div class="comment-action">
    149                                                         <?php do_action( 'comment_form', $post->ID ); ?>
    150                                                 </div>
    151 
    152120                                        </form>
    153121
    154                                         <?php do_action( 'bp_after_blog_comment_form' ) ?>
    155 
    156122                                <?php endif; ?>
     123                               
     124                       
    157125
     126
    158127                        </div><!-- .comment-content -->
    159128                </div><!-- #respond -->
     129       
    160130
    161                 <?php endif; ?>
    162 
    163131                <?php if ( isset( $numTrackBacks ) && $numTrackBacks ) : ?>
    164132                        <div id="trackbacks">
    165133
     
    180148                                        <?php endforeach; ?>
    181149                                </ul>
    182150                        </div>
    183                 <?php endif; ?>
     151                <?php endif; ?>
     152 No newline at end of file