function execute()
 {
     $model = new connectionUserPhotoModel();
     $user = ConnectionHelper::userLogin();
     $photo = $model->getPhoto($user['id']);
     return array('photos' => $photo);
 }
예제 #2
0
 public function getInfo($id)
 {
     $user = $this->getFromId((int) $id);
     if (!$user) {
         return false;
     }
     $photoModel = new connectionUserPhotoModel();
     $timeOnline = (int) ((int) strtotime('now') - (int) Settings::getValue('time_online') * 60);
     $user['online'] = $user['last_active'] >= $timeOnline ? true : false;
     $user['photo'] = $photoModel->getPhoto($user['id']);
     $user['avatar'] = $photoModel->getAvatar($user['id']);
     $user['age'] = floor((strtotime('now') - $user['birth_date']) / (60 * 60 * 24 * 365));
     return $user;
 }