misc: Minor improvements (#1876)

* misc: Minor improvements

* Update viewprofile.php

* Update viewprofile.php

* Update functions.php

* Update filelist.php

* Revert "Update filelist.php"

This reverts commit e5eb9a6b3f.

* Update .cliffignore

* Updated

* Update viewtopic_attach_guest.tpl
This commit is contained in:
Roman Kelesidis 2025-04-16 17:40:36 +07:00 committed by GitHub
commit eeb391da6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 11 additions and 6 deletions

View file

@ -898,13 +898,16 @@ function bb_get_config($table, $from_db = false, $update_cache = true)
{
if ($from_db or !$cfg = CACHE('bb_config')->get("config_{$table}")) {
$cfg = [];
foreach (DB()->fetch_rowset("SELECT * FROM $table") as $row) {
$cfg[$row['config_name']] = $row['config_value'];
}
if ($update_cache) {
CACHE('bb_config')->set("config_{$table}", $cfg);
}
}
return $cfg;
}

View file

@ -76,7 +76,7 @@ if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) {
// Null ratio
if ($bb_cfg['ratio_null_enabled'] && $btu = get_bt_userdata($profiledata['user_id'])) {
$template->assign_vars(array('NULLED_RATIO' => $btu['ratio_nulled']));
$template->assign_vars(['NULLED_RATIO' => $btu['ratio_nulled']]);
}
// Ban information
@ -93,7 +93,7 @@ $template->assign_vars([
'PROFILE_USER_ID' => $profiledata['user_id'],
'PROFILE_USER' => $profile_user_id,
'USER_REGDATE' => bb_date($profiledata['user_regdate'], 'Y-m-d H:i', false),
'POSTER_RANK' => ($poster_rank) ? "<span class=\"$rank_style\">" . $poster_rank . "</span>" : $lang['USER'],
'POSTER_RANK' => $poster_rank ? "<span class=\"$rank_style\">" . $poster_rank . "</span>" : $lang['USER'],
'RANK_IMAGE' => $rank_image,
'RANK_SELECT' => $rank_select,
'POSTS' => $profiledata['user_posts'],
@ -101,8 +101,8 @@ $template->assign_vars([
'EMAIL' => $email,
'WWW' => $profiledata['user_website'],
'ICQ' => $profiledata['user_icq'],
'LAST_VISIT_TIME' => ($profiledata['user_lastvisit']) ? (!$profile_user_id && bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_lastvisit'], 'Y-m-d H:i', false) : $lang['NEVER'],
'LAST_ACTIVITY_TIME' => ($profiledata['user_session_time']) ? (!$profile_user_id && bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_session_time'], 'Y-m-d H:i', false) : $lang['NEVER'],
'LAST_VISIT_TIME' => $profiledata['user_lastvisit'] ? (!$profile_user_id && bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_lastvisit'], 'Y-m-d H:i', false) : $lang['NEVER'],
'LAST_ACTIVITY_TIME' => $profiledata['user_session_time'] ? (!$profile_user_id && bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN) ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_session_time'], 'Y-m-d H:i', false) : $lang['NEVER'],
'USER_ACTIVE' => $profiledata['user_active'],
'LOCATION' => render_flag($profiledata['user_from']),
'OCCUPATION' => $profiledata['user_occ'],