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))
- 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))
- 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 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)
[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'];
}
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)

View file

@ -78,6 +78,7 @@ if ($watch_count > 0) {
'REPLIES' => $watch[$i]['topic_replies'],
'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_RAW' => $watch[$i]['topic_last_post_time'],
'LAST_POST_ID' => $watch[$i]['topic_last_post_id'],
'IS_UNREAD' => $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),
'AVATAR' => $user_info['avatar'],
'FROM' => $user_info['from'],
'JOINED_RAW' => $row['user_regdate'],
'JOINED' => $user_info['joined'],
'JOINED_RAW' => $user_info['joined_raw'],
'POSTS' => $user_info['posts'],
'PM' => $user_info['pm'],
'EMAIL' => $user_info['email'],

View file

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