From fcb1deb3bc76e59132482ed333f70531a105ce8b Mon Sep 17 00:00:00 2001 From: Yury Pikhtarev Date: Fri, 24 Mar 2023 16:49:09 +0300 Subject: [PATCH] Continuation of non-breaking edits --- admin/pagestart.php | 2 -- ajax.php | 8 ------- callseed.php | 8 +++---- library/defines.php | 1 - library/includes/init_bb.php | 21 ------------------- modcp.php | 17 +++------------ styles/templates/admin/admin_groups.tpl | 10 +-------- .../templates/admin/admin_rebuild_search.tpl | 5 ++--- styles/templates/default/index.tpl | 4 ++-- styles/templates/default/tpl_config.php | 2 -- styles/templates/default/usercp_register.tpl | 7 ------- .../templates/default/usercp_viewprofile.tpl | 10 ++++----- styles/templates/default/viewforum.tpl | 2 +- 13 files changed, 16 insertions(+), 81 deletions(-) diff --git a/admin/pagestart.php b/admin/pagestart.php index 0a27b178c..79807035c 100644 --- a/admin/pagestart.php +++ b/admin/pagestart.php @@ -11,8 +11,6 @@ define('BB_ROOT', './../'); define('IN_ADMIN', true); require dirname(__DIR__) . '/common.php'; -require ATTACH_DIR . '/attachment_mod.php'; -require ATTACH_DIR . '/includes/functions_admin.php'; $user->session_start(); diff --git a/ajax.php b/ajax.php index d78beb3d2..71ae34725 100644 --- a/ajax.php +++ b/ajax.php @@ -25,14 +25,6 @@ switch ($ajax->action) { case 'post_mod_comment': require INC_DIR . '/bbcode.php'; break; - - case 'view_torrent': - case 'mod_action': - case 'change_tor_status': - case 'change_torrent': - case 'gen_passkey': - require ATTACH_DIR . '/attachment_mod.php'; - break; } $ajax->exec(); diff --git a/callseed.php b/callseed.php index 2b81a8924..80bbe07d8 100644 --- a/callseed.php +++ b/callseed.php @@ -8,11 +8,9 @@ */ define('BB_SCRIPT', 'callseed'); -define('BB_ROOT', './'); require __DIR__ . '/common.php'; -// Init userdata -$user->session_start(array('req_login' => true)); +$user->session_start(['req_login' => true]); $topic_id = (int)request_var('t', 0); $t_data = topic_info($topic_id); @@ -49,7 +47,7 @@ $user_list = DB()->fetch_rowset(" "); $subject = sprintf($lang['CALLSEED_SUBJECT'], $t_data['topic_title']); -$message = sprintf($lang['CALLSEED_TEXT'], make_url(TOPIC_URL . $topic_id), $t_data['topic_title'], make_url(DL_URL . $t_data['attach_id'])); +$message = sprintf($lang['CALLSEED_TEXT'], make_url(TOPIC_URL . $topic_id), $t_data['topic_title'], make_url(DL_URL . $topic_id)); if ($user_list) { foreach ($user_list as $row) { @@ -65,7 +63,7 @@ if ($user_list) { send_pm($t_data['poster_id'], $subject, $message, BOT_UID); } -DB()->query("UPDATE " . BB_BT_TORRENTS . " SET call_seed_time = " . TIMENOW . " WHERE topic_id = $topic_id"); +DB()->query("UPDATE " . BB_BT_TORRENTS . " SET call_seed_time = " . TIMENOW . " WHERE topic_id = $topic_id LIMIT 1"); meta_refresh(TOPIC_URL . $topic_id); bb_die($lang['CALLSEED_MSG_OK']); diff --git a/library/defines.php b/library/defines.php index ae12adccc..504cf580e 100644 --- a/library/defines.php +++ b/library/defines.php @@ -25,7 +25,6 @@ define('CACHE_DIR', BB_PATH . '/internal_data/cache'); 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'); diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index cf2e5fc23..d0030feff 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -137,9 +137,6 @@ define('TOPIC_UNLOCKED', 0); define('TOPIC_LOCKED', 1); define('TOPIC_MOVED', 2); -define('TOPIC_WATCH_NOTIFIED', 1); -define('TOPIC_WATCH_UNNOTIFIED', 0); - // Topic types define('POST_NORMAL', 0); define('POST_STICKY', 1); @@ -253,8 +250,6 @@ define('BB_POSTS_TEXT', 'bb_posts_text'); define('BB_POSTS_HTML', 'bb_posts_html'); define('BB_PRIVMSGS', 'bb_privmsgs'); define('BB_PRIVMSGS_TEXT', 'bb_privmsgs_text'); -define('BB_QUOTA_LIMITS', 'bb_quota_limits'); -define('BB_QUOTA', 'bb_attach_quota'); define('BB_RANKS', 'bb_ranks'); define('BB_SEARCH_REBUILD', 'bb_search_rebuild'); define('BB_SEARCH', 'bb_search_results'); @@ -262,7 +257,6 @@ define('BB_SESSIONS', 'bb_sessions'); define('BB_SMILIES', 'bb_smilies'); define('BB_TOPIC_TPL', 'bb_topic_tpl'); define('BB_TOPICS', 'bb_topics'); -define('BB_TOPICS_WATCH', 'bb_topics_watch'); define('BB_USER_GROUP', 'bb_user_group'); define('BB_USERS', 'bb_users'); define('BB_WORDS', 'bb_words'); @@ -347,21 +341,6 @@ function bb_exit($output = '') exit; } -/** - * @param $var - * @param string $title - * @param bool $print - * @return string - */ -function prn_r($var, $title = '', $print = true) -{ - $r = '
' . ($title ? "$title\n\n" : '') . htmlspecialchars(print_r($var, true)) . '
'; - if ($print) { - echo $r; - } - return $r; -} - /** * @param $txt * @param bool $double_encode diff --git a/modcp.php b/modcp.php index b2249f558..16f8ea1e3 100644 --- a/modcp.php +++ b/modcp.php @@ -8,7 +8,6 @@ */ define('BB_SCRIPT', 'modcp'); -define('BB_ROOT', './'); require __DIR__ . '/common.php'; require INC_DIR . '/bbcode.php'; @@ -347,7 +346,7 @@ switch ($mode) { case 'set_download': case 'unset_download': $set_download = ($mode == 'set_download'); - $new_dl_type = ($set_download) ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL; + $new_dl_type = $set_download ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL; DB()->query(" UPDATE " . BB_TOPICS . " SET @@ -455,16 +454,6 @@ switch ($mode) { $new_topic_id = DB()->sql_nextid(); - // Update topic watch table, switch users whose posts - // have moved, over to watching the new topic - $sql = "UPDATE " . BB_TOPICS_WATCH . " - SET topic_id = $new_topic_id - WHERE topic_id = $topic_id - AND user_id IN ($user_id_sql)"; - if (!DB()->sql_query($sql)) { - bb_die('Could not update topics watch table'); - } - $sql_where = (!empty($_POST['split_type_beyond'])) ? " post_time >= $post_time AND topic_id = $topic_id" : "post_id IN ($post_id_sql)"; $sql = "UPDATE " . BB_POSTS . " SET topic_id = $new_topic_id, forum_id = $new_forum_id WHERE $sql_where"; @@ -596,7 +585,7 @@ switch ($mode) { $template->assign_vars(array( 'TPL_MODCP_IP' => true, 'IP' => $ip_this_post, - 'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=$ip_this_post&sid=" . $userdata['session_id'], + 'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $ip_this_post, )); // @@ -627,7 +616,7 @@ switch ($mode) { 'ROW_CLASS' => !($i % 2) ? 'row4' : 'row5', 'IP' => $ip, 'POSTS' => $row['postings'], - 'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $row['poster_ip'] . "&sid=" . $userdata['session_id'], + 'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $row['poster_ip'], )); $i++; diff --git a/styles/templates/admin/admin_groups.tpl b/styles/templates/admin/admin_groups.tpl index f8624464f..7f2d62692 100644 --- a/styles/templates/admin/admin_groups.tpl +++ b/styles/templates/admin/admin_groups.tpl @@ -3,7 +3,7 @@

