Example #1
0
File: Group.php Project: ncube/edu
 public function publicGroupExists($id)
 {
     $count = DB::fetchCount('group', array('group_id' => $id, 'public' => 1), 'group_id');
     if ($count === 1) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
Example #2
0
File: Notif.php Project: ncube/edu
 public function raiseMsgNotif($to_id)
 {
     if (!empty($to_id)) {
         #code...
     } else {
         return FALSE;
     }
     $user_id = Session::get('user_id');
     // Check if exists
     $count = DB::fetchCount('msg_notif', array('user_id' => $user_id, 'to_id' => $to_id));
     if ($count === 0) {
         DB::insert('msg_notif', array('user_id' => $user_id, 'to_id' => $to_id, 'time' => time()));
         return TRUE;
     } else {
         DB::updateIf('msg_notif', array('status' => 0, 'time' => time()), array('user_id' => $user_id, 'to_id' => $to_id));
         return TRUE;
     }
 }
Example #3
0
File: User.php Project: ncube/edu
 public function followerCount()
 {
     return DB::fetchCount('follow', array('following_id' => Session::get('user_id')));
 }
Example #4
0
 public function exists($id)
 {
     if (DB::fetchCount('question', array('q_id' => $id)) === 1) {
         return TRUE;
     } else {
         return FALSE;
     }
 }