/** * @return object * @param boolean $required * @param string $title * @param string $minimum * @param string $message * @param string $error_fragment */ function &testGDVersion($required, $title, $minimum, $message = '', $error_fragment = '') { $test = new CmsInstallTest(); $test->title = $title; $gd_version_number = GDVersion(); $test->value = $gd_version_number; $test->secondvalue = null; if ($gd_version_number < $minimum) { if ($required) { $test->res = 'red'; } else { $test->res = 'yellow'; } } else { $test->res = 'green'; } getTestReturn($test, $required, $message, $error_fragment); return $test; }
/** * Возвращает имя файла аватара пользователя * @param $user_id * @return string */ function GetPersonalAvatar($user_id, $GetFile = false) { if ($user_id == 0) { return GetGalleryAvatar('guest.gif'); } if (System::config('user/secure_avatar_upload') && GDVersion() != 0 && !$GetFile) { return 'index.php?name=plugins&p=avatars_render&user='******'guest.gif'); } if ($users[$user_id]['a_personal'] == '1') { $avatar_file = RealPath2(System::config('general/personal_avatars_dir') . $users[$user_id]['avatar']); } else { $avatar_file = RealPath2(System::config('general/avatars_dir') . $users[$user_id]['avatar']); } if (is_file($avatar_file)) { return $avatar_file; } else { return GetGalleryAvatar('noavatar.gif'); } } }