/bp-forums/bbpress/view.php

  1. <?php 
  2. require_once('./bb-load.php'); 
  3.  
  4. bb_repermalink(); 
  5.  
  6. $view = bb_slug_sanitize($view); 
  7.  
  8. $sticky_count = $topic_count = 0; 
  9. $stickies = $topics = $view_count = false; 
  10.  
  11. if ( isset($bb_views[$view]) ) { 
  12. if ( $bb_views[$view]['sticky'] ) { 
  13. $sticky_query = bb_view_query( $view, array('sticky' => '-no') ); // -no = yes 
  14. $stickies = $sticky_query->results; 
  15. $sticky_count = $sticky_query->found_rows; 
  16. $topic_query = bb_view_query( $view, array('count' => true) ); 
  17. $topics = $topic_query->results; 
  18. $topic_count = $topic_query->found_rows; 
  19.  
  20. $view_count = max($sticky_count, $topic_count); 
  21.  
  22. do_action( 'bb_custom_view', $view, $page ); 
  23.  
  24. bb_load_template( 'view.php', array('view_count', 'stickies'), $view ); 
  25.  
  26. ?> 
.