/bp-templates/bp-legacy/buddypress/activity/entry.php

  1. <?php 
  2. /** 
  3. * BuddyPress - Activity Stream (Single Item) 
  4. * 
  5. * This template is used by activity-loop.php and AJAX functions to show 
  6. * each activity. 
  7. * 
  8. * @package BuddyPress 
  9. * @subpackage bp-legacy 
  10. */ 
  11.  
  12. /** 
  13. * Fires before the display of an activity entry. 
  14. * 
  15. * @since 1.2.0 
  16. */ 
  17. do_action( 'bp_before_activity_entry' ); ?> 
  18.  
  19. <li class="<?php bp_activity_css_class(); ?>" id="activity-<?php bp_activity_id(); ?>"> 
  20. <div class="activity-avatar"> 
  21. <a href="<?php bp_activity_user_link(); ?>"> 
  22.  
  23. <?php bp_activity_avatar(); ?> 
  24.  
  25. </a> 
  26. </div> 
  27.  
  28. <div class="activity-content"> 
  29.  
  30. <div class="activity-header"> 
  31.  
  32. <?php bp_activity_action(); ?> 
  33.  
  34. </div> 
  35.  
  36. <?php if ( bp_activity_has_content() ) : ?> 
  37.  
  38. <div class="activity-inner"> 
  39.  
  40. <?php bp_activity_content_body(); ?> 
  41.  
  42. </div> 
  43.  
  44. <?php endif; ?> 
  45.  
  46. <?php 
  47.  
  48. /** 
  49. * Fires after the display of an activity entry content. 
  50. * 
  51. * @since 1.2.0 
  52. */ 
  53. do_action( 'bp_activity_entry_content' ); ?> 
  54.  
  55. <div class="activity-meta"> 
  56.  
  57. <?php if ( bp_get_activity_type() == 'activity_comment' ) : ?> 
  58.  
  59. <a href="<?php bp_activity_thread_permalink(); ?>" class="button view bp-secondary-action"><?php _e( 'View Conversation', 'buddypress' ); ?></a> 
  60.  
  61. <?php endif; ?> 
  62.  
  63. <?php if ( is_user_logged_in() ) : ?> 
  64.  
  65. <?php if ( bp_activity_can_comment() ) : ?> 
  66.  
  67. <a href="<?php bp_activity_comment_link(); ?>" class="button acomment-reply bp-primary-action" id="acomment-comment-<?php bp_activity_id(); ?>"><?php printf( __( 'Comment %s', 'buddypress' ), '<span>' . bp_activity_get_comment_count() . '</span>' ); ?></a> 
  68.  
  69. <?php endif; ?> 
  70.  
  71. <?php if ( bp_activity_can_favorite() ) : ?> 
  72.  
  73. <?php if ( !bp_get_activity_is_favorite() ) : ?> 
  74.  
  75. <a href="<?php bp_activity_favorite_link(); ?>" class="button fav bp-secondary-action"><?php _e( 'Favorite', 'buddypress' ); ?></a> 
  76.  
  77. <?php else : ?> 
  78.  
  79. <a href="<?php bp_activity_unfavorite_link(); ?>" class="button unfav bp-secondary-action"><?php _e( 'Remove Favorite', 'buddypress' ); ?></a> 
  80.  
  81. <?php endif; ?> 
  82.  
  83. <?php endif; ?> 
  84.  
  85. <?php if ( bp_activity_user_can_delete() ) bp_activity_delete_link(); ?> 
  86.  
  87. <?php 
  88.  
  89. /** 
  90. * Fires at the end of the activity entry meta data area. 
  91. * 
  92. * @since 1.2.0 
  93. */ 
  94. do_action( 'bp_activity_entry_meta' ); ?> 
  95.  
  96. <?php endif; ?> 
  97.  
  98. </div> 
  99.  
  100. </div> 
  101.  
  102. <?php 
  103.  
  104. /** 
  105. * Fires before the display of the activity entry comments. 
  106. * 
  107. * @since 1.2.0 
  108. */ 
  109. do_action( 'bp_before_activity_entry_comments' ); ?> 
  110.  
  111. <?php if ( ( bp_activity_get_comment_count() || bp_activity_can_comment() ) || bp_is_single_activity() ) : ?> 
  112.  
  113. <div class="activity-comments"> 
  114.  
  115. <?php bp_activity_comments(); ?> 
  116.  
  117. <?php if ( is_user_logged_in() && bp_activity_can_comment() ) : ?> 
  118.  
  119. <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(); ?>> 
  120. <div class="ac-reply-avatar"><?php bp_loggedin_user_avatar( 'width=' . BP_AVATAR_THUMB_WIDTH . '&height=' . BP_AVATAR_THUMB_HEIGHT ); ?></div> 
  121. <div class="ac-reply-content"> 
  122. <div class="ac-textarea"> 
  123. <label for="ac-input-<?php bp_activity_id(); ?>" class="bp-screen-reader-text"><?php 
  124. /** translators: accessibility text */ 
  125. _e( 'Comment', 'buddypress' ); 
  126. ?></label> 
  127. <textarea id="ac-input-<?php bp_activity_id(); ?>" class="ac-input bp-suggestions" name="ac_input_<?php bp_activity_id(); ?>"></textarea> 
  128. </div> 
  129. <input type="submit" name="ac_form_submit" value="<?php esc_attr_e( 'Post', 'buddypress' ); ?>" />   <a href="#" class="ac-reply-cancel"><?php _e( 'Cancel', 'buddypress' ); ?></a> 
  130. <input type="hidden" name="comment_form_id" value="<?php bp_activity_id(); ?>" /> 
  131. </div> 
  132.  
  133. <?php 
  134.  
  135. /** 
  136. * Fires after the activity entry comment form. 
  137. * 
  138. * @since 1.5.0 
  139. */ 
  140. do_action( 'bp_activity_entry_comments' ); ?> 
  141.  
  142. <?php wp_nonce_field( 'new_activity_comment', '_wpnonce_new_activity_comment' ); ?> 
  143.  
  144. </form> 
  145.  
  146. <?php endif; ?> 
  147.  
  148. </div> 
  149.  
  150. <?php endif; ?> 
  151.  
  152. <?php 
  153.  
  154. /** 
  155. * Fires after the display of the activity entry comments. 
  156. * 
  157. * @since 1.2.0 
  158. */ 
  159. do_action( 'bp_after_activity_entry_comments' ); ?> 
  160.  
  161. </li> 
  162.  
  163. <?php 
  164.  
  165. /** 
  166. * Fires after the display of an activity entry. 
  167. * 
  168. * @since 1.2.0 
  169. */ 
  170. do_action( 'bp_after_activity_entry' ); ?> 
.