/themes/p2-buddypress/groupblog/comments.php

  1. <?php 
  2. if ( post_password_required() ) : 
  3. echo '<h3 class="comments-header">' . __('Password Protected', 'buddypress') . '</h3>'; 
  4. echo '<p class="alert password-protected">' . __('Enter the password to view comments.', 'buddypress') . '</p>'; 
  5. return; 
  6. endif; 
  7.  
  8. if ( is_page() && !have_comments() && !comments_open() && !pings_open() ) 
  9. return; 
  10. ?> 
  11.  
  12. <div class="activity single-group"> 
  13.  
  14. <?php if ( bp_has_activities ( 'object=groups&primary_id=' . bp_get_groupblog_id() .'&secondary_id=' . get_the_ID() . '&action=new_blog_post' ) ) : ?> 
  15.  
  16. <ul id="blog-stream" class="activity-list item-list"> 
  17.  
  18. <?php while ( bp_activities() ) : bp_the_activity(); ?> 
  19.  
  20. <?php do_action( 'groupblog_before_activity_entry' ) ?> 
  21.  
  22. <li class="<?php bp_activity_css_class() ?>" id="activity-<?php bp_activity_id() ?>"> 
  23.  
  24. <div class="activity-post"> 
  25.  
  26. <p class="postmetadata">  
  27. <?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?> 
  28. <a href="<?php bp_activity_comment_link() ?>" class="acomment-reply" id="acomment-comment-<?php bp_activity_id() ?>"><?php _e( 'Reply', 'buddypress' ) ?> (<span><?php bp_activity_comment_count() ?></span>)</a> 
  29. <?php else : ?>  
  30. <?php _e( 'Comments', 'buddypress' ) ?> (<span><?php bp_activity_comment_count() ?></span>) 
  31. <?php endif; ?> 
  32.  
  33. <?php if ( is_user_logged_in() ) : ?> 
  34. <?php if ( !bp_get_activity_is_favorite() ) : ?> 
  35. <a href="<?php bp_activity_favorite_link() ?>" class="fav" title="<?php _e( 'Mark as Favorite', 'buddypress' ) ?>"><?php _e( 'Favorite', 'buddypress' ) ?></a> 
  36. <?php else : ?> 
  37. <a href="<?php bp_activity_unfavorite_link() ?>" class="unfav" title="<?php _e( 'Remove Favorite', 'buddypress' ) ?>"><?php _e( 'Remove Favorite', 'buddypress' ) ?></a> 
  38. <?php endif; ?> 
  39. <?php endif;?> 
  40.  
  41. <?php do_action( 'bp_activity_entry_meta' ) ?> 
  42.  
  43. <span class="tags"><?php the_tags( __( 'Tags: ', 'buddypress' ), ', ', '<br />'); ?></span> 
  44. </p> 
  45.  
  46. <?php if ( 'activity_comment' == bp_get_activity_type() ) : ?> 
  47. <div class="activity-inreplyto"> 
  48. <strong><?php _e( 'In reply to', 'buddypress' ) ?></strong> - <?php bp_activity_parent_content() ?> · 
  49. <a href="<?php bp_activity_thread_permalink() ?>" class="view" title="<?php _e( 'View Thread / Permalink', 'buddypress' ) ?>"><?php _e( 'View', 'buddypress' ) ?></a> 
  50. </div> 
  51. <?php endif; ?> 
  52.  
  53. <?php do_action( 'bp_before_activity_entry_comments' ) ?> 
  54.  
  55. <?php if ( bp_activity_can_comment() ) : ?> 
  56. <div class="activity-comments"> 
  57. <?php bp_activity_comments() ?> 
  58.  
  59. <?php if ( is_user_logged_in() ) : ?> 
  60. <form action="<?php bp_activity_comment_form_action() ?>" method="post" id="ac-form-<?php bp_activity_id() ?>" class="ac-form"<?php bp_activity_comment_form_nojs_display() ?>> 
  61. <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=25&height=25' ) ?></div> 
  62. <div class="ac-reply-content"> 
  63. <div class="ac-textarea"> 
  64. <textarea id="ac-input-<?php bp_activity_id() ?>" class="ac-input" name="ac_input_<?php bp_activity_id() ?>"></textarea> 
  65. </div> 
  66. <input type="submit" name="ac_form_submit" value="<?php _e( 'Post', 'buddypress' ) ?> →" />   <?php _e( 'or press esc to cancel.', 'buddypress' ) ?> 
  67. <input type="hidden" name="comment_form_id" value="<?php bp_activity_id() ?>" /> 
  68. </div> 
  69. <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ) ?> 
  70. </form> 
  71. <?php endif; ?> 
  72. </div> 
  73. <?php endif; ?> 
  74.  
  75. <?php do_action( 'bp_after_activity_entry_comments' ) ?> 
  76.  
  77. </div>  
  78.  
  79. </li> 
  80.  
  81. <?php do_action( 'groupblog_after_activity_entry' ) ?> 
  82.  
  83. <?php endwhile; ?> 
  84.  
  85. </ul> 
  86.  
  87. <?php endif; ?> 
  88.  
  89. </div> 
.