From 91430352e0d0e4d44ad9cb7a23f34c7d680110a3 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Thu, 9 Feb 2023 18:14:51 +0800 Subject: [PATCH] fix user class name etc. --- include/functions.php | 8 ++------ lang/chs/lang_mybonus.php | 1 + lang/cht/lang_mybonus.php | 1 + lang/en/lang_mybonus.php | 1 + public/details.php | 1 - public/invite.php | 9 +++++++-- public/mybonus.php | 1 + public/userdetails.php | 5 +++-- 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/functions.php b/include/functions.php index 2670e05c..d4c3f9be 100644 --- a/include/functions.php +++ b/include/functions.php @@ -523,7 +523,7 @@ function get_user_class_name($class, $compact = false, $b_colored = false, $I18N case UC_SYSOP: {$class_name = $this_lang_functions['text_sysops']; break;} case UC_STAFFLEADER: {$class_name = $this_lang_functions['text_staff_leader']; break;} } - if ($class < UC_VIP && isset($settingAccount["{$class}_alias"])) { + if (isset($options['with_alias']) && $options['with_alias'] && $class < UC_VIP && isset($settingAccount["{$class}_alias"])) { $alias = trim($settingAccount["{$class}_alias"]); if (!empty($alias)) { $class_name = sprintf('%s(%s)', $class_name, $alias); @@ -3872,11 +3872,7 @@ function get_username($id, $big = false, $link = true, $bold = true, $target = f } $href = getSchemeAndHttpHost() . "/userdetails.php?id=$id"; - $options = [ -// 'uid' => $id, -// 'with_role' => true, - ]; - $username = ($link == true ? "" . $username . "" : $username) . $pics . ($withtitle == true ? " (" . ($arr['title'] == "" ? get_user_class_name($arr['class'],false,true,true, $options) : "".htmlspecialchars($arr['title'])) . ")" : ""); + $username = ($link == true ? "" . $username . "" : $username) . $pics . ($withtitle == true ? " (" . ($arr['title'] == "" ? get_user_class_name($arr['class'],false,true,true, ['with_alias' => true]) : "".htmlspecialchars($arr['title'])) . ")" : ""); $username = "" . ( $bracket == true ? "(" . $username . ")" : $username) . "$medalHtml"; } diff --git a/lang/chs/lang_mybonus.php b/lang/chs/lang_mybonus.php index 74bd1daf..21bc88aa 100644 --- a/lang/chs/lang_mybonus.php +++ b/lang/chs/lang_mybonus.php @@ -151,6 +151,7 @@ $lang_mybonus = array 'reward_type_official_addition' => '官种加成', 'text_get_by_harem' => '后宫加成每小时将额外得到如下的魔力值', 'harem_additional_desc' => '后宫只考虑直属后宫。每个后宫加成值可在此查看', + 'harem_additional_note' => '注意:如果自己不做种,此加成值不会增加到用户账号上', 'harem_additional_factor' => '所得奖励为全部后宫的时魔(不考虑加成)之和,乘以后宫加成系数,当前值为:', 'text_bonus_summary' => '每小时获得的合计魔力值', 'col_count' => '数量', diff --git a/lang/cht/lang_mybonus.php b/lang/cht/lang_mybonus.php index 463564fa..9232a3b9 100644 --- a/lang/cht/lang_mybonus.php +++ b/lang/cht/lang_mybonus.php @@ -151,6 +151,7 @@ $lang_mybonus = array 'reward_type_official_addition' => '官種加成', 'text_get_by_harem' => '後宮加成每小時將額外得到如下的魔力值', 'harem_additional_desc' => '後宮只考慮直屬後宮。每個後宮加成值可在此查看', + 'harem_additional_note' => '註意:如果自己不做種,此加成值不會增加到用戶賬號上', 'harem_additional_factor' => '所得獎勵為全部後宮的時魔(不考慮加成)之和,乘以後宮加成系數,當前值為:', 'text_bonus_summary' => '每小時獲得的合計魔力值', 'col_count' => '數量', diff --git a/lang/en/lang_mybonus.php b/lang/en/lang_mybonus.php index c07236cf..fa57f0a5 100644 --- a/lang/en/lang_mybonus.php +++ b/lang/en/lang_mybonus.php @@ -151,6 +151,7 @@ where
"); + if ($CURUSER['id'] == $id) { + print ("
"); + } end_main_frame(); } @@ -54,6 +56,9 @@ if ($inv["invites"] != 1){ } if ($type == 'new'){ + if ($CURUSER['id'] != $id) { + stderr($lang_invite['std_sorry'],$lang_invite['std_permission_denied'], true, false); + } try { $sendBtnText = $userRep->getInviteBtnText($CURUSER['id']); } catch (\Exception $exception) { diff --git a/public/mybonus.php b/public/mybonus.php index 9511a3f3..2ac51702 100644 --- a/public/mybonus.php +++ b/public/mybonus.php @@ -509,6 +509,7 @@ if ($bonusTableResult['has_harem_addition']) { print("
    "); print("
  • ".sprintf($lang_mybonus['harem_additional_desc'], $CURUSER['id'])."
  • "); print("
  • ".$lang_mybonus['harem_additional_factor'].$bonusTableResult['harem_addition_factor']."
  • "); + print("
  • ".$lang_mybonus['harem_additional_note']."
  • "); print("
"); } diff --git a/public/userdetails.php b/public/userdetails.php index 3f0cec11..8d89f790 100644 --- a/public/userdetails.php +++ b/public/userdetails.php @@ -195,11 +195,12 @@ if (($user["privacy"] != "strong") OR (user_can('prfmanage')) || $CURUSER['id'] } */ tr_small($lang_userdetails['text_user_id'], $userIdDisplay, 1); + $tmpInviteCount = $userInfo->temporary_invites()->count(); if ($CURUSER['id'] == $user['id'] || user_can('viewinvite')){ - if ($user["invites"] <= 0) + if ($user["invites"] <= 0 && $tmpInviteCount <= 0) tr_small($lang_userdetails['row_invitation'], $lang_userdetails['text_no_invitation'], 1); else - tr_small($lang_userdetails['row_invitation'], "".$user['invites']."", 1);} + tr_small($lang_userdetails['row_invitation'], "".sprintf('%s(%s)', $user['invites'], $tmpInviteCount)."", 1);} else{ if ($CURUSER['id'] != $user['id'] || get_user_class() != $viewinvite_class){ if ($user["invites"] <= 0)