$user = $this->user;
- $notice = $user->noticesWithFriends();
-
- if ($limit != 0) {
- $notice->limit(0, $limit);
- }
-
- $notice->find();
-
+ $notice = $user->noticesWithFriends(0, $limit);
+
while ($notice->fetch()) {
$notices[] = clone($notice);
}
function get_image() {
$user = $this->user;
$profile = $user->getProfile();
+ if (!$profile) {
+ return NULL;
+ }
$avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE);
return ($avatar) ? $avatar->url : NULL;
}