/** * 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 }
/** * Is a camp in the future? * * We do a little adjustment to make sure that camps happening today show up in this list */ function thatcamp_is_in_the_future() { $camp_date = thatcamp_get_camp_date(bp_get_group_id(), 'unix'); $day_after = $camp_date + 60 * 60 * 24; return $day_after >= time(); }
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> </div> </article> <?php } ?> <?php do_action('bp_after_directory_groups_list'); ?>