custom fields add priority + display

This commit is contained in:
xiaomlove
2022-09-19 16:27:04 +08:00
parent a9c734e45b
commit b305ce7380
20 changed files with 225 additions and 72 deletions

View File

@@ -25,11 +25,12 @@ class BaseRepository
$canViewAnonymousClass = Setting::get('authority.viewanonymous');
if($user->privacy == "strong" || ($torrent && $torrent->anonymous == 'yes' && $user->id == $torrent->owner)) {
//用户强私密,或者种子作者匿名而当前项作者刚好为种子作者
$anonymousText = nexus_trans('label.anonymous');
if($authenticator->class >= $canViewAnonymousClass || $user->id == $authenticator->id) {
//但当前用户权限可以查看匿名者,或当前用户查看自己的数据,显示个匿名,后边加真实用户名
return sprintf('匿名(%s)', $username);
return sprintf('%s(%s)', $anonymousText, $username);
} else {
return '匿名';
return $anonymousText;
}
} else {
return $username;