mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 10:37:30 -07:00
Minor improvements (#1395)
* Minor improvements * Updated * Update functions.php * Update functions.php * Update mysql.sql * Update viewtopic.php * Update CHANGELOG.md
This commit is contained in:
parent
392186c36e
commit
679d422a2a
5 changed files with 43 additions and 36 deletions
|
@ -567,9 +567,6 @@ for ($i = 0; $i < $total_posts; $i++) {
|
|||
$poster_joined = !$poster_guest ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i') : '';
|
||||
$poster_longevity = !$poster_guest ? delta_time($postrow[$i]['user_regdate']) : '';
|
||||
$post_id = $postrow[$i]['post_id'];
|
||||
$mc_type = (int)$postrow[$i]['mc_type'];
|
||||
$mc_comment = $postrow[$i]['mc_comment'];
|
||||
$mc_user_id = profile_url(['username' => $postrow[$i]['mc_username'], 'user_id' => $postrow[$i]['mc_user_id'], 'user_rank' => $postrow[$i]['mc_user_rank']]);
|
||||
|
||||
$rg_id = $postrow[$i]['poster_rg_id'] ?: 0;
|
||||
$rg_avatar = get_avatar(GROUP_AVATAR_MASK . $rg_id, $postrow[$i]['rg_avatar_id']);
|
||||
|
@ -658,13 +655,18 @@ for ($i = 0; $i < $total_posts; $i++) {
|
|||
$pg_row_class = !($i % 2) ? 'row2' : 'row1';
|
||||
|
||||
// Mod comment
|
||||
$mc_class = match ($mc_type) {
|
||||
1 => 'success',
|
||||
2 => 'info',
|
||||
3 => 'warning',
|
||||
4 => 'danger',
|
||||
default => '',
|
||||
};
|
||||
if ($mc_type = (int)$postrow[$i]['mc_type']) {
|
||||
$mc_comment = $postrow[$i]['mc_comment'];
|
||||
$mc_user_id = profile_url(['username' => $postrow[$i]['mc_username'], 'user_id' => $postrow[$i]['mc_user_id'], 'user_rank' => $postrow[$i]['mc_user_rank']]);
|
||||
|
||||
$mc_class = match ($mc_type) {
|
||||
1 => 'success',
|
||||
2 => 'info',
|
||||
3 => 'warning',
|
||||
4 => 'danger',
|
||||
default => '',
|
||||
};
|
||||
}
|
||||
$mc_select_type = [];
|
||||
foreach ($lang['MC_COMMENT'] as $key => $value) {
|
||||
$mc_select_type[$key] = $value['type'];
|
||||
|
@ -711,10 +713,10 @@ for ($i = 0; $i < $total_posts; $i++) {
|
|||
|
||||
'POSTER_BIRTHDAY' => user_birthday_icon($postrow[$i]['user_birthday'], $postrow[$i]['user_id']),
|
||||
|
||||
'MC_COMMENT' => $mc_type ? bbcode2html($mc_comment) : '',
|
||||
'MC_BBCODE' => $mc_type ? $mc_comment : '',
|
||||
'MC_CLASS' => $mc_class,
|
||||
'MC_TITLE' => sprintf($lang['MC_COMMENT'][$mc_type]['title'], $mc_user_id),
|
||||
'MC_COMMENT' => isset($mc_comment) ? bbcode2html($mc_comment) : '',
|
||||
'MC_BBCODE' => $mc_comment ?? '',
|
||||
'MC_CLASS' => $mc_class ?? '',
|
||||
'MC_TITLE' => isset($mc_user_id) ? sprintf($lang['MC_COMMENT'][$mc_type]['title'], $mc_user_id) : '',
|
||||
'MC_SELECT_TYPE' => build_select("mc_type_$post_id", array_flip($mc_select_type), $mc_type),
|
||||
|
||||
'RG_AVATAR' => $rg_avatar,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue