function es_admin_participants($event_id) { $is_new = $event_id == 0; if (!$is_new) { $users_events = new ES_DB_UsersEvents(); $event = new stdClass(); $event->ID = $event_id; if (isset($_POST['subscribe-action'])) { global $wpdb; $users_events = new ES_DB_UsersEvents(); $action = $_POST['subscribe-action']; $user = new stdClass(); $user->ID = $_POST['subscribe-user-id']; $users_events->update_user_status($user, $event, $action); } $users = $users_events->get_users_grouped_by_status($event); } ?> <table id="event_participants" class="eventtable participants"> <thead> <tr> <td colspan="2" class="tribe_sectionheader"> <h4 id="participants">Participants</h4> </td> </tr> </thead> <tbody> <tr> <td> <?php es_render_subscription_admin_for("onboard", $users, $event_id); ?> <?php es_render_subscription_admin_for("pending", $users, $event_id); ?> <?php es_render_subscription_admin_for("onlist", $users, $event_id); ?> <?php es_render_subscription_admin_for("rejected", $users, $event_id); ?> </td> </tr> </tbody> </table> <?php }
function es_delete_user_subscriptions($user_id) { $users_events = new ES_DB_UsersEvents(); $users_events->destroy_subscriptions($user_id); }
* * @package TribeEventsCalendar * */ if (!defined('ABSPATH')) { die('-1'); } global $post; /** * We build and gather information specific to the individual event prior to * the tribe_events_template_data() call to reduce the opportunities for 3rd * party code to call wp_reset_postdata() or similar, which can result in the * $post global referencing something other than the event we're interested * in. */ $users_events = new ES_DB_UsersEvents(); $day = tribe_events_get_current_month_day(); $event_id = "{$post->ID}-{$day['daynum']}"; $link = tribe_get_event_link($post); $title = get_the_title($post); $users = es_event_find_users($post); $spots = es_event_get_spots($post); $onlist_count = count($users_events->get_users($post, "onlist")); $users_count = count($users); /** * How to Use the Javascript Templating System in this View * ======================================================== * * Month view (and week in events pro) has implemented javascript templating to power its rich tooltips and mobile views * as of Events Version 3.3. This is a guide on how to modify, extend and use this functionality. *
function es_setup_create_user_events() { $users_events = new ES_DB_UsersEvents(); $users_events->create_table(); }
/** * Single Event Template * A single event. This displays the event title, description, meta, and * optionally, the Google map for the event. * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php * * @package TribeEventsCalendar * */ if (!defined('ABSPATH')) { die('-1'); } $event = get_post(); $current_user = wp_get_current_user(); $users_events = new ES_DB_UsersEvents(); $users = $users_events->get_users($event, "onboard"); $users_count = count($users); $onlist_count = count($users_events->get_users($event, "onlist")); $spots = es_event_get_spots($event); $spots_left = $spots - $users_count; $onlist_left = 1 - $onlist_count; // Make sure $onlist_left is not negative $onlist_left = $onlist_left < 0 ? 0 : $onlist_left; $participating = $users_events->user_status($current_user, $event) == "onboard"; if (isset($_POST['subscribe']) || isset($_GET['subscribe'])) { if (isset($_GET['subscribe'])) { $event = get_post($_GET['event_id']); } else { $event = get_post($_POST['event_id']); }