mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Minor improvements (#882)
* Minor improvements * Updated * Updated * Updated * Update privmsg.php * Updated * Update admin_attach_cp.php
This commit is contained in:
parent
2c07660435
commit
4b453de64a
75 changed files with 699 additions and 735 deletions
|
@ -16,23 +16,23 @@ global $bf, $bb_cfg;
|
|||
//
|
||||
// cat_forums
|
||||
//
|
||||
$data = array(
|
||||
'not_auth_forums' => array(
|
||||
'guest_view' => array(),
|
||||
'guest_read' => array(),
|
||||
'user_view' => array(),
|
||||
'user_read' => array(),
|
||||
),
|
||||
'tracker_forums' => array(),
|
||||
'cat_title_html' => array(),
|
||||
'forum_name_html' => array(),
|
||||
'c' => array(), // also has $data['c']['cat_id']['forums'] key
|
||||
'f' => array(), // also has $data['f']['forum_id']['subforums'] key
|
||||
);
|
||||
$data = [
|
||||
'not_auth_forums' => [
|
||||
'guest_view' => [],
|
||||
'guest_read' => [],
|
||||
'user_view' => [],
|
||||
'user_read' => []
|
||||
],
|
||||
'tracker_forums' => [],
|
||||
'cat_title_html' => [],
|
||||
'forum_name_html' => [],
|
||||
'c' => [], // also has $data['c']['cat_id']['forums'] key
|
||||
'f' => [] // also has $data['f']['forum_id']['subforums'] key
|
||||
];
|
||||
|
||||
// Store only these fields from BB_FORUMS in $data['f']
|
||||
$forum_store_fields = array_flip(array_keys($bf['forum_perm']));
|
||||
$forum_store_fields += array_flip(array(
|
||||
$forum_store_fields += array_flip([
|
||||
'forum_id',
|
||||
'cat_id',
|
||||
'forum_name',
|
||||
|
@ -40,8 +40,8 @@ $forum_store_fields += array_flip(array(
|
|||
'forum_status',
|
||||
'forum_posts',
|
||||
'forum_topics',
|
||||
'forum_parent',
|
||||
));
|
||||
'forum_parent'
|
||||
]);
|
||||
|
||||
// Categories
|
||||
$sql = "SELECT * FROM " . BB_CATEGORIES . " ORDER BY cat_order";
|
||||
|
@ -106,10 +106,10 @@ $this->store('cat_forums', $data);
|
|||
//
|
||||
// jumpbox
|
||||
//
|
||||
$data = array(
|
||||
$data = [
|
||||
'guest' => get_forum_select('guest', 'f', null, null, null, 'id="jumpbox" onchange="window.location.href=\'viewforum.php?f=\'+this.value;"'),
|
||||
'user' => get_forum_select('user', 'f', null, null, null, 'id="jumpbox" onchange="window.location.href=\'viewforum.php?f=\'+this.value;"'),
|
||||
);
|
||||
];
|
||||
|
||||
$this->store('jumpbox', $data);
|
||||
|
||||
|
@ -119,9 +119,7 @@ file_write($data['user'], AJAX_HTML_DIR . '/jumpbox_user.html', false, true, tru
|
|||
//
|
||||
// viewtopic_forum_select
|
||||
//
|
||||
$data = array(
|
||||
'viewtopic_forum_select' => get_forum_select('admin', 'new_forum_id'),
|
||||
);
|
||||
$data = ['viewtopic_forum_select' => get_forum_select('admin', 'new_forum_id')];
|
||||
|
||||
$this->store('viewtopic_forum_select', $data);
|
||||
|
||||
|
|
|
@ -11,14 +11,14 @@ if (!defined('BB_ROOT')) {
|
|||
die(basename(__FILE__));
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'name_users' => array(), // only by personal permissions
|
||||
'name_groups' => array(), // only visible to all users
|
||||
'mod_users' => array(), // only by personal permissions
|
||||
'mod_groups' => array(), // only visible to all users
|
||||
'moderators' => array(), // all moderators
|
||||
'admins' => array(), // all admins
|
||||
);
|
||||
$data = [
|
||||
'name_users' => [], // only by personal permissions
|
||||
'name_groups' => [], // only visible to all users
|
||||
'mod_users' => [], // only by personal permissions
|
||||
'mod_groups' => [], // only visible to all users
|
||||
'moderators' => [], // all moderators
|
||||
'admins' => [] // all admins
|
||||
];
|
||||
|
||||
// name_users
|
||||
// mod_users
|
||||
|
|
|
@ -11,7 +11,7 @@ if (!defined('BB_ROOT')) {
|
|||
die(basename(__FILE__));
|
||||
}
|
||||
|
||||
$ranks = array();
|
||||
$ranks = [];
|
||||
|
||||
$sql = "SELECT * FROM " . BB_RANKS;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ if (!defined('BB_ROOT')) {
|
|||
|
||||
global $bb_cfg;
|
||||
|
||||
$smilies = array();
|
||||
$smilies = [];
|
||||
|
||||
$rowset = DB()->fetch_rowset("SELECT * FROM " . BB_SMILIES);
|
||||
sort($rowset);
|
||||
|
|
|
@ -13,7 +13,7 @@ if (!defined('BB_ROOT')) {
|
|||
|
||||
global $bb_cfg;
|
||||
|
||||
$data = array();
|
||||
$data = [];
|
||||
|
||||
// usercount
|
||||
$row = DB()->fetch_row("SELECT COUNT(*) AS usercount FROM " . BB_USERS . " WHERE user_id NOT IN(" . EXCLUDED_USERS . ")");
|
||||
|
@ -68,27 +68,27 @@ if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) {
|
|||
$date_today = bb_date(TIMENOW, 'md', false);
|
||||
$date_forward = bb_date(TIMENOW + ($bb_cfg['birthday_check_day'] * 86400), 'md', false);
|
||||
|
||||
$birthday_today_list = $birthday_week_list = array();
|
||||
$birthday_today_list = $birthday_week_list = [];
|
||||
|
||||
foreach ($sql as $row) {
|
||||
$user_birthday = bb_date(strtotime($row['user_birthday']), 'md', false);
|
||||
|
||||
if ($user_birthday > $date_today && $user_birthday <= $date_forward) {
|
||||
// user are having birthday within the next days
|
||||
$birthday_week_list[] = array(
|
||||
$birthday_week_list[] = [
|
||||
'user_id' => $row['user_id'],
|
||||
'username' => $row['username'],
|
||||
'user_rank' => $row['user_rank'],
|
||||
'user_birthday' => $row['user_birthday'],
|
||||
);
|
||||
'user_birthday' => $row['user_birthday']
|
||||
];
|
||||
} elseif ($user_birthday == $date_today) {
|
||||
//user have birthday today
|
||||
$birthday_today_list[] = array(
|
||||
$birthday_today_list[] = [
|
||||
'user_id' => $row['user_id'],
|
||||
'username' => $row['username'],
|
||||
'user_rank' => $row['user_rank'],
|
||||
'user_birthday' => $row['user_birthday'],
|
||||
);
|
||||
'user_birthday' => $row['user_birthday']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue