mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 13:54:02 -07:00
Minor improvements (#884)
* Minor improvements * Update displaying_torrent.php * Updated * Updated * Updated * Update terms.php
This commit is contained in:
parent
4b453de64a
commit
209b8cd638
20 changed files with 207 additions and 211 deletions
|
@ -17,11 +17,11 @@ require __DIR__ . '/pagestart.php';
|
|||
|
||||
$mode = $_GET['mode'] ?? '';
|
||||
|
||||
$return_links = array(
|
||||
$return_links = [
|
||||
'index' => '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'),
|
||||
'config' => '<br /><br />' . sprintf($lang['CLICK_RETURN_CONFIG'], '<a href="admin_board.php?mode=config">', '</a>'),
|
||||
'config_mods' => '<br /><br />' . sprintf($lang['CLICK_RETURN_CONFIG_MODS'], '<a href="admin_board.php?mode=config_mods">', '</a>')
|
||||
);
|
||||
];
|
||||
|
||||
/**
|
||||
* Pull all config data
|
||||
|
@ -45,7 +45,7 @@ if (!$result = DB()->sql_query($sql)) {
|
|||
) {
|
||||
$new[$config_name] = serialize(str_replace(',', '.', $new[$config_name]));
|
||||
}
|
||||
bb_update_config(array($config_name => $new[$config_name]));
|
||||
bb_update_config([$config_name => $new[$config_name]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ if (!$result = DB()->sql_query($sql)) {
|
|||
|
||||
switch ($mode) {
|
||||
case 'config_mods':
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'S_CONFIG_ACTION' => 'admin_board.php?mode=config_mods',
|
||||
'CONFIG_MODS' => true,
|
||||
|
||||
|
@ -83,8 +83,8 @@ switch ($mode) {
|
|||
'TOR_COMMENT' => $new['tor_comment'],
|
||||
'SEED_BONUS_ENABLED' => $new['seed_bonus_enabled'],
|
||||
'SEED_BONUS_TOR_SIZE' => $new['seed_bonus_tor_size'],
|
||||
'SEED_BONUS_USER_REGDATE' => $new['seed_bonus_user_regdate'],
|
||||
));
|
||||
'SEED_BONUS_USER_REGDATE' => $new['seed_bonus_user_regdate']
|
||||
]);
|
||||
|
||||
if ($new['seed_bonus_points'] && $new['seed_bonus_release']) {
|
||||
$seed_bonus = unserialize($new['seed_bonus_points']);
|
||||
|
@ -95,10 +95,10 @@ switch ($mode) {
|
|||
continue;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('seed_bonus', array(
|
||||
$template->assign_block_vars('seed_bonus', [
|
||||
'RELEASE' => $seed_release[$i],
|
||||
'POINTS' => $row,
|
||||
));
|
||||
'POINTS' => $row
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,16 +111,16 @@ switch ($mode) {
|
|||
continue;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('bonus_upload', array(
|
||||
$template->assign_block_vars('bonus_upload', [
|
||||
'UP' => $row,
|
||||
'PRICE' => $price_row[$i],
|
||||
));
|
||||
'PRICE' => $price_row[$i]
|
||||
]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'S_CONFIG_ACTION' => 'admin_board.php?mode=config',
|
||||
'CONFIG' => true,
|
||||
|
||||
|
@ -145,8 +145,8 @@ switch ($mode) {
|
|||
'ALLOW_SIG' => (bool)$new['allow_sig'],
|
||||
'SIG_SIZE' => $new['max_sig_chars'],
|
||||
'ALLOW_NAMECHANGE' => (bool)$new['allow_namechange'],
|
||||
'SMILIES_PATH' => $new['smilies_path'],
|
||||
));
|
||||
'SMILIES_PATH' => $new['smilies_path']
|
||||
]);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,9 +78,9 @@ if (count($disallowed) <= 0) {
|
|||
|
||||
$disallow_select .= '</select>';
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'S_DISALLOW_SELECT' => $disallow_select,
|
||||
'S_FORM_ACTION' => 'admin_disallow.php',
|
||||
));
|
||||
]);
|
||||
|
||||
print_page('admin_disallow.tpl', 'admin');
|
||||
|
|
|
@ -38,11 +38,11 @@ if (isset($_REQUEST['submit'])) {
|
|||
$pruned_total += $pruned_topics;
|
||||
$prune_performed = true;
|
||||
|
||||
$template->assign_block_vars('pruned', array(
|
||||
$template->assign_block_vars('pruned', [
|
||||
'ROW_CLASS' => !($i % 2) ? 'row1' : 'row2',
|
||||
'FORUM_NAME' => htmlCHR($row['forum_name']),
|
||||
'PRUNED_TOPICS' => $pruned_topics,
|
||||
));
|
||||
'PRUNED_TOPICS' => $pruned_topics
|
||||
]);
|
||||
}
|
||||
if (!$prune_performed) {
|
||||
bb_die($lang['NONE_SELECTED']);
|
||||
|
@ -52,10 +52,10 @@ if (isset($_REQUEST['submit'])) {
|
|||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'PRUNED_TOTAL' => $pruned_total,
|
||||
'S_PRUNE_ACTION' => basename(__FILE__),
|
||||
'SEL_FORUM' => get_forum_select('admin', 'f[]', null, 65, 16, '', $all_forums),
|
||||
));
|
||||
'SEL_FORUM' => get_forum_select('admin', 'f[]', null, 65, 16, '', $all_forums)
|
||||
]);
|
||||
|
||||
print_page('admin_forum_prune.tpl', 'admin');
|
||||
|
|
|
@ -24,25 +24,25 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
|||
if (!$row = \TorrentPier\Legacy\Group::get_group_data($group_id)) {
|
||||
bb_die($lang['GROUP_NOT_EXIST']);
|
||||
}
|
||||
$group_info = array(
|
||||
$group_info = [
|
||||
'group_name' => $row['group_name'],
|
||||
'group_description' => $row['group_description'],
|
||||
'group_moderator' => $row['group_moderator'],
|
||||
'group_mod_name' => $row['moderator_name'],
|
||||
'group_type' => $row['group_type'],
|
||||
'release_group' => $row['release_group'],
|
||||
);
|
||||
'release_group' => $row['release_group']
|
||||
];
|
||||
$mode = 'editgroup';
|
||||
$template->assign_block_vars('group_edit', []);
|
||||
} elseif (!empty($_POST['new'])) {
|
||||
$group_info = array(
|
||||
$group_info = [
|
||||
'group_name' => '',
|
||||
'group_description' => '',
|
||||
'group_moderator' => '',
|
||||
'group_mod_name' => '',
|
||||
'group_type' => GROUP_OPEN,
|
||||
'release_group' => 0,
|
||||
);
|
||||
'release_group' => 0
|
||||
];
|
||||
$mode = 'newgroup';
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
|||
<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />
|
||||
';
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_EDIT_GROUP' => true,
|
||||
|
||||
'GROUP_NAME' => stripslashes(htmlspecialchars($group_info['group_name'])),
|
||||
|
@ -68,8 +68,8 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
|||
'S_GROUP_HIDDEN_CHECKED' => ($group_info['group_type'] == GROUP_HIDDEN) ? HTML_CHECKED : '',
|
||||
'RELEASE_GROUP' => (bool)$group_info['release_group'],
|
||||
'S_GROUP_ACTION' => 'admin_groups.php',
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
));
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields
|
||||
]);
|
||||
} elseif (!empty($_POST['group_update'])) {
|
||||
if (!empty($_POST['group_delete'])) {
|
||||
if (!$group_info = \TorrentPier\Legacy\Group::get_group_data($group_id)) {
|
||||
|
@ -101,14 +101,14 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
|||
bb_die($lang['NO_GROUP_MODERATOR']);
|
||||
}
|
||||
|
||||
$sql_ary = array(
|
||||
$sql_ary = [
|
||||
'group_type' => (int)$group_type,
|
||||
'release_group' => (int)$release_group,
|
||||
'group_name' => (string)$group_name,
|
||||
'group_description' => (string)$group_desc,
|
||||
'group_moderator' => (int)$group_moderator,
|
||||
'group_single_user' => 0,
|
||||
);
|
||||
];
|
||||
|
||||
if ($mode == 'editgroup') {
|
||||
if (!$group_info = \TorrentPier\Legacy\Group::get_group_data($group_id)) {
|
||||
|
@ -157,12 +157,12 @@ if (!empty($_POST['edit']) || !empty($_POST['new'])) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_GROUP_SELECT' => true,
|
||||
|
||||
'S_GROUP_ACTION' => 'admin_groups.php',
|
||||
'S_GROUP_SELECT' => stripslashes(get_select('groups')),
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
print_page('admin_groups.tpl', 'admin');
|
||||
|
|
|
@ -75,10 +75,10 @@ if (isset($_POST['submit'])) {
|
|||
$emailer->set_reply($reply_to);
|
||||
|
||||
$emailer->set_template('admin_send_email');
|
||||
$emailer->assign_vars(array(
|
||||
$emailer->assign_vars([
|
||||
'SUBJECT' => html_entity_decode($subject),
|
||||
'MESSAGE' => html_entity_decode($message),
|
||||
));
|
||||
'MESSAGE' => html_entity_decode($message)
|
||||
]);
|
||||
|
||||
$emailer->send($message_type);
|
||||
}
|
||||
|
@ -94,12 +94,12 @@ $sql = 'SELECT group_id, group_name
|
|||
ORDER BY group_name
|
||||
';
|
||||
|
||||
$groups = array('-- ' . $lang['ALL_USERS'] . ' --' => -1);
|
||||
$groups = ['-- ' . $lang['ALL_USERS'] . ' --' => -1];
|
||||
foreach (DB()->fetch_rowset($sql) as $row) {
|
||||
$groups[$row['group_name']] = $row['group_id'];
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'MESSAGE' => $message,
|
||||
'SUBJECT' => $subject,
|
||||
'REPLY_TO' => $reply_to,
|
||||
|
@ -107,7 +107,7 @@ $template->assign_vars(array(
|
|||
'ERROR_MESSAGE' => $errors ? implode('<br />', array_unique($errors)) : '',
|
||||
|
||||
'S_USER_ACTION' => 'admin_mass_email.php',
|
||||
'S_GROUP_SELECT' => build_select(POST_GROUPS_URL, $groups),
|
||||
));
|
||||
'S_GROUP_SELECT' => build_select(POST_GROUPS_URL, $groups)
|
||||
]);
|
||||
|
||||
print_page('admin_mass_email.tpl', 'admin');
|
||||
|
|
|
@ -54,7 +54,7 @@ if ($mode != '') {
|
|||
|
||||
$s_hidden_fields .= '<input type="hidden" name="mode" value="save" />';
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_RANKS_EDIT' => true,
|
||||
|
||||
'RANK' => !empty($rank_info['rank_title']) ? $rank_info['rank_title'] : '',
|
||||
|
@ -63,8 +63,8 @@ if ($mode != '') {
|
|||
'IMAGE_DISPLAY' => !empty($rank_info['rank_image']) ? '<img src="../' . $rank_info['rank_image'] . '" />' : '',
|
||||
|
||||
'S_RANK_ACTION' => 'admin_ranks.php',
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
));
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields
|
||||
]);
|
||||
} elseif ($mode == 'save') {
|
||||
//
|
||||
// Ok, they sent us our info, let's update it.
|
||||
|
@ -161,10 +161,10 @@ if ($mode != '') {
|
|||
$rank_count = DB()->num_rows($result);
|
||||
$rank_rows = DB()->sql_fetchrowset($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_RANKS_LIST' => true,
|
||||
'S_RANKS_ACTION' => 'admin_ranks.php',
|
||||
));
|
||||
'S_RANKS_ACTION' => 'admin_ranks.php'
|
||||
]);
|
||||
|
||||
for ($i = 0; $i < $rank_count; $i++) {
|
||||
$rank = $rank_rows[$i]['rank_title'];
|
||||
|
@ -172,15 +172,15 @@ if ($mode != '') {
|
|||
|
||||
$row_class = !($i % 2) ? 'row1' : 'row2';
|
||||
|
||||
$template->assign_block_vars('ranks', array(
|
||||
$template->assign_block_vars('ranks', [
|
||||
'ROW_CLASS' => $row_class,
|
||||
'RANK' => $rank,
|
||||
'STYLE' => $rank_rows[$i]['rank_style'],
|
||||
'IMAGE_DISPLAY' => $rank_rows[$i]['rank_image'] ? '<img src="../' . $rank_rows[$i]['rank_image'] . '" />' : '',
|
||||
|
||||
'U_RANK_EDIT' => "admin_ranks.php?mode=edit&id=$rank_id",
|
||||
'U_RANK_DELETE' => "admin_ranks.php?mode=delete&id=$rank_id",
|
||||
));
|
||||
'U_RANK_DELETE' => "admin_ranks.php?mode=delete&id=$rank_id"
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,9 +42,9 @@ if (!$result = DB()->sql_query($sql)) {
|
|||
$s_mess = $lang['SITEMAP_CREATED'] . ': <b>' . bb_date($new['sitemap_time'], $bb_cfg['post_date_format']) . '</b> ' . $lang['SITEMAP_AVAILABLE'] . ': <a href="' . make_url('sitemap/sitemap.xml') . '" target="_blank">' . make_url('sitemap/sitemap.xml') . '</a>';
|
||||
$message = file_exists(SITEMAP_DIR . '/sitemap.xml') ? $s_mess : $lang['SITEMAP_NOT_CREATED'];
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'STATIC_SITEMAP' => $new['static_sitemap'],
|
||||
'MESSAGE' => $message,
|
||||
));
|
||||
'MESSAGE' => $message
|
||||
]);
|
||||
|
||||
print_page('admin_sitemap.tpl', 'admin');
|
||||
|
|
|
@ -122,13 +122,13 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
|
||||
$hidden_vars = '<input type="hidden" name="mode" value="import">';
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_SMILE_IMPORT' => true,
|
||||
|
||||
'S_SMILEY_ACTION' => 'admin_smilies.php',
|
||||
'S_SMILE_SELECT' => $smile_paks_select,
|
||||
'S_HIDDEN_FIELDS' => $hidden_vars,
|
||||
));
|
||||
'S_HIDDEN_FIELDS' => $hidden_vars
|
||||
]);
|
||||
}
|
||||
} elseif (isset($_POST['export_pack']) || isset($_GET['export_pack'])) {
|
||||
$export_pack = (string)request_var('export_pack', '');
|
||||
|
@ -165,14 +165,14 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
|
||||
$s_hidden_fields = '<input type="hidden" name="mode" value="savenew" />';
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_SMILE_EDIT' => true,
|
||||
'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smiley_images[0],
|
||||
'S_SMILEY_ACTION' => 'admin_smilies.php',
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
'S_FILENAME_OPTIONS' => $filename_list,
|
||||
'S_SMILEY_BASEDIR' => BB_ROOT . $bb_cfg['smilies_path']
|
||||
));
|
||||
]);
|
||||
} elseif ($mode != '') {
|
||||
switch ($mode) {
|
||||
case 'delete':
|
||||
|
@ -213,7 +213,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
|
||||
$s_hidden_fields = '<input type="hidden" name="mode" value="save" /><input type="hidden" name="smile_id" value="' . $smile_data['smilies_id'] . '" />';
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_SMILE_EDIT' => true,
|
||||
'SMILEY_CODE' => $smile_data['code'],
|
||||
'SMILEY_EMOTICON' => $smile_data['emoticon'],
|
||||
|
@ -221,8 +221,8 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
'S_SMILEY_ACTION' => 'admin_smilies.php',
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
'S_FILENAME_OPTIONS' => $filename_list,
|
||||
'S_SMILEY_BASEDIR' => BB_ROOT . $bb_cfg['smilies_path'],
|
||||
));
|
||||
'S_SMILEY_BASEDIR' => BB_ROOT . $bb_cfg['smilies_path']
|
||||
]);
|
||||
|
||||
break;
|
||||
|
||||
|
@ -291,11 +291,11 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
|
||||
$smilies = DB()->sql_fetchrowset($result);
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_SMILE_MAIN' => true,
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
'S_SMILEY_ACTION' => 'admin_smilies.php',
|
||||
));
|
||||
'S_SMILEY_ACTION' => 'admin_smilies.php'
|
||||
]);
|
||||
|
||||
// Loop throuh the rows of smilies setting block vars for the template
|
||||
for ($i = 0, $iMax = count($smilies); $i < $iMax; $i++) {
|
||||
|
@ -305,7 +305,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
|
||||
$row_class = !($i % 2) ? 'row1' : 'row2';
|
||||
|
||||
$template->assign_block_vars('smiles', array(
|
||||
$template->assign_block_vars('smiles', [
|
||||
'ROW_CLASS' => $row_class,
|
||||
|
||||
'SMILEY_IMG' => BB_ROOT . $bb_cfg['smilies_path'] . '/' . $smilies[$i]['smile_url'],
|
||||
|
@ -314,7 +314,7 @@ if (isset($_GET['import_pack']) || isset($_POST['import_pack'])) {
|
|||
|
||||
'U_SMILEY_EDIT' => 'admin_smilies.php?mode=edit&id=' . $smilies[$i]['smilies_id'],
|
||||
'U_SMILEY_DELETE' => 'admin_smilies.php?mode=delete&id=' . $smilies[$i]['smilies_id'],
|
||||
));
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,15 +16,15 @@ require __DIR__ . '/pagestart.php';
|
|||
require INC_DIR . '/bbcode.php';
|
||||
|
||||
if (isset($_POST['post']) && $bb_cfg['terms'] != $_POST['message']) {
|
||||
bb_update_config(array('terms' => $_POST['message']));
|
||||
bb_update_config(['terms' => $_POST['message']]);
|
||||
bb_die($lang['CONFIG_UPDATED']);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'S_ACTION' => 'admin_terms.php',
|
||||
'EXT_LINK_NW' => $bb_cfg['ext_link_new_win'],
|
||||
'MESSAGE' => $bb_cfg['terms'] ?: '',
|
||||
'PREVIEW_HTML' => isset($_REQUEST['preview']) ? bbcode2html($_POST['message']) : '',
|
||||
));
|
||||
]);
|
||||
|
||||
print_page('admin_terms.tpl', 'admin');
|
||||
|
|
|
@ -167,9 +167,7 @@ if (isset($_POST['submit'])) {
|
|||
|
||||
bb_die($lang['BAN_UPDATE_SUCESSFUL'] . '<br /><br />' . sprintf($lang['CLICK_RETURN_BANADMIN'], '<a href="admin_user_ban.php">', '</a>') . '<br /><br />' . sprintf($lang['CLICK_RETURN_ADMIN_INDEX'], '<a href="index.php?pane=right">', '</a>'));
|
||||
} else {
|
||||
$template->assign_vars(array(
|
||||
'S_BANLIST_ACTION' => 'admin_user_ban.php',
|
||||
));
|
||||
$template->assign_vars(['S_BANLIST_ACTION' => 'admin_user_ban.php']);
|
||||
|
||||
$userban_count = 0;
|
||||
$ipban_count = 0;
|
||||
|
@ -236,13 +234,13 @@ if (isset($_POST['submit'])) {
|
|||
$select_iplist = '<select name="unban_ip[]" multiple size="15">' . $select_iplist . '</select>';
|
||||
$select_emaillist = '<select name="unban_email[]" multiple size="10">' . $select_emaillist . '</select>';
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'U_SEARCH_USER' => './../search.php?mode=searchuser',
|
||||
'S_UNBAN_USERLIST_SELECT' => $select_userlist,
|
||||
'S_UNBAN_IPLIST_SELECT' => $select_iplist,
|
||||
'S_UNBAN_EMAILLIST_SELECT' => $select_emaillist,
|
||||
'S_BAN_ACTION' => 'admin_user_ban.php',
|
||||
));
|
||||
'S_BAN_ACTION' => 'admin_user_ban.php'
|
||||
]);
|
||||
}
|
||||
|
||||
print_page('admin_user_ban.tpl', 'admin');
|
||||
|
|
|
@ -81,14 +81,14 @@ if (!isset($_REQUEST['dosearch'])) {
|
|||
}
|
||||
}
|
||||
|
||||
$lastvisited = array(1, 7, 14, 30, 60, 120, 365, 500, 730, 1000);
|
||||
$lastvisited = [1, 7, 14, 30, 60, 120, 365, 500, 730, 1000];
|
||||
$lastvisited_list = '';
|
||||
|
||||
foreach ($lastvisited as $days) {
|
||||
$lastvisited_list .= '<option value="' . $days . '">' . $days . ' ' . (($days > 1) ? $lang['DAYS'] : $lang['DAY']) . '</option>';
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_ADMIN_USER_SEARCH_MAIN' => true,
|
||||
|
||||
'YEAR' => date('Y'),
|
||||
|
@ -102,8 +102,8 @@ if (!isset($_REQUEST['dosearch'])) {
|
|||
'LASTVISITED_LIST' => $lastvisited_list,
|
||||
|
||||
'U_SEARCH_USER' => BB_ROOT . 'search.php?mode=searchuser',
|
||||
'S_SEARCH_ACTION' => 'admin_user_search.php',
|
||||
));
|
||||
'S_SEARCH_ACTION' => 'admin_user_search.php'
|
||||
]);
|
||||
} else {
|
||||
$mode = '';
|
||||
|
||||
|
@ -876,7 +876,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
|||
if ($num_pages > 2) {
|
||||
$pagination .= ' <input type="text" name="page" maxlength="5" size="2" class="post" /> <input type="submit" name="submit" value="' . $lang['GO'] . '" class="post" />';
|
||||
}
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_ADMIN_USER_SEARCH_RESULTS' => true,
|
||||
|
||||
'PAGE_NUMBER' => sprintf($lang['PAGE_OF'], $page, $num_pages),
|
||||
|
@ -890,7 +890,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
|||
'U_LASTVISIT' => ($sort == 'lastvisit') ? "$base_url&sort=$sort&order=$o_order" : "$base_url&sort=lastvisit&order=$order",
|
||||
|
||||
'S_POST_ACTION' => "$base_url&sort=$sort&order=$order"
|
||||
));
|
||||
]);
|
||||
|
||||
if (!$result = DB()->sql_query($select_sql)) {
|
||||
bb_die('Could not select user data');
|
||||
|
@ -921,7 +921,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
|||
for ($i = 0, $iMax = count($rowset); $i < $iMax; $i++) {
|
||||
$row_class = !($i % 2) ? 'row1' : 'row2';
|
||||
|
||||
$template->assign_block_vars('userrow', array(
|
||||
$template->assign_block_vars('userrow', [
|
||||
'ROW_CLASS' => $row_class,
|
||||
'USER' => profile_url($rowset[$i]),
|
||||
'EMAIL' => $rowset[$i]['user_email'],
|
||||
|
@ -934,7 +934,7 @@ if (!isset($_REQUEST['dosearch'])) {
|
|||
'U_VIEWPOSTS' => "../search.php?search_author=1&uid={$rowset[$i]['user_id']}",
|
||||
'U_MANAGE' => '../profile.php?mode=editprofile&' . POST_USERS_URL . '=' . $rowset[$i]['user_id'] . '&admin=1',
|
||||
'U_PERMISSIONS' => 'admin_ug_auth.php?mode=user&' . POST_USERS_URL . '=' . $rowset[$i]['user_id'],
|
||||
));
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -49,13 +49,13 @@ if ($mode != '') {
|
|||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_ADMIN_WORDS_EDIT' => true,
|
||||
'WORD' => $word,
|
||||
'REPLACEMENT' => $replacement,
|
||||
'S_WORDS_ACTION' => 'admin_words.php',
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
));
|
||||
]);
|
||||
} elseif ($mode == 'save') {
|
||||
$word_id = (int)request_var('id', 0);
|
||||
$word = trim(request_var('word', ''));
|
||||
|
@ -110,11 +110,11 @@ if ($mode != '') {
|
|||
$word_rows = DB()->sql_fetchrowset($result);
|
||||
$word_count = count($word_rows);
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_ADMIN_WORDS_LIST' => true,
|
||||
'S_WORDS_ACTION' => 'admin_words.php',
|
||||
'S_HIDDEN_FIELDS' => '',
|
||||
));
|
||||
'S_HIDDEN_FIELDS' => ''
|
||||
]);
|
||||
|
||||
for ($i = 0; $i < $word_count; $i++) {
|
||||
$word = $word_rows[$i]['word'];
|
||||
|
@ -123,13 +123,13 @@ if ($mode != '') {
|
|||
|
||||
$row_class = !($i % 2) ? 'row1' : 'row2';
|
||||
|
||||
$template->assign_block_vars('words', array(
|
||||
$template->assign_block_vars('words', [
|
||||
'ROW_CLASS' => $row_class,
|
||||
'WORD' => $word,
|
||||
'REPLACEMENT' => $replacement,
|
||||
'U_WORD_EDIT' => "admin_words.php?mode=edit&id=$word_id",
|
||||
'U_WORD_DELETE' => "admin_words.php?mode=delete&id=$word_id",
|
||||
));
|
||||
'U_WORD_DELETE' => "admin_words.php?mode=delete&id=$word_id"
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -520,7 +520,7 @@ if ($bb_cfg['bt_allow_spmode_change'] && $s_mode != 'full') {
|
|||
]);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'SHOW_DL_LIST_LINK' => (($bb_cfg['bt_show_dl_list'] || $bb_cfg['allow_dl_list_names_mode']) && $t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL),
|
||||
'SHOW_TOR_ACT' => ($tor_reged && $show_peers && (!isset($bb_cfg['tor_no_tor_act'][$tor_info['tor_status']]) || IS_AM)),
|
||||
'S_MODE_COUNT' => ($s_mode == 'count'),
|
||||
|
@ -531,4 +531,4 @@ $template->assign_vars(array(
|
|||
'LEECH_EXIST' => ($leechers || defined('LEECHER_EXIST')),
|
||||
'TOR_HELP_LINKS' => $bb_cfg['tor_help_links'],
|
||||
'CALL_SEED' => ($bb_cfg['callseed'] && $tor_reged && !isset($bb_cfg['tor_no_tor_act'][$tor_info['tor_status']]) && $seed_count < 3 && $tor_info['call_seed_time'] < (TIMENOW - 86400)),
|
||||
));
|
||||
]);
|
||||
|
|
|
@ -88,7 +88,7 @@ function set_tracks($cookie_name, &$tracking_ary, $tracks = null, $val = TIMENOW
|
|||
|
||||
if ($tracks) {
|
||||
if (!is_array($tracks)) {
|
||||
$tracks = array($tracks => $val);
|
||||
$tracks = [$tracks => $val];
|
||||
}
|
||||
foreach ($tracks as $key => $val) {
|
||||
$key = (int)$key;
|
||||
|
@ -164,7 +164,7 @@ define('UG_PERM_BOTH', 1); // both user and group
|
|||
define('UG_PERM_USER_ONLY', 2); // only personal user permissions
|
||||
define('UG_PERM_GROUP_ONLY', 3); // only group permissions
|
||||
|
||||
$bf['forum_perm'] = array(
|
||||
$bf['forum_perm'] = [
|
||||
'auth_view' => AUTH_VIEW,
|
||||
'auth_read' => AUTH_READ,
|
||||
'auth_mod' => AUTH_MOD,
|
||||
|
@ -178,9 +178,9 @@ $bf['forum_perm'] = array(
|
|||
'auth_pollcreate' => AUTH_POLLCREATE,
|
||||
'auth_attachments' => AUTH_ATTACH,
|
||||
'auth_download' => AUTH_DOWNLOAD,
|
||||
);
|
||||
];
|
||||
|
||||
$bf['user_opt'] = array(
|
||||
$bf['user_opt'] = [
|
||||
# 'dis_opt_name' => ЗАПРЕТЫ используемые администраторами для пользователей
|
||||
# 'user_opt_name' => НАСТРОЙКИ используемые пользователями
|
||||
'user_viewemail' => 0, // Показывать e-mail
|
||||
|
@ -199,7 +199,7 @@ $bf['user_opt'] = array(
|
|||
'dis_post_edit' => 13, // Запрет на редактирование сообщений
|
||||
'user_dls' => 14, // Скрывать список текущих закачек в профиле
|
||||
'user_retracker' => 15, // Добавлять ретрекер к скачиваемым торрентам
|
||||
);
|
||||
];
|
||||
|
||||
function bit2dec($bit_num)
|
||||
{
|
||||
|
@ -275,7 +275,7 @@ function auth($type, $forum_id, $ug_data, array $f_access = [], $group_perm = UG
|
|||
if ($type == AUTH_ALL) {
|
||||
$auth_fields = array_keys($bf['forum_perm']);
|
||||
} elseif ($auth_type = array_search($type, $bf['forum_perm'])) {
|
||||
$auth_fields = array($auth_type);
|
||||
$auth_fields = [$auth_type];
|
||||
}
|
||||
|
||||
if (empty($auth_fields)) {
|
||||
|
@ -300,7 +300,7 @@ function auth($type, $forum_id, $ug_data, array $f_access = [], $group_perm = UG
|
|||
}
|
||||
} elseif (isset($f_access['forum_id'])) {
|
||||
// Change passed $f_access format for later using in foreach()
|
||||
$f_access = array($f_access['forum_id'] => $f_access);
|
||||
$f_access = [$f_access['forum_id'] => $f_access];
|
||||
}
|
||||
|
||||
if (empty($f_access)) {
|
||||
|
@ -564,8 +564,8 @@ function url_arg($url, $arg, $value, $amp = '&')
|
|||
*/
|
||||
function humn_size($size, $rounder = null, $min = null, $space = ' ')
|
||||
{
|
||||
static $sizes = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
static $rounders = array(0, 0, 0, 2, 3, 3, 3, 3, 3);
|
||||
static $sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
static $rounders = [0, 0, 0, 2, 3, 3, 3, 3, 3];
|
||||
|
||||
$size = (float)$size;
|
||||
$ext = $sizes[0];
|
||||
|
@ -656,7 +656,7 @@ function set_var(&$result, $var, $type, $multibyte = false, $strip = true)
|
|||
$result = $var;
|
||||
|
||||
if ($type == 'string') {
|
||||
$result = trim(htmlspecialchars(str_replace(array("\r\n", "\r"), array("\n", "\n"), $result)));
|
||||
$result = trim(htmlspecialchars(str_replace(["\r\n", "\r"], ["\n", "\n"], $result)));
|
||||
|
||||
if (!empty($result)) {
|
||||
// Make sure multibyte characters are wellformed
|
||||
|
@ -848,7 +848,7 @@ function show_bt_userdata($user_id)
|
|||
return;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'SHOW_BT_USERDATA' => true,
|
||||
'UP_TOTAL' => humn_size($btu['u_up_total']),
|
||||
'UP_BONUS' => humn_size($btu['u_up_bonus']),
|
||||
|
@ -874,7 +874,7 @@ function show_bt_userdata($user_id)
|
|||
|
||||
'SPEED_UP' => humn_size($btu['speed_up'], 0, 'KB') . '/s',
|
||||
'SPEED_DOWN' => humn_size($btu['speed_down'], 0, 'KB') . '/s',
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
function get_attachments_dir($cfg = null)
|
||||
|
@ -908,10 +908,10 @@ function bb_update_config($params, $table = BB_CONFIG)
|
|||
{
|
||||
$updates = [];
|
||||
foreach ($params as $name => $val) {
|
||||
$updates[] = array(
|
||||
$updates[] = [
|
||||
'config_name' => $name,
|
||||
'config_value' => $val,
|
||||
);
|
||||
'config_value' => $val
|
||||
];
|
||||
}
|
||||
$updates = DB()->build_array('MULTI_INSERT', $updates);
|
||||
|
||||
|
@ -1021,9 +1021,7 @@ function make_jumpbox($selected = 0)
|
|||
$jumpbox = $datastore->get('jumpbox');
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'JUMPBOX' => (IS_GUEST) ? $jumpbox['guest'] : $jumpbox['user'],
|
||||
));
|
||||
$template->assign_vars(['JUMPBOX' => (IS_GUEST) ? $jumpbox['guest'] : $jumpbox['user']]);
|
||||
}
|
||||
|
||||
// $mode: array(not_auth_forum1,not_auth_forum2,..) or (string) 'mode'
|
||||
|
@ -1038,7 +1036,7 @@ function get_forum_select($mode = 'guest', $name = POST_FORUM_URL, $selected = n
|
|||
if (null === $max_length) {
|
||||
$max_length = HTML_SELECT_MAX_LENGTH;
|
||||
}
|
||||
$select = null === $all_forums_option ? [] : array($lang['ALL_AVAILABLE'] => $all_forums_option);
|
||||
$select = null === $all_forums_option ? [] : [$lang['ALL_AVAILABLE'] => $all_forums_option];
|
||||
if (!$forums = $datastore->get('cat_forums')) {
|
||||
$datastore->update('cat_forums');
|
||||
$forums = $datastore->get('cat_forums');
|
||||
|
@ -1109,17 +1107,17 @@ function setup_style()
|
|||
$template = new TorrentPier\Legacy\Template(TEMPLATES_DIR . '/' . $tpl_dir_name);
|
||||
$css_dir = 'styles/' . basename(TEMPLATES_DIR) . '/' . $tpl_dir_name . '/css/';
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'SPACER' => make_url('styles/images/spacer.gif'),
|
||||
'STYLESHEET' => make_url($css_dir . $stylesheet),
|
||||
'EXT_LINK_NEW_WIN' => $bb_cfg['ext_link_new_win'],
|
||||
'TPL_DIR' => make_url($css_dir),
|
||||
'SITE_URL' => make_url('/'),
|
||||
));
|
||||
'SITE_URL' => make_url('/')
|
||||
]);
|
||||
|
||||
require_once TEMPLATES_DIR . '/' . $tpl_dir_name . '/tpl_config.php';
|
||||
|
||||
return array('template_name' => $tpl_dir_name);
|
||||
return ['template_name' => $tpl_dir_name];
|
||||
}
|
||||
|
||||
// Create date / time with format and friendly date
|
||||
|
@ -1259,12 +1257,12 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
|
|||
$pagination = str_replace('&start=0', '', $pagination);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'PAGINATION' => $pagination,
|
||||
'PAGE_NUMBER' => sprintf($lang['PAGE_OF'], (floor($start_item / $per_page) + 1), ceil($num_items / $per_page)),
|
||||
'PG_BASE_URL' => $base_url,
|
||||
'PG_PER_PAGE' => $per_page,
|
||||
));
|
||||
'PG_PER_PAGE' => $per_page
|
||||
]);
|
||||
|
||||
return $pagination;
|
||||
}
|
||||
|
@ -1297,7 +1295,7 @@ function obtain_word_list(&$orig_word, &$replacement_word)
|
|||
if (!$sql = CACHE('bb_cache')->get('censored')) {
|
||||
$sql = DB()->fetch_rowset("SELECT word, replacement FROM " . BB_WORDS);
|
||||
if (!$sql) {
|
||||
$sql = array(array('word' => 1, 'replacement' => 1));
|
||||
$sql = [['word' => 1, 'replacement' => 1]];
|
||||
}
|
||||
CACHE('bb_cache')->set('censored', $sql, 7200);
|
||||
}
|
||||
|
@ -1352,12 +1350,12 @@ function bb_die($msg_text)
|
|||
$msg_text = $lang[$msg_text];
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_BB_DIE' => true,
|
||||
'MESSAGE_TEXT' => $msg_text,
|
||||
));
|
||||
'MESSAGE_TEXT' => $msg_text
|
||||
]);
|
||||
|
||||
$template->set_filenames(array('bb_die' => 'common.tpl'));
|
||||
$template->set_filenames(['bb_die' => 'common.tpl']);
|
||||
$template->pparse('bb_die');
|
||||
|
||||
require(PAGE_FOOTER);
|
||||
|
@ -1425,14 +1423,14 @@ function get_forum_display_sort_option($selected_row = 0, $action = 'list', $lis
|
|||
{
|
||||
global $lang;
|
||||
|
||||
$forum_display_sort = array(
|
||||
'lang_key' => array('LASTPOST', 'SORT_TOPIC_TITLE', 'SORT_TIME'),
|
||||
'fields' => array('t.topic_last_post_time', 't.topic_title', 't.topic_time'),
|
||||
);
|
||||
$forum_display_order = array(
|
||||
'lang_key' => array('DESC', 'ASC'),
|
||||
'fields' => array('DESC', 'ASC'),
|
||||
);
|
||||
$forum_display_sort = [
|
||||
'lang_key' => ['LASTPOST', 'SORT_TOPIC_TITLE', 'SORT_TIME'],
|
||||
'fields' => ['t.topic_last_post_time', 't.topic_title', 't.topic_time']
|
||||
];
|
||||
$forum_display_order = [
|
||||
'lang_key' => ['DESC', 'ASC'],
|
||||
'fields' => ['DESC', 'ASC']
|
||||
];
|
||||
|
||||
// get the good list
|
||||
$list_name = 'forum_display_' . $list;
|
||||
|
@ -1569,11 +1567,11 @@ function print_confirmation($tpl_vars)
|
|||
{
|
||||
global $template, $lang;
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_CONFIRM' => true,
|
||||
'CONFIRM_TITLE' => $lang['CONFIRM'],
|
||||
'FORM_METHOD' => 'post',
|
||||
));
|
||||
'FORM_METHOD' => 'post'
|
||||
]);
|
||||
$template->assign_vars($tpl_vars);
|
||||
|
||||
print_page('common.tpl');
|
||||
|
@ -1606,7 +1604,7 @@ function print_page($args, $type = '', $mode = '')
|
|||
require(PAGE_HEADER);
|
||||
}
|
||||
|
||||
$template->set_filenames(array('body' => $tpl));
|
||||
$template->set_filenames(['body' => $tpl]);
|
||||
$template->pparse('body');
|
||||
|
||||
if ($mode !== 'no_footer') {
|
||||
|
@ -1686,12 +1684,12 @@ function init_sphinx()
|
|||
|
||||
function log_sphinx_error($err_type, $err_msg, $query = '')
|
||||
{
|
||||
$ignore_err_txt = array(
|
||||
$ignore_err_txt = [
|
||||
'negation on top level',
|
||||
'Query word length is less than min prefix length',
|
||||
);
|
||||
'Query word length is less than min prefix length'
|
||||
];
|
||||
if (!count($ignore_err_txt) || !preg_match('#' . implode('|', $ignore_err_txt) . '#i', $err_msg)) {
|
||||
$orig_query = strtr($_REQUEST['nm'], array("\n" => '\n'));
|
||||
$orig_query = strtr($_REQUEST['nm'], ["\n" => '\n']);
|
||||
bb_log(date('m-d H:i:s') . " | $err_type | $err_msg | $orig_query | $query" . LOG_LF, 'sphinx_error');
|
||||
}
|
||||
}
|
||||
|
@ -2059,7 +2057,7 @@ function bb_captcha($mode, $callback = '')
|
|||
|
||||
function clean_tor_dirname($dirname)
|
||||
{
|
||||
return str_replace(array('[', ']', '<', '>', "'"), array('[', ']', '<', '>', '''), $dirname);
|
||||
return str_replace(['[', ']', '<', '>', "'"], ['[', ']', '<', '>', '''], $dirname);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,7 +31,7 @@ $users_cnt = [
|
|||
'user' => 0,
|
||||
'guest' => 0,
|
||||
];
|
||||
$online = $online_short = array('userlist' => '');
|
||||
$online = $online_short = ['userlist' => ''];
|
||||
|
||||
$sql = "
|
||||
SELECT
|
||||
|
@ -117,10 +117,10 @@ if (!$online['userlist']) {
|
|||
$total_online = $logged_online + $guests_online;
|
||||
|
||||
if ($total_online > $bb_cfg['record_online_users']) {
|
||||
bb_update_config(array(
|
||||
bb_update_config([
|
||||
'record_online_users' => $total_online,
|
||||
'record_online_date' => TIMENOW,
|
||||
));
|
||||
'record_online_date' => TIMENOW
|
||||
]);
|
||||
}
|
||||
|
||||
$online['stat'] = $online_short['stat'] = sprintf($lang['ONLINE_USERS'], $total_online, $logged_online, $guests_online);
|
||||
|
|
|
@ -14,14 +14,14 @@ if (!defined('BB_ROOT')) {
|
|||
global $bb_cfg, $userdata, $template, $DBS, $lang;
|
||||
|
||||
if (!empty($template)) {
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'SIMPLE_FOOTER' => !empty($gen_simple_header),
|
||||
'POWERED' => 'Tracker software by <a target="_blank" href="https://torrentpier.com">TorrentPier</a> © 2005-' . date('Y'),
|
||||
'SHOW_ADMIN_LINK' => (IS_ADMIN && !defined('IN_ADMIN')),
|
||||
'ADMIN_LINK_HREF' => "admin/index.php",
|
||||
));
|
||||
'ADMIN_LINK_HREF' => 'admin/index.php',
|
||||
]);
|
||||
|
||||
$template->set_filenames(array('page_footer' => 'page_footer.tpl'));
|
||||
$template->set_filenames(['page_footer' => 'page_footer.tpl']);
|
||||
$template->pparse('page_footer');
|
||||
}
|
||||
|
||||
|
|
|
@ -32,11 +32,11 @@ if (defined('SHOW_ONLINE') && SHOW_ONLINE) {
|
|||
$online_full = !empty($_REQUEST['online_full']);
|
||||
$online_list = $online_full ? 'online_' . $userdata['user_lang'] : 'online_short_' . $userdata['user_lang'];
|
||||
|
||||
${$online_list} = array(
|
||||
${$online_list} = [
|
||||
'stat' => '',
|
||||
'userlist' => '',
|
||||
'cnt' => '',
|
||||
);
|
||||
'cnt' => ''
|
||||
];
|
||||
|
||||
if (defined('IS_GUEST') && !(IS_GUEST || IS_USER)) {
|
||||
$template->assign_var('SHOW_ONLINE_LIST');
|
||||
|
@ -48,12 +48,12 @@ if (defined('SHOW_ONLINE') && SHOW_ONLINE) {
|
|||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TOTAL_USERS_ONLINE' => ${$online_list}['stat'],
|
||||
'LOGGED_IN_USER_LIST' => ${$online_list}['userlist'],
|
||||
'USERS_ONLINE_COUNTS' => ${$online_list}['cnt'],
|
||||
'RECORD_USERS' => sprintf($lang['RECORD_ONLINE_USERS'], $bb_cfg['record_online_users'], bb_date($bb_cfg['record_online_date'])),
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
// Info about new private messages
|
||||
|
@ -70,9 +70,9 @@ if ($logged_in && empty($gen_simple_header) && !defined('IN_ADMIN')) {
|
|||
if ($userdata['user_last_privmsg'] > $userdata['user_lastvisit'] && defined('IN_PM')) {
|
||||
$userdata['user_last_privmsg'] = $userdata['user_lastvisit'];
|
||||
|
||||
\TorrentPier\Sessions::db_update_userdata($userdata, array(
|
||||
'user_last_privmsg' => $userdata['user_lastvisit'],
|
||||
));
|
||||
\TorrentPier\Sessions::db_update_userdata($userdata, [
|
||||
'user_last_privmsg' => $userdata['user_lastvisit']
|
||||
]);
|
||||
|
||||
$have_new_pm = ($userdata['user_new_privmsg'] > 1);
|
||||
}
|
||||
|
@ -93,9 +93,9 @@ if ($logged_in && empty($gen_simple_header) && !defined('IN_ADMIN')) {
|
|||
if ($userdata['user_unread_privmsg'] != $real_unread_pm_count) {
|
||||
$userdata['user_unread_privmsg'] = $real_unread_pm_count;
|
||||
|
||||
\TorrentPier\Sessions::db_update_userdata($userdata, array(
|
||||
'user_unread_privmsg' => $real_unread_pm_count,
|
||||
));
|
||||
\TorrentPier\Sessions::db_update_userdata($userdata, [
|
||||
'user_unread_privmsg' => $real_unread_pm_count
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,13 +103,13 @@ if ($logged_in && empty($gen_simple_header) && !defined('IN_ADMIN')) {
|
|||
$have_unread_pm = true;
|
||||
}
|
||||
}
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'HAVE_NEW_PM' => $have_new_pm,
|
||||
'HAVE_UNREAD_PM' => $have_unread_pm,
|
||||
));
|
||||
'HAVE_UNREAD_PM' => $have_unread_pm
|
||||
]);
|
||||
|
||||
// The following assigns all _common_ variables that may be used at any point in a template
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'SIMPLE_HEADER' => !empty($gen_simple_header),
|
||||
'CONTENT_ENCODING' => $bb_cfg['charset'],
|
||||
|
||||
|
@ -153,20 +153,20 @@ $template->assign_vars(array(
|
|||
'S_LOGIN_ACTION' => LOGIN_URL,
|
||||
|
||||
'U_CUR_DOWNLOADS' => PROFILE_URL . $userdata['user_id'],
|
||||
'U_FORUM' => "viewforum.php",
|
||||
'U_GROUPS' => "group.php",
|
||||
'U_FORUM' => 'viewforum.php',
|
||||
'U_GROUPS' => 'group.php',
|
||||
'U_LOGIN_LOGOUT' => $u_login_logout,
|
||||
'U_MEMBERLIST' => "memberlist.php",
|
||||
'U_MODCP' => "modcp.php",
|
||||
'U_OPTIONS' => "profile.php?mode=editprofile",
|
||||
'U_MEMBERLIST' => 'memberlist.php',
|
||||
'U_MODCP' => 'modcp.php',
|
||||
'U_OPTIONS' => 'profile.php?mode=editprofile',
|
||||
'U_PRIVATEMSGS' => PM_URL . "?folder=inbox",
|
||||
'U_PROFILE' => PROFILE_URL . $userdata['user_id'],
|
||||
'U_READ_PM' => PM_URL . "?folder=inbox" . (($userdata['user_newest_pm_id'] && $userdata['user_new_privmsg'] == 1) ? "&mode=read&p={$userdata['user_newest_pm_id']}" : ''),
|
||||
'U_REGISTER' => "profile.php?mode=register",
|
||||
'U_SEARCH' => "search.php",
|
||||
'U_REGISTER' => 'profile.php?mode=register',
|
||||
'U_SEARCH' => 'search.php',
|
||||
'U_SEND_PASSWORD' => "profile.php?mode=sendpassword",
|
||||
'U_TERMS' => $bb_cfg['terms_and_conditions_url'],
|
||||
'U_TRACKER' => "tracker.php",
|
||||
'U_TRACKER' => 'tracker.php',
|
||||
|
||||
'SHOW_SIDEBAR1' => !empty($bb_cfg['page']['show_sidebar1'][BB_SCRIPT]) || $bb_cfg['show_sidebar1_on_every_page'],
|
||||
'SHOW_SIDEBAR2' => !empty($bb_cfg['page']['show_sidebar2'][BB_SCRIPT]) || $bb_cfg['show_sidebar2_on_every_page'],
|
||||
|
@ -205,8 +205,8 @@ $template->assign_vars(array(
|
|||
'SELECTED' => HTML_SELECTED,
|
||||
|
||||
'U_SEARCH_SELF_BY_LAST' => "search.php?uid={$userdata['user_id']}&o=5",
|
||||
'U_WATCHED_TOPICS' => "profile.php?mode=watch",
|
||||
));
|
||||
'U_WATCHED_TOPICS' => 'profile.php?mode=watch'
|
||||
]);
|
||||
|
||||
if (!empty($bb_cfg['page']['show_torhelp'][BB_SCRIPT]) && !empty($userdata['torhelp'])) {
|
||||
$ignore_time = !empty($_COOKIE['torhelp']) ? (int)$_COOKIE['torhelp'] : 0;
|
||||
|
@ -228,9 +228,9 @@ if (!empty($bb_cfg['page']['show_torhelp'][BB_SCRIPT]) && !empty($userdata['torh
|
|||
$torhelp_topics[] = '<a href="viewtopic.php?t=' . $row['topic_id'] . '">' . $row['topic_title'] . '</a>';
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'TORHELP_TOPICS' => implode("</li>\n<li>", $torhelp_topics),
|
||||
));
|
||||
$template->assign_vars([
|
||||
'TORHELP_TOPICS' => implode("</li>\n<li>", $torhelp_topics)
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -244,7 +244,7 @@ if (!IS_GUEST) {
|
|||
header('Pragma: no-cache');
|
||||
}
|
||||
|
||||
$template->set_filenames(array('page_header' => 'page_header.tpl'));
|
||||
$template->set_filenames(['page_header' => 'page_header.tpl']);
|
||||
$template->pparse('page_header');
|
||||
|
||||
define('PAGE_HEADER_SENT', true);
|
||||
|
|
|
@ -30,7 +30,7 @@ if (!$f_data['forum_tpl_id'] || !$tpl_data = DB()->fetch_row($sql)) {
|
|||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'PAGE_TITLE' => $lang['NEW_RELEASE'],
|
||||
'FORUM_NAME' => $f_data['forum_name'],
|
||||
'FORUM_ID' => $forum_id,
|
||||
|
@ -39,8 +39,8 @@ $template->assign_vars(array(
|
|||
'TOR_REQUIRED' => $f_data['allow_reg_tracker'],
|
||||
'EDIT_TPL' => $edit_tpl_mode,
|
||||
'CAN_EDIT_TPL' => $can_edit_tpl,
|
||||
'EDIT_TPL_URL' => POSTING_URL . "?mode=new_rel&f=$forum_id&edit_tpl=1",
|
||||
));
|
||||
'EDIT_TPL_URL' => POSTING_URL . "?mode=new_rel&f=$forum_id&edit_tpl=1"
|
||||
]);
|
||||
|
||||
if ($tpl_data) {
|
||||
// tpl_rules_html
|
||||
|
@ -53,30 +53,30 @@ if ($tpl_data) {
|
|||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_ID' => $tpl_data['tpl_id'],
|
||||
'TPL_NAME' => $tpl_data['tpl_name'],
|
||||
'TPL_SRC_FORM_VAL' => $tpl_data['tpl_src_form'],
|
||||
'TPL_SRC_TITLE_VAL' => $tpl_data['tpl_src_title'],
|
||||
'TPL_SRC_MSG_VAL' => $tpl_data['tpl_src_msg'],
|
||||
'TPL_RULES_HTML' => $tpl_rules_html,
|
||||
));
|
||||
'TPL_RULES_HTML' => $tpl_rules_html
|
||||
]);
|
||||
}
|
||||
|
||||
if ($edit_tpl_mode) {
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'NO_TPL_ASSIGNED' => !($f_data['forum_tpl_id']),
|
||||
'TPL_SELECT' => get_select('forum_tpl', $f_data['forum_tpl_id']),
|
||||
));
|
||||
'TPL_SELECT' => get_select('forum_tpl', $f_data['forum_tpl_id'])
|
||||
]);
|
||||
|
||||
if ($tpl_data) {
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TPL_COMMENT' => $tpl_data['tpl_comment'],
|
||||
'TPL_RULES_POST_ID' => $tpl_data['tpl_rules_post_id'],
|
||||
'TPL_LAST_EDIT_TIME' => bb_date($tpl_data['tpl_last_edit_tm'], 'd-M-y H:i'),
|
||||
'TPL_LAST_EDIT_USER' => get_username((int)$tpl_data['tpl_last_edit_by']),
|
||||
'TPL_LAST_EDIT_TIMESTAMP' => $tpl_data['tpl_last_edit_tm'],
|
||||
));
|
||||
'TPL_LAST_EDIT_TIMESTAMP' => $tpl_data['tpl_last_edit_tm']
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ $dl_users_overflow_div_height = '120px';
|
|||
$dl_users_div_style_normal = 'padding: 0px;';
|
||||
$dl_users_div_style_overflow = "padding: 6px; height: $dl_users_overflow_div_height; overflow: auto; border: 1px inset;";
|
||||
|
||||
$template->assign_vars(array('DL_BUTTONS' => false));
|
||||
$template->assign_vars(['DL_BUTTONS' => false]);
|
||||
|
||||
$count_mode = ($bb_cfg['bt_dl_list_only_count'] && !(@$_GET['dl'] === 'names'));
|
||||
|
||||
|
@ -28,10 +28,10 @@ $show_dl_list = ($dl_topic && ($bb_cfg['bt_show_dl_list'] || ($bb_cfg['allow_dl_
|
|||
$show_dl_buttons = (!IS_GUEST && $dl_topic && $bb_cfg['bt_show_dl_list_buttons']);
|
||||
|
||||
// link to clear DL-List
|
||||
$template->assign_vars(array('S_DL_DELETE' => false));
|
||||
$template->assign_vars(['S_DL_DELETE' => false]);
|
||||
if (($is_auth['auth_mod']) && ($t_data['topic_dl_type'] == TOPIC_DL_TYPE_DL)) {
|
||||
$s_dl_delete = "<br /><a href=\"dl_list.php?mode=dl_delete&" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id'] . '">' . $lang['DL_LIST_DEL'] . '</a>';
|
||||
$template->assign_vars(array('S_DL_DELETE' => $s_dl_delete));
|
||||
$template->assign_vars(['S_DL_DELETE' => $s_dl_delete]);
|
||||
}
|
||||
|
||||
$dl_cat = $dl_count = [];
|
||||
|
@ -71,7 +71,7 @@ if ($show_dl_list) {
|
|||
$dl_count[$u['user_status']] = $u['username'];
|
||||
} else {
|
||||
$u_prof_href = ($u['user_id'] == GUEST_UID) ? '#' : "profile.php?mode=viewprofile&u=" . $u['user_id'] . "#torrent";
|
||||
$dl_cat[$u['user_status']] .= '<nobr><a class="' . $u_link_class . '" href="' . $u_prof_href . '" title="' . $u['last_modified_dlstatus'] . '">' . profile_url(array('username' => $u['username'], 'user_rank' => $u['user_rank'])) . '</a></nobr>, ';
|
||||
$dl_cat[$u['user_status']] .= '<nobr><a class="' . $u_link_class . '" href="' . $u_prof_href . '" title="' . $u['last_modified_dlstatus'] . '">' . profile_url(['username' => $u['username'], 'user_rank' => $u['user_rank']]) . '</a></nobr>, ';
|
||||
$dl_count[$u['user_status']]++;
|
||||
}
|
||||
}
|
||||
|
@ -82,20 +82,20 @@ if ($show_dl_list) {
|
|||
$dl_cat[$i][strlen($dl_cat[$i]) - 2] = ' ';
|
||||
$dl_cat[$i] = "<span class=$desc>" . $dl_cat[$i] . '</span>';
|
||||
|
||||
$template->assign_block_vars('dl_users.users_row', array(
|
||||
$template->assign_block_vars('dl_users.users_row', [
|
||||
'DL_OPTION_NAME' => $lang[strtoupper($desc)],
|
||||
'DL_OPTION_USERS' => $dl_cat[$i],
|
||||
'DL_COUNT' => $dl_count[$i],
|
||||
'DL_USERS_DIV_STYLE' => $dl_users_div_style,
|
||||
));
|
||||
'DL_USERS_DIV_STYLE' => $dl_users_div_style
|
||||
]);
|
||||
} elseif ($dl_count[$i] && $count_mode) {
|
||||
if ($i == DL_STATUS_CANCEL && !$show_canceled_in_count_mode) {
|
||||
continue;
|
||||
}
|
||||
$template->assign_block_vars('dl_counts.count_row', array(
|
||||
$template->assign_block_vars('dl_counts.count_row', [
|
||||
'DL_OPTION_NAME' => $lang[strtoupper($desc)],
|
||||
'DL_OPTION_USERS' => $dl_count[$i],
|
||||
));
|
||||
'DL_OPTION_USERS' => $dl_count[$i]
|
||||
]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -104,13 +104,13 @@ if ($show_dl_list) {
|
|||
}
|
||||
|
||||
if ($show_dl_buttons) {
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'DL_BUTTONS' => true,
|
||||
'DL_BUT_WILL' => $bb_cfg['bt_show_dl_but_will'],
|
||||
'DL_BUT_DOWN' => $bb_cfg['bt_show_dl_but_down'],
|
||||
'DL_BUT_COMPL' => $bb_cfg['bt_show_dl_but_compl'],
|
||||
'DL_BUT_CANCEL' => $bb_cfg['bt_show_dl_but_cancel'],
|
||||
));
|
||||
'DL_BUT_CANCEL' => $bb_cfg['bt_show_dl_but_cancel']
|
||||
]);
|
||||
|
||||
$dl_hidden_fields = '
|
||||
<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />
|
||||
|
@ -119,11 +119,11 @@ if ($show_dl_buttons) {
|
|||
<input type="hidden" name="mode" value="set_dl_status" />
|
||||
';
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'DL_HIDDEN_FIELDS' => $dl_hidden_fields,
|
||||
'S_DL_ACTION' => "dl_list.php?" . POST_TOPIC_URL . "=$topic_id",
|
||||
));
|
||||
'S_DL_ACTION' => 'dl_list.php?' . POST_TOPIC_URL . "=$topic_id"
|
||||
]);
|
||||
}
|
||||
|
||||
$template->assign_vars(array('SHOW_DL_LIST' => $show_dl_list));
|
||||
$template->assign_vars(['SHOW_DL_LIST' => $show_dl_list]);
|
||||
unset($dl_info);
|
||||
|
|
|
@ -19,9 +19,9 @@ if (!$bb_cfg['terms'] && !IS_ADMIN) {
|
|||
redirect('index.php');
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$template->assign_vars([
|
||||
'TERMS_EDIT' => bbcode2html(sprintf($lang['TERMS_EMPTY_TEXT'], $bb_cfg['server_name'])),
|
||||
'TERMS_HTML' => bbcode2html($bb_cfg['terms']),
|
||||
));
|
||||
]);
|
||||
|
||||
print_page('terms.tpl');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue