Merged some fixes from new-attachments branch (#1700)

* Merged some fixes from `new-attachments` branch

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-12-07 20:29:21 +07:00 committed by GitHub
commit 83b465ddd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 13 additions and 10 deletions

View file

@ -21,6 +21,7 @@
- Show torrent unregister action in log actions [\#1696](https://github.com/torrentpier/torrentpier/pull/1696) ([belomaxorka](https://github.com/belomaxorka)) - Show torrent unregister action in log actions [\#1696](https://github.com/torrentpier/torrentpier/pull/1696) ([belomaxorka](https://github.com/belomaxorka))
- Show torrent status changes in actions log [\#1688](https://github.com/torrentpier/torrentpier/pull/1688) ([belomaxorka](https://github.com/belomaxorka)) - Show torrent status changes in actions log [\#1688](https://github.com/torrentpier/torrentpier/pull/1688) ([belomaxorka](https://github.com/belomaxorka))
- Show torrent type (gold / silver) changes in actions log [\#1689](https://github.com/torrentpier/torrentpier/pull/1689) ([belomaxorka](https://github.com/belomaxorka)) - Show torrent type (gold / silver) changes in actions log [\#1689](https://github.com/torrentpier/torrentpier/pull/1689) ([belomaxorka](https://github.com/belomaxorka))
- Merged some fixes from `new-attachments` branch [\#1700](https://github.com/torrentpier/torrentpier/pull/1700) ([belomaxorka](https://github.com/belomaxorka))
- Changed database encoding to `utf8mb4_unicode_ci` [\#1684](https://github.com/torrentpier/torrentpier/pull/1684) ([belomaxorka](https://github.com/belomaxorka)) - Changed database encoding to `utf8mb4_unicode_ci` [\#1684](https://github.com/torrentpier/torrentpier/pull/1684) ([belomaxorka](https://github.com/belomaxorka))
- Demo mode: Save user language in cookies [\#1584](https://github.com/torrentpier/torrentpier/pull/1584) ([belomaxorka](https://github.com/belomaxorka)) - Demo mode: Save user language in cookies [\#1584](https://github.com/torrentpier/torrentpier/pull/1584) ([belomaxorka](https://github.com/belomaxorka))
- Make `get_torrent_info()` as public method for re-use [\#1697](https://github.com/torrentpier/torrentpier/pull/1697) ([belomaxorka](https://github.com/belomaxorka)) - Make `get_torrent_info()` as public method for re-use [\#1697](https://github.com/torrentpier/torrentpier/pull/1697) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -28,7 +28,7 @@ if ($rank_id != 0 && !isset($ranks[$rank_id])) {
$this->ajax_die("invalid rank_id: $rank_id"); $this->ajax_die("invalid rank_id: $rank_id");
} }
DB()->query("UPDATE " . BB_USERS . " SET user_rank = $rank_id WHERE user_id = $user_id"); DB()->query("UPDATE " . BB_USERS . " SET user_rank = $rank_id WHERE user_id = $user_id LIMIT 1");
\TorrentPier\Sessions::cache_rm_user_sessions($user_id); \TorrentPier\Sessions::cache_rm_user_sessions($user_id);

View file

@ -51,4 +51,4 @@ switch ($mode) {
} }
$value_sql = DB()->escape($value, true); $value_sql = DB()->escape($value, true);
DB()->query("UPDATE " . BB_GROUPS . " SET $mode = $value_sql WHERE group_id = $group_id"); DB()->query("UPDATE " . BB_GROUPS . " SET $mode = $value_sql WHERE group_id = $group_id LIMIT 1");

View file

@ -152,7 +152,7 @@ switch ($field) {
} }
$value_sql = DB()->escape($value, true); $value_sql = DB()->escape($value, true);
DB()->query("UPDATE $table SET $field = $value_sql WHERE user_id = $user_id"); DB()->query("UPDATE $table SET $field = $value_sql WHERE user_id = $user_id LIMIT 1");
\TorrentPier\Sessions::cache_rm_user_sessions($user_id); \TorrentPier\Sessions::cache_rm_user_sessions($user_id);

View file

@ -170,7 +170,7 @@ switch ($mode) {
<th>' . $lang['UPLOADED'] . '</th> <th>' . $lang['UPLOADED'] . '</th>
<th>' . $lang['RELEASED'] . '</th> <th>' . $lang['RELEASED'] . '</th>
<th>' . $lang['BONUS'] . '</th>'; <th>' . $lang['BONUS'] . '</th>';
$html .= ($bb_cfg['seed_bonus_enabled']) ? '<th>' . $lang['SEED_BONUS'] . '</th>' : ''; $html .= $bb_cfg['seed_bonus_enabled'] ? '<th>' . $lang['SEED_BONUS'] . '</th>' : '';
$html .= '</tr> $html .= '</tr>
<tr class="row1"> <tr class="row1">
<td>' . $lang['TOTAL_TRAF'] . '</td> <td>' . $lang['TOTAL_TRAF'] . '</td>
@ -178,13 +178,13 @@ switch ($mode) {
<td id="u_up_total"><span class="editable bold seedmed">' . humn_size($btu['u_up_total']) . '</span></td> <td id="u_up_total"><span class="editable bold seedmed">' . humn_size($btu['u_up_total']) . '</span></td>
<td id="u_up_release"><span class="editable bold seedmed">' . humn_size($btu['u_up_release']) . '</span></td> <td id="u_up_release"><span class="editable bold seedmed">' . humn_size($btu['u_up_release']) . '</span></td>
<td id="u_up_bonus"><span class="editable bold seedmed">' . humn_size($btu['u_up_bonus']) . '</span></td>'; <td id="u_up_bonus"><span class="editable bold seedmed">' . humn_size($btu['u_up_bonus']) . '</span></td>';
$html .= ($bb_cfg['seed_bonus_enabled']) ? '<td id="user_points"><span class="editable bold points">' . $profiledata['user_points'] . '</b></td>' : ''; $html .= $bb_cfg['seed_bonus_enabled'] ? '<td id="user_points"><span class="editable bold points">' . $profiledata['user_points'] . '</b></td>' : '';
$html .= '</tr> $html .= '</tr>
<tr class="row5"> <tr class="row5">
<td colspan="1">' . $lang['MAX_SPEED'] . '</td> <td colspan="1">' . $lang['MAX_SPEED'] . '</td>
<td colspan="2">' . $lang['DL_DL_SPEED'] . ': ' . $speed_down . '</span></td> <td colspan="2">' . $lang['DL_DL_SPEED'] . ': ' . $speed_down . '</span></td>
<td colspan="2">' . $lang['DL_UL_SPEED'] . ': ' . $speed_up . '</span></td>'; <td colspan="2">' . $lang['DL_UL_SPEED'] . ': ' . $speed_up . '</span></td>';
$html .= ($bb_cfg['seed_bonus_enabled']) ? '<td colspan="1"></td>' : ''; $html .= $bb_cfg['seed_bonus_enabled'] ? '<td colspan="1"></td>' : '';
$html .= '</tr>'; $html .= '</tr>';
$this->response['user_ratio'] = ' $this->response['user_ratio'] = '

View file

@ -116,7 +116,7 @@ switch ($mode) {
$new_tpl_id = $tpl_id; $new_tpl_id = $tpl_id;
$this->response['msg'] = "Включен шаблон $tpl_name"; $this->response['msg'] = "Включен шаблон $tpl_name";
} }
DB()->query("UPDATE " . BB_FORUMS . " SET forum_tpl_id = $new_tpl_id WHERE forum_id = $forum_id"); DB()->query("UPDATE " . BB_FORUMS . " SET forum_tpl_id = $new_tpl_id WHERE forum_id = $forum_id LIMIT 1");
break; break;
// сохранение изменений // сохранение изменений
@ -127,7 +127,7 @@ switch ($mode) {
$msg .= 'Шаблон был отредактирован: ' . html_ent_decode($last_edit_by_username) . ', ' . bb_date($tpl_data['tpl_last_edit_tm'], 'd-M-y H:i'); $msg .= 'Шаблон был отредактирован: ' . html_ent_decode($last_edit_by_username) . ', ' . bb_date($tpl_data['tpl_last_edit_tm'], 'd-M-y H:i');
$this->ajax_die($msg); $this->ajax_die($msg);
} }
$sql = "UPDATE " . BB_TOPIC_TPL . " SET " . DB()->build_array('UPDATE', $sql_args) . " WHERE tpl_id = $tpl_id"; $sql = "UPDATE " . BB_TOPIC_TPL . " SET " . DB()->build_array('UPDATE', $sql_args) . " WHERE tpl_id = $tpl_id LIMIT 1";
if (!DB()->query($sql)) { if (!DB()->query($sql)) {
$sql_error = DB()->sql_error(); $sql_error = DB()->sql_error();
} }

View file

@ -254,7 +254,7 @@ function setbit(&$int, $bit_num, $on)
All results are returned as associative arrays, even when a single auth type is All results are returned as associative arrays, even when a single auth type is
specified. specified.
If available you can send an array (either one or two dimensional) containing the If available you can send an array (either one or two-dimensional) containing the
forum auth levels, this will prevent the auth function having to do its own forum auth levels, this will prevent the auth function having to do its own
lookup lookup
*/ */

View file

@ -355,7 +355,7 @@ switch ($mode) {
case 'set_download': case 'set_download':
case 'unset_download': case 'unset_download':
$set_download = ($mode == 'set_download'); $set_download = ($mode == 'set_download');
$new_dl_type = ($set_download) ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL; $new_dl_type = $set_download ? TOPIC_DL_TYPE_DL : TOPIC_DL_TYPE_NORMAL;
DB()->query(" DB()->query("
UPDATE " . BB_TOPICS . " SET UPDATE " . BB_TOPICS . " SET

View file

@ -625,7 +625,9 @@ $template->assign_vars([
'POSTER_RGROUPS' => !empty($poster_rgroups) ? $poster_rgroups : '', 'POSTER_RGROUPS' => !empty($poster_rgroups) ? $poster_rgroups : '',
'ATTACH_RG_SIG' => $switch_rg_sig ?: false, 'ATTACH_RG_SIG' => $switch_rg_sig ?: false,
// todo: remove (cuz unused)
'U_VIEWTOPIC' => ($mode == 'reply') ? TOPIC_URL . "$topic_id&amp;postorder=desc" : '', 'U_VIEWTOPIC' => ($mode == 'reply') ? TOPIC_URL . "$topic_id&amp;postorder=desc" : '',
// todo: end
'S_NOTIFY_CHECKED' => $notify_user ? 'checked' : '', 'S_NOTIFY_CHECKED' => $notify_user ? 'checked' : '',
'S_ROBOTS_CHECKED' => $robots_indexing ? 'checked' : '', 'S_ROBOTS_CHECKED' => $robots_indexing ? 'checked' : '',