Added "Random release" button in tracker.php (#1334)

* Added "Random release" button in tracker.php

* Updated

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-01-23 18:46:48 +07:00 committed by GitHub
commit 15a5ae7b2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 14 additions and 2 deletions

View file

@ -7,6 +7,7 @@
- Release 2.4.1 🦉 ([belomaxorka](https://github.com/belomaxorka), [kovalensky](https://github.com/kovalensky))
- Added `bt_announce_url` autofill [\#1331](https://github.com/torrentpier/torrentpier/pull/1331) ([belomaxorka](https://github.com/belomaxorka))
- Added "Random release" button in tracker.php [\#1334](https://github.com/torrentpier/torrentpier/pull/1334) ([belomaxorka](https://github.com/belomaxorka))
- Added support for fastly cdn [\#1327](https://github.com/torrentpier/torrentpier/pull/1327) ([belomaxorka](https://github.com/belomaxorka), [kovalensky](https://github.com/kovalensky))
- Use constants instead of string literals [\#1332](https://github.com/torrentpier/torrentpier/pull/1332) ([belomaxorka](https://github.com/belomaxorka))
- Use `target="_blank"` in admin for profile_url() redirects [\#1330](https://github.com/torrentpier/torrentpier/pull/1330) ([belomaxorka](https://github.com/belomaxorka))

View file

@ -8,7 +8,7 @@
"torrent",
"tracker"
],
"homepage": "https://torrentpier.com",
"homepage": "https://github.com/torrentpier",
"license": "MIT",
"authors": [
{

View file

@ -1279,6 +1279,7 @@ $lang['BONUS_NOT_SUCCES'] = '<span class="leech">You do not have bonuses availab
$lang['BONUS_RETURN'] = 'Return to the seed bonus exchange';
$lang['TRACKER'] = 'Tracker';
$lang['RANDOM_RELEASE'] = 'Random release';
$lang['OPEN_TOPICS'] = 'Open topics';
$lang['OPEN_IN_SAME_WINDOW'] = 'open in same window';
$lang['SHOW_TIME_TOPICS'] = 'show time of the creation topics';

View file

@ -62,7 +62,7 @@ ajax.callback.view_post = function(data) {
<!-- ENDIF / AJAX_TOPICS -->
<a name="start"></a>
<h1 class="pagetitle">{PAGE_TITLE}</h1>
<h1 class="pagetitle">{PAGE_TITLE}&nbsp;&middot;&nbsp;<a href="{U_TRACKER}?random_release=1">{L_RANDOM_RELEASE}</a></h1>
<div class="nav">
<p class="floatL"><a href="{U_INDEX}">{T_INDEX}</a></p>

View file

@ -297,6 +297,16 @@ if (isset($_GET[$user_releases_key])) {
}
}
// Random release
if (isset($_GET['random_release'])) {
if ($random_release = DB()->fetch_row("SELECT topic_id FROM " . BB_BT_TORRENTS . " WHERE tor_status NOT IN(" . implode(', ', array_keys($bb_cfg['tor_frozen'])) . ") ORDER BY RAND() LIMIT 1")) {
redirect(TOPIC_URL . $random_release['topic_id']);
unset($random_release);
} else {
bb_die($lang['NO_MATCH']);
}
}
// Restore torrents list and search settings if we have valid $search_id
$tor_list_ary = [];
$tor_list_sql = '';