function display()
    {
        global $bp;
        $current_url = bp_get_group_permalink($bp->groups->current_group) . $bp->current_action . '/';
        $checkins_group_class = false;
        ?>
		<div class="item-list-tabs no-ajax checkins-type-tabs" id="subnav">
			<form action="" method="get" id="checkins-form-filter">
			<ul>
				<li id="group-checkins" class="<?php 
        if (!bp_action_variable(0) || 'checkins' == bp_action_variable(0)) {
            echo 'selected';
        }
        ?>
"><a href="<?php 
        echo $current_url;
        ?>
" id="checkins-area"><?php 
        _e('Checkins', 'bp-checkins');
        ?>
</a></li>
				
				<li id="group-places" class="<?php 
        if ('places' == bp_action_variable(0)) {
            echo 'selected';
        }
        ?>
"><a href="<?php 
        echo $current_url . 'places/';
        ?>
" id="places-area"><?php 
        _e('Places', 'bp-checkins');
        ?>
</a></li>
				
				<?php 
        do_action('bp_checkins_group_nav');
        ?>
				
				<?php 
        if (!bp_action_variable(0) || 'checkins' == bp_action_variable(0)) {
            ?>

				<li id="checkins-filter-select" class="last">

					<label for="checkins-filter-by"><?php 
            _e('Show:', 'bp-checkins');
            ?>
</label>
					<select id="checkins-filter-by" name="_checkins_filter_by">
						<option value="-1"><?php 
            _e('Everything', 'bp-checkins');
            ?>
</option>
						<option value="friends_checkin"><?php 
            _e('Friends checkins', 'bp-checkins');
            ?>
</option>
						<option value="activity_checkin"><?php 
            _e('Activity checkins', 'bp-checkins');
            ?>
</option>
						<option value="place_checkin"><?php 
            _e('Place checkins', 'bp-checkins');
            ?>
</option>
						
						<?php 
            do_action('bp_checkins_group_checkins_filters');
            ?>
						
					</select>
				</li>
				
				<?php 
        } else {
            ?>
					
					<li id="places-filter-select" class="last">

						<label for="places-filter-by"><?php 
            _e('Show:', 'bp-checkins');
            ?>
</label>
						<select id="places-filter-by">
							<option value="-1"><?php 
            _e('Everything', 'bp-checkins');
            ?>
</option>
							<option value="all_live_places"><?php 
            _e('Live Places', 'bp-checkins');
            ?>
</option>
							<option value="upcoming_places"><?php 
            _e('Upcoming Places', 'bp-checkins');
            ?>
</option>
							<?php 
            if (is_user_logged_in()) {
                ?>
								<option value="places_around"><?php 
                _e('Places around', 'bp-checkins');
                ?>
</option>
							<?php 
            }
            ?>

							<?php 
            do_action('bp_checkins_group_places_filters');
            ?>

						</select>
					</li>
					
				<?php 
        }
        ?>
				
			</ul>
			</form>
		</div>
		<?php 
        if (!bp_action_variable(0) || 'checkins' == bp_action_variable(0)) {
            ?>
		
			<?php 
            do_action('bp_before_group_checkins_post_form');
            ?>

			<?php 
            if (is_user_logged_in() && bp_group_is_member()) {
                ?>
				<?php 
                bp_checkins_load_template_choose('bp-checkins-post-form');
                ?>
			<?php 
            }
            ?>

			<?php 
            do_action('bp_after_group_checkins_post_form');
            ?>
			<?php 
            do_action('bp_before_group_checkins_content');
            ?>

			<div class="activity single-group" role="main">
				<?php 
            bp_checkins_locate_template_choose('activity/activity-loop');
            ?>
			</div><!-- .activity.single-group -->

			<?php 
            do_action('bp_after_group_checkins_content');
            ?>
			
		<?php 
        } else {
            ?>
			
			<?php 
            do_action('bp_before_group_places_post_form');
            ?>

			<?php 
            if (is_user_logged_in() && bp_group_is_member()) {
                ?>
				<?php 
                bp_checkins_load_template_choose('bp-checkins-places-form');
                ?>
			<?php 
            }
            ?>

			<?php 
            do_action('bp_after_group_places_post_form');
            ?>
			<?php 
            do_action('bp_before_group_places_content');
            ?>

			<div class="activity single-group" role="main">
				<?php 
            bp_checkins_load_template_choose('bp-checkins-places-loop');
            ?>
			</div><!-- .activity.single-group -->

			<?php 
            do_action('bp_after_group_places_content');
            ?>
			
		<?php 
        }
        ?>
		
		<?php 
    }
function bp_checkins_post_checkin()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    // Check the nonce
    check_admin_referer('post_checkin', '_wpnonce_post_checkin');
    if (!is_user_logged_in()) {
        echo '-1';
        return false;
    }
    if (empty($_POST['content'])) {
        echo '-1<div id="message" class="error"><p>' . __('Please enter some content to post.', 'bp-checkins') . '</p></div>';
        return false;
    }
    $content = apply_filters('bp_checkins_contenteditable_fix', $_POST['content']);
    $activity_id = 0;
    if ($_POST['object'] == "checkin" && bp_is_active('checkins')) {
        $activity_id = bp_checkins_post_update(array('content' => $content));
    } elseif ($_POST['object'] == 'groups') {
        if (!empty($_POST['item_id']) && bp_is_active('groups')) {
            $activity_id = bp_checkins_groups_post_update(array('content' => $content, 'group_id' => $_POST['item_id']));
        }
    } else {
        $activity_id = apply_filters('bp_checkins_custom_update', $_POST['object'], $_POST['item_id'], $content);
    }
    if (empty($activity_id)) {
        echo '-1<div id="message" class="error"><p>' . __('There was a problem posting your update, please try again.', 'bp-checkins') . '</p></div>';
        return false;
    }
    if (bp_has_activities('include=' . $activity_id)) {
        ?>
		<?php 
        while (bp_activities()) {
            bp_the_activity();
            ?>
			<?php 
            bp_checkins_locate_template_choose('activity/entry');
            ?>
		<?php 
        }
        ?>
	 <?php 
    }
    exit;
}
    bp_checkins_load_template_choose('bp-checkins-post-form');
    ?>
				<?php 
}
?>
				
				<?php 
do_action('bp_after_member_checkins_post_form');
?>
				<?php 
do_action('bp_before_member_checkins_body');
?>
				
				<div class="activity single-member" role="main">
					<?php 
bp_checkins_locate_template_choose('activity/activity-loop');
?>
				</div><!-- .activity.single-member -->

				<?php 
do_action('bp_after_member_checkins_body');
?>

			</div><!-- #item-body -->

			<?php 
do_action('bp_after_member_checkins_content');
?>

<?php 
if (bp_checkins_is_bp_default()) {