/bp-themes/bp-default/forums/forums-loop.php

  1. <?php 
  2.  
  3. /** 
  4. * BuddyPress - Forums Loop 
  5. * 
  6. * Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_object_filter() 
  7. * 
  8. * @package BuddyPress 
  9. * @subpackage bp-default 
  10. */ 
  11.  
  12. ?> 
  13.  
  14. <?php do_action( 'bp_before_forums_loop' ); ?> 
  15.  
  16. <?php if ( bp_has_forum_topics( bp_ajax_querystring( 'forums' ) ) ) : ?> 
  17.  
  18. <div id="pag-top" class="pagination"> 
  19.  
  20. <div class="pag-count" id="topic-count-top"> 
  21.  
  22. <?php bp_forum_pagination_count(); ?> 
  23.  
  24. </div> 
  25.  
  26. <div class="pagination-links" id="topic-pag-top"> 
  27.  
  28. <?php bp_forum_pagination(); ?> 
  29.  
  30. </div> 
  31.  
  32. </div> 
  33.  
  34. <?php do_action( 'bp_before_directory_forums_list' ); ?> 
  35.  
  36. <table class="forum"> 
  37. <thead> 
  38. <tr> 
  39. <th id="th-title"><?php _e( 'Topic', 'buddypress' ); ?></th> 
  40. <th id="th-postcount"><?php _e( 'Posts', 'buddypress' ); ?></th> 
  41. <th id="th-freshness"><?php _e( 'Freshness', 'buddypress' ); ?></th> 
  42.  
  43. <?php do_action( 'bp_directory_forums_extra_cell_head' ); ?> 
  44.  
  45. </tr> 
  46. </thead> 
  47.  
  48. <tbody> 
  49.  
  50. <?php while ( bp_forum_topics() ) : bp_the_forum_topic(); ?> 
  51.  
  52. <tr class="<?php bp_the_topic_css_class(); ?>"> 
  53. <td class="td-title"> 
  54. <a class="topic-title" href="<?php bp_the_topic_permalink(); ?>" title="<?php esc_attr_e( 'Permanent link to this post', 'buddypress' ); ?>"> 
  55.  
  56. <?php bp_the_topic_title(); ?> 
  57.  
  58. </a> 
  59.  
  60. <p class="topic-meta"> 
  61. <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> 
  62.  
  63. <?php if ( !bp_is_group_forum() ) : ?> 
  64.  
  65. <span class="topic-in"> 
  66.  
  67. <?php 
  68. $topic_in = '<a href="' . bp_get_the_topic_object_permalink() . '">' . bp_get_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) . '</a>' . 
  69. '<a href="' . bp_get_the_topic_object_permalink() . '" title="' . bp_get_the_topic_object_name() . '">' . bp_get_the_topic_object_name() .'</a>'; 
  70.  
  71. /** translators: "started by [poster] in [forum]" */ 
  72. printf( __( 'in %1$s', 'buddypress' ), $topic_in ); 
  73. ?> 
  74.  
  75. </span> 
  76.  
  77. <?php endif; ?> 
  78.  
  79. </p> 
  80. </td> 
  81. <td class="td-postcount"> 
  82. <?php bp_the_topic_total_posts(); ?> 
  83. </td> 
  84. <td class="td-freshness"> 
  85. <span class="time-since"><?php bp_the_topic_time_since_last_post(); ?></span> 
  86. <p class="topic-meta"> 
  87. <span class="freshness-author"> 
  88. <a href="<?php bp_the_topic_permalink(); ?>"><?php bp_the_topic_last_poster_avatar( 'type=thumb&width=20&height=20' ); ?></a> 
  89. <?php bp_the_topic_last_poster_name(); ?> 
  90. </span> 
  91. </p> 
  92. </td> 
  93.  
  94. <?php do_action( 'bp_directory_forums_extra_cell' ); ?> 
  95.  
  96. </tr> 
  97.  
  98. <?php do_action( 'bp_directory_forums_extra_row' ); ?> 
  99.  
  100. <?php endwhile; ?> 
  101.  
  102. </tbody> 
  103. </table> 
  104.  
  105. <?php do_action( 'bp_after_directory_forums_list' ); ?> 
  106.  
  107. <div id="pag-bottom" class="pagination"> 
  108.  
  109. <div class="pag-count" id="topic-count-bottom"> 
  110. <?php bp_forum_pagination_count(); ?> 
  111. </div> 
  112.  
  113. <div class="pagination-links" id="topic-pag-bottom"> 
  114. <?php bp_forum_pagination(); ?> 
  115. </div> 
  116.  
  117. </div> 
  118.  
  119. <?php else: ?> 
  120.  
  121. <div id="message" class="info"> 
  122. <p><?php _e( 'Sorry, there were no forum topics found.', 'buddypress' ); ?></p> 
  123. </div> 
  124.  
  125. <?php endif; ?> 
  126.  
  127. <?php do_action( 'bp_after_forums_loop' ); ?> 
.