Minor improvements (#1224)

* Minor improvements

* Update CHANGELOG.md

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2023-12-19 08:25:01 +07:00 committed by GitHub
commit 86d02e9fae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 132 additions and 108 deletions

View file

@ -19,9 +19,10 @@
- search.php parameter sanitizing [\#1213](https://github.com/torrentpier/torrentpier/pull/1213) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka)) - search.php parameter sanitizing [\#1213](https://github.com/torrentpier/torrentpier/pull/1213) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka))
- Limit execution time for forum file-listing [\#1211](https://github.com/torrentpier/torrentpier/pull/1211) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka)) - Limit execution time for forum file-listing [\#1211](https://github.com/torrentpier/torrentpier/pull/1211) ([kovalensky](https://github.com/kovalensky), [belomaxorka](https://github.com/belomaxorka))
- Some reported bugfixes [\#1214](https://github.com/torrentpier/torrentpier/pull/1214) ([belomaxorka](https://github.com/belomaxorka)) - Some reported bugfixes [\#1214](https://github.com/torrentpier/torrentpier/pull/1214) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#1215](https://github.com/torrentpier/torrentpier/pull/1215), [\#1217](https://github.com/torrentpier/torrentpier/pull/1217), [\#1219](https://github.com/torrentpier/torrentpier/pull/1219), [\#1220](https://github.com/torrentpier/torrentpier/pull/1220) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#1215](https://github.com/torrentpier/torrentpier/pull/1215), [\#1217](https://github.com/torrentpier/torrentpier/pull/1217), [\#1219](https://github.com/torrentpier/torrentpier/pull/1219), [\#1220](https://github.com/torrentpier/torrentpier/pull/1220), [\#1224](https://github.com/torrentpier/torrentpier/pull/1224) ([belomaxorka](https://github.com/belomaxorka))
- Fixed extensions issue [\#1218](https://github.com/torrentpier/torrentpier/pull/1218) ([belomaxorka](https://github.com/belomaxorka)) - Fixed extensions issue [\#1218](https://github.com/torrentpier/torrentpier/pull/1218) ([belomaxorka](https://github.com/belomaxorka))
- Fixed broken sorting in group.php [\#1221](https://github.com/torrentpier/torrentpier/pull/1221) ([belomaxorka](https://github.com/belomaxorka)) - Fixed broken sorting in group.php [\#1221](https://github.com/torrentpier/torrentpier/pull/1221) ([belomaxorka](https://github.com/belomaxorka))
- Introduce limit setting for max number of files to be processed in separate index file-listing [\#1223](https://github.com/torrentpier/torrentpier/pull/1223) ([kovalensky](https://github.com/kovalensky))
## [v2.4.0-rc2](https://github.com/torrentpier/torrentpier/tree/v2.4.0-rc2) (2023-12-12) ## [v2.4.0-rc2](https://github.com/torrentpier/torrentpier/tree/v2.4.0-rc2) (2023-12-12)
[Full Changelog](https://github.com/torrentpier/torrentpier/compare/v2.4.0-rc1...v2.4.0-rc2) [Full Changelog](https://github.com/torrentpier/torrentpier/compare/v2.4.0-rc1...v2.4.0-rc2)

View file

@ -811,7 +811,18 @@ function generate_user_info($row, bool $have_auth = IS_ADMIN): array
$www = $lang['NOSELECT']; $www = $lang['NOSELECT'];
} }
return ['from' => $from, 'joined' => $joined, 'joined_raw' => $row['user_regdate'], 'posts' => $posts, 'pm' => $pm, 'avatar' => $avatar, 'user_time' => $user_time, 'user_time_raw' => $row['user_time'], 'email' => $email, 'www' => $www]; return [
'from' => $from,
'joined' => $joined,
'joined_raw' => $row['user_regdate'],
'posts' => $posts,
'pm' => $pm,
'avatar' => $avatar,
'user_time' => $user_time,
'user_time_raw' => ($row['user_time'] ?? ''),
'email' => $email,
'www' => $www
];
} }
function get_bt_userdata($user_id) function get_bt_userdata($user_id)

View file

@ -78,6 +78,7 @@ if ($watch_count > 0) {
'REPLIES' => $watch[$i]['topic_replies'], 'REPLIES' => $watch[$i]['topic_replies'],
'AUTHOR' => profile_url($watch[$i]), 'AUTHOR' => profile_url($watch[$i]),
'LAST_POST' => bb_date($watch[$i]['topic_last_post_time']) . '<br />' . profile_url(['user_id' => $watch[$i]['last_user_id'], 'username' => $watch[$i]['last_username'], 'user_rank' => $watch[$i]['last_user_rank']]), 'LAST_POST' => bb_date($watch[$i]['topic_last_post_time']) . '<br />' . profile_url(['user_id' => $watch[$i]['last_user_id'], 'username' => $watch[$i]['last_username'], 'user_rank' => $watch[$i]['last_user_rank']]),
'LAST_POST_RAW' => $watch[$i]['topic_last_post_time'],
'LAST_POST_ID' => $watch[$i]['topic_last_post_id'], 'LAST_POST_ID' => $watch[$i]['topic_last_post_id'],
'IS_UNREAD' => $is_unread, 'IS_UNREAD' => $is_unread,
'TOPIC_ICON' => get_topic_icon($watch[$i], $is_unread), 'TOPIC_ICON' => get_topic_icon($watch[$i], $is_unread),

View file

@ -78,8 +78,8 @@ if ($result = DB()->fetch_rowset($sql)) {
'USER' => profile_url($row), 'USER' => profile_url($row),
'AVATAR' => $user_info['avatar'], 'AVATAR' => $user_info['avatar'],
'FROM' => $user_info['from'], 'FROM' => $user_info['from'],
'JOINED_RAW' => $row['user_regdate'],
'JOINED' => $user_info['joined'], 'JOINED' => $user_info['joined'],
'JOINED_RAW' => $user_info['joined_raw'],
'POSTS' => $user_info['posts'], 'POSTS' => $user_info['posts'],
'PM' => $user_info['pm'], 'PM' => $user_info['pm'],
'EMAIL' => $user_info['email'], 'EMAIL' => $user_info['email'],

View file

@ -1,127 +1,138 @@
<script type="text/javascript"> <script type="text/javascript">
ajax.in_edit_mode = false; ajax.in_edit_mode = false;
$(document).ready(function(){ $(document).ready(function () {
$('#show-edit-btn a').click(function(){ $('#show-edit-btn a').click(function () {
show_edit_options(); show_edit_options();
$('#show-edit-btn').html( $('#edit-sel-topics').html() ); $('#show-edit-btn').html($('#edit-sel-topics').html());
return false; return false;
}); });
$('td.topic_id').click(function(){ $('td.topic_id').click(function () {
if (!ajax.in_edit_mode) { if (!ajax.in_edit_mode) {
$('#show-edit-btn a').click(); $('#show-edit-btn a').click();
$(this).find('input').click(); $(this).find('input').click();
} }
}); });
}); });
function show_edit_options () function show_edit_options() {
{ $('td.topic_id').each(function () {
$('td.topic_id').each(function(){ var topic_id = $(this).attr('id');
var topic_id = $(this).attr('id'); var input = '<input id="sel-' + topic_id + '" type="checkbox" value="' + topic_id + '" class="topic-chbox" />';
var input = '<input id="sel-'+ topic_id +'" type="checkbox" value="'+ topic_id +'" class="topic-chbox" />'; $(this).html(input);
$(this).html(input); });
});
$('input.topic-chbox').click(function(){ $('input.topic-chbox').click(function () {
if ($.browser.mozilla) { if ($.browser.mozilla) {
$('#tr-'+this.value+' td').toggleClass('hl-selected-row'); $('#tr-' + this.value + ' td').toggleClass('hl-selected-row');
} else { } else {
$('#tr-'+this.value).toggleClass('hl-selected-row'); $('#tr-' + this.value).toggleClass('hl-selected-row');
} }
}); });
$('#pagination a.pg').each(function(){ this.href += '&mod=1'; }); $('#pagination a.pg').each(function () {
$('#ed-list-desc').hide(); this.href += '&mod=1';
$('#mod-action-cell').append( $('#mod-action-content')[0] ); });
$('#mod-action-row, #mod-action-content').show(); $('#ed-list-desc').hide();
$('#mod-action-cell').append($('#mod-action-content')[0]);
$('#mod-action-row, #mod-action-content').show();
$('#mod-action').submit(function(){ $('#mod-action').submit(function () {
var $form = $(this); var $form = $(this);
$('input[name~=topic_id_list]', $form).remove(); $('input[name~=topic_id_list]', $form).remove();
$('input.topic-chbox:checked').each(function(){ $('input.topic-chbox:checked').each(function () {
$form.append('<input type="hidden" name="topic_id_list[]" value="'+ this.value +'" />'); $form.append('<input type="hidden" name="topic_id_list[]" value="' + this.value + '" />');
$('#tr-'+this.value).remove(); $('#tr-' + this.value).remove();
}); });
}); });
ajax.in_edit_mode = true; ajax.in_edit_mode = true;
} }
</script> </script>
<style> <style>
td.topic_id { cursor: pointer; } td.topic_id {
cursor: pointer;
}
</style> </style>
<div id="mod-action-content" style="display: none;"> <div id="mod-action-content" style="display: none;">
<form id="mod-action" name="watch_form" method="post" action="{S_FORM_ACTION}"> <form id="mod-action" name="watch_form" method="post" action="{S_FORM_ACTION}">
<table class="borderless pad_0" cellpadding="0" cellspacing="0"> <table class="borderless pad_0" cellpadding="0" cellspacing="0">
<tr><td class="pad_4"> <tr>
<input type="submit" name="del_from_ut" value="{L_DEL_LIST_MY_MESSAGE}" onclick="if (!window.confirm( this.value +'?' )){ return false };" /> <td class="pad_4">
</tr></table> <input type="submit" name="del_from_ut" value="{L_DEL_LIST_MY_MESSAGE}"
</form> onclick="if (!window.confirm( this.value +'?' )) { return false; }"/>
</tr>
</table>
</form>
</div> </div>
<table id="post-row" style="display: none;"> <table id="post-row" style="display: none;">
<tr> <tr>
<td class="row2" colspan="7"> <td class="row2" colspan="7">
<div class="post_watch_wrap row1"> <div class="post_watch_wrap row1">
<div class="post_body pad_6"></div> <div class="post_body pad_6"></div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
</td> </td>
</tr> </tr>
</table> </table>
<table cellpadding="2" cellspacing="0" width="100%"> <table cellpadding="2" cellspacing="0" width="100%">
<tr> <tr>
<td width="100%"> <td width="100%">
<h1 class="maintitle">{PAGE_TITLE}</h1> <h1 class="maintitle">{PAGE_TITLE}</h1>
<div id="forums_top_links" class="nav"> <div id="forums_top_links" class="nav">
<a href="{U_INDEX}">{T_INDEX}</a>&nbsp;<em>&middot;</em> <a href="{U_INDEX}">{T_INDEX}</a>&nbsp;<em>&middot;</em>
<span id="show-edit-btn"><a href="#">{L_EDIT_MY_MESSAGE_LIST}</a></span> <span id="show-edit-btn"><a href="#">{L_EDIT_MY_MESSAGE_LIST}</a></span>
<span id="edit-sel-topics" style="display: none;"><a href="#" class="bold adm" onclick="$('input.topic-chbox').trigger('click'); return false;">{L_SELECT_INVERT}</a></span><em>&middot;</em> <span id="edit-sel-topics" style="display: none;"><a href="#" class="bold adm"
<a href="#" class="med normal" onclick="setCookie('{#COOKIE_MARK#}', 'all_forums');">{L_MARK_ALL_FORUMS_READ}</a> onclick="$('input.topic-chbox').trigger('click'); return false;">{L_SELECT_INVERT}</a></span><em>&middot;</em>
</div> <a href="#" class="med normal"
</td> onclick="setCookie('{#COOKIE_MARK#}', 'all_forums');">{L_MARK_ALL_FORUMS_READ}</a>
<td class="vBottom tLeft nowrap med"><b>{PAGINATION}</b></td> </div>
</tr> </td>
<td class="vBottom tLeft nowrap med"><b>{PAGINATION}</b></td>
</tr>
</table> </table>
<table width="100%" class="forumline tablesorter"> <table width="100%" class="forumline tablesorter">
<thead> <thead>
<tr> <tr>
<th class="{sorter: 'text'}"></th> <th class="{sorter: 'text'}"></th>
<th class="{sorter: 'text'}" width="25%"><b class="tbs-text">{L_FORUM}</b></th> <th class="{sorter: 'text'}" width="25%"><b class="tbs-text">{L_FORUM}</b></th>
<th class="{sorter: 'text'}" width="75%"><b class="tbs-text">{L_TOPIC}</b></th> <th class="{sorter: 'text'}" width="75%"><b class="tbs-text">{L_TOPIC}</b></th>
<th class="{sorter: 'text'}"><b class="tbs-text">{L_AUTHOR}</b></th> <th class="{sorter: 'text'}"><b class="tbs-text">{L_AUTHOR}</b></th>
<th width="80" class="{sorter: 'text'}"><b class="tbs-text">{L_REPLIES}</b></th> <th width="80" class="{sorter: 'digit'}"><b class="tbs-text">{L_REPLIES}</b></th>
<th width="120" class="{sorter: 'text'} nowrap"><b class="tbs-text">{L_LASTPOST}</b></th> <th width="120" class="{sorter: 'digit'} nowrap"><b class="tbs-text">{L_LASTPOST}</b></th>
</tr> </tr>
</thead> </thead>
<!-- BEGIN watch --> <!-- BEGIN watch -->
<tr class="tCenter {watch.ROW_CLASS}" id="tr-{watch.TOPIC_ID}"> <tr class="tCenter {watch.ROW_CLASS}" id="tr-{watch.TOPIC_ID}">
<td id="{watch.TOPIC_ID}" class="topic_id"> <td id="{watch.TOPIC_ID}" class="topic_id">
<span style="display: none;">{watch.TOPIC_ICON}</span> <span style="display: none;">{watch.TOPIC_ICON}</span>
<img class="topic_icon" src="{watch.TOPIC_ICON}"> <img class="topic_icon" src="{watch.TOPIC_ICON}">
</td> </td>
<td><a href="{watch.U_FORUM}" class="genmed">{watch.FORUM_TITLE}</a></td> <td><a href="{watch.U_FORUM}" class="genmed">{watch.FORUM_TITLE}</a></td>
<td class="tLeft nowrap"> <td class="tLeft nowrap">
<a class="topictitle" title="{watch.FULL_TOPIC_TITLE}" href="{watch.U_TOPIC}">{watch.TOPIC_TITLE}</a> <a class="topictitle" title="{watch.FULL_TOPIC_TITLE}" href="{watch.U_TOPIC}">{watch.TOPIC_TITLE}</a>
<!-- IF watch.PAGINATION --><br /><span class="topicPG">&nbsp;[{ICON_GOTOPOST}{L_GOTO_SHORT} {watch.PAGINATION} ]</span><!-- ENDIF --> <!-- IF watch.PAGINATION --><br/><span
</td> class="topicPG">&nbsp;[{ICON_GOTOPOST}{L_GOTO_SHORT} {watch.PAGINATION} ]</span><!-- ENDIF -->
<td>{watch.AUTHOR}</td> </td>
<td class="gensmall">{watch.REPLIES}</td> <td>{watch.AUTHOR}</td>
<td class="gensmall nowrap"> <td class="gensmall">{watch.REPLIES}</td>
{watch.LAST_POST}<!-- IF watch.IS_UNREAD --><a href="{TOPIC_URL}{watch.TOPIC_ID}{NEWEST_URL}">{ICON_NEWEST_REPLY}</a><!-- ELSE --> <td class="gensmall nowrap">
<a href="{POST_URL}{watch.LAST_POST_ID}#{watch.LAST_POST_ID}">{ICON_LATEST_REPLY}</a><!-- ENDIF --> <u>{watch.LAST_POST_RAW}</u>
</td> {watch.LAST_POST}<!-- IF watch.IS_UNREAD --><a
</tr> href="{TOPIC_URL}{watch.TOPIC_ID}{NEWEST_URL}">{ICON_NEWEST_REPLY}</a><!-- ELSE -->
<!-- END watch --> <a href="{POST_URL}{watch.LAST_POST_ID}#{watch.LAST_POST_ID}">{ICON_LATEST_REPLY}</a><!-- ENDIF -->
<tfoot> </td>
<tr id="mod-action-row"> </tr>
<td colspan="6" id="mod-action-cell" class="row2"> <!-- END watch -->
<span id="ed-list-desc" class="small">{L_DEL_LIST_INFO}<span class="floatR">{MATCHES}</span></span> <tfoot>
</td> <tr id="mod-action-row">
</tr> <td colspan="6" id="mod-action-cell" class="row2">
</tfoot> <span id="ed-list-desc" class="small">{L_DEL_LIST_INFO}<span class="floatR">{MATCHES}</span></span>
</td>
</tr>
</tfoot>
</table> </table>