Ejemplo n.º 1
0
 public function find_author_img($id = 0)
 {
     if ((int) $id == 0) {
         return false;
     }
     $name = parent::find($id);
     return gravatar_link($name->email);
 }
Ejemplo n.º 2
0
 /**
  * Returns Name of Author of article.
  *
  * @param int $id  User ID of Author
  *
  * @return mixed   False if no ID is provided, else String of Display Name of User.
  */
 public function find_author($id = 0)
 {
     if ((int) $id == 0) {
         return false;
     }
     $this->select($this->display_name);
     $name = parent::find($id);
     return $name->{$this->display_name};
 }
Ejemplo n.º 3
0
 public function can_delete_role($role_id = 0)
 {
     $this->db->select('role_id, can_delete');
     $delete_role = parent::find($role_id);
     if ($delete_role->can_delete == 1) {
         return TRUE;
     }
     return FALSE;
 }
Ejemplo n.º 4
0
 /**
  * Find a user's record and role information.
  *
  * @param integer $id The user's ID.
  *
  * @return boolean|object An object with the user's information.
  */
 public function find($id = null)
 {
     return parent::find($id);
 }
Ejemplo n.º 5
0
 public function find($id = null)
 {
     $this->db->join('roles', 'roles.role_id = users.role_id', 'left');
     return parent::find($id);
 }
Ejemplo n.º 6
0
 public function find($id = null)
 {
     if (empty($this->selects)) {
         $this->select($this->table . '.*, role_name');
     }
     $this->db->join('roles', 'roles.role_id = users.role_id', 'left');
     return parent::find($id);
 }
Ejemplo n.º 7
0
 /**
  * Find a user's record and role information.
  *
  * @param integer $id The user's ID.
  *
  * @return boolean|object An object with the user's information.
  */
 public function find($id = null)
 {
     $this->preFind();
     return parent::find($id);
 }
Ejemplo n.º 8
0
 /**
  * Verifies that a role can be deleted.
  *
  * @param int $role_id The role to verify.
  *
  * @return bool true if the role can be deleted, else false
  */
 public function can_delete_role($role_id = 0)
 {
     $this->db->select('can_delete');
     $delete_role = parent::find($role_id);
     if ($delete_role->can_delete == 1) {
         return true;
     }
     return false;
 }
Ejemplo n.º 9
0
 public function find($id = null)
 {
     if (empty($this->selects)) {
         $this->select($this->table . '.*, category');
     }
     $this->db->join('news_categories', 'news_categories.id = news_articles.category_id', 'left');
     return parent::find($id);
 }
Ejemplo n.º 10
0
 /**
  * Verifies that a role can be deleted.
  *
  * @param integer $role_id The role to verify.
  *
  * @return boolean True if the role can be deleted, else false.
  */
 public function can_delete_role($role_id = 0)
 {
     $this->db->select('can_delete');
     $delete_role = parent::find($role_id);
     return $delete_role->can_delete == 1;
 }