Minor improvements (#882)

* Minor improvements

* Updated

* Updated

* Updated

* Update privmsg.php

* Updated

* Update admin_attach_cp.php
This commit is contained in:
Roman Kelesidis 2023-09-04 01:01:01 +07:00 committed by GitHub
commit 4b453de64a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 699 additions and 735 deletions

View file

@ -126,7 +126,7 @@ switch ($field) {
$table = BB_BT_USERS;
$value = (float)str_replace(',', '.', $this->request['value']);
foreach (array('KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4, 'PB' => 5, 'EB' => 6, 'ZB' => 7, 'YB' => 8) as $s => $m) {
foreach (['KB' => 1, 'MB' => 2, 'GB' => 3, 'TB' => 4, 'PB' => 5, 'EB' => 6, 'ZB' => 7, 'YB' => 8] as $s => $m) {
if (stripos($this->request['value'], $s) !== false) {
$value *= (1024 ** $m);
break;

View file

@ -31,7 +31,7 @@ switch ($mode) {
WHERE ug.user_id = $user_id
ORDER BY g.group_name
";
$html = array();
$html = [];
foreach (DB()->fetch_rowset($sql) as $row) {
$class = ($row['user_pending']) ? 'med' : 'med bold';
$class .= ($row['group_moderator'] == $user_id) ? ' colorMod' : '';

View file

@ -19,9 +19,9 @@ $html = '';
switch ($mode) {
case 'birthday_week':
$stats = $datastore->get('stats');
$datastore->enqueue(array(
'stats',
));
$datastore->enqueue([
'stats'
]);
$users = [];
@ -37,9 +37,9 @@ switch ($mode) {
case 'birthday_today':
$stats = $datastore->get('stats');
$datastore->enqueue(array(
'stats',
));
$datastore->enqueue([
'stats'
]);
$users = [];
@ -56,12 +56,12 @@ switch ($mode) {
case 'get_forum_mods':
$forum_id = (int)$this->request['forum_id'];
$datastore->enqueue(array(
$datastore->enqueue([
'moderators',
'cat_forums',
));
'cat_forums'
]);
$moderators = array();
$moderators = [];
$mod = $datastore->get('moderators');
if (isset($mod['mod_users'][$forum_id])) {

View file

@ -69,12 +69,12 @@ switch ($mode) {
}
// Log action
$log_action->mod('mod_topic_renamed', array(
$log_action->mod('mod_topic_renamed', [
'forum_id' => $t_data['forum_id'],
'topic_id' => $topic_id,
'topic_title' => $old_title,
'topic_title_new' => $new_title,
));
'topic_title_new' => $new_title
]);
$this->response['topic_id'] = $topic_id;
$this->response['topic_title'] = $new_title;

View file

@ -30,11 +30,11 @@ if (!$post) {
$this->ajax_die('not post');
}
$data = array(
$data = [
'mc_comment' => ($mc_type) ? $mc_text : '',
'mc_type' => $mc_type,
'mc_user_id' => ($mc_type) ? $userdata['user_id'] : 0,
);
'mc_user_id' => ($mc_type) ? $userdata['user_id'] : 0
];
$sql_args = DB()->build_array('UPDATE', $data);
DB()->query("UPDATE " . BB_POSTS . " SET $sql_args WHERE post_id = $post_id");

View file

@ -48,8 +48,8 @@ if (isset($this->request['post_id'])) {
}
if (!defined('WORD_LIST_OBTAINED')) {
$orig_word = array();
$replace_word = array();
$orig_word = [];
$replace_word = [];
obtain_word_list($orig_word, $replace_word);
define('WORD_LIST_OBTAINED', true);
}
@ -142,10 +142,10 @@ switch ($this->request['type']) {
$s_text = str_replace('\n', "\n", $text);
$s_topic_title = str_replace('\n', "\n", $post['topic_title']);
add_search_words($post_id, stripslashes($s_text), stripslashes($s_topic_title));
update_post_html(array(
update_post_html([
'post_id' => $post_id,
'post_text' => $text,
));
'post_text' => $text
]);
}
} else {
$this->ajax_die($lang['EMPTY_MESSAGE']);
@ -276,10 +276,10 @@ switch ($this->request['type']) {
$s_message = str_replace('\n', "\n", $message);
$s_topic_title = str_replace('\n', "\n", $post['topic_title']);
add_search_words($post_id, stripslashes($s_message), stripslashes($s_topic_title));
update_post_html(array(
update_post_html([
'post_id' => $post_id,
'post_text' => $message,
));
'post_text' => $message
]);
if ($bb_cfg['topic_notify_enabled']) {
$notify = !empty($this->request['notify']);

View file

@ -60,7 +60,7 @@ switch ($mode) {
preg_match('#\d+#', (string)$this->request['tpl_rules'], $m);
$tpl_rules_post_id = isset($m[0]) ? (int)$m[0] : 0;
$sql_args = array(
$sql_args = [
'tpl_name' => (string)$tpl_name,
'tpl_src_form' => (string)$tpl_src_form,
'tpl_src_title' => (string)$tpl_src_title,
@ -68,8 +68,8 @@ switch ($mode) {
'tpl_comment' => (string)$tpl_comment,
'tpl_rules_post_id' => (int)$tpl_rules_post_id,
'tpl_last_edit_tm' => (int)TIMENOW,
'tpl_last_edit_by' => (int)$userdata['user_id'],
);
'tpl_last_edit_by' => (int)$userdata['user_id']
];
break;
}
// выполнение