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


Generated: Mon Aug 15 01:00:51 2022 Cross-referenced by PHPXref 0.7.1