function bp_checkins_display_place_checkin()
{
    $place_id = bp_get_checkins_places_id();
    $place_permalink = bp_get_checkins_places_the_permalink();
    $address = get_post_meta($place_id, 'bpci_places_address', true);
    if ($address) {
        ?>
		<div class="activity-checkin">
			<a href="<?php 
        echo $place_permalink;
        ?>
" title="<?php 
        _e('Open the map for this update', 'bp-checkins');
        ?>
" class="link-checkin"><span class="update-checkin"><?php 
        echo stripslashes($address);
        ?>
</span></a>
		</div>
		<?php 
    }
}
function bp_checkins_get_friends_checkedin()
{
    global $bp;
    $output = "";
    if (!(int) bp_get_option('bp-checkins-enable-box-checkedin-friends') || '' == bp_get_option('bp-checkins-enable-box-checkedin-friends')) {
        return $output;
    }
    if (!is_user_logged_in()) {
        return $output;
    }
    $place_id = bp_get_checkins_places_id();
    $args = array('filter' => array('action' => 'place_checkin', 'primary_id' => $place_id));
    $activities = bp_activity_get($args);
    $friends_checkin = array();
    foreach ($activities['activities'] as $checkedin) {
        if ($checkedin->user_id != $bp->loggedin_user->id && 'is_friend' == friends_check_friendship_status($bp->loggedin_user->id, $checkedin->user_id)) {
            // as people can checkin several times 1 each 12 hours...
            if (!in_array($checkedin->user_id, $friends_checkin)) {
                $friends_checkin[] = $checkedin->user_id;
            }
        }
    }
    shuffle($friends_checkin);
    if (count($friends_checkin) >= 1) {
        $output = '<br style="clear:both"><div class="checkedin-amigos">' . __('Great! Some of your friends checked in this place.', 'bp-checkins') . '<ul>';
        $step = 0;
        $max = apply_filters('bp_checkins_max_friends_checkedin', 5);
        foreach ($friends_checkin as $friend_id) {
            if ($step == $max) {
                break;
            }
            $output .= '<li><a href="' . bp_core_get_userlink($friend_id, false, true) . '">' . bp_core_fetch_avatar(array('item_id' => $friend_id, 'object' => 'user', 'type' => 'thumb', 'class' => 'avatar checkedin_friend', 'width' => '40', 'height' => '40')) . '</a></li>';
            $step += 1;
        }
        $output .= '</ul><br style="clear:both"></div>';
    }
    return apply_filters('bp_checkins_get_friends_checkedin', $output, $friends_checkin);
}