function add_rating($site_id, $data) { $data = array('site_id' => $site_id, 'user_id' => $data['user_id'], 'content_id' => $data['content_id'], 'type' => $data['type'], 'rating' => $data['rating'], 'created_at' => unix_to_mysql(now())); $insert = $this->db->insert('ratings', $data); $rating_id = $this->db->insert_id(); return $this->db->get_where('ratings', array('rating_id' => $rating_id))->row(); }
function add_rating($rating_data) { $rating_data['created_at'] = unix_to_mysql(now()); $this->db->insert('ratings', $rating_data); $rating_data['rating_id'] = $this->db->insert_id(); return $rating_data; }
function update_relationship($relationship_id, $relationship_data) { $relationship_data['updated_at'] = unix_to_mysql(now()); $this->db->where('relationship_id', $relationship_id); $this->db->update('relationships', $relationship_data); return TRUE; }
function update_category($category_id, $category_data) { $category_data['updated_at'] = unix_to_mysql(now()); $this->db->where('category_id', $category_id); $this->db->update('categories', $category_data); return TRUE; }
function add_tags_link($tag_id, $content_id) { $data = array('tag_id' => $tag_id, 'content_id' => $content_id, 'created_at' => unix_to_mysql(now())); $insert = $this->db->insert('tags_link', $data); $tag_link_id = $this->db->insert_id(); return $this->db->get_where('tags_link', array('tag_link_id' => $tag_link_id))->row(); }
function add_upload($upload_data) { $upload_data['status'] = 'P'; $upload_data['uploaded_at'] = unix_to_mysql(now()); $this->db->insert('uploads', $upload_data); $upload_id = $this->db->insert_id(); if ($upload_id) { return $upload_id; } return FALSE; }
function add_activity($activity_info, $activity_data) { if (array_key_exists('content_id', $activity_info)) { $content_id = $activity_info['content_id']; } else { $content_id = 0; } $insert_data = array('site_id' => $activity_info['site_id'], 'user_id' => $activity_info['user_id'], 'verb' => $activity_info['verb'], 'module' => $activity_info['module'], 'type' => $activity_info['type'], 'content_id' => $content_id, 'data' => json_encode($activity_data), 'status' => 'P', 'created_at' => unix_to_mysql(now())); $this->db->insert('activity', $insert_data); $activity_id = $this->db->insert_id(); if ($activity_id) { return $activity_id; } return FALSE; }
function add_comment($site_id, $comment_data) { // If Empty Fail if (!$comment_data['user_id'] || !$comment_data['content_id']) { return FALSE; } // Viewed Status if ($comment_data['user_id'] == $comment_data['owner_id']) { $viewed = 'Y'; } else { $viewed = 'N'; } $data = array('site_id' => $site_id, 'reply_to_id' => $comment_data['reply_to_id'], 'content_id' => $comment_data['content_id'], 'owner_id' => $comment_data['owner_id'], 'module' => $comment_data['module'], 'type' => $comment_data['type'], 'user_id' => $comment_data['user_id'], 'comment' => $comment_data['comment'], 'geo_lat' => $comment_data['geo_lat'], 'geo_long' => $comment_data['geo_long'], 'viewed' => $viewed, 'approval' => $comment_data['approval'], 'created_at' => unix_to_mysql(now())); $this->db->insert('comments', $data); return $this->db->insert_id(); }
function update_user_meta($user_meta_id, $meta_data) { $meta_data['updated_at'] = unix_to_mysql(now()); $this->db->where('user_meta_id', $user_meta_id); $this->db->update('users_meta', $meta_data); return TRUE; }
/** * Update Metadata * * @param int $content_meta_id The id of the metadata to update * @param array $update_data An assoc. array of data to update (column => newval) * @return bool Always returns true * @todo Make this return more meaningful data */ function update_meta($content_meta_id, $update_data) { $update_data['updated_at'] = unix_to_mysql(now()); $this->db->where('content_meta_id', $content_meta_id); $this->db->update('content_meta', $update_data); return TRUE; }
/** * Update Connection * * @param int $connection_id The ID of the connection to update * @param array $update_data Assoc array of column name => data to update it with * @return bool Always returns true * @todo Make this return more meaningful data */ function update_connection($connection_id, $update_data) { $update_data['updated_at'] = unix_to_mysql(now()); $this->db->where('connection_id', $connection_id); $this->db->update('connections', $update_data); return TRUE; }
public function _set_updateddate($Date) { return unix_to_mysql($Date); }
public function _set_estdate($Date) { list($Year, $Month, $Day) = explode('-', $Date); return unix_to_mysql(mktime(0, 0, 0, $Month, $Day, $Year)); }