mirror of
https://github.com/torrentpier/torrentpier.git
synced 2025-03-12 04:35:42 -07:00
Minor improvements (#1458)
* Minor improvements * Updated * Update modcp.php * Update modcp.tpl * Update modcp.php * Update modcp.tpl * Update viewtopic.php * Update posting.php * Updated * Update viewtopic.tpl * Update admin_log.tpl * Updated * Update modcp.php * Update modcp.php * Update CHANGELOG.md * Revert "Update CHANGELOG.md" This reverts commit 7933176d330c48148de7b139cf234220acc0b85d. * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md
This commit is contained in:
parent
c0273117b5
commit
9d3bc2c178
@ -14,7 +14,7 @@
|
||||
- Fixed quote selection for smiles [\#1457](https://github.com/torrentpier/torrentpier/pull/1457) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Demo mode: Allow registering torrents by default [\#1440](https://github.com/torrentpier/torrentpier/pull/1440) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Code refactoring [\#1441](https://github.com/torrentpier/torrentpier/pull/1441) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Minor improvements [\#1435](https://github.com/torrentpier/torrentpier/pull/1435), [\#1443](https://github.com/torrentpier/torrentpier/pull/1443), [\#1446](https://github.com/torrentpier/torrentpier/pull/1446), [\#1450](https://github.com/torrentpier/torrentpier/pull/1450), [\#1452](https://github.com/torrentpier/torrentpier/pull/1452) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Minor improvements [\#1435](https://github.com/torrentpier/torrentpier/pull/1435), [\#1443](https://github.com/torrentpier/torrentpier/pull/1443), [\#1446](https://github.com/torrentpier/torrentpier/pull/1446), [\#1450](https://github.com/torrentpier/torrentpier/pull/1450), [\#1452](https://github.com/torrentpier/torrentpier/pull/1452), [\#1458](https://github.com/torrentpier/torrentpier/pull/1458) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- Updated deps [\#1454](https://github.com/torrentpier/torrentpier/pull/1454), [\#1455](https://github.com/torrentpier/torrentpier/pull/1455), [\#1459](https://github.com/torrentpier/torrentpier/pull/1459), [\#1460](https://github.com/torrentpier/torrentpier/pull/1460) ([belomaxorka](https://github.com/belomaxorka))
|
||||
- New Crowdin updates [\#1444](https://github.com/torrentpier/torrentpier/pull/1444), [\#1447](https://github.com/torrentpier/torrentpier/pull/1447), [\#1453](https://github.com/torrentpier/torrentpier/pull/1453) ([Exileum](https://github.com/Exileum))
|
||||
|
||||
|
@ -11,8 +11,8 @@ define('BB_SCRIPT', 'dl_list');
|
||||
|
||||
require __DIR__ . '/common.php';
|
||||
|
||||
$forum_id = isset($_REQUEST[POST_FORUM_URL]) ? (int)$_REQUEST[POST_FORUM_URL] : 0;
|
||||
$topic_id = isset($_REQUEST[POST_TOPIC_URL]) ? (int)$_REQUEST[POST_TOPIC_URL] : 0;
|
||||
$forum_id = $_REQUEST[POST_FORUM_URL] ?? 0;
|
||||
$topic_id = $_REQUEST[POST_TOPIC_URL] ?? 0;
|
||||
$mode = isset($_REQUEST['mode']) ? (string)$_REQUEST['mode'] : '';
|
||||
$confirmed = isset($_POST['confirm']);
|
||||
|
||||
|
26
modcp.php
26
modcp.php
@ -73,9 +73,9 @@ function validate_mode_condition($request_index, $mod_action = '')
|
||||
$user->session_start(['req_login' => true]);
|
||||
|
||||
// Obtain initial vars
|
||||
$forum_id = $_REQUEST['f'] ?? 0;
|
||||
$topic_id = $_REQUEST['t'] ?? 0;
|
||||
$post_id = $_REQUEST['p'] ?? 0;
|
||||
$forum_id = $_REQUEST[POST_FORUM_URL] ?? 0;
|
||||
$topic_id = $_REQUEST[POST_TOPIC_URL] ?? 0;
|
||||
$post_id = $_REQUEST[POST_POST_URL] ?? 0;
|
||||
|
||||
$start = isset($_REQUEST['start']) ? abs((int)$_REQUEST['start']) : 0;
|
||||
$confirmed = isset($_POST['confirm']);
|
||||
@ -599,8 +599,10 @@ switch ($mode) {
|
||||
bb_die($lang['NO_SUCH_POST']);
|
||||
}
|
||||
|
||||
$no_lookup = false;
|
||||
if (!$ip_this_post = \TorrentPier\Helpers\IPHelper::long2ip_extended($post_row['poster_ip'])) {
|
||||
$ip_this_post = $lang['NOT_AVAILABLE'];
|
||||
$no_lookup = true;
|
||||
}
|
||||
|
||||
$ip_this_post = ($rdns_ip_num == $ip_this_post) ? gethostbyaddr($ip_this_post) : $ip_this_post;
|
||||
@ -610,8 +612,9 @@ switch ($mode) {
|
||||
$template->assign_vars([
|
||||
'TPL_MODCP_IP' => true,
|
||||
'IP' => $ip_this_post,
|
||||
'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=$ip_this_post&sid=" . $userdata['session_id'],
|
||||
'U_LOOKUP_IP' => !$no_lookup ? "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=$ip_this_post&sid=" . $userdata['session_id'] : '',
|
||||
]);
|
||||
unset($no_lookup);
|
||||
|
||||
//
|
||||
// Get other IP's this user has posted under
|
||||
@ -631,8 +634,10 @@ switch ($mode) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$no_lookup = false;
|
||||
if (!$ip = \TorrentPier\Helpers\IPHelper::long2ip_extended($row['poster_ip'])) {
|
||||
$ip = $lang['NOT_AVAILABLE'];
|
||||
$no_lookup = true;
|
||||
}
|
||||
$ip = ($rdns_ip_num == $ip || $rdns_ip_num == 'all') ? gethostbyaddr($ip) : $ip;
|
||||
|
||||
@ -640,8 +645,9 @@ switch ($mode) {
|
||||
'ROW_CLASS' => !($i % 2) ? 'row4' : 'row5',
|
||||
'IP' => $ip,
|
||||
'POSTS' => $row['postings'],
|
||||
'U_LOOKUP_IP' => "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $ip . "&sid=" . $userdata['session_id'],
|
||||
'U_LOOKUP_IP' => !$no_lookup ? "modcp.php?mode=ip&" . POST_POST_URL . "=$post_id&" . POST_TOPIC_URL . "=$topic_id&rdns=" . $ip . "&sid=" . $userdata['session_id'] : '',
|
||||
]);
|
||||
unset($no_lookup);
|
||||
|
||||
$i++;
|
||||
} while ($row = DB()->sql_fetchrow($result));
|
||||
@ -651,7 +657,7 @@ switch ($mode) {
|
||||
// Get other users who've posted under this IP
|
||||
//
|
||||
$sql = "SELECT
|
||||
u.user_id,
|
||||
u.user_id, u.user_rank,
|
||||
IF(u.user_id = $anon, p.post_username, u.username) AS username,
|
||||
COUNT(*) as postings
|
||||
FROM " . BB_USERS . " u, " . BB_POSTS . " p
|
||||
@ -667,15 +673,11 @@ switch ($mode) {
|
||||
if ($row = DB()->sql_fetchrow($result)) {
|
||||
$i = 0;
|
||||
do {
|
||||
$id = $row['user_id'];
|
||||
$username = (!$row['username']) ? $lang['GUEST'] : $row['username'];
|
||||
|
||||
$template->assign_block_vars('userrow', [
|
||||
'ROW_CLASS' => !($i % 2) ? 'row4' : 'row5',
|
||||
'USERNAME' => $username,
|
||||
'USERNAME' => profile_url($row),
|
||||
'POSTS' => $row['postings'],
|
||||
'U_PROFILE' => ($id == GUEST_UID) ? "modcp.php?mode=ip&p=$post_id&t=$topic_id" : PROFILE_URL . $id,
|
||||
'U_SEARCHPOSTS' => "search.php?search_author=1&uid=$id",
|
||||
'U_SEARCHPOSTS' => "search.php?search_author=1&uid={$row['user_id']}",
|
||||
]);
|
||||
|
||||
$i++;
|
||||
|
@ -202,17 +202,17 @@ if (!$is_auth[$is_auth_type]) {
|
||||
|
||||
switch ($mode) {
|
||||
case 'newtopic':
|
||||
$redirect = "mode=newtopic&f=$forum_id";
|
||||
$redirect = "mode=newtopic&" . POST_FORUM_URL . "=$forum_id";
|
||||
break;
|
||||
case 'new_rel':
|
||||
$redirect = "mode=new_rel&f=$forum_id";
|
||||
$redirect = "mode=new_rel&" . POST_FORUM_URL . "=$forum_id";
|
||||
break;
|
||||
case 'reply':
|
||||
$redirect = "mode=reply&t=$topic_id";
|
||||
$redirect = "mode=reply&" . POST_TOPIC_URL . "=$topic_id";
|
||||
break;
|
||||
case 'quote':
|
||||
case 'editpost':
|
||||
$redirect = "mode=quote&p=$post_id";
|
||||
$redirect = "mode=quote&" . POST_POST_URL . "=$post_id";
|
||||
break;
|
||||
default:
|
||||
$redirect = '';
|
||||
|
@ -19,7 +19,7 @@
|
||||
<h1>{L_ACTIONS_LOG}</h1>
|
||||
|
||||
<form action="{S_LOG_ACTION}" method="post">
|
||||
<!-- IF TOPIC_CSV --><input type="hidden" name="t" value="{TOPIC_CSV}"/><!-- ENDIF -->
|
||||
<!-- IF TOPIC_CSV --><input type="hidden" name="{POST_TOPIC_URL}" value="{TOPIC_CSV}"/><!-- ENDIF -->
|
||||
|
||||
<table class="bordered w100" cellspacing="0">
|
||||
<tr>
|
||||
|
@ -55,7 +55,7 @@ $(function(){
|
||||
|
||||
<form id="feed-form" method="post" action="feed.php" target="_blank" style="display: none;">
|
||||
<input type="hidden" name="mode" value="get_feed_url">
|
||||
<input type="hidden" name="type" value="f">
|
||||
<input type="hidden" name="type" value="{POST_FORUM_URL}">
|
||||
<input id="feed-id" type="hidden" name="id" value="">
|
||||
</form>
|
||||
|
||||
|
@ -15,7 +15,9 @@
|
||||
<tr>
|
||||
<td class="row1 pad_6">
|
||||
<p class="floatL"><b>{IP}</b></p>
|
||||
<!-- IF U_LOOKUP_IP -->
|
||||
<p class="floatR">[ <a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a> ] </p>
|
||||
<!-- ENDIF -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -24,7 +26,7 @@
|
||||
<!-- BEGIN userrow -->
|
||||
<tr>
|
||||
<td class="{userrow.ROW_CLASS} pad_4 nowrap">
|
||||
<p class="floatL" style="width: 160px;"><a href="{userrow.U_PROFILE}"><b>{userrow.USERNAME}</b></a></p>
|
||||
<p class="floatL" style="width: 160px;"><b>{userrow.USERNAME}</b></p>
|
||||
<p class="floatL">[ {L_POSTS}: {userrow.POSTS} ]</p>
|
||||
<p class="floatR">[ <a href="{userrow.U_SEARCHPOSTS}">{L_SEARCH_USER_POSTS_SHORT}</a> ] </p>
|
||||
</td>
|
||||
@ -38,7 +40,9 @@
|
||||
<td class="{iprow.ROW_CLASS} pad_4 nowrap">
|
||||
<p class="floatL" style="_width: 160px; min-width: 160px;">{iprow.IP}</p>
|
||||
<p class="floatL">[ {L_POSTS}: {iprow.POSTS} ]</p>
|
||||
<!-- IF iprow.U_LOOKUP_IP -->
|
||||
<p class="floatR">[ <a href="{iprow.U_LOOKUP_IP}">{L_LOOKUP_IP}</a> ] </p>
|
||||
<!-- ENDIF -->
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END iprow -->
|
||||
|
@ -53,7 +53,7 @@
|
||||
<!-- IF t.p.QUOTE --><a class="txtb" href="{QUOTE_URL}{t.p.POST_ID}">{QUOTE_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF t.p.EDIT --><a class="txtb" href="{EDIT_POST_URL}{t.p.POST_ID}">{EDIT_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF t.p.DELETE --><a class="txtb" href="{DELETE_POST_URL}{t.p.POST_ID}">{DELETE_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF t.p.IP --><a class="txtb" href="{IP_POST_URL}{t.p.POST_ID}&t={t.TOPIC_ID}">{IP_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF t.p.IP --><a class="txtb" href="{IP_POST_URL}{t.p.POST_ID}&{POST_TOPIC_URL}={t.TOPIC_ID}">{IP_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
@ -153,7 +153,7 @@ ajax.callback.mod_action = function (data) {
|
||||
|
||||
<div id="mod-action-content" style="display: none;">
|
||||
<form id="mod-action" method="post" action="modcp.php" class="tokenized">
|
||||
<input type="hidden" name="f" value="{FORUM_ID}" />
|
||||
<input type="hidden" name="{POST_FORUM_URL}" value="{FORUM_ID}" />
|
||||
<div class="floatL">
|
||||
<input type="checkbox" onclick="$('.topic-chbox').attr({ checked: this.checked }); if(this.checked){$('.tt-text').addClass('hl-tt');}else{$('.tt-text').removeClass('hl-tt');}" />
|
||||
<!-- IF TORRENTS -->
|
||||
|
@ -409,7 +409,7 @@ function build_poll_add_form (src_el)
|
||||
<p style="float: left;<!-- IF TEXT_BUTTONS --> padding: 4px 0 3px;<!-- ELSE --> padding-top: 5px;<!-- ENDIF -->">
|
||||
<!-- IF postrow.IS_UNREAD -->{MINIPOST_IMG_NEW}<!-- ELSE -->{MINIPOST_IMG}<!-- ENDIF -->
|
||||
<a class="small" href="{POST_URL}{postrow.POST_ID}#{postrow.POST_ID}" title="{L_POST_LINK}">{postrow.POST_DATE} | #{postrow.POST_NUMBER}</a>
|
||||
<!-- IF postrow.POSTER_AUTHOR and not postrow.POSTER_GUEST -->· <span>{L_AUTHOR}</span><!-- ENDIF -->
|
||||
<!-- IF postrow.POSTER_AUTHOR -->· <span>{L_AUTHOR}</span><!-- ENDIF -->
|
||||
<!-- IF postrow.POSTED_AFTER -->
|
||||
<span class="posted_since">({L_POSTED_AFTER} {postrow.POSTED_AFTER})</span>
|
||||
<!-- ENDIF -->
|
||||
@ -423,7 +423,7 @@ function build_poll_add_form (src_el)
|
||||
<!-- IF postrow.EDIT --><a class="txtb" href="<!-- IF $bb_cfg['use_ajax_posts'] -->" onclick="edit_post({postrow.POST_ID}, 'edit'); return false;<!-- ELSE -->{EDIT_POST_URL}{postrow.POST_ID}<!-- ENDIF -->">{EDIT_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF postrow.DELETE --><a class="txtb" href="<!-- IF $bb_cfg['use_ajax_posts'] -->" onclick="ajax.exec({ action: 'posts', post_id: {postrow.POST_ID}, topic_id : {TOPIC_ID}, type: 'delete'}); return false;<!-- ELSE -->{DELETE_POST_URL}{postrow.POST_ID}<!-- ENDIF -->">{DELETE_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF postrow.IS_FIRST_POST && $bb_cfg['show_post_bbcode_button'] --><a href="#" class="txtb" onclick="ajax.view_post('{postrow.POST_ID}'); return false;">{CODE_IMG}</a><!-- ENDIF -->
|
||||
<!-- IF postrow.IP --><a class="txtb" href="{IP_POST_URL}{postrow.POST_ID}&t={TOPIC_ID}">{IP_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF postrow.IP --><a class="txtb" href="{IP_POST_URL}{postrow.POST_ID}&{POST_TOPIC_URL}={TOPIC_ID}">{IP_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
<!-- IF AUTH_MOD -->
|
||||
<a class="menu-root menu-alt1 txtb" href="#mc_{postrow.POST_ID}">{MC_IMG}</a>{POST_BTN_SPACER}
|
||||
<!-- IF not IN_MODERATION --><a class="txtb" href="{PAGE_URL}&mod=1&start={PAGE_START}#{postrow.POST_ID}">{MOD_POST_IMG}</a>{POST_BTN_SPACER}<!-- ENDIF -->
|
||||
@ -593,7 +593,7 @@ function build_poll_add_form (src_el)
|
||||
<br>
|
||||
<form action="{QR_POST_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }">
|
||||
<input type="hidden" name="mode" value="reply" />
|
||||
<input type="hidden" name="t" value="{QR_TOPIC_ID}" />
|
||||
<input type="hidden" name="{POST_TOPIC_URL}" value="{QR_TOPIC_ID}" />
|
||||
|
||||
<table id="topic_quick_reply" class="topic" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
|
@ -358,8 +358,8 @@ if (!$ranks = $datastore->get('ranks')) {
|
||||
$topic_title = $wordCensor->censorString($topic_title);
|
||||
|
||||
// Post, reply and other URL generation for templating vars
|
||||
$new_topic_url = POSTING_URL . "?mode=newtopic&f=" . $forum_id;
|
||||
$reply_topic_url = POSTING_URL . "?mode=reply&t=" . $topic_id;
|
||||
$new_topic_url = POSTING_URL . "?mode=newtopic&" . POST_FORUM_URL . "=$forum_id";
|
||||
$reply_topic_url = POSTING_URL . "?mode=reply&" . POST_TOPIC_URL . "=$topic_id";
|
||||
$view_forum_url = FORUM_URL . $forum_id;
|
||||
$view_prev_topic_url = TOPIC_URL . $topic_id . "&view=previous#newest";
|
||||
$view_next_topic_url = TOPIC_URL . $topic_id . "&view=next#newest";
|
||||
@ -494,7 +494,7 @@ $template->assign_vars([
|
||||
'U_VIEW_NEWER_TOPIC' => $view_next_topic_url,
|
||||
'U_POST_NEW_TOPIC' => $new_topic_url,
|
||||
'U_POST_REPLY_TOPIC' => $reply_topic_url,
|
||||
'U_SEARCH_SELF' => "search.php?uid={$userdata['user_id']}&t=$topic_id&dm=1",
|
||||
'U_SEARCH_SELF' => "search.php?uid={$userdata['user_id']}&" . POST_TOPIC_URL . "=$topic_id&dm=1",
|
||||
|
||||
'TOPIC_HAS_POLL' => $topic_has_poll,
|
||||
'POLL_IS_EDITABLE' => !$poll_time_expired,
|
||||
|
Loading…
x
Reference in New Issue
Block a user