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

@ -3,3 +3,4 @@
2d53efc945c7747be1755d0b66557a86bdc12cbd 2d53efc945c7747be1755d0b66557a86bdc12cbd
602137b65129b817811b80975a369ebde3270c6d 602137b65129b817811b80975a369ebde3270c6d
4eb26ae37e1f4c82a45961517ffeb54c20200408 4eb26ae37e1f4c82a45961517ffeb54c20200408
1073f190135f2098b75293a62608e2c45762d5cf

View file

@ -219,7 +219,6 @@ if ($tor_reged && $tor_info) {
'HASH' => !empty($tor_info['info_hash']) ? strtoupper(bin2hex($tor_info['info_hash'])) : false, '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, 'HASH_V2' => !empty($tor_info['info_hash_v2']) ? strtoupper(bin2hex($tor_info['info_hash_v2'])) : false,
'FILELIST_ICON' => $images['icon_tor_filelist'], 'FILELIST_ICON' => $images['icon_tor_filelist'],
'FILELIST_LINK' => FILELIST_URL . $tor_info['topic_id'],
'REGED_TIME' => bb_date($tor_info['reg_time']), 'REGED_TIME' => bb_date($tor_info['reg_time']),
'REGED_DELTA' => delta_time($tor_info['reg_time']), 'REGED_DELTA' => delta_time($tor_info['reg_time']),
'TORRENT_SIZE' => humn_size($tor_size, 2), 'TORRENT_SIZE' => humn_size($tor_size, 2),

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}")) { if ($from_db or !$cfg = CACHE('bb_config')->get("config_{$table}")) {
$cfg = []; $cfg = [];
foreach (DB()->fetch_rowset("SELECT * FROM $table") as $row) { foreach (DB()->fetch_rowset("SELECT * FROM $table") as $row) {
$cfg[$row['config_name']] = $row['config_value']; $cfg[$row['config_name']] = $row['config_value'];
} }
if ($update_cache) { if ($update_cache) {
CACHE('bb_config')->set("config_{$table}", $cfg); CACHE('bb_config')->set("config_{$table}", $cfg);
} }
} }
return $cfg; return $cfg;
} }

View file

@ -76,7 +76,7 @@ if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) {
// Null ratio // Null ratio
if ($bb_cfg['ratio_null_enabled'] && $btu = get_bt_userdata($profiledata['user_id'])) { 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 // Ban information
@ -93,7 +93,7 @@ $template->assign_vars([
'PROFILE_USER_ID' => $profiledata['user_id'], 'PROFILE_USER_ID' => $profiledata['user_id'],
'PROFILE_USER' => $profile_user_id, 'PROFILE_USER' => $profile_user_id,
'USER_REGDATE' => bb_date($profiledata['user_regdate'], 'Y-m-d H:i', false), '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_IMAGE' => $rank_image,
'RANK_SELECT' => $rank_select, 'RANK_SELECT' => $rank_select,
'POSTS' => $profiledata['user_posts'], 'POSTS' => $profiledata['user_posts'],
@ -101,8 +101,8 @@ $template->assign_vars([
'EMAIL' => $email, 'EMAIL' => $email,
'WWW' => $profiledata['user_website'], 'WWW' => $profiledata['user_website'],
'ICQ' => $profiledata['user_icq'], '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_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_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'], 'USER_ACTIVE' => $profiledata['user_active'],
'LOCATION' => render_flag($profiledata['user_from']), 'LOCATION' => render_flag($profiledata['user_from']),
'OCCUPATION' => $profiledata['user_occ'], 'OCCUPATION' => $profiledata['user_occ'],

View file

@ -345,6 +345,7 @@ class BBCode
foreach ($this->smilies['repl'] as &$smile) { foreach ($this->smilies['repl'] as &$smile) {
$smile = preg_replace('/src="([^"]+)"/', 'src="./../$1"', $smile); $smile = preg_replace('/src="([^"]+)"/', 'src="./../$1"', $smile);
} }
unset($smile);
} }
if ($this->smilies) { if ($this->smilies) {

View file

@ -146,7 +146,7 @@
<table class="attach bordered med"> <table class="attach bordered med">
<tr class="row3"> <tr class="row3">
<th colspan="3" class="{postrow.attach.tor_reged.DL_LINK_CLASS}">{postrow.attach.tor_reged.DOWNLOAD_NAME} <th colspan="3" class="{postrow.attach.tor_reged.DL_LINK_CLASS}">{postrow.attach.tor_reged.DOWNLOAD_NAME}
<a href="{postrow.attach.tor_reged.FILELIST_LINK}" title="{L_BT_FLIST_LINK_TITLE}" target="_blank"><img alt="{L_BT_FLIST_LINK_TITLE}" src="{postrow.attach.tor_reged.FILELIST_ICON}" width="12" height="12" border="0"></a> <a href="{#FILELIST_URL#}{TOPIC_ID}" title="{L_BT_FLIST_LINK_TITLE}" target="_blank"><img alt="{L_BT_FLIST_LINK_TITLE}" src="{postrow.attach.tor_reged.FILELIST_ICON}" width="12" height="12" border="0"></a>
<!-- IF postrow.attach.tor_reged.MAGNET and not postrow.attach.tor_reged.TOR_FROZEN -->&nbsp;{postrow.attach.tor_reged.MAGNET}<!-- ENDIF --></th> <!-- IF postrow.attach.tor_reged.MAGNET and not postrow.attach.tor_reged.TOR_FROZEN -->&nbsp;{postrow.attach.tor_reged.MAGNET}<!-- ENDIF --></th>
</tr> </tr>
<!-- IF postrow.attach.tor_reged.TOR_TYPE --> <!-- IF postrow.attach.tor_reged.TOR_TYPE -->

View file

@ -4,6 +4,7 @@
<legend>{L_DOWNLOAD}</legend> <legend>{L_DOWNLOAD}</legend>
<h1 class="attach_link"><a href="{U_REGISTER}" style="color: brown;">{L_DOWNLOAD_INFO}</a></h1> <h1 class="attach_link"><a href="{U_REGISTER}" style="color: brown;">{L_DOWNLOAD_INFO}</a></h1>
<p id="guest-dl-tip" class="attach_comment med"> <p id="guest-dl-tip" class="attach_comment med">
<a href="{#FILELIST_URL#}{TOPIC_ID}" target="_blank" class="med"><b>{L_BT_FLIST_LINK_TITLE}</b></a> &middot;
<a href="{$bb_cfg['how_to_download_url_help']}" class="med"><b>{L_HOW_TO_DOWNLOAD}</b></a> &middot; <a href="{$bb_cfg['how_to_download_url_help']}" class="med"><b>{L_HOW_TO_DOWNLOAD}</b></a> &middot;
<a href="{$bb_cfg['what_is_torrent_url_help']}" class="med"><b>{L_WHAT_IS_A_TORRENT}</b></a> &middot; <a href="{$bb_cfg['what_is_torrent_url_help']}" class="med"><b>{L_WHAT_IS_A_TORRENT}</b></a> &middot;
<a href="{$bb_cfg['ratio_url_help']}" class="med"><b>{L_RATINGS_AND_LIMITATIONS}</b></a><br/> <a href="{$bb_cfg['ratio_url_help']}" class="med"><b>{L_RATINGS_AND_LIMITATIONS}</b></a><br/>