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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue