api scrape + medal wearing status

This commit is contained in:
xiaomlove
2022-03-19 14:55:43 +08:00
parent 8c32b45e64
commit 4857b799b8
24 changed files with 16536 additions and 69 deletions

View File

@@ -632,7 +632,7 @@ if ($action == "viewtopic")
$uidArr = array_keys($uidArr);
unset($arr);
$neededColumns = array('id', 'noad', 'class', 'enabled', 'privacy', 'avatar', 'signature', 'uploaded', 'downloaded', 'last_access', 'username', 'donor', 'leechwarn', 'warned', 'title');
$userInfoArr = \App\Models\User::query()->with(['valid_medals'])->find($uidArr, $neededColumns)->keyBy('id');
$userInfoArr = \App\Models\User::query()->with(['wearing_medals'])->find($uidArr, $neededColumns)->keyBy('id');
$pn = 0;
$lpr = get_last_read_post_id($topicid);
@@ -674,7 +674,7 @@ if ($action == "viewtopic")
$avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars($arr2["avatar"]) : "");
$uclass = get_user_class_image($arr2["class"]);
$by = build_medal_image($userInfo->valid_medals, 20) . get_username($posterid,false,true,true,false,false,true);
$by = build_medal_image($userInfo->wearing_medals, 20) . get_username($posterid,false,true,true,false,false,true);
if (!$avatar)
$avatar = "pic/default_avatar.png";