[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-templates/bp-legacy/buddypress/groups/single/forum/ -> topic.php (source)

   1  <?php
   2  /**
   3   * BuddyPress - Groups Single Forum Topic.
   4   *
   5   * @package BuddyPress
   6   * @subpackage bp-legacy
   7   */
   8  
   9  /**
  10   * Fires at the top of the group forum topic template.
  11   *
  12   * @since 1.2.4
  13   */
  14  do_action( 'bp_before_group_forum_topic' ); ?>
  15  
  16  <form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form">
  17      <div class="item-list-tabs no-ajax" id="subnav" aria-label="<?php esc_attr_e( 'Forums secondary navigation', 'buddypress' ); ?>" role="navigation">
  18          <ul>
  19              <?php if ( is_user_logged_in() ) : ?>
  20  
  21                  <li>
  22                      <a href="<?php bp_forum_topic_new_reply_link(); ?>" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ); ?></a>
  23                  </li>
  24  
  25              <?php endif; ?>
  26  
  27              <?php if ( bp_forums_has_directory() ) : ?>
  28  
  29                  <li>
  30                      <a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress' ); ?></a>
  31                  </li>
  32  
  33              <?php endif; ?>
  34  
  35          </ul>
  36      </div>
  37  
  38      <div id="topic-meta">
  39          <h3><?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3>
  40  
  41          <?php if ( bp_forum_topic_has_tags() ) : ?>
  42  
  43              <div class="topic-tags">
  44  
  45                  <?php _e( 'Topic tags:', 'buddypress' ); ?> <?php bp_forum_topic_tag_list(); ?>
  46  
  47              </div>
  48  
  49          <?php endif; ?>
  50  
  51          <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?>
  52  
  53              <div class="last admin-links">
  54  
  55                  <?php bp_the_topic_admin_links(); ?>
  56  
  57              </div>
  58  
  59          <?php endif; ?>
  60  
  61          <?php
  62  
  63          /**
  64           * Fires at the end of the group forum topic meta markup.
  65           *
  66           * @since 1.2.5
  67           */
  68          do_action( 'bp_group_forum_topic_meta' ); ?>
  69  
  70      </div>
  71  
  72  
  73      <?php if ( bp_has_forum_topic_posts() ) : ?>
  74  
  75          <div class="pagination no-ajax">
  76  
  77              <div id="post-count-top" class="pag-count">
  78  
  79                  <?php bp_the_topic_pagination_count(); ?>
  80  
  81              </div>
  82  
  83              <div class="pagination-links" id="topic-pag-top">
  84  
  85                  <?php bp_the_topic_pagination(); ?>
  86  
  87              </div>
  88  
  89          </div>
  90  
  91          <?php
  92  
  93          /**
  94           * Fires before the listing of the group forum topic posts.
  95           *
  96           * @since 1.2.4
  97           */
  98          do_action( 'bp_before_group_forum_topic_posts' ); ?>
  99  
 100          <ul id="topic-post-list" class="item-list">
 101              <?php while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?>
 102  
 103                  <li id="post-<?php bp_the_topic_post_id(); ?>" class="<?php bp_the_topic_post_css_class(); ?>">
 104                      <div class="poster-meta">
 105                          <a href="<?php bp_the_topic_post_poster_link(); ?>">
 106                              <?php bp_the_topic_post_poster_avatar( 'width=40&height=40' ); ?>
 107                          </a>
 108                          <?php echo sprintf( __( '%1$s said %2$s:', 'buddypress' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ); ?>
 109                      </div>
 110  
 111                      <div class="post-content">
 112                          <?php bp_the_topic_post_content(); ?>
 113                      </div>
 114  
 115                      <div class="admin-links">
 116                          <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?>
 117                              <?php bp_the_topic_post_admin_links(); ?>
 118                          <?php endif; ?>
 119  
 120                          <?php
 121  
 122                          /**
 123                           * Fires inside the group forum post meta markup.
 124                           *
 125                           * @since 1.2.5
 126                           */
 127                          do_action( 'bp_group_forum_post_meta' ); ?>
 128  
 129                          <a href="#post-<?php bp_the_topic_post_id(); ?>" aria-label="<?php esc_attr_e( 'Permanent link to this post', 'buddypress' ); ?>">#</a>
 130                      </div>
 131                  </li>
 132  
 133              <?php endwhile; ?>
 134          </ul><!-- #topic-post-list -->
 135  
 136          <?php
 137  
 138          /**
 139           * Fires before the listing of the group forum topic posts.
 140           *
 141           * @since 1.2.4
 142           */
 143          do_action( 'bp_after_group_forum_topic_posts' ); ?>
 144  
 145          <div class="pagination no-ajax">
 146  
 147              <div id="post-count-bottom" class="pag-count">
 148                  <?php bp_the_topic_pagination_count(); ?>
 149              </div>
 150  
 151              <div class="pagination-links" id="topic-pag-bottom">
 152                  <?php bp_the_topic_pagination(); ?>
 153              </div>
 154  
 155          </div>
 156  
 157      <?php else: ?>
 158  
 159          <div id="message" class="info">
 160              <p><?php _e( 'There are no posts for this topic.', 'buddypress' ); ?></p>
 161          </div>
 162  
 163      <?php endif;?>
 164  
 165      <?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?>
 166  
 167          <?php if ( bp_get_the_topic_is_last_page() ) : ?>
 168  
 169              <?php if ( bp_get_the_topic_is_topic_open() && !bp_group_is_user_banned() ) : ?>
 170  
 171                  <div id="post-topic-reply">
 172                      <p id="post-reply"></p>
 173  
 174                      <?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?>
 175                          <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ); ?></p>
 176                      <?php endif; ?>
 177  
 178                      <?php
 179  
 180                      /**
 181                       * Fires before the display of the group forum new reply section.
 182                       *
 183                       * @since 1.0.0
 184                       */
 185                      do_action( 'groups_forum_new_reply_before' ); ?>
 186  
 187                      <h4><?php _e( 'Add a reply:', 'buddypress' ); ?></h4>
 188  
 189                      <label for="reply_text" class="bp-screen-reader-text"><?php
 190                          /* translators: accessibility text */
 191                          _e( 'Reply', 'buddypress' );
 192                      ?></label>
 193                      <textarea name="reply_text" id="reply_text"></textarea>
 194  
 195                      <div class="submit">
 196                          <input type="submit" name="submit_reply" id="submit" value="<?php esc_attr_e( 'Post Reply', 'buddypress' ); ?>" />
 197                      </div>
 198  
 199                      <?php
 200  
 201                      /**
 202                       * Fires after the display of the group forum new reply section.
 203                       *
 204                       * @since 1.0.0
 205                       */
 206                      do_action( 'groups_forum_new_reply_after' ); ?>
 207  
 208                      <?php wp_nonce_field( 'bp_forums_new_reply' ); ?>
 209                  </div>
 210  
 211              <?php elseif ( !bp_group_is_user_banned() ) : ?>
 212  
 213                  <div id="message" class="info">
 214                      <p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ); ?></p>
 215                  </div>
 216  
 217              <?php endif; ?>
 218  
 219          <?php endif; ?>
 220  
 221      <?php endif; ?>
 222  
 223  </form><!-- #forum-topic-form -->
 224  
 225  <?php
 226  
 227  /**
 228   * Fires at the end of the group forum topic template.
 229   *
 230   * @since 1.2.4
 231   */
 232  do_action( 'bp_after_group_forum_topic' );


Generated: Thu Dec 7 01:01:35 2017 Cross-referenced by PHPXref 0.7.1