Advertisement
Guest User

buddypress code

a guest
Aug 31st, 2010
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.48 KB | None | 0 0
  1. // top is part of the single.php file
  2. <?php $checkStaff = get_post_meta($post->ID, 'isStaff',true); ?>
  3. <?php if((in_category('Staff')) OR ($checkStaff==1) ) :            
  4. if (groups_is_user_member($bp->loggedin_user->id, 16 )) : ?>
  5.  
  6. // bottom: this is into /activity/index.php
  7. <?php global $bp;
  8.  if (groups_is_user_member($bp->loggedin_user->id, 16 )) :  // check group membership ?>
  9.                 <div class="activity">
  10.                     <?php echo 'This is staff'; ?>
  11.                     <?php locate_template( array( 'activity/activity-loop-staff.php' ), true ) ?>
  12.                 </div><!-- .activity -->
  13.             <?php else: // non staff member ?>
  14.                 <div class="activity">
  15.                     <?php locate_template( array( 'activity/activity-loop.php' ), true ) ?>
  16.                 </div><!-- .activity -->           
  17.              <?php endif; ?>
  18.  
  19.  
  20. // this is the content of the 'default' activity-loop.php
  21. <?php /* Querystring is set via AJAX in _inc/ajax.php - bp_dtheme_activity_loop() */ ?>
  22.  
  23. <?php do_action( 'bp_before_activity_loop' ) ?>
  24.  
  25.  
  26.     <?php $args = array (
  27.             bp_ajax_querystring( 'activity' ),
  28.             'scope' => 'mentions',
  29.             'display_comments' => 'threaded',
  30.             'max' => 5); ?>
  31.            
  32.            
  33. <?php if ( bp_has_activities($args) ) : ?>
  34.  
  35.     <?php /* Show pagination if JS is not enabled, since the "Load More" link will do nothing */ ?>
  36.     <noscript>
  37.         <div class="pagination">
  38.             <div class="pag-count"><?php bp_activity_pagination_count() ?></div>
  39.             <div class="pagination-links"><?php bp_activity_pagination_links() ?></div>
  40.         </div>
  41.     </noscript>
  42.  
  43.     <?php if ( empty( $_POST['page'] ) ) : ?>
  44.         <ul id="activity-stream" class="activity-list item-list">
  45.     <?php endif; ?>
  46.    
  47.         <?php while ( bp_activities() ) : bp_the_activity(); ?>
  48.                 <?php include( locate_template( array( 'activity/entry.php' ), true ) ) ?>
  49.         <?php endwhile; ?>
  50.  
  51.  
  52.     <?php if ( bp_get_activity_count() == bp_get_activity_per_page() ) : ?>
  53.         <li class="load-more">
  54.             <a href="#more"><?php _e( 'Load More', 'buddypress' ) ?></a> &nbsp; <span class="ajax-loader"></span>
  55.         </li>
  56.     <?php endif; ?>
  57.  
  58.     <?php if ( empty( $_POST['page'] ) ) : ?>
  59.         </ul>
  60.     <?php endif; ?>
  61.  
  62. <?php else : ?>
  63.     <div id="message" class="info">
  64.         <p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ) ?></p>
  65.     </div>
  66. <?php endif; ?>
  67.  
  68. <?php do_action( 'bp_after_activity_loop' ) ?>
  69.  
  70. <form action="" name="activity-loop-form" id="activity-loop-form" method="post">
  71.     <?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ) ?>
  72. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement