示例#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 defaults()
 {
     global $_wt_options;
     parent::defaults(WORDTOUR_TRACKS);
     $default_artist = $_wt_options->options("default_artist");
     if (!empty($default_artist) && empty($this->data["track_artist_id"])) {
         $id = $_wt_options->options("default_artist");
         $artist = new WT_Artist($id);
         $data = $artist->retrieve();
         if ($data) {
             $this->data["track_artist_id"] = $id;
             $this->data["artist_name"] = $data["artist_name"];
         }
     }
     $this->data = array_merge($this->data, array("track_id" => "", "track_title" => "", "track_lyrics" => "", "track_genre" => array()));
     return $this->data;
 }
示例#3
0
 public function bio($atts = null, $content = null, $code = "")
 {
     require_once WT_PLUGIN_PATH . 'admin/template.php';
     require_once WT_PLUGIN_PATH . 'admin/handlers.php';
     require_once WT_PLUGIN_PATH . 'dwoo/dwooAutoload.php';
     $dwoo = new Dwoo();
     if ($atts["artist"]) {
         $artist = new WT_Artist($atts["artist"]);
         $artist->retrieve();
         if ($artist->data) {
             $tpl = $artist->template();
             include WT_PLUGIN_PATH . 'theme/layout.renderer.php';
             return $html;
         }
     }
     return "";
 }
示例#4
0
     $artist->db_response("json");
     break;
 case "delete_all_tracks":
     unset($_POST["action"]);
     if ($_POST["id"]) {
         $track = new WT_Track();
         $track->delete_all(json_decode(stripslashes($_POST["id"])), $_POST["_nonce"]);
         $track->db_response("json");
     }
     break;
     // ARTIST
 // ARTIST
 case "get_artist":
     $artist = new WT_Artist($_POST["artist_id"]);
     if (!empty($_POST["artist_id"])) {
         $artist->retrieve();
     } else {
         $artist->defaults();
     }
     echo json_encode($artist->db_out(null, 0));
     break;
 case "update_artist":
     $artist = new WT_Artist($_POST["artist_id"]);
     $artist->update($_POST);
     $artist->db_response("json");
     break;
 case "quickupdate_artist":
     $artist = new WT_Artist($_POST["artist_id"]);
     $artist->quick_update($_POST);
     $artist->db_response("json");
     break;