コード例 #1
0
    bp_checkins_load_template_choose('bp-checkins-places-form');
    ?>
				<?php 
}
?>

				<?php 
do_action('bp_after_member_places_post_form');
?>
				<?php 
do_action('bp_before_member_places_body');
?>

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

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

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

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

<?php 
if (bp_checkins_is_bp_default()) {
コード例 #2
0
function bp_checkins_post_places()
{
    global $bp;
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    // Check the nonce
    check_admin_referer('post_places', '_wpnonce_post_places');
    $group_id = 0;
    if (!empty($_POST['group_id'])) {
        $group_id = intval($_POST['group_id']);
    }
    if (!is_user_logged_in()) {
        echo '-1';
        return false;
    }
    if (empty($_POST['title'])) {
        echo '-1<div id="message" class="error"><p>' . __('Please put the name of the place.', 'bp-checkins') . '</p></div>';
        return false;
    }
    if (empty($_POST['content'])) {
        echo '-1<div id="message" class="error"><p>' . __('Please enter some content to place.', 'bp-checkins') . '</p></div>';
        return false;
    }
    if (empty($_POST['bpci-address'])) {
        echo '-1<div id="message" class="error"><p>' . __('Please enter an address for the place.', 'bp-checkins') . '</p></div>';
        return false;
    }
    if (empty($_POST['category'])) {
        echo '-1<div id="message" class="error"><p>' . __('Please select a category for the place.', 'bp-checkins') . '</p></div>';
        return false;
    }
    if ($_POST['type'] == "live" && ($_POST['start'] == " " || $_POST['end'] == " ")) {
        echo '-1<div id="message" class="error"><p>' . __('Please choose a date for your live place.', 'bp-checkins') . '</p></div>';
        return false;
    }
    $args = array('group_id' => $group_id, 'title' => $_POST['title'], 'content' => $_POST['content'], 'address' => $_POST['bpci-address'], 'lat' => $_POST['bpci-lat'], 'lng' => $_POST['bpci-lng'], 'place_category' => intval($_POST['category']));
    if ($_POST['type'] == "live") {
        $args['type'] = $_POST['type'];
        $args['start'] = $_POST['start'];
        $args['end'] = $_POST['end'];
    }
    // If the group is not public, hide the activity sitewide.
    if (!empty($group_id)) {
        $bp->groups->current_group = new BP_Groups_Group($group_id);
        if (isset($bp->groups->current_group->status) && 'public' != $bp->groups->current_group->status) {
            $args['hide_sitewide'] = 1;
        }
        /*else
        		$args['hide_sitewide'] = 0;*/
    }
    $place_id = bp_checkins_add_new_place($args);
    if (empty($place_id)) {
        echo '-1<div id="message" class="error"><p>' . __('There was a problem posting your place, please try again.', 'bp-checkins') . '</p></div>';
        return false;
    }
    // setting the activity content
    $place = get_post($place_id);
    $thumbnail = bp_get_checkins_places_featured_image($place_id);
    $excerpt = bp_get_checkins_places_excerpt($place->post_content);
    $place_name = esc_attr($place->post_title);
    $content = apply_filters('bp_checkins_place_content_before_activity', $thumbnail . $excerpt);
    $activity_id = 0;
    if (empty($group_id) && bp_is_active('checkins')) {
        $activity_id = bp_checkins_post_update(array('content' => $content, 'type' => 'new_place', 'place_id' => $place_id, 'place_name' => $place_name));
    } else {
        $activity_id = bp_checkins_groups_post_update(array('content' => $content, 'group_id' => $group_id, 'type' => 'new_place', 'place_id' => $place_id, 'place_name' => $place_name));
    }
    if (empty($place_id)) {
        echo '-1<div id="message" class="error"><p>' . __('There was a problem posting your place, please try again.', 'bp-checkins') . '</p></div>';
        return false;
    }
    if (bp_checkins_has_places('p=' . $place->post_name)) {
        ?>
		<?php 
        while (bp_checkins_has_places()) {
            bp_checkins_the_place();
            ?>
			<?php 
            bp_checkins_load_template_choose('bp-checkins-places-entry');
            ?>
		<?php 
        }
        ?>
	 <?php 
    }
    exit;
}
コード例 #3
0
    if (empty($_POST['page'])) {
        ?>

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

	<?php 
    }
    ?>

	<?php 
    while (bp_checkins_has_places()) {
        bp_checkins_the_place();
        ?>

		<?php 
        bp_checkins_load_template_choose('bp-checkins-places-entry', false);
        ?>

	<?php 
    }
    ?>

	<?php 
    if (bp_checkins_has_more_places()) {
        ?>

		<li class="bpci-place-load-more">
			<a href="#more-places"><?php 
        _e('Load More', 'bp-checkins');
        ?>
</a>
コード例 #4
0
    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 
    }
コード例 #5
0
								<?php 
do_action('bp_checkins_member_checkins_filters');
?>

							</select>
						</li>
					</ul>
					</form>
				</div>
				
				<?php 
if (is_user_logged_in() && bp_is_my_profile()) {
    ?>
					<?php 
    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');