Minor improvements (#1539)

* Minor improvements

* Update CHANGELOG.md

* Update thanks.php

* Updated
This commit is contained in:
Roman Kelesidis 2024-07-13 18:25:21 +07:00 committed by GitHub
commit faede91a14
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 40 additions and 5 deletions

View file

@ -18,7 +18,7 @@
- Hide in topic: Added country hiding [\#1535](https://github.com/torrentpier/torrentpier/pull/1535) ([belomaxorka](https://github.com/belomaxorka))
- Hide vote button in topic for guests [\#1507](https://github.com/torrentpier/torrentpier/pull/1507) ([belomaxorka](https://github.com/belomaxorka))
- Word censor code optimization [\#1537](https://github.com/torrentpier/torrentpier/pull/1537) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#1502](https://github.com/torrentpier/torrentpier/pull/1502), [\#1506](https://github.com/torrentpier/torrentpier/pull/1506), [\#1509](https://github.com/torrentpier/torrentpier/pull/1509), [\#1511](https://github.com/torrentpier/torrentpier/pull/1511), [\#1515](https://github.com/torrentpier/torrentpier/pull/1515), [\#1516](https://github.com/torrentpier/torrentpier/pull/1516), [\#1517](https://github.com/torrentpier/torrentpier/pull/1517), [\#1519](https://github.com/torrentpier/torrentpier/pull/1519), [\#1523](https://github.com/torrentpier/torrentpier/pull/1523), [\#1525](https://github.com/torrentpier/torrentpier/pull/1525), [\#1530](https://github.com/torrentpier/torrentpier/pull/1530), [\#1532](https://github.com/torrentpier/torrentpier/pull/1532), [\#1536](https://github.com/torrentpier/torrentpier/pull/1536) ([belomaxorka](https://github.com/belomaxorka))
- Minor improvements [\#1502](https://github.com/torrentpier/torrentpier/pull/1502), [\#1506](https://github.com/torrentpier/torrentpier/pull/1506), [\#1509](https://github.com/torrentpier/torrentpier/pull/1509), [\#1511](https://github.com/torrentpier/torrentpier/pull/1511), [\#1515](https://github.com/torrentpier/torrentpier/pull/1515), [\#1516](https://github.com/torrentpier/torrentpier/pull/1516), [\#1517](https://github.com/torrentpier/torrentpier/pull/1517), [\#1519](https://github.com/torrentpier/torrentpier/pull/1519), [\#1523](https://github.com/torrentpier/torrentpier/pull/1523), [\#1525](https://github.com/torrentpier/torrentpier/pull/1525), [\#1530](https://github.com/torrentpier/torrentpier/pull/1530), [\#1532](https://github.com/torrentpier/torrentpier/pull/1532), [\#1536](https://github.com/torrentpier/torrentpier/pull/1536), [\#1539](https://github.com/torrentpier/torrentpier/pull/1539) ([belomaxorka](https://github.com/belomaxorka))
- New Crowdin updates [\#1504](https://github.com/torrentpier/torrentpier/pull/1504), [\#1513](https://github.com/torrentpier/torrentpier/pull/1513) ([Exileum](https://github.com/Exileum))
## [v2.4.3](https://github.com/torrentpier/torrentpier/tree/v2.4.3) (2024-06-09)

View file

@ -46,6 +46,18 @@ switch ($mode) {
$columns = 'topic_id, user_id, time';
$values = "$topic_id, {$userdata['user_id']}, " . TIMENOW;
DB()->query('INSERT IGNORE INTO ' . BB_THX . " ($columns) VALUES ($values)");
DB()->query("
DELETE FROM " . BB_THX . "
WHERE user_id IN (
SELECT user_id FROM (
SELECT user_id
FROM " . BB_THX . "
WHERE topic_id = $topic_id
ORDER BY time ASC
LIMIT 1
) AS subquery
) AND (SELECT COUNT(*) FROM " . BB_THX . " WHERE topic_id = $topic_id) > 50;
");
break;
case 'get':
if (IS_GUEST && !$bb_cfg['tor_thanks_list_guests']) {

View file

@ -446,6 +446,15 @@ $bb_cfg['abuse_email'] = "abuse@$domain_name"; // abuse email (e.g. DMCA)
$bb_cfg['adv_email'] = "adv@$domain_name"; // advertisement email
// Error reporting
$bb_cfg['whoops'] = [
'error_message' => 'Sorry, something went wrong. Drink coffee and come back after some time... ☕️',
'blacklist' => [
'_COOKIE' => array_keys($_COOKIE),
'_SERVER' => array_keys($_SERVER),
'_ENV' => array_keys($_ENV),
]
];
$bb_cfg['bugsnag'] = [
'enabled' => true,
'api_key' => '33b3ed0102946bab71341f9edc125e21', // Don't change this if you want to help us find bugs

View file

@ -1693,6 +1693,7 @@ $lang['FILELIST'] = 'Filelist';
$lang['COLLAPSE'] = 'Collapse directory';
$lang['EXPAND'] = 'Expand';
$lang['SWITCH'] = 'Switch';
$lang['TOGGLE_WINDOW_FULL_SIZE'] = 'Increase/smart window';
$lang['EMPTY_ATTACH_ID'] = 'Missing file identifier!';
$lang['TOR_NOT_FOUND'] = 'File is missing on the server!';
$lang['ERROR_BUILD'] = 'The content of this torrent file can not be viewed on the site (it was not possible to build a list of files)';

View file

@ -58,7 +58,7 @@ class Dev
*/
public function __construct()
{
$this->envType = env('APP_ENV', 'production');
$this->envType = strtolower(env('APP_ENV', 'production'));
$this->whoops = new Run;
switch ($this->envType) {
@ -128,7 +128,8 @@ class Dev
private function getWhoopsProduction(): void
{
$this->whoops->pushHandler(function () {
echo 'Sorry, something went wrong. Drink coffee and come back after some time... ☕️';
global $bb_cfg;
echo $bb_cfg['whoops']['error_message'];
});
}
@ -139,10 +140,18 @@ class Dev
*/
private function getWhoops(): void
{
global $bb_cfg;
/**
* Show errors on page
*/
$this->whoops->pushHandler(new PrettyPageHandler);
$prettyPageHandler = new PrettyPageHandler();
foreach ($bb_cfg['whoops']['blacklist'] as $key => $secrets) {
foreach ($secrets as $secret) {
$prettyPageHandler->blacklist($key, $secret);
}
}
$this->whoops->pushHandler($prettyPageHandler);
/**
* Show log in browser console

View file

@ -347,6 +347,7 @@ $('#tor-filelist-btn').click(function () {
margin: 0 2px; padding: 8px 6px;
max-height: 284px; overflow: auto;
}
.tor-filelist-fullsize { max-height: unset !important; }
#tor-filelist i { color: #7A7A7A; padding-left: 4px; }
#tor-filelist s { color: #0000FF; text-decoration: none; }
#tor-filelist .b > s { color: #800000; }
@ -363,9 +364,12 @@ $('#tor-filelist-btn').click(function () {
<table class="w100 borderless" cellspacing="0" cellpadding="0">
<tr>
<td>
<div id="tor-fl-treecontrol">
<div style="float: left;" id="tor-fl-treecontrol">
<a href="#">{L_COLLAPSE}</a>&middot;<a href="#">{L_EXPAND}</a>&middot;<a href="#">{L_SWITCH}</a>
</div>
<div style="float: right; padding: 2px 0 4px;">
<a style="padding: 0 8px; font-size: 11px; text-decoration: none;" href="#" onclick="$('#tor-filelist').toggleClass('tor-filelist-fullsize'); return false;">{L_TOGGLE_WINDOW_FULL_SIZE}</a>
</div>
</td>
</tr>
<tr>