Advertisement
Ronnie_Fantastic

BP activity index page code

Oct 26th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.06 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4. * Template Name: BuddyPress - Activity Directory
  5. *
  6. * @package BuddyPress
  7. * @subpackage Theme
  8. */
  9.  
  10. get_header( 'buddypress' ); ?>
  11.  
  12. <?php do_action( 'bp_before_directory_activity_page' ); ?>
  13.  
  14. <div id="content">
  15. <div class="padder">
  16.  
  17. <?php do_action( 'bp_before_directory_activity' ); ?>
  18.  
  19. <?php if ( !is_user_logged_in() ) : ?>
  20.  
  21. <h3><?php _e( 'Site Activity', 'buddypress' ); ?></h3>
  22.  
  23. <?php endif; ?>
  24.  
  25. <?php do_action( 'bp_before_directory_activity_content' ); ?>
  26.  
  27. <?php if ( is_user_logged_in() ) : ?>
  28.  
  29. <?php locate_template( array( 'activity/post-form.php'), true ); ?>
  30.  
  31. <?php endif; ?>
  32.  
  33. <?php do_action( 'template_notices' ); ?>
  34.  
  35. <div class="item-list-tabs activity-type-tabs" role="navigation">
  36. <ul>
  37. <?php do_action( 'bp_before_activity_type_tab_all' ); ?>
  38.  
  39. <li class="selected" id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php _e( 'The public activity for everyone on this site.', 'buddypress' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>
  40.  
  41. <?php if ( is_user_logged_in() ) : ?>
  42.  
  43. <?php do_action( 'bp_before_activity_type_tab_friends' ); ?>
  44.  
  45. <?php if ( bp_is_active( 'friends' ) ) : ?>
  46.  
  47. <?php if ( bp_get_total_friend_count( bp_loggedin_user_id() ) ) : ?>
  48.  
  49. <li id="activity-friends"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/'; ?>" title="<?php _e( 'The activity of my friends only.', 'buddypress' ); ?>"><?php printf( __( 'My Friends <span>%s</span>', 'buddypress' ), bp_get_total_friend_count( bp_loggedin_user_id() ) ); ?></a></li>
  50.  
  51. <?php endif; ?>
  52.  
  53. <?php endif; ?>
  54.  
  55. <?php do_action( 'bp_before_activity_type_tab_groups' ); ?>
  56.  
  57. <?php if ( bp_is_active( 'groups' ) ) : ?>
  58.  
  59. <?php if ( bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
  60.  
  61. <li id="activity-groups"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/'; ?>" title="<?php _e( 'The activity of groups I am a member of.', 'buddypress' ); ?>"><?php printf( __( 'My Groups <span>%s</span>', 'buddypress' ), bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
  62.  
  63. <?php endif; ?>
  64.  
  65. <?php endif; ?>
  66.  
  67. <?php do_action( 'bp_before_activity_type_tab_favorites' ); ?>
  68.  
  69. <?php if ( bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ) : ?>
  70.  
  71. <li id="activity-favorites"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/favorites/'; ?>" title="<?php _e( "The activity I've marked as a favorite.", 'buddypress' ); ?>"><?php printf( __( 'My Favorites <span>%s</span>', 'buddypress' ), bp_get_total_favorite_count_for_user( bp_loggedin_user_id() ) ); ?></a></li>
  72.  
  73. <?php endif; ?>
  74.  
  75. <?php do_action( 'bp_before_activity_type_tab_mentions' ); ?>
  76.  
  77. <li id="activity-mentions"><a href="<?php echo bp_loggedin_user_domain() . bp_get_activity_slug() . '/mentions/'; ?>" title="<?php _e( 'Activity that I have been mentioned in.', 'buddypress' ); ?>"><?php _e( 'Mentions', 'buddypress' ); ?><?php if ( bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ) : ?> <strong><?php printf( __( '<span>%s new</span>', 'buddypress' ), bp_get_total_mention_count_for_user( bp_loggedin_user_id() ) ); ?></strong><?php endif; ?></a></li>
  78.  
  79. <?php endif; ?>
  80.  
  81. <?php do_action( 'bp_activity_type_tabs' ); ?>
  82. </ul>
  83. </div><!-- .item-list-tabs -->
  84.  
  85. <div class="item-list-tabs no-ajax" id="subnav" role="navigation">
  86. <ul>
  87. <li class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" title="<?php _e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li>
  88.  
  89. <?php do_action( 'bp_activity_syndication_options' ); ?>
  90.  
  91. <li id="activity-filter-select" class="last">
  92. <label for="activity-filter-by"><?php _e( 'Show:', 'buddypress' ); ?></label>
  93. <select id="activity-filter-by">
  94. <option value="-1"><?php _e( 'Everything', 'buddypress' ); ?></option>
  95. <option value="activity_update"><?php _e( 'Updates', 'buddypress' ); ?></option>
  96.  
  97. <?php if ( bp_is_active( 'blogs' ) ) : ?>
  98.  
  99. <option value="new_blog_post"><?php _e( 'Posts', 'buddypress' ); ?></option>
  100. <option value="new_blog_comment"><?php _e( 'Comments', 'buddypress' ); ?></option>
  101.  
  102. <?php endif; ?>
  103.  
  104. <?php if ( bp_is_active( 'forums' ) ) : ?>
  105.  
  106. <option value="new_forum_topic"><?php _e( 'Forum Topics', 'buddypress' ); ?></option>
  107. <option value="new_forum_post"><?php _e( 'Forum Replies', 'buddypress' ); ?></option>
  108.  
  109. <?php endif; ?>
  110.  
  111. <?php if ( bp_is_active( 'groups' ) ) : ?>
  112.  
  113. <option value="created_group"><?php _e( 'New Groups', 'buddypress' ); ?></option>
  114. <option value="joined_group"><?php _e( 'Group Memberships', 'buddypress' ); ?></option>
  115.  
  116. <?php endif; ?>
  117.  
  118. <?php if ( bp_is_active( 'friends' ) ) : ?>
  119.  
  120. <option value="friendship_accepted,friendship_created"><?php _e( 'Friendships', 'buddypress' ); ?></option>
  121.  
  122. <?php endif; ?>
  123.  
  124. <option value="new_member"><?php _e( 'New Members', 'buddypress' ); ?></option>
  125.  
  126. <?php do_action( 'bp_activity_filter_options' ); ?>
  127.  
  128. </select>
  129. </li>
  130. </ul>
  131. </div><!-- .item-list-tabs -->
  132.  
  133. <?php do_action( 'bp_before_directory_activity_list' ); ?>
  134.  
  135. <div class="activity" role="main">
  136.  
  137. <?php locate_template( array( 'activity/activity-loop.php' ), true ); ?>
  138.  
  139. </div><!-- .activity -->
  140.  
  141. <?php do_action( 'bp_after_directory_activity_list' ); ?>
  142.  
  143. <?php do_action( 'bp_directory_activity_content' ); ?>
  144.  
  145. <?php do_action( 'bp_after_directory_activity_content' ); ?>
  146.  
  147. <?php do_action( 'bp_after_directory_activity' ); ?>
  148.  
  149. </div><!-- .padder -->
  150. </div><!-- #content -->
  151.  
  152. <?php do_action( 'bp_after_directory_activity_page' ); ?>
  153.  
  154. <?php get_sidebar( 'buddypress' ); ?>
  155. <?php get_footer( 'buddypress' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement