예제 #1
0
 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;
 }
예제 #2
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;
     }
 }
예제 #3
0
     }
     break;
 case "remove_default_artist":
     $id = $_POST["artist_id"];
     if ($id) {
         $artist = new WT_Artist($id);
         $artist->set_default("");
         $artist->db_response("json");
     }
     break;
     // TOUR
 // TOUR
 case "get_tour":
     $tour = new WT_Tour($_POST["tour_id"]);
     if (!empty($_POST["tour_id"])) {
         $tour->retrieve();
     } else {
         $tour->defaults();
     }
     echo json_encode($tour->db_out(null, 0));
     break;
 case "update_tour":
     $tour = new WT_Tour($_POST["tour_id"]);
     $tour->update($_POST);
     $tour->db_response("json");
     break;
 case "quickupdate_tour":
     $tour = new WT_Tour($_POST["tour_id"]);
     $tour->quick_update($_POST);
     $tour->db_response("json");
     break;