public function update_view_status($userID) { $query = parent::get_many_by('to', $userID); $data = array('status' => 1); foreach ($query as $msg) { parent::update($msg->id, $data); } }
/** * Update an existing category * @access public * @param int $id The ID of the category * @param array $input The data to update * @return bool */ public function update($id, $input) { return parent::update($id, array( 'title' => $input['title'], 'slug' => url_title(strtolower(convert_accented_characters($input['title']))) )); }
/** * Update * * @access public * @param id $id * @param array $input * @return mixed */ public function update($id, $input = array()) { return parent::update($id, array( 'name' => $input['name'], 'data' => $input['data'] )); }
public function update($primary_value, $data, $skip_validation = false) { $group = $data['group']; unset($data['btnAction'], $data['group']); if (parent::update($primary_value, $data)) { return $this->_recipient_groups($primary_value, $group); } else { return FALSE; } }
function update($id, $input) { $this->load->helper('date'); return parent::update($id, array( 'title' => $input['title'], 'slug' => $input['slug'], 'description' => $input['description'], 'parent' => $input['parent'], 'updated_on' => now() )); }
function update($data, $value = '') { if (is_array($data)) { foreach ($data as $key => $value) { $record = array('property' => $key, 'value' => $value); parent::update($record); } } else { $record = array('property' => $data, 'value' => $value); parent::update($record); } }
/** * Update resource details * * @access public * @param int $resource_id * @param array $attributes * @return void */ function update($resource_id = 0, $attributes = array()) { if ($resource_id > 0 && !$this->get_by_name($attributes['name'], $resource_id)) { // Update return parent::update($resource_id, $attributes); } elseif (!$this->get_by_name($attributes['name'])) { // Insert return parent::insert($attributes); } else { return FALSE; } }
public function update($uid, $user) { $this->form_validation->set_rules('first_name', 'First Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('last_name', 'Last Name', 'trim|required|xss_clean'); $this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[6]|xss_clean'); if ($this->form_validation->run()) { if (parent::update($uid, $user)) { return true; } else { return false; } } else { return false; } }
public function update($id=null, $data=array()) { if (empty($data['pass_confirm']) && isset($data['password'])) { unset($data['pass_confirm'], $data['password']); } else if (!empty($data['password']) && !empty($data['pass_confirm']) && $data['password'] == $data['pass_confirm']) { list($password, $salt) = $this->hash_password($data['password']); unset($data['password'], $data['pass_confirm']); } if (isset($data['zipcode'])) { $data['zipcode'] = (int)$data['zipcode']; $data['zip_extra'] = (int)$data['zip_extra']; } return parent::update($id, $data); }
function update_reply_msg($data, $id = NULL) { parent::update($data, $id); return $id; }
function activate($id) { return parent::update($id, array('is_active' => 1, 'activation_code' => '')); }
/** * Update a group * * * @param int $id The ID of the role * @param array $input The data to update * @return array */ public function update($id = 0, $input = array(), $skip_validation = false) { return parent::update($id, array('description' => $input['description'])); }
function update_lmember($data, $id = NULL) { parent::update($data, $id); return $id; }
public function update($data = array(), $id = 0) { parent::update($data, $id); if ($this->db->affected_rows() > 0) { return TRUE; } return FALSE; }
function update_expense($data, $id = NULL) { parent::update($data, $id); return $id; }
function update_classes($data, $id = NULL) { parent::update($data, $id); return $id; }
function update($id = 0, $input = array()) { $this->load->helper('date'); $input['updated_on'] = now(); return parent::update($id, $input); }
function update_term($data, $id = NULL) { parent::update($data, $id); return $id; }
function update_module($data, $id = NULL) { parent::update($data, $id); return $id; }
public function publish($id = 0) { return parent::update($id, array('status' => 'live', 'preview_hash' => '')); }
/** * Update an existing image * * @author Yorick Peterse - PyroCMS Dev Team * @modified by Jerel Unruh - PyroCMS Dev Team to add crop * @access public * @param int $id The ID of the image * @param array $input The data used for updating the image * @return mixed */ public function update_image($id, $input) { // Get the data related to the image we're working with $image = $this->db->from('gallery_images')->join('galleries', 'gallery_images.gallery_id = galleries.id')->where('gallery_images.id', $id)->get()->row(); // Set the paths $full_path = 'uploads/galleries/' . $image->slug . '/full/' . $image->filename . $image->extension; $thumb_path = 'uploads/galleries/' . $image->slug . '/thumbs/' . $image->filename . '_thumb' . $image->extension; // Crop an existing thumbnail if ($input['thumb_width'] && $input['thumb_height'] > '1') { // Get the required values for cropping the thumbnail $size_array = getimagesize($full_path); $width = $size_array[0]; $height = $size_array[1]; $scaled_height = $input['scaled_height']; $scaled_percent = $scaled_height / $height; $options['width'] = $input['thumb_width'] / $scaled_percent; $options['height'] = $input['thumb_height'] / $scaled_percent; $options['x_axis'] = $input['thumb_x'] / $scaled_percent; $options['y_axis'] = $input['thumb_y'] / $scaled_percent; $options['create_thumb'] = FALSE; $options['maintain_ratio'] = $input['ratio']; // Crop the fullsize image first if ($this->resize('crop', $full_path, $full_path, $options) !== TRUE) { return FALSE; } //Create a new thumbnail from the newly cropped image // Is the current size larger? If so, resize to a width/height of X pixels (determined by the config file) if ($options['width'] > $this->config->item('image_thumb_width')) { $options['width'] = $this->config->item('image_thumb_width'); } if ($options['height'] > $this->config->item('image_thumb_height')) { $options['height'] = $this->config->item('image_thumb_height'); } // Set the thumbnail option $options['create_thumb'] = TRUE; $options['maintain_ratio'] = TRUE; //create the thumbnail if ($this->resize('resize', $full_path, 'uploads/galleries/' . $image->slug . '/thumbs/', $options) !== TRUE) { return FALSE; } } else { if (isset($input['delete'])) { // First we'll delete it from the DB if (parent::delete($id)) { // Change the table $this->table = 'galleries'; // Unset the thumbnail for each gallery that was using this image if (parent::update_by('thumbnail_id', $id, array('thumbnail_id' => NULL))) { // Change the table back $this->table = 'gallery_images'; // Delete the files if (unlink($full_path) === TRUE and unlink($thumb_path) === TRUE) { return TRUE; } else { return FALSE; } } else { return FALSE; } } else { return FALSE; } } } // Just save it already, do note that data isn't saved if the user decides to delete an image $to_update['title'] = $input['title']; $to_update['description'] = $input['description']; $to_update['updated_on'] = time(); return parent::update($id, $to_update); }
function update_automation_rec($data, $id = NULL) { parent::update($data, $id); return $id; }
/** * Unapprove a comment * * @access public * @param int $id The ID of the comment to unapprove * @return mixed */ public function unapprove($id) { return parent::update($id, array('is_active' => 0)); }
public function update($id, $params) { if (isset($params->last_seen)) { $replacement = "VBX_User::setting('last_seen', new MY_ModelLiteral('UTC_TIMESTAMP()'))"; _deprecated_notice(__CLASS__ . '::$last_seen', '1.1.2', $replacement); } return parent::update($id, $params); }
function update($id, $input) { return parent::update($id, $input); }
/** * Updates the current user to database. * * @return boolean */ public function update() { if (empty($this->email)) { return false; } $this->dateupdate = gmdate("Y-m-d H:i:s"); $res = parent::update(); return $res; }
/** * Update an existing category * * @param int $id The ID of the category * @param array $input The data to update * @param bool $skip_validation * * @return bool */ public function update($id, $input, $skip_validation = false) { return parent::update($id, array('title' => $input['title'], 'slug' => $input['slug'])); }
/** * Update media */ public function update($path) { if (!file_exists($path)) { return false; } if ($this->public_id) { \Cloudinary\Uploader::destroy($this->public_id); } $res = \Cloudinary\Uploader::upload($path); $this->public_id = $res['public_id']; return parent::update(); }
function update_alert($data, $id = NULL) { parent::update($data, $id); return $id; }
function update_feetype($data, $id = NULL) { parent::update($data, $id); return $id; }