public function defaults() { global $wpdb, $_wt_options; $options = $_wt_options->options(); parent::defaults(array(WORDTOUR_EVENTS, WORDTOUR_EVENTS_META)); if (!empty($options["default_artist"]) && empty($this->data["event_artist_id"])) { $id = $options["default_artist"]; $artist = new WT_Artist($id); $data = $artist->retrieve(); if ($data) { $this->data["event_artist_id"] = $id; $this->data["artist_name"] = $data["artist_name"]; } } if (!empty($options["default_tour"]) && empty($this->data["event_tour_id"])) { $id = $options["default_tour"]; $tour = new WT_Tour($id); $data = $tour->retrieve(); if ($tour) { $this->data["event_tour_id"] = $id; $this->data["tour_name"] = $data["tour_name"]; } } if (!empty($options["default_venue"]) && empty($this->data["event_venue_id"])) { $id = $options["default_venue"]; $venue = new WT_Venue($id); $data = $venue->retrieve(); if ($data) { $this->data["event_venue_id"] = $id; $this->data["venue_name"] = $data["venue_name"]; } } $this->data = array_merge($this->data, array("event_thumbnail" => "", "event_videos" => array(), "event_gallery" => array(), "event_category" => array(), "event_genre" => array(), "comment_status" => $options["allow_comments"] ? $options["allow_comments"] : $this->data["comment_status"], "rsvp_status" => $options["allow_rsvp"] ? $options["allow_rsvp"] : $this->data["rsvp_status"], "gallery_status" => $options["show_gallery"] ? $options["show_gallery"] : $this->data["gallery_status"], "flickr_status" => $options["show_flickr"] ? $options["show_flickr"] : $this->data["flickr_status"], "video_status" => $options["show_videos"] ? $options["show_videos"] : $this->data["video_status"], "post_status" => $options["show_posts"] ? $options["show_posts"] : $this->data["post_status"], "event_more_artists" => array())); return $this->data; }
public function get_venue_id($venue_id = 0) { if ($venue_id) { $venue = new WT_Venue($venue_id); $venue->retrieve(); return $this->save_venue($venue->db_out(null, 0), 0); } return 0; }
public function single($page = 0, $id) { if ($page && $id) { require_once ABSPATH . "wp-load.php"; require_once WT_PLUGIN_PATH . "admin/template.php"; require_once WT_PLUGIN_PATH . "admin/handlers.php"; $dwoo = new Dwoo(); switch ($page) { case "event": $event_id = $id; if ($event_id) { $event = new WT_Event($event_id); $event->retrieve(); } break; case "artist": $artist_id = $id; if ($artist_id) { $artist = new WT_Artist($artist_id); $artist->retrieve(); } break; case "tour": $tour_id = $id; if ($tour_id) { $tour = new WT_Tour($tour_id); $tour->retrieve(); } break; case "venue": $venue_id = $id; if ($venue_id) { $venue = new WT_Venue($venue_id); $venue->retrieve(); } break; case "album": $album_id = $id; if ($album_id) { $album = new WT_Album($album_id); $album->retrieve(); } break; } $tpl = new WT_Theme(); include $tpl->single_path(); exit; } }
$event = new WT_Event($_POST["event_id"]); $event->publish($_POST); $event->db_response("json"); break; case "get_event_rsvp": if (!empty($_POST["event_id"])) { $event = new WT_Event($_POST["event_id"]); echo json_encode($event->get_rsvp_users()); } break; // VENUE // VENUE case "get_venue": $venue = new WT_Venue($_POST["venue_id"]); if (!empty($_POST["venue_id"])) { $venue->retrieve(); } else { $venue->defaults(); } echo json_encode($venue->db_out(null, 0)); break; case "update_venue": $venue = new WT_Venue($_POST["venue_id"]); $venue->update($_POST); $venue->db_response("json"); break; case "quickupdate_venue": $venue = new WT_Venue($_POST["venue_id"]); $venue->quick_update($_POST); $venue->db_response("json"); break;