mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-19 21:03:54 -07:00
parent
a319d29bc5
commit
3c5a37fdb4
6 changed files with 94 additions and 106 deletions
|
@ -34,24 +34,24 @@ $view = (isset($_POST['search']) && $_POST['search']) ? 'attachments' : $view;
|
||||||
|
|
||||||
// process modes based on view
|
// process modes based on view
|
||||||
if ($view === 'username') {
|
if ($view === 'username') {
|
||||||
$mode_types_text = array($lang['SORT_USERNAME'], $lang['SORT_ATTACHMENTS'], $lang['SORT_SIZE']);
|
$mode_types_text = [$lang['SORT_USERNAME'], $lang['SORT_ATTACHMENTS'], $lang['SORT_SIZE']];
|
||||||
$mode_types = array('username', 'attachments', 'filesize');
|
$mode_types = ['username', 'attachments', 'filesize'];
|
||||||
|
|
||||||
if (!$mode) {
|
if (!$mode) {
|
||||||
$mode = 'attachments';
|
$mode = 'attachments';
|
||||||
$sort_order = 'DESC';
|
$sort_order = 'DESC';
|
||||||
}
|
}
|
||||||
} elseif ($view === 'attachments') {
|
} elseif ($view === 'attachments') {
|
||||||
$mode_types_text = array($lang['SORT_FILENAME'], $lang['SORT_COMMENT'], $lang['SORT_EXTENSION'], $lang['SORT_SIZE'], $lang['SORT_DOWNLOADS'], $lang['SORT_POSTTIME']);
|
$mode_types_text = [$lang['SORT_FILENAME'], $lang['SORT_COMMENT'], $lang['SORT_EXTENSION'], $lang['SORT_SIZE'], $lang['SORT_DOWNLOADS'], $lang['SORT_POSTTIME']];
|
||||||
$mode_types = array('real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time');
|
$mode_types = ['real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time'];
|
||||||
|
|
||||||
if (!$mode) {
|
if (!$mode) {
|
||||||
$mode = 'real_filename';
|
$mode = 'real_filename';
|
||||||
$sort_order = 'ASC';
|
$sort_order = 'ASC';
|
||||||
}
|
}
|
||||||
} elseif ($view === 'search') {
|
} elseif ($view === 'search') {
|
||||||
$mode_types_text = array($lang['SORT_FILENAME'], $lang['SORT_COMMENT'], $lang['SORT_EXTENSION'], $lang['SORT_SIZE'], $lang['SORT_DOWNLOADS'], $lang['SORT_POSTTIME']);
|
$mode_types_text = [$lang['SORT_FILENAME'], $lang['SORT_COMMENT'], $lang['SORT_EXTENSION'], $lang['SORT_SIZE'], $lang['SORT_DOWNLOADS'], $lang['SORT_POSTTIME']];
|
||||||
$mode_types = array('real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time');
|
$mode_types = ['real_filename', 'comment', 'extension', 'filesize', 'downloads', 'post_time'];
|
||||||
|
|
||||||
$sort_order = 'DESC';
|
$sort_order = 'DESC';
|
||||||
} else {
|
} else {
|
||||||
|
@ -112,8 +112,8 @@ if ($view === 'username') {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set select fields
|
// Set select fields
|
||||||
$view_types_text = array($lang['VIEW_STATISTIC'], $lang['VIEW_SEARCH']);
|
$view_types_text = [$lang['VIEW_STATISTIC'], $lang['VIEW_SEARCH']];
|
||||||
$view_types = array('stats', 'search');
|
$view_types = ['stats', 'search'];
|
||||||
|
|
||||||
$select_view = '<select name="view">';
|
$select_view = '<select name="view">';
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ $select_sort_order .= '</select>';
|
||||||
|
|
||||||
$submit_change = isset($_POST['submit_change']);
|
$submit_change = isset($_POST['submit_change']);
|
||||||
$delete = isset($_POST['delete']);
|
$delete = isset($_POST['delete']);
|
||||||
$delete_id_list = get_var('delete_id_list', array(0));
|
$delete_id_list = get_var('delete_id_list', [0]);
|
||||||
|
|
||||||
$confirm = isset($_POST['confirm']);
|
$confirm = isset($_POST['confirm']);
|
||||||
|
|
||||||
|
@ -163,22 +163,22 @@ if ($confirm && count($delete_id_list) > 0) {
|
||||||
$hidden_fields .= '<input type="hidden" name="delete_id_list[]" value="' . $iValue . '" />';
|
$hidden_fields .= '<input type="hidden" name="delete_id_list[]" value="' . $iValue . '" />';
|
||||||
}
|
}
|
||||||
|
|
||||||
print_confirmation(array(
|
print_confirmation([
|
||||||
'FORM_ACTION' => 'admin_attach_cp.php',
|
'FORM_ACTION' => 'admin_attach_cp.php',
|
||||||
'HIDDEN_FIELDS' => $hidden_fields,
|
'HIDDEN_FIELDS' => $hidden_fields,
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assign Default Template Vars
|
// Assign Default Template Vars
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'S_VIEW_SELECT' => $select_view,
|
'S_VIEW_SELECT' => $select_view,
|
||||||
'S_MODE_ACTION' => 'admin_attach_cp.php',
|
'S_MODE_ACTION' => 'admin_attach_cp.php',
|
||||||
));
|
]);
|
||||||
|
|
||||||
if ($submit_change && $view === 'attachments') {
|
if ($submit_change && $view === 'attachments') {
|
||||||
$attach_change_list = get_var('attach_id_list', array(0));
|
$attach_change_list = get_var('attach_id_list', [0]);
|
||||||
$attach_comment_list = get_var('attach_comment_list', array(''));
|
$attach_comment_list = get_var('attach_comment_list', ['']);
|
||||||
$attach_download_count_list = get_var('attach_count_list', array(0));
|
$attach_download_count_list = get_var('attach_count_list', [0]);
|
||||||
|
|
||||||
// Generate correct Change List
|
// Generate correct Change List
|
||||||
$attachments = [];
|
$attachments = [];
|
||||||
|
@ -232,7 +232,7 @@ if ($view == 'stats') {
|
||||||
$row = DB()->fetch_row('SELECT COUNT(DISTINCT user_id_1) AS users FROM ' . BB_ATTACHMENTS . ' WHERE post_id != 0');
|
$row = DB()->fetch_row('SELECT COUNT(DISTINCT user_id_1) AS users FROM ' . BB_ATTACHMENTS . ' WHERE post_id != 0');
|
||||||
$number_of_users = $row['users'];
|
$number_of_users = $row['users'];
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'TPL_ATTACH_STATISTICS' => true,
|
'TPL_ATTACH_STATISTICS' => true,
|
||||||
'TOTAL_FILESIZE' => $upload_dir_size,
|
'TOTAL_FILESIZE' => $upload_dir_size,
|
||||||
'ATTACH_QUOTA' => $attachment_quota,
|
'ATTACH_QUOTA' => $attachment_quota,
|
||||||
|
@ -241,7 +241,7 @@ if ($view == 'stats') {
|
||||||
'NUMBER_OF_PMS' => $number_of_pms,
|
'NUMBER_OF_PMS' => $number_of_pms,
|
||||||
'NUMBER_OF_TOPICS' => $number_of_topics,
|
'NUMBER_OF_TOPICS' => $number_of_topics,
|
||||||
'NUMBER_OF_USERS' => $number_of_users,
|
'NUMBER_OF_USERS' => $number_of_users,
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
|
@ -281,22 +281,22 @@ if ($view === 'search') {
|
||||||
bb_die($lang['NO_SEARCHABLE_FORUMS']);
|
bb_die($lang['NO_SEARCHABLE_FORUMS']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'TPL_ATTACH_SEARCH' => true,
|
'TPL_ATTACH_SEARCH' => true,
|
||||||
'S_FORUM_OPTIONS' => $s_forums,
|
'S_FORUM_OPTIONS' => $s_forums,
|
||||||
'S_CATEGORY_OPTIONS' => $s_categories,
|
'S_CATEGORY_OPTIONS' => $s_categories,
|
||||||
'S_SORT_OPTIONS' => $select_sort_mode,
|
'S_SORT_OPTIONS' => $select_sort_mode,
|
||||||
'S_SORT_ORDER' => $select_sort_order,
|
'S_SORT_ORDER' => $select_sort_order,
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Username
|
// Username
|
||||||
if ($view === 'username') {
|
if ($view === 'username') {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'TPL_ATTACH_USER' => true,
|
'TPL_ATTACH_USER' => true,
|
||||||
'S_MODE_SELECT' => $select_sort_mode,
|
'S_MODE_SELECT' => $select_sort_mode,
|
||||||
'S_ORDER_SELECT' => $select_sort_order,
|
'S_ORDER_SELECT' => $select_sort_order,
|
||||||
));
|
]);
|
||||||
$total_rows = 0;
|
$total_rows = 0;
|
||||||
bb_die('removed');
|
bb_die('removed');
|
||||||
}
|
}
|
||||||
|
@ -308,11 +308,11 @@ if ($view === 'attachments') {
|
||||||
|
|
||||||
$hidden_fields = '';
|
$hidden_fields = '';
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'TPL_ATTACH_ATTACHMENTS' => true,
|
'TPL_ATTACH_ATTACHMENTS' => true,
|
||||||
'S_MODE_SELECT' => $select_sort_mode,
|
'S_MODE_SELECT' => $select_sort_mode,
|
||||||
'S_ORDER_SELECT' => $select_sort_order,
|
'S_ORDER_SELECT' => $select_sort_order,
|
||||||
));
|
]);
|
||||||
|
|
||||||
$total_rows = 0;
|
$total_rows = 0;
|
||||||
|
|
||||||
|
@ -332,10 +332,10 @@ if ($view === 'attachments') {
|
||||||
|
|
||||||
$template->assign_block_vars('switch_user_based', []);
|
$template->assign_block_vars('switch_user_based', []);
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'S_USER_HIDDEN' => $s_hidden,
|
'S_USER_HIDDEN' => $s_hidden,
|
||||||
'L_STATISTICS_FOR_USER' => sprintf($lang['STATISTICS_FOR_USER'], $username),
|
'L_STATISTICS_FOR_USER' => sprintf($lang['STATISTICS_FOR_USER'], $username),
|
||||||
));
|
]);
|
||||||
|
|
||||||
$sql = 'SELECT attach_id
|
$sql = 'SELECT attach_id
|
||||||
FROM ' . BB_ATTACHMENTS . '
|
FROM ' . BB_ATTACHMENTS . '
|
||||||
|
@ -439,7 +439,7 @@ if ($view === 'attachments') {
|
||||||
|
|
||||||
$hidden_field = '<input type="hidden" name="attach_id_list[]" value="' . (int)$attachments[$i]['attach_id'] . '" />';
|
$hidden_field = '<input type="hidden" name="attach_id_list[]" value="' . (int)$attachments[$i]['attach_id'] . '" />';
|
||||||
|
|
||||||
$template->assign_block_vars('attachrow', array(
|
$template->assign_block_vars('attachrow', [
|
||||||
'ROW_NUMBER' => $i + ($_GET['start'] + 1),
|
'ROW_NUMBER' => $i + ($_GET['start'] + 1),
|
||||||
'ROW_CLASS' => $row_class,
|
'ROW_CLASS' => $row_class,
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ if ($view === 'attachments') {
|
||||||
'S_DELETE_BOX' => $delete_box,
|
'S_DELETE_BOX' => $delete_box,
|
||||||
'S_HIDDEN' => $hidden_field,
|
'S_HIDDEN' => $hidden_field,
|
||||||
'U_VIEW_ATTACHMENT' => BB_ROOT . DL_URL . $attachments[$i]['attach_id'],
|
'U_VIEW_ATTACHMENT' => BB_ROOT . DL_URL . $attachments[$i]['attach_id'],
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@ if ($t_data['seeders'] > 2) {
|
||||||
$this->ajax_die(sprintf($lang['CALLSEED_MSG_SPAM'], $time_left));
|
$this->ajax_die(sprintf($lang['CALLSEED_MSG_SPAM'], $time_left));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$get_banned_users = get_banned_users() ? (', ' . implode(', ', get_banned_users())) : '';
|
||||||
|
|
||||||
$user_list = DB()->fetch_rowset("
|
$user_list = DB()->fetch_rowset("
|
||||||
SELECT DISTINCT dl.user_id, u.user_opt, tr.user_id as active_dl
|
SELECT DISTINCT dl.user_id, u.user_opt, tr.user_id as active_dl
|
||||||
FROM " . BB_BT_DLSTATUS . " dl
|
FROM " . BB_BT_DLSTATUS . " dl
|
||||||
|
@ -41,7 +43,7 @@ $user_list = DB()->fetch_rowset("
|
||||||
LEFT JOIN " . BB_BT_TRACKER . " tr ON(tr.user_id = dl.user_id)
|
LEFT JOIN " . BB_BT_TRACKER . " tr ON(tr.user_id = dl.user_id)
|
||||||
WHERE dl.topic_id = $topic_id
|
WHERE dl.topic_id = $topic_id
|
||||||
AND dl.user_status IN (" . DL_STATUS_COMPLETE . ", " . DL_STATUS_DOWN . ")
|
AND dl.user_status IN (" . DL_STATUS_COMPLETE . ", " . DL_STATUS_DOWN . ")
|
||||||
AND dl.user_id NOT IN ({$userdata['user_id']}, " . EXCLUDED_USERS . ", " . implode(', ', get_banned_users()) . ")
|
AND dl.user_id NOT IN ({$userdata['user_id']}, " . EXCLUDED_USERS . $get_banned_users . ")
|
||||||
AND u.user_active = 1
|
AND u.user_active = 1
|
||||||
GROUP BY dl.user_id
|
GROUP BY dl.user_id
|
||||||
");
|
");
|
||||||
|
|
|
@ -241,7 +241,7 @@ switch ($mode) {
|
||||||
print_confirmation([
|
print_confirmation([
|
||||||
'QUESTION' => $lang['CONFIRM_DELETE_TOPIC'],
|
'QUESTION' => $lang['CONFIRM_DELETE_TOPIC'],
|
||||||
'ITEMS_LIST' => implode("\n</li>\n<li>\n", $topic_titles),
|
'ITEMS_LIST' => implode("\n</li>\n<li>\n", $topic_titles),
|
||||||
'FORM_ACTION' => "modcp.php",
|
'FORM_ACTION' => 'modcp.php',
|
||||||
'HIDDEN_FIELDS' => build_hidden_fields($hidden_fields)
|
'HIDDEN_FIELDS' => build_hidden_fields($hidden_fields)
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -288,7 +288,7 @@ switch ($mode) {
|
||||||
'TOPIC_TITLES' => implode("\n</li>\n<li>\n", $topic_titles),
|
'TOPIC_TITLES' => implode("\n</li>\n<li>\n", $topic_titles),
|
||||||
|
|
||||||
'S_FORUM_SELECT' => $forum_select,
|
'S_FORUM_SELECT' => $forum_select,
|
||||||
'S_MODCP_ACTION' => "modcp.php",
|
'S_MODCP_ACTION' => 'modcp.php',
|
||||||
'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
'S_HIDDEN_FIELDS' => build_hidden_fields($hidden_fields),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -345,10 +345,12 @@ class Post
|
||||||
if ($mode == 'reply') {
|
if ($mode == 'reply') {
|
||||||
$update_watched_sql = [];
|
$update_watched_sql = [];
|
||||||
|
|
||||||
|
$get_banned_users = get_banned_users() ? (', ' . implode(', ', get_banned_users())) : '';
|
||||||
|
|
||||||
$watch_list = DB()->fetch_rowset("SELECT u.username, u.user_id, u.user_email, u.user_lang
|
$watch_list = DB()->fetch_rowset("SELECT u.username, u.user_id, u.user_email, u.user_lang
|
||||||
FROM " . BB_TOPICS_WATCH . " tw, " . BB_USERS . " u
|
FROM " . BB_TOPICS_WATCH . " tw, " . BB_USERS . " u
|
||||||
WHERE tw.topic_id = $topic_id
|
WHERE tw.topic_id = $topic_id
|
||||||
AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . EXCLUDED_USERS . ", " . implode(', ', get_banned_users()) . ")
|
AND tw.user_id NOT IN (" . $userdata['user_id'] . ", " . EXCLUDED_USERS . $get_banned_users . ")
|
||||||
AND tw.notify_status = " . TOPIC_WATCH_NOTIFIED . "
|
AND tw.notify_status = " . TOPIC_WATCH_NOTIFIED . "
|
||||||
AND u.user_id = tw.user_id
|
AND u.user_id = tw.user_id
|
||||||
AND u.user_active = 1
|
AND u.user_active = 1
|
||||||
|
|
|
@ -95,14 +95,10 @@ if ($is_auth['auth_mod']) {
|
||||||
unset($_REQUEST['sort'], $_REQUEST['order'], $_REQUEST[$title_match_key]);
|
unset($_REQUEST['sort'], $_REQUEST['order'], $_REQUEST[$title_match_key]);
|
||||||
$show_type_separator = false;
|
$show_type_separator = false;
|
||||||
}
|
}
|
||||||
$select_tst = array_merge(array($lang['TOR_STATUS_SELECT_ALL'] => -1), array_flip($lang['TOR_STATUS_NAME']));
|
$select_tst = array_merge([$lang['TOR_STATUS_SELECT_ALL'] => -1], array_flip($lang['TOR_STATUS_NAME']));
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(['SELECT_TST' => build_select('tst', $select_tst, $tor_status)]);
|
||||||
'SELECT_TST' => build_select('tst', $select_tst, $tor_status),
|
$select_st = array_merge([$lang['TOR_STATUS_SELECT_ACTION'] => -1], array_flip($lang['TOR_STATUS_NAME']));
|
||||||
));
|
$template->assign_vars(['SELECT_ST' => build_select('st', $select_st, -1)]);
|
||||||
$select_st = array_merge(array($lang['TOR_STATUS_SELECT_ACTION'] => -1), array_flip($lang['TOR_STATUS_NAME']));
|
|
||||||
$template->assign_vars(array(
|
|
||||||
'SELECT_ST' => build_select('st', $select_st, -1),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Topics read tracks
|
// Topics read tracks
|
||||||
|
@ -148,12 +144,12 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums'])
|
||||||
";
|
";
|
||||||
|
|
||||||
if ($rowset = DB()->fetch_rowset($sql)) {
|
if ($rowset = DB()->fetch_rowset($sql)) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'SHOW_SUBFORUMS' => true,
|
'SHOW_SUBFORUMS' => true,
|
||||||
'FORUM_IMG' => $images['forum'],
|
'FORUM_IMG' => $images['forum'],
|
||||||
'FORUM_NEW_IMG' => $images['forum_new'],
|
'FORUM_NEW_IMG' => $images['forum_new'],
|
||||||
'FORUM_LOCKED_IMG' => $images['forum_locked'],
|
'FORUM_LOCKED_IMG' => $images['forum_locked']
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
foreach ($rowset as $sf_data) {
|
foreach ($rowset as $sf_data) {
|
||||||
$sf_forum_id = $sf_data['forum_id'];
|
$sf_forum_id = $sf_data['forum_id'];
|
||||||
|
@ -171,7 +167,7 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums'])
|
||||||
$folder_image = $images['forum_new'];
|
$folder_image = $images['forum_new'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$last_post_user = profile_url(array('username' => $sf_data['sf_last_username'], 'user_id' => $sf_data['sf_last_user_id'], 'user_rank' => $sf_data['user_rank']));
|
$last_post_user = profile_url(['username' => $sf_data['sf_last_username'], 'user_id' => $sf_data['sf_last_user_id'], 'user_rank' => $sf_data['user_rank']]);
|
||||||
|
|
||||||
if ($sf_data['forum_last_post_id']) {
|
if ($sf_data['forum_last_post_id']) {
|
||||||
$last_post = bb_date($sf_data['topic_last_post_time'], $bb_cfg['last_post_date_format']);
|
$last_post = bb_date($sf_data['topic_last_post_time'], $bb_cfg['last_post_date_format']);
|
||||||
|
@ -179,7 +175,7 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums'])
|
||||||
$last_post .= '<a href="' . POST_URL . $sf_data['forum_last_post_id'] . '#' . $sf_data['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" class="icon2" alt="latest" title="' . $lang['VIEW_LATEST_POST'] . '" /></a>';
|
$last_post .= '<a href="' . POST_URL . $sf_data['forum_last_post_id'] . '#' . $sf_data['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" class="icon2" alt="latest" title="' . $lang['VIEW_LATEST_POST'] . '" /></a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_block_vars('f', array(
|
$template->assign_block_vars('f', [
|
||||||
'FORUM_FOLDER_IMG' => $folder_image,
|
'FORUM_FOLDER_IMG' => $folder_image,
|
||||||
|
|
||||||
'FORUM_NAME' => $fname_html,
|
'FORUM_NAME' => $fname_html,
|
||||||
|
@ -187,11 +183,11 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums'])
|
||||||
'U_VIEWFORUM' => FORUM_URL . $sf_forum_id,
|
'U_VIEWFORUM' => FORUM_URL . $sf_forum_id,
|
||||||
'TOPICS' => commify($sf_data['forum_topics']),
|
'TOPICS' => commify($sf_data['forum_topics']),
|
||||||
'POSTS' => commify($sf_data['forum_posts']),
|
'POSTS' => commify($sf_data['forum_posts']),
|
||||||
'LAST_POST' => $last_post,
|
'LAST_POST' => $last_post
|
||||||
));
|
]);
|
||||||
|
|
||||||
if ($sf_data['forum_last_post_id']) {
|
if ($sf_data['forum_last_post_id']) {
|
||||||
$template->assign_block_vars('f.last', array(
|
$template->assign_block_vars('f.last', [
|
||||||
'FORUM_LAST_POST' => true,
|
'FORUM_LAST_POST' => true,
|
||||||
'SHOW_LAST_TOPIC' => $show_last_topic,
|
'SHOW_LAST_TOPIC' => $show_last_topic,
|
||||||
'LAST_TOPIC_ID' => $sf_data['last_topic_id'],
|
'LAST_TOPIC_ID' => $sf_data['last_topic_id'],
|
||||||
|
@ -200,10 +196,10 @@ if (!$forum_data['forum_parent'] && isset($forums['f'][$forum_id]['subforums'])
|
||||||
'LAST_POST_TIME' => bb_date($sf_data['topic_last_post_time'], $bb_cfg['last_post_date_format']),
|
'LAST_POST_TIME' => bb_date($sf_data['topic_last_post_time'], $bb_cfg['last_post_date_format']),
|
||||||
'LAST_POST_ID' => $sf_data['forum_last_post_id'],
|
'LAST_POST_ID' => $sf_data['forum_last_post_id'],
|
||||||
'LAST_POST_USER' => $last_post_user,
|
'LAST_POST_USER' => $last_post_user,
|
||||||
'ICON_LATEST_REPLY' => $images['icon_latest_reply'],
|
'ICON_LATEST_REPLY' => $images['icon_latest_reply']
|
||||||
));
|
]);
|
||||||
} else {
|
} else {
|
||||||
$template->assign_block_vars('f.last', array('FORUM_LAST_POST' => false));
|
$template->assign_block_vars('f.last', ['FORUM_LAST_POST' => false]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -229,7 +225,7 @@ if ($is_auth['auth_mod']) {
|
||||||
$topic_days = 0; // all the time
|
$topic_days = 0; // all the time
|
||||||
$forum_topics = $forum_data['forum_topics'];
|
$forum_topics = $forum_data['forum_topics'];
|
||||||
|
|
||||||
$sel_previous_days = array(
|
$sel_previous_days = [
|
||||||
0 => $lang['ALL_POSTS'],
|
0 => $lang['ALL_POSTS'],
|
||||||
1 => $lang['1_DAY'],
|
1 => $lang['1_DAY'],
|
||||||
7 => $lang['7_DAYS'],
|
7 => $lang['7_DAYS'],
|
||||||
|
@ -237,8 +233,8 @@ $sel_previous_days = array(
|
||||||
30 => $lang['1_MONTH'],
|
30 => $lang['1_MONTH'],
|
||||||
90 => $lang['3_MONTHS'],
|
90 => $lang['3_MONTHS'],
|
||||||
180 => $lang['6_MONTHS'],
|
180 => $lang['6_MONTHS'],
|
||||||
364 => $lang['1_YEAR'],
|
364 => $lang['1_YEAR']
|
||||||
);
|
];
|
||||||
|
|
||||||
if (!empty($_REQUEST['topicdays'])) {
|
if (!empty($_REQUEST['topicdays'])) {
|
||||||
if ($req_topic_days = abs((int)$_REQUEST['topicdays']) and isset($sel_previous_days[$req_topic_days])) {
|
if ($req_topic_days = abs((int)$_REQUEST['topicdays']) and isset($sel_previous_days[$req_topic_days])) {
|
||||||
|
@ -304,7 +300,7 @@ $title_match_sql = '';
|
||||||
if ($title_match =& $_REQUEST[$title_match_key]) {
|
if ($title_match =& $_REQUEST[$title_match_key]) {
|
||||||
if ($tmp = mb_substr(trim($title_match), 0, $title_match_max_len)) {
|
if ($tmp = mb_substr(trim($title_match), 0, $title_match_max_len)) {
|
||||||
$title_match_val = clean_text_match($tmp, true, false);
|
$title_match_val = clean_text_match($tmp, true, false);
|
||||||
$title_match_topics = get_title_match_topics($title_match_val, array(0 => $forum_id));
|
$title_match_topics = get_title_match_topics($title_match_val, [0 => $forum_id]);
|
||||||
|
|
||||||
if ($search_match_topics_csv = implode(',', $title_match_topics)) {
|
if ($search_match_topics_csv = implode(',', $title_match_topics)) {
|
||||||
$title_match_sql = "AND t.topic_id IN($search_match_topics_csv)";
|
$title_match_sql = "AND t.topic_id IN($search_match_topics_csv)";
|
||||||
|
|
|
@ -12,10 +12,10 @@ define('BB_SCRIPT', 'topic');
|
||||||
require __DIR__ . '/common.php';
|
require __DIR__ . '/common.php';
|
||||||
require INC_DIR . '/bbcode.php';
|
require INC_DIR . '/bbcode.php';
|
||||||
|
|
||||||
$datastore->enqueue(array(
|
$datastore->enqueue([
|
||||||
'ranks',
|
'ranks',
|
||||||
'cat_forums',
|
'cat_forums'
|
||||||
));
|
]);
|
||||||
|
|
||||||
$page_cfg['load_tpl_vars'] = [
|
$page_cfg['load_tpl_vars'] = [
|
||||||
'post_buttons',
|
'post_buttons',
|
||||||
|
@ -119,13 +119,11 @@ if ($t_data['allow_porno_topic'] && bf($userdata['user_opt'], 'user_opt', 'user_
|
||||||
|
|
||||||
if ($userdata['session_admin'] && !empty($_REQUEST['mod'])) {
|
if ($userdata['session_admin'] && !empty($_REQUEST['mod'])) {
|
||||||
if (IS_ADMIN) {
|
if (IS_ADMIN) {
|
||||||
$datastore->enqueue(array('viewtopic_forum_select'));
|
$datastore->enqueue(['viewtopic_forum_select']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($topic_attachment) {
|
if ($topic_attachment) {
|
||||||
$datastore->enqueue(array(
|
$datastore->enqueue(['attach_extensions']);
|
||||||
'attach_extensions',
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_die_append_msg($forum_id);
|
set_die_append_msg($forum_id);
|
||||||
|
@ -202,9 +200,7 @@ if ($moderation) {
|
||||||
$not_auth_forums_csv = $user->get_not_auth_forums(AUTH_VIEW);
|
$not_auth_forums_csv = $user->get_not_auth_forums(AUTH_VIEW);
|
||||||
$forum_select_html = get_forum_select(explode(',', $not_auth_forums_csv), 'new_forum_id');
|
$forum_select_html = get_forum_select(explode(',', $not_auth_forums_csv), 'new_forum_id');
|
||||||
}
|
}
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(['S_FORUM_SELECT' => $forum_select_html]);
|
||||||
'S_FORUM_SELECT' => $forum_select_html,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$forums = $datastore->get('cat_forums')) {
|
if (!$forums = $datastore->get('cat_forums')) {
|
||||||
|
@ -212,12 +208,12 @@ if (!$forums = $datastore->get('cat_forums')) {
|
||||||
$forums = $datastore->get('cat_forums');
|
$forums = $datastore->get('cat_forums');
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'CAT_TITLE' => $forums['cat_title_html'][$t_data['cat_id']],
|
'CAT_TITLE' => $forums['cat_title_html'][$t_data['cat_id']],
|
||||||
'U_VIEWCAT' => CAT_URL . $t_data['cat_id'],
|
'U_VIEWCAT' => CAT_URL . $t_data['cat_id'],
|
||||||
'PARENT_FORUM_HREF' => ($parent_id = $t_data['forum_parent']) ? FORUM_URL . $parent_id : '',
|
'PARENT_FORUM_HREF' => ($parent_id = $t_data['forum_parent']) ? FORUM_URL . $parent_id : '',
|
||||||
'PARENT_FORUM_NAME' => ($parent_id = $t_data['forum_parent']) ? htmlCHR($forums['f'][$parent_id]['forum_name']) : '',
|
'PARENT_FORUM_NAME' => ($parent_id = $t_data['forum_parent']) ? htmlCHR($forums['f'][$parent_id]['forum_name']) : '',
|
||||||
));
|
]);
|
||||||
unset($forums);
|
unset($forums);
|
||||||
$datastore->rm('cat_forums');
|
$datastore->rm('cat_forums');
|
||||||
|
|
||||||
|
@ -386,7 +382,7 @@ $reply_img = ($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status']
|
||||||
$reply_alt = ($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED) ? $lang['TOPIC_LOCKED_SHORT'] : $lang['REPLY_TO_TOPIC'];
|
$reply_alt = ($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED) ? $lang['TOPIC_LOCKED_SHORT'] : $lang['REPLY_TO_TOPIC'];
|
||||||
|
|
||||||
// Set 'body' template for attach_mod
|
// Set 'body' template for attach_mod
|
||||||
$template->set_filenames(array('body' => 'viewtopic.tpl'));
|
$template->set_filenames(['body' => 'viewtopic.tpl']);
|
||||||
|
|
||||||
//
|
//
|
||||||
// User authorisation levels output
|
// User authorisation levels output
|
||||||
|
@ -442,7 +438,7 @@ $pg_url .= ($posts_per_page != $bb_cfg['posts_per_page']) ? "&ppp=$posts_per
|
||||||
generate_pagination($pg_url, $total_replies, $posts_per_page, $start);
|
generate_pagination($pg_url, $total_replies, $posts_per_page, $start);
|
||||||
|
|
||||||
// Selects
|
// Selects
|
||||||
$sel_previous_days = array(
|
$sel_previous_days = [
|
||||||
0 => $lang['ALL_POSTS'],
|
0 => $lang['ALL_POSTS'],
|
||||||
1 => $lang['1_DAY'],
|
1 => $lang['1_DAY'],
|
||||||
7 => $lang['7_DAYS'],
|
7 => $lang['7_DAYS'],
|
||||||
|
@ -450,13 +446,13 @@ $sel_previous_days = array(
|
||||||
30 => $lang['1_MONTH'],
|
30 => $lang['1_MONTH'],
|
||||||
90 => $lang['3_MONTHS'],
|
90 => $lang['3_MONTHS'],
|
||||||
180 => $lang['6_MONTHS'],
|
180 => $lang['6_MONTHS'],
|
||||||
364 => $lang['1_YEAR'],
|
364 => $lang['1_YEAR']
|
||||||
);
|
];
|
||||||
|
|
||||||
$sel_post_order_ary = array(
|
$sel_post_order_ary = [
|
||||||
$lang['OLDEST_FIRST'] => 'asc',
|
$lang['OLDEST_FIRST'] => 'asc',
|
||||||
$lang['NEWEST_FIRST'] => 'desc',
|
$lang['NEWEST_FIRST'] => 'desc'
|
||||||
);
|
];
|
||||||
|
|
||||||
$topic_has_poll = ($t_data['topic_vote'] && !IS_GUEST);
|
$topic_has_poll = ($t_data['topic_vote'] && !IS_GUEST);
|
||||||
$poll_time_expired = ($t_data['topic_time'] < TIMENOW - $bb_cfg['poll_max_days'] * 86400);
|
$poll_time_expired = ($t_data['topic_time'] < TIMENOW - $bb_cfg['poll_max_days'] * 86400);
|
||||||
|
@ -469,7 +465,7 @@ $page_title = ((int)($start / $posts_per_page) === 0) ? $topic_title :
|
||||||
//
|
//
|
||||||
// Send vars to template
|
// Send vars to template
|
||||||
//
|
//
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'PAGE_URL' => $pg_url,
|
'PAGE_URL' => $pg_url,
|
||||||
'PAGE_URL_PPP' => url_arg($pg_url, 'ppp', null),
|
'PAGE_URL_PPP' => url_arg($pg_url, 'ppp', null),
|
||||||
'PAGE_START' => $start,
|
'PAGE_START' => $start,
|
||||||
|
@ -521,15 +517,15 @@ $template->assign_vars(array(
|
||||||
'POLL_IS_EDITABLE' => (!$poll_time_expired),
|
'POLL_IS_EDITABLE' => (!$poll_time_expired),
|
||||||
'POLL_IS_FINISHED' => ($t_data['topic_vote'] == POLL_FINISHED),
|
'POLL_IS_FINISHED' => ($t_data['topic_vote'] == POLL_FINISHED),
|
||||||
'CAN_MANAGE_POLL' => $can_manage_poll,
|
'CAN_MANAGE_POLL' => $can_manage_poll,
|
||||||
'CAN_ADD_POLL' => $can_add_poll,
|
'CAN_ADD_POLL' => $can_add_poll
|
||||||
));
|
]);
|
||||||
|
|
||||||
// Does this topic contain DL-List?
|
// Does this topic contain DL-List?
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'SHOW_TOR_ACT' => false,
|
'SHOW_TOR_ACT' => false,
|
||||||
'PEERS_FULL_LINK' => false,
|
'PEERS_FULL_LINK' => false,
|
||||||
'DL_LIST_HREF' => TOPIC_URL . "$topic_id&dl=names&spmode=full",
|
'DL_LIST_HREF' => TOPIC_URL . "$topic_id&dl=names&spmode=full",
|
||||||
));
|
]);
|
||||||
require INC_DIR . '/torrent_show_dl_list.php';
|
require INC_DIR . '/torrent_show_dl_list.php';
|
||||||
|
|
||||||
if ($topic_attachment) {
|
if ($topic_attachment) {
|
||||||
|
@ -552,14 +548,12 @@ if ($topic_has_poll) {
|
||||||
$poll_votes_js = \TorrentPier\Legacy\Poll::get_poll_data_items_js($topic_id);
|
$poll_votes_js = \TorrentPier\Legacy\Poll::get_poll_data_items_js($topic_id);
|
||||||
|
|
||||||
if (!$poll_votes_js) {
|
if (!$poll_votes_js) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(['TOPIC_HAS_POLL' => false]);
|
||||||
'TOPIC_HAS_POLL' => false,
|
|
||||||
));
|
|
||||||
} else {
|
} else {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'SHOW_VOTE_BTN' => \TorrentPier\Legacy\Poll::poll_is_active($t_data),
|
'SHOW_VOTE_BTN' => \TorrentPier\Legacy\Poll::poll_is_active($t_data),
|
||||||
'POLL_VOTES_JS' => $poll_votes_js,
|
'POLL_VOTES_JS' => $poll_votes_js
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -577,7 +571,7 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
$post_id = $postrow[$i]['post_id'];
|
$post_id = $postrow[$i]['post_id'];
|
||||||
$mc_type = $postrow[$i]['mc_type'];
|
$mc_type = $postrow[$i]['mc_type'];
|
||||||
$mc_comment = $postrow[$i]['mc_comment'];
|
$mc_comment = $postrow[$i]['mc_comment'];
|
||||||
$mc_user_id = profile_url(array('username' => $postrow[$i]['mc_username'], 'user_id' => $postrow[$i]['mc_user_id'], 'user_rank' => $postrow[$i]['mc_user_rank']));
|
$mc_user_id = profile_url(['username' => $postrow[$i]['mc_username'], 'user_id' => $postrow[$i]['mc_user_id'], 'user_rank' => $postrow[$i]['mc_user_rank']]);
|
||||||
|
|
||||||
$rg_id = ($postrow[$i]['poster_rg_id']) ?: 0;
|
$rg_id = ($postrow[$i]['poster_rg_id']) ?: 0;
|
||||||
$rg_avatar = get_avatar(GROUP_AVATAR_MASK . $rg_id, $postrow[$i]['rg_avatar_id']);
|
$rg_avatar = get_avatar(GROUP_AVATAR_MASK . $rg_id, $postrow[$i]['rg_avatar_id']);
|
||||||
|
@ -691,11 +685,11 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
|
|
||||||
$is_first_post = ($post_id == $t_data['topic_first_post_id']);
|
$is_first_post = ($post_id == $t_data['topic_first_post_id']);
|
||||||
|
|
||||||
$template->assign_block_vars('postrow', array(
|
$template->assign_block_vars('postrow', [
|
||||||
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
||||||
'POST_ID' => $post_id,
|
'POST_ID' => $post_id,
|
||||||
'IS_NEWEST' => ($post_id == $newest),
|
'IS_NEWEST' => ($post_id == $newest),
|
||||||
'POSTER_NAME' => profile_url(array('username' => $poster, 'user_rank' => $user_rank)),
|
'POSTER_NAME' => profile_url(['username' => $poster, 'user_rank' => $user_rank]),
|
||||||
'POSTER_NAME_JS' => addslashes($poster),
|
'POSTER_NAME_JS' => addslashes($poster),
|
||||||
'POSTER_RANK' => $poster_rank,
|
'POSTER_RANK' => $poster_rank,
|
||||||
'RANK_IMAGE' => $rank_image,
|
'RANK_IMAGE' => $rank_image,
|
||||||
|
@ -740,8 +734,8 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
'RG_URL' => GROUP_URL . $rg_id,
|
'RG_URL' => GROUP_URL . $rg_id,
|
||||||
'RG_FIND_URL' => 'tracker.php?srg=' . $rg_id,
|
'RG_FIND_URL' => 'tracker.php?srg=' . $rg_id,
|
||||||
'RG_SIG' => $rg_signature,
|
'RG_SIG' => $rg_signature,
|
||||||
'RG_SIG_ATTACH' => $postrow[$i]['attach_rg_sig'],
|
'RG_SIG_ATTACH' => $postrow[$i]['attach_rg_sig']
|
||||||
));
|
]);
|
||||||
|
|
||||||
if (isset($postrow[$i]['post_attachment']) && $is_auth['auth_download'] && function_exists('display_post_attachments')) {
|
if (isset($postrow[$i]['post_attachment']) && $is_auth['auth_download'] && function_exists('display_post_attachments')) {
|
||||||
display_post_attachments($post_id, $postrow[$i]['post_attachment']);
|
display_post_attachments($post_id, $postrow[$i]['post_attachment']);
|
||||||
|
@ -759,47 +753,41 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
set_tracks(COOKIE_TOPIC, $tracking_topics, $topic_id, $max_post_time);
|
set_tracks(COOKIE_TOPIC, $tracking_topics, $topic_id, $max_post_time);
|
||||||
|
|
||||||
if (defined('SPLIT_FORM_START')) {
|
if (defined('SPLIT_FORM_START')) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'SPLIT_FORM' => true,
|
'SPLIT_FORM' => true,
|
||||||
'START' => $start,
|
'START' => $start,
|
||||||
'S_SPLIT_ACTION' => "modcp.php",
|
'S_SPLIT_ACTION' => 'modcp.php',
|
||||||
'POST_FORUM_URL' => POST_FORUM_URL,
|
'POST_FORUM_URL' => POST_FORUM_URL,
|
||||||
'POST_TOPIC_URL' => POST_TOPIC_URL,
|
'POST_TOPIC_URL' => POST_TOPIC_URL,
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Quick Reply
|
// Quick Reply
|
||||||
if ($bb_cfg['show_quick_reply']) {
|
if ($bb_cfg['show_quick_reply']) {
|
||||||
if ($is_auth['auth_reply'] && !($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED)) {
|
if ($is_auth['auth_reply'] && !($t_data['forum_status'] == FORUM_LOCKED || $t_data['topic_status'] == TOPIC_LOCKED)) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars([
|
||||||
'QUICK_REPLY' => true,
|
'QUICK_REPLY' => true,
|
||||||
'QR_POST_ACTION' => POSTING_URL,
|
'QR_POST_ACTION' => POSTING_URL,
|
||||||
'QR_TOPIC_ID' => $topic_id,
|
'QR_TOPIC_ID' => $topic_id,
|
||||||
'CAPTCHA_HTML' => (IS_GUEST && !$bb_cfg['captcha']['disabled']) ? bb_captcha('get') : '',
|
'CAPTCHA_HTML' => (IS_GUEST && !$bb_cfg['captcha']['disabled']) ? bb_captcha('get') : ''
|
||||||
));
|
]);
|
||||||
|
|
||||||
if (!IS_GUEST) {
|
if (!IS_GUEST) {
|
||||||
$notify_user = bf($userdata['user_opt'], 'user_opt', 'user_notify');
|
$notify_user = bf($userdata['user_opt'], 'user_opt', 'user_notify');
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(['QR_NOTIFY_CHECKED' => ($notify_user) ? ($notify_user && $is_watching_topic) : $is_watching_topic]);
|
||||||
'QR_NOTIFY_CHECKED' => ($notify_user) ? $notify_user && $is_watching_topic : $is_watching_topic,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($is_auth as $name => $is) {
|
foreach ($is_auth as $name => $is) {
|
||||||
$template->assign_vars(array(strtoupper($name) => $is));
|
$template->assign_vars([strtoupper($name) => $is]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(['PG_ROW_CLASS' => $pg_row_class ?? 'row1']);
|
||||||
'PG_ROW_CLASS' => $pg_row_class ?? 'row1',
|
|
||||||
));
|
|
||||||
|
|
||||||
if (IS_ADMIN) {
|
if (IS_ADMIN) {
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(['U_LOGS' => "admin/admin_log.php?t=$topic_id&db={$bb_cfg['log_days_keep']}"]);
|
||||||
'U_LOGS' => "admin/admin_log.php?t=$topic_id&db={$bb_cfg['log_days_keep']}",
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print_page('viewtopic.tpl');
|
print_page('viewtopic.tpl');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue