From b0cbb68394f2a1fcd79195f881bdc9ec783c00d1 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Wed, 2 Jul 2025 11:33:50 +0300 Subject: [PATCH] feat: Restore some deprecated code for backward compatibility --- library/config.php | 2 ++ library/defines.php | 1 + library/includes/functions.php | 5 +++++ library/includes/init_bb.php | 1 + posting.php | 2 ++ 5 files changed, 11 insertions(+) diff --git a/library/config.php b/library/config.php index e782b10ea..2c9e8ccd2 100644 --- a/library/config.php +++ b/library/config.php @@ -724,6 +724,8 @@ $bb_cfg['tracker'] = [ 'update_dlstat' => true, 'expire_factor' => 2.5, 'compact_mode' => true, + 'upd_user_up_down_stat' => true, + 'browser_redirect_url' => '', 'scrape' => true, 'limit_active_tor' => true, 'limit_seed_count' => 0, diff --git a/library/defines.php b/library/defines.php index df8813a64..30d3d3ab2 100644 --- a/library/defines.php +++ b/library/defines.php @@ -20,6 +20,7 @@ define('LOG_DIR', BB_PATH . '/internal_data/log'); define('TRIGGERS_DIR', BB_PATH . '/internal_data/triggers'); define('AJAX_DIR', BB_PATH . '/library/ajax'); define('ATTACH_DIR', BB_PATH . '/library/attach_mod'); +define('CFG_DIR', BB_PATH . '/library/config'); define('INC_DIR', BB_PATH . '/library/includes'); define('UCP_DIR', BB_PATH . '/library/includes/ucp'); define('LANG_ROOT_DIR', BB_PATH . '/library/language'); diff --git a/library/includes/functions.php b/library/includes/functions.php index c222ecc39..3d24a5147 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -800,6 +800,11 @@ function str_short($text, $max_length, $space = ' ') return $text ?? ''; } +function wbr($text, $max_word_length = HTML_WBR_LENGTH) +{ + return preg_replace("/([\w\->;:.,~!?(){}@#$%^*\/\\\\]{" . $max_word_length . "})/ui", '$1', $text); +} + function generate_user_info($row, bool $have_auth = IS_ADMIN): array { global $userdata, $lang, $images, $bb_cfg; diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index 932dba5a1..1cb8a6c6f 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -293,6 +293,7 @@ define('USER_AGENT', strtolower($_SERVER['HTTP_USER_AGENT'])); define('HTML_SELECT_MAX_LENGTH', 60); define('HTML_SF_SPACER', ' |- '); +define('HTML_WBR_LENGTH', 12); define('HTML_CHECKED', ' checked '); define('HTML_DISABLED', ' disabled '); diff --git a/posting.php b/posting.php index 39d44c373..b75e17091 100644 --- a/posting.php +++ b/posting.php @@ -625,6 +625,8 @@ $template->assign_vars([ 'POSTER_RGROUPS' => !empty($poster_rgroups) ? $poster_rgroups : '', 'ATTACH_RG_SIG' => $switch_rg_sig ?: false, + 'U_VIEWTOPIC' => ($mode == 'reply') ? TOPIC_URL . "$topic_id&postorder=desc" : '', + 'S_NOTIFY_CHECKED' => $notify_user ? 'checked' : '', 'S_ROBOTS_CHECKED' => $robots_indexing ? 'checked' : '', 'S_TYPE_TOGGLE' => $topic_type_toggle,