コード例 #1
0
ファイル: class.rsvp.php プロジェクト: Ashleyotero/oldest-old
 public function retrieve()
 {
     global $wpdb, $_wt_options;
     $rsvp_id = $this->id;
     $rsvp = null;
     if ($rsvp_id) {
         $rsvp = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . WORDTOUR_ATTENDING . " WHERE rsvp_id = {$rsvp_id}"), "ARRAY_A");
     }
     return parent::retrieve($rsvp);
 }
コード例 #2
0
 public function retrieve($attachment_id = 0)
 {
     global $wpdb;
     if (!$attachment_id) {
         $attachment_id = $this->id;
     }
     if ($attachment_id) {
         $attachment = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . WORDTOUR_ATTACHMENT . " WHERE attachment_id={$attachment_id}"), "ARRAY_A");
     }
     return parent::retrieve($attachment);
 }
コード例 #3
0
 public function update($nonce = 0, $social_id = 0, $type = "", $id = 0, $ref_id = 0, $parent_type = "event")
 {
     global $wpdb;
     if (parent::validate($nonce, self::NONCE_INSERT)) {
         if ($id) {
             $wpdb->update(WORDTOUR_SOCIAL, array('social_parent_id' => $id, 'social_parent_type' => $parent_type, 'social_type' => $type, 'social_publish_time' => current_time("mysql", 0), 'social_ref_id' => $ref_id), array("social_id" => $social_id), array('%d', '%s', '%s', '%s', '%d'), array('%d'));
             if ($wpdb->result) {
                 $update_wpdb = clone $wpdb;
                 $this->retrieve();
                 $this->db_result("success", $update_wpdb, array("result" => $this->db_out($this->data)));
                 return true;
             } else {
                 $this->db_result("error", $wpdb, array("msg" => "Update was succesfull, unfortontly database didnt updated with recent changes(<i>" . $wpdb->last_error . "</i>)"));
                 return false;
             }
             return $wpdb->get_row($wpdb->prepare("SELECT * FROM " . WORDTOUR_SOCIAL . " WHERE social_parent_id={$id} AND social_type='{$type}'"), "ARRAY_A");
         }
     }
     return 0;
 }
コード例 #4
0
ファイル: class.post.php プロジェクト: Ashleyotero/oldest-old
 protected function validate(&$data, $nonce_name)
 {
     # check in parent class if nonce is legal
     $is_valid = parent::validate($data["_post_nonce"], $nonce_name);
     if ($is_valid) {
         //			if(empty($data["post_title"])) {
         //				$is_valid = false ;
         //				$this->add_db_result("post_title","required","Title is missing");
         //			}
         //
         //			if(empty($data["post_event_id"])) {
         //				$is_valid = false ;
         //				$this->add_db_result("post_event_id","required","Event Id is missing");
         //			}
         if (!$is_valid) {
             $this->db_result("error", null, array("data" => $this->db_response_msg));
         }
     }
     return $is_valid;
 }
コード例 #5
0
 public function delete_all($comment_id = array(), $nonce = "")
 {
     global $wpdb;
     if (parent::validate($nonce, self::NONCE_DELETE)) {
         $result = array();
         foreach ($comment_id as $id) {
             $this->id = $id;
             $this->delete(null, $id, 0);
             $result[$id] = $this->db_result;
         }
         $this->db_result = $result;
     }
     return false;
 }
コード例 #6
0
 public function admin_html($data = null)
 {
     return parent::admin_html("get_gallery_row_html", $data);
 }