function thatcamp_camp_summary()
{
    $summary = 'A new THATCamp has been registered at <a href="http://thatcamp.org">thatcamp.org</a>:<br /><br />';
    $summary .= 'Name: ' . bp_get_group_name() . '<br />';
    $permalink = thatcamp_get_camp_permalink();
    $summary .= 'URL: <a href="' . thatcamp_get_camp_permalink() . '">' . thatcamp_get_camp_permalink() . '</a><br />';
    $location = thatcamp_get_location(bp_get_group_id());
    if ($location) {
        $summary .= 'Location: ' . $location . '<br />';
    }
    $date = thatcamp_get_camp_date_pretty(bp_get_group_id());
    if ($date) {
        $summary .= 'Date: ' . $date . '<br />';
    }
    echo $summary;
}
示例#2
0
        bp_the_group();
        ?>
				<article class="camp-listitem">
					<div class="camp-listdate">TBA</div>

					<div class="camp-listinfo">
						<h3><a href="<?php 
        thatcamp_camp_permalink();
        ?>
" class="camplink"><?php 
        bp_group_name();
        ?>
</a></h3>
						<div class="item-desc">
							<?php 
        echo thatcamp_get_location(bp_get_group_id(), 'pretty');
        ?>
						</div>
					</div>
				</article>
			<?php 
    }
}
?>


			<a href="<?php 
echo site_url();
?>
/camps" class="button campbutton offset">
				<span class="button-inner"><?php 
/**
 * Renders the admin page
 */
function thatcamp_menu_page()
{
    $group_id = thatcamp_get_blog_group(get_current_blog_id());
    $start_date = thatcamp_get_camp_date($group_id, 'mmddyy');
    $end_date = thatcamp_get_camp_date($group_id, 'mmddyy', 'end');
    $location = array('country' => thatcamp_get_location($group_id, 'country'), 'state' => thatcamp_get_location($group_id, 'state'), 'province' => thatcamp_get_location($group_id, 'province'), 'city' => thatcamp_get_location($group_id, 'city'));
    ?>
	<form method="post">

	<div class="wrap">
		<h2>THATCamp Setup</h2>

		<table class="form-table">
			<tr>
				<th scope="row">
					<label for="thatcamp_date">When will your THATCamp be held?</label>
				</th>

				<td>
					<input id="thatcamp_start_date" name="thatcamp_start_date" type="text" value="<?php 
    echo esc_attr($start_date);
    ?>
" />
					<p class="description">Start Date (<small>one-day THATCamps need only a Start Date</small>)</p><br />
					<input id="thatcamp_end_date" name="thatcamp_end_date" type="text" value="<?php 
    echo esc_attr($end_date);
    ?>
" />
					<p class="description">End Date</p>
				</td>
			</tr>

			<tr>
				<th scope="row">
					<label for="thatcamp_country">Where will your THATCamp be held?</label>
				</th>

				<td>
					<?php 
    thatcamp_country_picker($location);
    ?>
				</td>
			</tr>

			<tr>
				<th scope="row">
					<label for="thatcamp_organizers">Organizers</label>
				</th>

				<td>
					<ul id="organizer-list">
					<?php 
    $users = new WP_User_Query(array('blog_id' => get_current_blog_id()));
    ?>
					<?php 
    foreach ($users->results as $user) {
        ?>
						<?php 
        $is_organizer = get_user_meta($user->ID, 'wp_' . get_current_blog_id() . '_is_organizer', true);
        ?>
						<li><input name="thatcamp_organizers[]" value="<?php 
        echo esc_attr($user->ID);
        ?>
" <?php 
        checked('yes', $is_organizer);
        ?>
 type="checkbox"> <?php 
        echo bp_core_get_userlink($user->ID);
        ?>
</li>
					<?php 
    }
    ?>
					</ul>

					<p class="description">Select all users who should be labeled as 'organizers' of your THATCamp.</p>
				</td>
			</tr>

		</table>

		<br /><br />

		<?php 
    wp_nonce_field('thatcamp_setup');
    ?>

		<input type="submit" class="button-primary" name="thatcamp_setup_submit" value="Save Changes" />
	</div>

	</form>
	<?php 
}
示例#4
0
			<div class="camp-listdate"><?php 
        echo thatcamp_get_camp_date_pretty();
        ?>
</div>

			<div class="camp-listinfo">
				<h3><a href="<?php 
        thatcamp_camp_permalink();
        ?>
" class="camplink"><?php 
        bp_group_name();
        ?>
</a></h3>
				<div class="item-desc">
                                        <?php 
        if ($location = thatcamp_get_location(bp_get_group_id(), 'pretty')) {
            ?>
                                                <?php 
            echo $location . '<br />';
            ?>
                                        <?php 
        }
        ?>

					<?php 
        thatcamp_get_camp_date(bp_get_group_id, 'unix');
        ?>
					<?php 
        thatcamp_camp_description();
        ?>
				</div>
function thatcamp_get_location($group_id = 0, $type = 'pretty')
{
    $group_id = thatcamp_fallback_group($group_id);
    switch ($type) {
        case 'country':
        case 'state':
        case 'province':
        case 'city':
            $key = 'thatcamp_' . $type;
            $location = groups_get_groupmeta($group_id, $key);
            break;
        case 'pretty':
        default:
            $location_array = array();
            foreach (array('country', 'state', 'province', 'city') as $ltype) {
                $maybe_l = thatcamp_get_location($group_id, $ltype);
                if ($maybe_l) {
                    $location_array[$ltype] = $maybe_l;
                }
                $location = implode(', ', array_reverse($location_array));
            }
            break;
    }
    return $location;
}