/bp-templates/bp-legacy/buddypress/forums/forums-loop.php

  1. <?php 
  2. /** 
  3. * BuddyPress - Forums Loop 
  4. * 
  5. * Querystring is set via AJAX in _inc/ajax.php - bp_legacy_theme_object_filter(). 
  6. * 
  7. * @package BuddyPress 
  8. * @subpackage bp-legacy 
  9. */ 
  10.  
  11. ?> 
  12.  
  13. <?php 
  14.  
  15. /** 
  16. * Fires at the start of the forums loop. 
  17. * 
  18. * @since 1.2.6 
  19. */ 
  20. do_action( 'bp_before_forums_loop' ); ?> 
  21.  
  22. <?php if ( bp_has_forum_topics( bp_ajax_querystring( 'forums' ) ) ) : ?> 
  23.  
  24. <div id="pag-top" class="pagination"> 
  25.  
  26. <div class="pag-count" id="topic-count-top"> 
  27.  
  28. <?php bp_forum_pagination_count(); ?> 
  29.  
  30. </div> 
  31.  
  32. <div class="pagination-links" id="topic-pag-top"> 
  33.  
  34. <?php bp_forum_pagination(); ?> 
  35.  
  36. </div> 
  37.  
  38. </div> 
  39.  
  40. <?php 
  41.  
  42. /** 
  43. * Fires before the display of the forums list. 
  44. * 
  45. * @since 1.1.0 
  46. */ 
  47. do_action( 'bp_before_directory_forums_list' ); ?> 
  48.  
  49. <table class="forum"> 
  50. <thead> 
  51. <tr> 
  52. <th id="th-title"><?php _e( 'Topic', 'buddypress' ); ?></th> 
  53. <th id="th-postcount"><?php _e( 'Posts', 'buddypress' ); ?></th> 
  54. <th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ); ?></th> 
  55.  
  56. <?php 
  57.  
  58. /** 
  59. * Fires at the end of <tr> row holding the <th> tags. 
  60. * 
  61. * @since 1.2.4 
  62. */ 
  63. do_action( 'bp_directory_forums_extra_cell_head' ); ?> 
  64.  
  65. </tr> 
  66. </thead> 
  67.  
  68. <tbody> 
  69.  
  70. <?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?> 
  71.  
  72. <tr class="<?php bp_the_topic_css_class(); ?>"> 
  73. <td class="td-title"> 
  74. <a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php esc_attr_e( 'Permanent link to this post', 'buddypress' ); ?>"> 
  75.  
  76. <?php bp_the_topic_title(); ?> 
  77.  
  78. </a> 
  79.  
  80. <p class="topic-meta"> 
  81. <span class="topic-by"><?php /** translators: "started by [poster] in [forum]" */ printf( __( 'Started by %1$s', 'buddypress' ), bp_get_the_topic_poster_avatar( 'height=20&width=20') . bp_get_the_topic_poster_name() ); ?></span> 
  82.  
  83. <?php if ( !bp_is_group_forum() ) : ?> 
  84.  
  85. <span class="topic-in"> 
  86.  
  87. <?php 
  88. $topic_in = '<a href="' . bp_get_the_topic_object_permalink() . '">' . bp_get_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) . '</a>' . 
  89. '<a href="' . bp_get_the_topic_object_permalink() . '" title="' . bp_get_the_topic_object_name() . '">' . bp_get_the_topic_object_name() .'</a>'; 
  90.  
  91. /** translators: "started by [poster] in [forum]" */ 
  92. printf( __( 'in %1$s', 'buddypress' ), $topic_in ); 
  93. ?> 
  94.  
  95. </span> 
  96.  
  97. <?php endif; ?> 
  98.  
  99. </p> 
  100. </td> 
  101. <td class="td-postcount"> 
  102. <?php bp_the_topic_total_posts(); ?> 
  103. </td> 
  104. <td class="td-freshness"> 
  105. <span class="time-since"><?php bp_the_topic_time_since_last_post(); ?></span> 
  106. <p class="topic-meta"> 
  107. <span class="freshness-author"> 
  108. <a href="<?php bp_the_topic_permalink(); ?>"><?php bp_the_topic_last_poster_avatar( 'type=thumb&width=20&height=20' ); ?></a> 
  109. <?php bp_the_topic_last_poster_name(); ?> 
  110. </span> 
  111. </p> 
  112. </td> 
  113.  
  114. <?php 
  115.  
  116. /** 
  117. * Fires at the end of <tr> row holding the <td> tags. 
  118. * 
  119. * @since 1.1.0 
  120. */ 
  121. do_action( 'bp_directory_forums_extra_cell' ); ?> 
  122.  
  123. </tr> 
  124.  
  125. <?php 
  126.  
  127. /** 
  128. * Fires after the <tr> for a forum listing display. 
  129. * 
  130. * @since 1.1.0 
  131. */ 
  132. do_action( 'bp_directory_forums_extra_row' ); ?> 
  133.  
  134. <?php endwhile; ?> 
  135.  
  136. </tbody> 
  137. </table> 
  138.  
  139. <?php 
  140.  
  141. /** 
  142. * Fires after the display of the forums list. 
  143. * 
  144. * @since 1.1.0 
  145. */ 
  146. do_action( 'bp_after_directory_forums_list' ); ?> 
  147.  
  148. <div id="pag-bottom" class="pagination"> 
  149.  
  150. <div class="pag-count" id="topic-count-bottom"> 
  151. <?php bp_forum_pagination_count(); ?> 
  152. </div> 
  153.  
  154. <div class="pagination-links" id="topic-pag-bottom"> 
  155. <?php bp_forum_pagination(); ?> 
  156. </div> 
  157.  
  158. </div> 
  159.  
  160. <?php else: ?> 
  161.  
  162. <div id="message" class="info"> 
  163. <p><?php _e( 'Sorry, there were no forum topics found.', 'buddypress' ); ?></p> 
  164. </div> 
  165.  
  166. <?php endif; ?> 
  167.  
  168. <?php 
  169.  
  170. /** 
  171. * Fires at the end of the forums loop. 
  172. * 
  173. * @since 1.2.6 
  174. */ 
  175. do_action( 'bp_after_forums_loop' ); ?> 
.