<?php

/**
 * Fires before the start of the activity loop.
 *
 * @since BuddyPress (1.2.0)
 */
do_action( 'bp_before_activity_loop' ); ?>

<?php
	$custom_query = '&action=activity_update, mpp_media_upload';
	if (!empty($_GET['keyword'])) {
		$custom_query .= '&search_terms='.$_GET['keyword'];
	}
?>

  	<div class="keywords-filter-box">
			<select data-active="<?php echo $_GET['keyword']; ?>" class="keywords-filter">
      		<option value="-1">-- Select # --</option>
          <option value="CheckinHunt">#CheckinHunt</option>
          <option value="HowToStayAwake">#HowToStayAwake</option>
          <option value="HowToBeIrresistible">#HowToBeIrresistible</option>
          <option value="HowToMakeUniqueSelfie">#HowToMakeUniqueSelfie</option>
          <option value="HowToSeduce">#HowToSeduce</option>
			</select>
    </div>

<?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ).$custom_query/*.'&per_page=5&action=activity_update,mpp_media_upload'*/) ) : ?>

	<?php if ( empty( $_POST['page'] ) ) : ?>
  

		<ul id="activity-stream" class="activity-list item-list">

	<?php endif; ?>

	<?php while ( bp_activities() ) : bp_the_activity(); ?>

		<?php bp_get_template_part( 'activity/entry' ); ?>

	<?php endwhile; ?>

	<?php if ( bp_activity_has_more_items() ) : ?>

		<li class="load-more">
			<a href="<?php bp_activity_load_more_link() ?>"><?php _e( 'Load More', 'buddypress' ); ?></a>
		</li>

	<?php endif; ?>

	<?php if ( empty( $_POST['page'] ) ) : ?>

		</ul>

	<?php endif; ?>

<?php else : ?>

	<div id="message" class="info">
		<p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ); ?></p>
	</div>

<?php endif; ?>

<?php

/**
 * Fires after the finish of the activity loop.
 *
 * @since BuddyPress (1.2.0)
 */
do_action( 'bp_after_activity_loop' ); ?>

<?php if ( empty( $_POST['page'] ) ) : ?>

	<form action="" name="activity-loop-form" id="activity-loop-form" method="post">

		<?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ); ?>

	</form>

<?php endif; ?>
