예제 #1
0
 public function user_auth($email, $pass)
 {
     $this->db->join('roles', "roles.role_id = users.role_id");
     $this->db->where(array('pass' => md5($pass), 'status' => 'active', 'username' => $email));
     $this->db->or_where(array('email' => $email));
     return parent::get(array('pass' => md5($pass), 'status' => 'active'));
 }
예제 #2
0
 public function set($where, $data)
 {
     //overrides parent method set
     if ($where && !is_array($where)) {
         $where = array('empty_id' => $where);
     }
     return parent::set($where, $data);
 }
예제 #3
0
 public function rateup($id, $minus = false)
 {
     if ($minus) {
         $this->db->set('rateup', 'rateup-1', false);
     } else {
         $this->db->set('rateup', 'rateup+1', false);
     }
     return parent::set(array('comment_id' => $id), array());
 }
예제 #4
0
 public function set($where, $data)
 {
     //overrides parent method set
     if ($where && !is_array($where)) {
         $where = array('node_id' => $where);
     }
     // when where is not false and only a single id
     $array = array('node_id' => '', 'user_id' => '', 'module' => '', 'created' => '', 'uri' => '', 'title' => '', 'content' => '', 'note' => '', 'status' => '');
     $array = array_intersect_key($data, $array);
     $array['modified'] = date('Y-m-d H:i:s');
     parent::set($where, $array);
     return array_diff_assoc($data, $array);
     // return array difference which haven't been updated yet
 }
예제 #5
0
 public function set($where, $data)
 {
     //overrides parent method set
     if ($where && !is_array($where)) {
         $where = array('node_id' => $where);
     }
     if (isset($where['reply_id'])) {
         $where['node_id'] = $where['reply_id'];
         unset($where['reply_id']);
     }
     $data = $this->mnodes->set($where, $data);
     if (isset($where['node_id'])) {
         $where['reply_id'] = $where['node_id'];
         unset($where['node_id']);
     }
     //$this->db->join('nodes', 'nodes.node_id = replies.reply_id');
     return parent::set($where, $data);
 }
예제 #6
0
 public function set($where, $data)
 {
     //overrides parent method set
     if ($where && !is_array($where)) {
         $where = array('node_id' => $where);
     }
     if (isset($where['menu_id'])) {
         $where['node_id'] = $where['menu_id'];
         unset($where['menu_id']);
     }
     $data = $this->mnodes->set($where, $data);
     if (isset($where['node_id'])) {
         $where['menu_id'] = $where['node_id'];
         unset($where['node_id']);
     }
     if ($data != array()) {
         return parent::set($where, $data);
     } else {
         return $data;
     }
 }
예제 #7
0
 public function get_many($where = false, $like = false, $order = false, $group = false, $select = false, $limit = false, $array = false)
 {
     //overrides parent method get_many
     $this->db->join('roles', 'roles.role_id = role_permissions.role_id');
     return parent::get_many($where, $like, $order, $group, $select, $limit, $array);
 }
예제 #8
0
 public function commented($id)
 {
     $this->db->set('comment_count', 'comment_count+1', false);
     return parent::set(array('page_id' => $id), array());
 }
예제 #9
0
 public function set($data, $where = array('primary' => '1'))
 {
     return parent::set($where, $data);
 }
예제 #10
0
 public function delete($id, $tag)
 {
     return parent::delete(array('post_id' => $id, 'tag' => $tag));
 }