[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-templates/bp-legacy/buddypress/activity/ -> entry.php (source)

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


Generated: Mon Jul 13 01:01:31 2020 Cross-referenced by PHPXref 0.7.1