From eeb391da6a16440492a3b803f63be301ba3d02d3 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 16 Apr 2025 17:40:36 +0700 Subject: [PATCH] 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 e5eb9a6b3fe8d532600ccc8dfcd3d5afe04091bf. * Update .cliffignore * Updated * Update viewtopic_attach_guest.tpl --- .cliffignore | 1 + library/attach_mod/displaying_torrent.php | 1 - library/includes/functions.php | 3 +++ library/includes/ucp/viewprofile.php | 8 ++++---- src/Legacy/BBCode.php | 1 + styles/templates/default/viewtopic_attach.tpl | 2 +- styles/templates/default/viewtopic_attach_guest.tpl | 1 + 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.cliffignore b/.cliffignore index 95600423e..2cb35e72e 100644 --- a/.cliffignore +++ b/.cliffignore @@ -3,3 +3,4 @@ 2d53efc945c7747be1755d0b66557a86bdc12cbd 602137b65129b817811b80975a369ebde3270c6d 4eb26ae37e1f4c82a45961517ffeb54c20200408 +1073f190135f2098b75293a62608e2c45762d5cf diff --git a/library/attach_mod/displaying_torrent.php b/library/attach_mod/displaying_torrent.php index 37fdd7f55..0af704a52 100644 --- a/library/attach_mod/displaying_torrent.php +++ b/library/attach_mod/displaying_torrent.php @@ -219,7 +219,6 @@ if ($tor_reged && $tor_info) { 'HASH' => !empty($tor_info['info_hash']) ? strtoupper(bin2hex($tor_info['info_hash'])) : false, 'HASH_V2' => !empty($tor_info['info_hash_v2']) ? strtoupper(bin2hex($tor_info['info_hash_v2'])) : false, 'FILELIST_ICON' => $images['icon_tor_filelist'], - 'FILELIST_LINK' => FILELIST_URL . $tor_info['topic_id'], 'REGED_TIME' => bb_date($tor_info['reg_time']), 'REGED_DELTA' => delta_time($tor_info['reg_time']), 'TORRENT_SIZE' => humn_size($tor_size, 2), diff --git a/library/includes/functions.php b/library/includes/functions.php index 0e1a2117a..2eaf182dc 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -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; } diff --git a/library/includes/ucp/viewprofile.php b/library/includes/ucp/viewprofile.php index 1b3e4f878..7dbc44541 100644 --- a/library/includes/ucp/viewprofile.php +++ b/library/includes/ucp/viewprofile.php @@ -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) ? "" . $poster_rank . "" : $lang['USER'], + 'POSTER_RANK' => $poster_rank ? "" . $poster_rank . "" : $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'], diff --git a/src/Legacy/BBCode.php b/src/Legacy/BBCode.php index 642ccfc5b..dddc8fc8f 100644 --- a/src/Legacy/BBCode.php +++ b/src/Legacy/BBCode.php @@ -345,6 +345,7 @@ class BBCode foreach ($this->smilies['repl'] as &$smile) { $smile = preg_replace('/src="([^"]+)"/', 'src="./../$1"', $smile); } + unset($smile); } if ($this->smilies) { diff --git a/styles/templates/default/viewtopic_attach.tpl b/styles/templates/default/viewtopic_attach.tpl index 372c87b7b..14c28862f 100644 --- a/styles/templates/default/viewtopic_attach.tpl +++ b/styles/templates/default/viewtopic_attach.tpl @@ -146,7 +146,7 @@ diff --git a/styles/templates/default/viewtopic_attach_guest.tpl b/styles/templates/default/viewtopic_attach_guest.tpl index fc83d07eb..7b9065d6f 100644 --- a/styles/templates/default/viewtopic_attach_guest.tpl +++ b/styles/templates/default/viewtopic_attach_guest.tpl @@ -4,6 +4,7 @@ {L_DOWNLOAD}

{L_DOWNLOAD_INFO}

+ {L_BT_FLIST_LINK_TITLE} · {L_HOW_TO_DOWNLOAD} · {L_WHAT_IS_A_TORRENT} · {L_RATINGS_AND_LIMITATIONS}

{postrow.attach.tor_reged.DOWNLOAD_NAME} - {L_BT_FLIST_LINK_TITLE} + {L_BT_FLIST_LINK_TITLE}  {postrow.attach.tor_reged.MAGNET}