{L_GROUP_ADMINISTRATION}

-
+ {S_HIDDEN_FIELDS} @@ -51,14 +51,6 @@ - - - - - - - -
{L_GROUP_DELETE}: {L_GROUP_DELETE_CHECK}
{L_UPLOAD_QUOTA}{S_SELECT_UPLOAD_QUOTA}
{L_PM_QUOTA}{S_SELECT_PM_QUOTA}
diff --git a/styles/templates/admin/admin_rebuild_search.tpl b/styles/templates/admin/admin_rebuild_search.tpl index aec57aac4..77545e368 100644 --- a/styles/templates/admin/admin_rebuild_search.tpl +++ b/styles/templates/admin/admin_rebuild_search.tpl @@ -126,7 +126,7 @@ function updateButton() { if ( ticker >= 0) { - if ( ticker == 0 ) + if (ticker === 0) { document.form_rebuild_progress.submit_button.value = label; document.form_rebuild_progress.submit_button.disabled = true; @@ -134,8 +134,7 @@ function updateButton() else { document.form_rebuild_progress.submit_button.value = label_next + " (" + ticker + ")"; - - ticker--;; + ticker--; refresh = setTimeout("updateButton()", 1000); } } diff --git a/styles/templates/default/index.tpl b/styles/templates/default/index.tpl index 86a3c47b0..dec278b28 100644 --- a/styles/templates/default/index.tpl +++ b/styles/templates/default/index.tpl @@ -1,7 +1,7 @@
- +
@@ -41,7 +41,7 @@
- + diff --git a/styles/templates/default/tpl_config.php b/styles/templates/default/tpl_config.php index 217450379..fb251e65c 100644 --- a/styles/templates/default/tpl_config.php +++ b/styles/templates/default/tpl_config.php @@ -94,8 +94,6 @@ $images['pm_new_msg'] = ''; $images['pm_no_new_msg'] = ''; // topic_mod_icons will be replaced with SELECT later... -$images['topic_watch'] = ''; -$images['topic_un_watch'] = ''; $images['topic_mod_lock'] = $_main . 'topic_lock.gif'; $images['topic_mod_unlock'] = $_main . 'topic_unlock.gif'; $images['topic_mod_split'] = $_main . 'topic_split.gif'; diff --git a/styles/templates/default/usercp_register.tpl b/styles/templates/default/usercp_register.tpl index 238ac91d2..d34c68e81 100644 --- a/styles/templates/default/usercp_register.tpl +++ b/styles/templates/default/usercp_register.tpl @@ -211,13 +211,6 @@ ajax.callback.posts = function(data){ - - {L_ALWAYS_NOTIFY}:
{L_ALWAYS_NOTIFY_EXPLAIN}
- -    - - - {L_NOTIFY_ON_PRIVMSG}: diff --git a/styles/templates/default/usercp_viewprofile.tpl b/styles/templates/default/usercp_viewprofile.tpl index b07e48c75..781310ea7 100644 --- a/styles/templates/default/usercp_viewprofile.tpl +++ b/styles/templates/default/usercp_viewprofile.tpl @@ -243,19 +243,18 @@ ajax.callback.gen_passkey = function(data){ {L_ICQ}: - {ICQ} - + + {ICQ} - {L_SKYPE}: - {SKYPE} - + + {SKYPE} @@ -370,7 +369,6 @@ ajax.callback.gen_passkey = function(data){ [ {L_SEARCH_USER_POSTS} ] [ {L_SEARCH_USER_TOPICS} ] [ {L_SEARCH_RELEASES} ] - [ {L_WATCHED_TOPICS} ] [ {FEED_IMG} ]

diff --git a/styles/templates/default/viewforum.tpl b/styles/templates/default/viewforum.tpl index 0c68c6d1c..861720623 100644 --- a/styles/templates/default/viewforum.tpl +++ b/styles/templates/default/viewforum.tpl @@ -478,7 +478,7 @@ td.topic_id { cursor: pointer; }
{t.tor.SEEDERS} | {t.tor.LEECHERS}
-
{t.tor.TOR_SIZE}{t.tor.TOR_SIZE} {t.tor.MAGNET}
+
{t.tor.TOR_SIZE}{t.tor.TOR_SIZE} {t.tor.MAGNET}