public function getUserAvatar($userId = '') { $profileModel = Portal::getModels('profiles'); $profile = $profileModel->getProfiles($userId); if (empty($profile['avatar'])) { return base_url('images/users/avatars/default/avatar.jpg'); } return base_url('images/users/avatars/' . $profile['id'] . '/' . $profile['avatar']); }