/bp-themes/bp-default/groups/single/home.php

  1. <?php get_header( 'buddypress' ); ?> 
  2.  
  3. <div id="content"> 
  4. <div class="padder"> 
  5.  
  6. <?php if ( bp_has_groups() ) : while ( bp_groups() ) : bp_the_group(); ?> 
  7.  
  8. <?php do_action( 'bp_before_group_home_content' ); ?> 
  9.  
  10. <div id="item-header" role="complementary"> 
  11.  
  12. <?php locate_template( array( 'groups/single/group-header.php' ), true ); ?> 
  13.  
  14. </div><!-- #item-header --> 
  15.  
  16. <div id="item-nav"> 
  17. <div class="item-list-tabs no-ajax" id="object-nav" role="navigation"> 
  18. <ul> 
  19.  
  20. <?php bp_get_options_nav(); ?> 
  21.  
  22. <?php do_action( 'bp_group_options_nav' ); ?> 
  23.  
  24. </ul> 
  25. </div> 
  26. </div><!-- #item-nav --> 
  27.  
  28. <div id="item-body"> 
  29.  
  30. <?php do_action( 'bp_before_group_body' ); 
  31.  
  32. /** 
  33. * Does this next bit look familiar? If not, go check out WordPress's 
  34. * /wp-includes/template-loader.php file. 
  35. * 
  36. * @todo A real template hierarchy? Gasp! 
  37. */ 
  38.  
  39. // Group is visible 
  40. if ( bp_group_is_visible() ) : 
  41.  
  42. // Looking at home location 
  43. if ( bp_is_group_home() ) : 
  44.  
  45. // Use custom front if one exists 
  46. $custom_front = locate_template( array( 'groups/single/front.php' ) ); 
  47. if ( ! empty( $custom_front ) ) : load_template( $custom_front, true ); 
  48.  
  49. // Default to activity 
  50. elseif ( bp_is_active( 'activity' ) ) : locate_template( array( 'groups/single/activity.php' ), true ); 
  51.  
  52. // Otherwise show members 
  53. elseif ( bp_is_active( 'members' ) ) : locate_template( array( 'groups/single/members.php' ), true ); 
  54.  
  55. endif; 
  56.  
  57. // Not looking at home 
  58. else : 
  59.  
  60. // Group Admin 
  61. if ( bp_is_group_admin_page() ) : locate_template( array( 'groups/single/admin.php' ), true ); 
  62.  
  63. // Group Activity 
  64. elseif ( bp_is_group_activity() ) : locate_template( array( 'groups/single/activity.php' ), true ); 
  65.  
  66. // Group Members 
  67. elseif ( bp_is_group_members() ) : locate_template( array( 'groups/single/members.php' ), true ); 
  68.  
  69. // Group Invitations 
  70. elseif ( bp_is_group_invites() ) : locate_template( array( 'groups/single/send-invites.php' ), true ); 
  71.  
  72. // Old group forums 
  73. elseif ( bp_is_group_forum() ) : locate_template( array( 'groups/single/forum.php' ), true ); 
  74.  
  75. // Membership request 
  76. elseif ( bp_is_group_membership_request() ) : locate_template( array( 'groups/single/request-membership.php' ), true ); 
  77.  
  78. // Anything else (plugins mostly) 
  79. else : locate_template( array( 'groups/single/plugins.php' ), true ); 
  80.  
  81. endif; 
  82. endif; 
  83.  
  84. // Group is not visible 
  85. elseif ( ! bp_group_is_visible() ) : 
  86. // Membership request 
  87. if ( bp_is_group_membership_request() ) : 
  88. locate_template( array( 'groups/single/request-membership.php' ), true ); 
  89.  
  90. // The group is not visible, show the status message 
  91. else : 
  92.  
  93. do_action( 'bp_before_group_status_message' ); ?> 
  94.  
  95. <div id="message" class="info"> 
  96. <p><?php bp_group_status_message(); ?></p> 
  97. </div> 
  98.  
  99. <?php do_action( 'bp_after_group_status_message' ); 
  100.  
  101. endif; 
  102. endif; 
  103.  
  104. do_action( 'bp_after_group_body' ); ?> 
  105.  
  106. </div><!-- #item-body --> 
  107.  
  108. <?php do_action( 'bp_after_group_home_content' ); ?> 
  109.  
  110. <?php endwhile; endif; ?> 
  111.  
  112. </div><!-- .padder --> 
  113. </div><!-- #content --> 
  114.  
  115. <?php get_sidebar( 'buddypress' ); ?> 
  116. <?php get_footer( 'buddypress' ); ?> 
.