fix user class name etc.

This commit is contained in:
xiaomlove
2023-02-09 18:14:51 +08:00
parent ac5dc99953
commit 91430352e0
8 changed files with 16 additions and 11 deletions

View File

@@ -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 ? "<a ". $link_ext . " href=\"" . $href . "\"" . ($target == true ? " target=\"_blank\"" : "") . " class='". get_user_class_name($arr['class'],true, false, false, $options) . "_Name'>" . $username . "</a>" : $username) . $pics . ($withtitle == true ? " (" . ($arr['title'] == "" ? get_user_class_name($arr['class'],false,true,true, $options) : "<span class='".get_user_class_name($arr['class'],true, false, false, $options) . "_Name'><b>".htmlspecialchars($arr['title'])) . "</b></span>)" : "");
$username = ($link == true ? "<a ". $link_ext . " href=\"" . $href . "\"" . ($target == true ? " target=\"_blank\"" : "") . " class='". get_user_class_name($arr['class'],true, false, false) . "_Name'>" . $username . "</a>" : $username) . $pics . ($withtitle == true ? " (" . ($arr['title'] == "" ? get_user_class_name($arr['class'],false,true,true, ['with_alias' => true]) : "<span class='".get_user_class_name($arr['class'],true, false, false) . "_Name'><b>".htmlspecialchars($arr['title'])) . "</b></span>)" : "");
$username = "<span class=\"nowrap\">" . ( $bracket == true ? "(" . $username . ")" : $username) . "$medalHtml</span>";
}

View File

@@ -151,6 +151,7 @@ $lang_mybonus = array
'reward_type_official_addition' => '官种加成',
'text_get_by_harem' => '后宫加成每小时将额外得到如下的魔力值',
'harem_additional_desc' => '后宫只考虑直属后宫。每个后宫加成值可<a href="invite.php?id=%s" target="_blank" class="altlink">在此</a>查看',
'harem_additional_note' => '注意:如果自己不做种,此加成值不会增加到用户账号上',
'harem_additional_factor' => '所得奖励为全部后宫的时魔(不考虑加成)之和,乘以后宫加成系数,当前值为:',
'text_bonus_summary' => '每小时获得的合计魔力值',
'col_count' => '数量',

View File

@@ -151,6 +151,7 @@ $lang_mybonus = array
'reward_type_official_addition' => '官種加成',
'text_get_by_harem' => '後宮加成每小時將額外得到如下的魔力值',
'harem_additional_desc' => '後宮只考慮直屬後宮。每個後宮加成值可<a href="invite.php?id=%s" target="_blank" class="altlink">在此</a>查看',
'harem_additional_note' => '註意:如果自己不做種,此加成值不會增加到用戶賬號上',
'harem_additional_factor' => '所得獎勵為全部後宮的時魔(不考慮加成)之和,乘以後宮加成系數,當前值為:',
'text_bonus_summary' => '每小時獲得的合計魔力值',
'col_count' => '數量',

View File

@@ -151,6 +151,7 @@ where<ul><li><b>A</b> is an intermediate variable</li><li><b>Ti</b> is the <b>i<
'reward_type_official_addition' => 'Official addition',
'text_get_by_harem' => 'The harem addition will give the following additional bonus value per hour',
'harem_additional_desc' => "Only direct harems will be considered for the harem. Each harem's bonus addition value can be viewed <a href=\"invite.php?id=%s\" class='altlink' target='_blank'>here</a>",
'harem_additional_note' => 'Note: If you do not do the seeding yourself, this bonus value will not be added to the user account',
'harem_additional_factor' => 'The reward obtained is the sum of the hourly bonus of all the harems (regardless of the addition), multiplied by the harem bonus factor, with the current value of ',
'text_bonus_summary' => 'Total bonus gained per hour',
'col_count' => 'Counts',

View File

@@ -111,7 +111,6 @@ if (!$row) {
else {
$uprow = (isset($row['owner']) ? get_username($row['owner'], false, true, true, false, false, true) : "<i>".$lang_details['text_unknown']."</i>");
}
if ($CURUSER["id"] == $row["owner"])
$CURUSER["downloadpos"] = "yes";
if ($CURUSER["downloadpos"] != "no")

View File

@@ -9,7 +9,7 @@ $type = unesc($_GET["type"] ?? '');
$menuSelected = $_REQUEST['menu'] ?? 'invitee';
$pageSize = 50;
if (($CURUSER['id'] != $id && !user_can('viewinvite')) || !is_valid_id($id))
stderr($lang_invite['std_sorry'],$lang_invite['std_permission_denied']);
stderr($lang_invite['std_sorry'],$lang_invite['std_permission_denied'], true, false);
$userRep = new \App\Repositories\UserRepository();
function inviteMenu ($selected = "invitee") {
global $lang_invite, $id, $CURUSER, $invitesystem, $userRep;
@@ -25,7 +25,9 @@ function inviteMenu ($selected = "invitee") {
$sendBtnText = $exception->getMessage();
$disabled = ' disabled';
}
print ("</ul><form style='position: absolute;top:0;right:0' method=post action=invite.php?id=".htmlspecialchars($id)."&type=new><input type=submit ".$disabled." value='".$sendBtnText."'></form></div>");
if ($CURUSER['id'] == $id) {
print ("</ul><form style='position: absolute;top:0;right:0' method=post action=invite.php?id=".htmlspecialchars($id)."&type=new><input type=submit ".$disabled." value='".$sendBtnText."'></form></div>");
}
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) {

View File

@@ -509,6 +509,7 @@ if ($bonusTableResult['has_harem_addition']) {
print("<ul>");
print("<li>".sprintf($lang_mybonus['harem_additional_desc'], $CURUSER['id'])."</li>");
print("<li>".$lang_mybonus['harem_additional_factor'].$bonusTableResult['harem_addition_factor']."</li>");
print("<li>".$lang_mybonus['harem_additional_note']."</li>");
print("</ul>");
}

View File

@@ -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'], "<a href=\"invite.php?id=".$user['id']."\" title=\"".$lang_userdetails['link_send_invitation']."\">".$user['invites']."</a>", 1);}
tr_small($lang_userdetails['row_invitation'], "<a href=\"invite.php?id=".$user['id']."\" title=\"".$lang_userdetails['link_send_invitation']."\">".sprintf('%s(%s)', $user['invites'], $tmpInviteCount)."</a>", 1);}
else{
if ($CURUSER['id'] != $user['id'] || get_user_class() != $viewinvite_class){
if ($user["invites"] <= 0)