/bp-themes/bp-default/groups/single/forum/topic.php

  1. <?php do_action( 'bp_before_group_forum_topic' ); ?> 
  2.  
  3. <form action="<?php bp_forum_topic_action(); ?>" method="post" id="forum-topic-form" class="standard-form"> 
  4. <div class="item-list-tabs no-ajax" id="subnav" role="navigation"> 
  5. <ul> 
  6. <?php if ( is_user_logged_in() ) : ?> 
  7.  
  8. <li> 
  9. <a href="<?php bp_forum_topic_new_reply_link(); ?>" class="new-reply-link"><?php _e( 'New Reply', 'buddypress' ); ?></a> 
  10. </li> 
  11.  
  12. <?php endif; ?> 
  13.  
  14. <?php if ( bp_forums_has_directory() ) : ?> 
  15.  
  16. <li> 
  17. <a href="<?php bp_forums_directory_permalink(); ?>"><?php _e( 'Forum Directory', 'buddypress'); ?></a> 
  18. </li> 
  19.  
  20. <?php endif; ?> 
  21.  
  22. </ul> 
  23. </div> 
  24.  
  25. <div id="topic-meta"> 
  26. <h3><?php bp_the_topic_title(); ?> (<?php bp_the_topic_total_post_count(); ?>)</h3> 
  27.  
  28. <?php if ( bp_forum_topic_has_tags() ) : ?> 
  29.  
  30. <div class="topic-tags"> 
  31.  
  32. <?php _e( 'Topic tags:', 'buddypress' ); ?> <?php bp_forum_topic_tag_list(); ?> 
  33.  
  34. </div> 
  35.  
  36. <?php endif; ?> 
  37.  
  38. <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_is_mine() ) : ?> 
  39.  
  40. <div class="last admin-links"> 
  41.  
  42. <?php bp_the_topic_admin_links(); ?> 
  43.  
  44. </div> 
  45.  
  46. <?php endif; ?> 
  47.  
  48. <?php do_action( 'bp_group_forum_topic_meta' ); ?> 
  49.  
  50. </div> 
  51.  
  52.  
  53. <?php if ( bp_has_forum_topic_posts() ) : ?> 
  54.  
  55. <div class="pagination no-ajax"> 
  56.  
  57. <div id="post-count-top" class="pag-count"> 
  58.  
  59. <?php bp_the_topic_pagination_count(); ?> 
  60.  
  61. </div> 
  62.  
  63. <div class="pagination-links" id="topic-pag-top"> 
  64.  
  65. <?php bp_the_topic_pagination(); ?> 
  66.  
  67. </div> 
  68.  
  69. </div> 
  70.  
  71. <?php do_action( 'bp_before_group_forum_topic_posts' ); ?> 
  72.  
  73. <ul id="topic-post-list" class="item-list" role="main"> 
  74. <?php while ( bp_forum_topic_posts() ) : bp_the_forum_topic_post(); ?> 
  75.  
  76. <li id="post-<?php bp_the_topic_post_id(); ?>" class="<?php bp_the_topic_post_css_class(); ?>"> 
  77. <div class="poster-meta"> 
  78. <a href="<?php bp_the_topic_post_poster_link(); ?>"> 
  79. <?php bp_the_topic_post_poster_avatar( 'width=40&height=40' ); ?> 
  80. </a> 
  81. <?php echo sprintf( __( '%1$s said %2$s:', 'buddypress' ), bp_get_the_topic_post_poster_name(), bp_get_the_topic_post_time_since() ); ?> 
  82. </div> 
  83.  
  84. <div class="post-content"> 
  85. <?php bp_the_topic_post_content(); ?> 
  86. </div> 
  87.  
  88. <div class="admin-links"> 
  89. <?php if ( bp_group_is_admin() || bp_group_is_mod() || bp_get_the_topic_post_is_mine() ) : ?> 
  90. <?php bp_the_topic_post_admin_links(); ?> 
  91. <?php endif; ?> 
  92.  
  93. <?php do_action( 'bp_group_forum_post_meta' ); ?> 
  94.  
  95. <a href="#post-<?php bp_the_topic_post_id(); ?>" title="<?php esc_attr_e( 'Permanent link to this post', 'buddypress' ); ?>">#</a> 
  96. </div> 
  97. </li> 
  98.  
  99. <?php endwhile; ?> 
  100. </ul><!-- #topic-post-list --> 
  101.  
  102. <?php do_action( 'bp_after_group_forum_topic_posts' ); ?> 
  103.  
  104. <div class="pagination no-ajax"> 
  105.  
  106. <div id="post-count-bottom" class="pag-count"> 
  107. <?php bp_the_topic_pagination_count(); ?> 
  108. </div> 
  109.  
  110. <div class="pagination-links" id="topic-pag-bottom"> 
  111. <?php bp_the_topic_pagination(); ?> 
  112. </div> 
  113.  
  114. </div> 
  115.  
  116. <?php else: ?> 
  117.  
  118. <div id="message" class="info"> 
  119. <p><?php _e( 'There are no posts for this topic.', 'buddypress' ); ?></p> 
  120. </div> 
  121.  
  122. <?php endif;?> 
  123.  
  124. <?php if ( ( is_user_logged_in() && 'public' == bp_get_group_status() ) || bp_group_is_member() ) : ?> 
  125.  
  126. <?php if ( bp_get_the_topic_is_last_page() ) : ?> 
  127.  
  128. <?php if ( bp_get_the_topic_is_topic_open() && !bp_group_is_user_banned() ) : ?> 
  129.  
  130. <div id="post-topic-reply"> 
  131. <p id="post-reply"></p> 
  132.  
  133. <?php if ( bp_groups_auto_join() && !bp_group_is_member() ) : ?> 
  134. <p><?php _e( 'You will auto join this group when you reply to this topic.', 'buddypress' ); ?></p> 
  135. <?php endif; ?> 
  136.  
  137. <?php do_action( 'groups_forum_new_reply_before' ); ?> 
  138.  
  139. <h4><?php _e( 'Add a reply:', 'buddypress' ); ?></h4> 
  140.  
  141. <textarea name="reply_text" id="reply_text" class="bp-suggestions"></textarea> 
  142.  
  143. <div class="submit"> 
  144. <input type="submit" name="submit_reply" id="submit" value="<?php esc_attr_e( 'Post Reply', 'buddypress' ); ?>" /> 
  145. </div> 
  146.  
  147. <?php do_action( 'groups_forum_new_reply_after' ); ?> 
  148.  
  149. <?php wp_nonce_field( 'bp_forums_new_reply' ); ?> 
  150. </div> 
  151.  
  152. <?php elseif ( !bp_group_is_user_banned() ) : ?> 
  153.  
  154. <div id="message" class="info"> 
  155. <p><?php _e( 'This topic is closed, replies are no longer accepted.', 'buddypress' ); ?></p> 
  156. </div> 
  157.  
  158. <?php endif; ?> 
  159.  
  160. <?php endif; ?> 
  161.  
  162. <?php endif; ?> 
  163.  
  164. </form><!-- #forum-topic-form --> 
  165.  
  166. <?php do_action( 'bp_after_group_forum_topic' ); ?> 
.