mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Compare commits
No commits in common. "master" and "v2.8.0" have entirely different histories.
20 changed files with 102 additions and 146 deletions
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
|
@ -43,3 +43,32 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: TorrentPier-master
|
name: TorrentPier-master
|
||||||
path: ${{ steps.create-zip.outputs.ZIP_NAME }}
|
path: ${{ steps.create-zip.outputs.ZIP_NAME }}
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: 🎉 Deploy
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: 🚚 Get latest code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: 🔩 Setup PHP
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
php-version: '8.2'
|
||||||
|
|
||||||
|
- name: 🖇 Install Composer dependencies
|
||||||
|
run: composer install --no-dev --no-progress --prefer-dist --optimize-autoloader
|
||||||
|
|
||||||
|
- name: 📂 Sync files
|
||||||
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.FTP_SERVER }}
|
||||||
|
username: ${{ secrets.FTP_USERNAME }}
|
||||||
|
password: ${{ secrets.FTP_PASSWORD }}
|
||||||
|
server-dir: ${{ secrets.FTP_DIR }}
|
||||||
|
protocol: ${{ secrets.FTP_PROTOCOL }}
|
||||||
|
port: ${{ secrets.FTP_PORT }}
|
||||||
|
exclude: |
|
||||||
|
**/.git*
|
||||||
|
**/.git*/**
|
||||||
|
.env
|
||||||
|
|
31
CHANGELOG.md
31
CHANGELOG.md
|
@ -2,37 +2,6 @@
|
||||||
|
|
||||||
# 📖 Change Log
|
# 📖 Change Log
|
||||||
|
|
||||||
## [v2.8.3](https://github.com/torrentpier/torrentpier/compare/v2.8.2..v2.8.3) (2025-07-03)
|
|
||||||
|
|
||||||
### 🚀 Features
|
|
||||||
|
|
||||||
- *(lang)* Added `RTL` languages support ([#2031](https://github.com/torrentpier/torrentpier/pull/2031)) - ([fd46d3d](https://github.com/torrentpier/torrentpier/commit/fd46d3d04ad3ab1453256b2ab620508e2ba33586))
|
|
||||||
- *(updater)* Added exceptions logging ([#2026](https://github.com/torrentpier/torrentpier/pull/2026)) - ([51f2c70](https://github.com/torrentpier/torrentpier/commit/51f2c70d81b910012cdecd111b5b92c1dfd0d6f6))
|
|
||||||
|
|
||||||
### 🚜 Refactor
|
|
||||||
|
|
||||||
- *(TorrentFileList)* Reduce duplication in root directory unset logic ([#2027](https://github.com/torrentpier/torrentpier/pull/2027)) - ([d4d8210](https://github.com/torrentpier/torrentpier/commit/d4d82101dd67c9f4cd86e0f6f909495696974354))
|
|
||||||
|
|
||||||
|
|
||||||
## [v2.8.2](https://github.com/torrentpier/torrentpier/compare/v2.8.1..v2.8.2) (2025-06-30)
|
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
|
||||||
|
|
||||||
- *(TorrentFileList)* Avoid `array_merge` reindexing for numeric folder names ([#2014](https://github.com/torrentpier/torrentpier/pull/2014)) - ([915e1d8](https://github.com/torrentpier/torrentpier/commit/915e1d817c61d2a4f0691b24ec1bc6577a9cd44b))
|
|
||||||
|
|
||||||
### 🚜 Refactor
|
|
||||||
|
|
||||||
- Use `DEFAULT_CHARSET` constant instead of hardcoded string ([#2011](https://github.com/torrentpier/torrentpier/pull/2011)) - ([7ac3359](https://github.com/torrentpier/torrentpier/commit/7ac335974baa44a8575bebb71ae2fbc0902d10e7))
|
|
||||||
|
|
||||||
|
|
||||||
## [v2.8.1](https://github.com/torrentpier/torrentpier/compare/v2.8.0..v2.8.1) (2025-06-24)
|
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
|
||||||
|
|
||||||
- *(filelist)* `Undefined property: FileTree::$length` when v2 torrent only ([#2004](https://github.com/torrentpier/torrentpier/pull/2004)) - ([7f4cc9d](https://github.com/torrentpier/torrentpier/commit/7f4cc9d3b9a5b87100f710cc60f636d6e7d5a34e))
|
|
||||||
- *(ip-api)* Add error handling and logging for freeipapi.com requests ([#2006](https://github.com/torrentpier/torrentpier/pull/2006)) - ([f1d6e74](https://github.com/torrentpier/torrentpier/commit/f1d6e74e5d4c74b6e12e9e742f60f62e71783d11))
|
|
||||||
|
|
||||||
|
|
||||||
## [v2.8.0](https://github.com/torrentpier/torrentpier/compare/v2.7.0..v2.8.0) (2025-06-21)
|
## [v2.8.0](https://github.com/torrentpier/torrentpier/compare/v2.7.0..v2.8.0) (2025-06-21)
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|
|
@ -90,7 +90,7 @@ if (isset($_GET['pane']) && $_GET['pane'] == 'left') {
|
||||||
'NEW_VERSION_SIZE' => $update_data['latest_version_size'],
|
'NEW_VERSION_SIZE' => $update_data['latest_version_size'],
|
||||||
'NEW_VERSION_DL_LINK' => $update_data['latest_version_dl_link'],
|
'NEW_VERSION_DL_LINK' => $update_data['latest_version_dl_link'],
|
||||||
'NEW_VERSION_LINK' => $update_data['latest_version_link'],
|
'NEW_VERSION_LINK' => $update_data['latest_version_link'],
|
||||||
'NEW_VERSION_HASH' => $update_data['latest_version_checksum']
|
'NEW_VERSION_MD5' => $update_data['latest_version_checksum']
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ $stopped = ($event === 'stopped');
|
||||||
|
|
||||||
// Check info_hash length
|
// Check info_hash length
|
||||||
if (strlen($info_hash) !== 20) {
|
if (strlen($info_hash) !== 20) {
|
||||||
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
|
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -257,7 +257,7 @@ if ($lp_info) {
|
||||||
|
|
||||||
// Verify if torrent registered on tracker and user authorized
|
// Verify if torrent registered on tracker and user authorized
|
||||||
if (empty($row['topic_id'])) {
|
if (empty($row['topic_id'])) {
|
||||||
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
|
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex));
|
||||||
}
|
}
|
||||||
if (empty($row['user_id'])) {
|
if (empty($row['user_id'])) {
|
||||||
msg_die('Please LOG IN and RE-DOWNLOAD this torrent (user not found)');
|
msg_die('Please LOG IN and RE-DOWNLOAD this torrent (user not found)');
|
||||||
|
|
|
@ -32,7 +32,7 @@ $info_hash_hex = bin2hex($info_hash);
|
||||||
|
|
||||||
// Check info_hash length
|
// Check info_hash length
|
||||||
if (strlen($info_hash) !== 20) {
|
if (strlen($info_hash) !== 20) {
|
||||||
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
|
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle multiple hashes
|
// Handle multiple hashes
|
||||||
|
@ -97,7 +97,7 @@ if (!empty($info_hash_count)) {
|
||||||
|
|
||||||
// Verify if torrent registered on tracker
|
// Verify if torrent registered on tracker
|
||||||
if (empty($torrents)) {
|
if (empty($torrents)) {
|
||||||
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
|
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex));
|
||||||
}
|
}
|
||||||
|
|
||||||
die(\Arokettu\Bencode\Bencode::encode($torrents));
|
die(\Arokettu\Bencode\Bencode::encode($torrents));
|
||||||
|
|
15
filelist.php
15
filelist.php
|
@ -82,7 +82,7 @@ if (IS_GUEST && $torrent->isPrivate()) {
|
||||||
|
|
||||||
// Get torrent files
|
// Get torrent files
|
||||||
$files = $torrent->$t_version_field()->$t_files_field();
|
$files = $torrent->$t_version_field()->$t_files_field();
|
||||||
if ($meta_v2) {
|
if ($meta_v1 && $meta_v2) {
|
||||||
$files = new \RecursiveIteratorIterator($files); // Flatten the list
|
$files = new \RecursiveIteratorIterator($files); // Flatten the list
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,6 +102,19 @@ foreach ($files as $file) {
|
||||||
$torrent_name = !empty($t_name = $torrent->getName()) ? str_short(htmlCHR($t_name), 200) : $lang['UNKNOWN'];
|
$torrent_name = !empty($t_name = $torrent->getName()) ? str_short(htmlCHR($t_name), 200) : $lang['UNKNOWN'];
|
||||||
$torrent_size = humn_size($row['size'], 2);
|
$torrent_size = humn_size($row['size'], 2);
|
||||||
|
|
||||||
|
// Get announcers list
|
||||||
|
$announcers_list = $torrent->getAnnounceList()->toArray();
|
||||||
|
$announcers_count = 0;
|
||||||
|
foreach ($announcers_list as $announcer) {
|
||||||
|
$announcers_count++;
|
||||||
|
$row_class = ($announcers_count % 2) ? 'row1' : 'row2';
|
||||||
|
$template->assign_block_vars('announcers', [
|
||||||
|
'ROW_NUMBER' => $announcers_count,
|
||||||
|
'ROW_CLASS' => $row_class,
|
||||||
|
'ANNOUNCER' => $announcer[0]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
// Output page
|
// Output page
|
||||||
$template->assign_vars([
|
$template->assign_vars([
|
||||||
'PAGE_TITLE' => "$torrent_name (" . $torrent_size . ")",
|
'PAGE_TITLE' => "$torrent_name (" . $torrent_size . ")",
|
||||||
|
|
|
@ -475,8 +475,6 @@ if ($tor_reged && $tor_info) {
|
||||||
if ($infoByIP = infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])) {
|
if ($infoByIP = infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])) {
|
||||||
if (!empty($infoByIP['countryCode'])) {
|
if (!empty($infoByIP['countryCode'])) {
|
||||||
$peerCountry = render_flag($infoByIP['countryCode'], false);
|
$peerCountry = render_flag($infoByIP['countryCode'], false);
|
||||||
} else {
|
|
||||||
$peerCountry = $lang['NOT_AVAILABLE'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,8 @@ $reserved_port = env('TP_PORT', 80);
|
||||||
$bb_cfg = [];
|
$bb_cfg = [];
|
||||||
|
|
||||||
// Version info
|
// Version info
|
||||||
$bb_cfg['tp_version'] = 'v2.8.3';
|
$bb_cfg['tp_version'] = 'v2.8.0';
|
||||||
$bb_cfg['tp_release_date'] = '03-07-2025';
|
$bb_cfg['tp_release_date'] = '21-06-2025';
|
||||||
$bb_cfg['tp_release_codename'] = 'Cattle';
|
$bb_cfg['tp_release_codename'] = 'Cattle';
|
||||||
|
|
||||||
// Increase version number after changing JS or CSS
|
// Increase version number after changing JS or CSS
|
||||||
|
@ -204,7 +204,6 @@ $bb_cfg['lang'] = [
|
||||||
'ar' => [
|
'ar' => [
|
||||||
'name' => 'Arabic',
|
'name' => 'Arabic',
|
||||||
'locale' => 'ar_SA.UTF-8',
|
'locale' => 'ar_SA.UTF-8',
|
||||||
'rtl' => true,
|
|
||||||
],
|
],
|
||||||
'hy' => [
|
'hy' => [
|
||||||
'name' => 'Armenian',
|
'name' => 'Armenian',
|
||||||
|
@ -281,7 +280,6 @@ $bb_cfg['lang'] = [
|
||||||
'he' => [
|
'he' => [
|
||||||
'name' => 'Hebrew',
|
'name' => 'Hebrew',
|
||||||
'locale' => 'he_IL.UTF-8',
|
'locale' => 'he_IL.UTF-8',
|
||||||
'rtl' => true,
|
|
||||||
],
|
],
|
||||||
'hi' => [
|
'hi' => [
|
||||||
'name' => 'Hindi',
|
'name' => 'Hindi',
|
||||||
|
|
|
@ -16,16 +16,9 @@ if (!config()->get('tp_updater_settings.enabled')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
$data[] = ['latest_check_timestamp' => TIMENOW];
|
|
||||||
|
|
||||||
try {
|
$updaterDownloader = new \TorrentPier\Updater();
|
||||||
$updaterDownloader = new \TorrentPier\Updater();
|
$updaterDownloader = $updaterDownloader->getLastVersion(config()->get('tp_updater_settings.allow_pre_releases'));
|
||||||
$updaterDownloader = $updaterDownloader->getLastVersion(config()->get('tp_updater_settings.allow_pre_releases'));
|
|
||||||
} catch (Exception $exception) {
|
|
||||||
bb_log('[Updater] Exception: ' . $exception->getMessage() . LOG_LF);
|
|
||||||
$this->store('check_updates', $data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$getVersion = \TorrentPier\Helpers\VersionHelper::removerPrefix($updaterDownloader['tag_name']);
|
$getVersion = \TorrentPier\Helpers\VersionHelper::removerPrefix($updaterDownloader['tag_name']);
|
||||||
$currentVersion = \TorrentPier\Helpers\VersionHelper::removerPrefix(config()->get('tp_version'));
|
$currentVersion = \TorrentPier\Helpers\VersionHelper::removerPrefix(config()->get('tp_version'));
|
||||||
|
@ -33,7 +26,6 @@ $currentVersion = \TorrentPier\Helpers\VersionHelper::removerPrefix(config()->ge
|
||||||
// Has update!
|
// Has update!
|
||||||
if (\z4kn4fein\SemVer\Version::greaterThan($getVersion, $currentVersion)) {
|
if (\z4kn4fein\SemVer\Version::greaterThan($getVersion, $currentVersion)) {
|
||||||
$latestBuildFileLink = $updaterDownloader['assets'][0]['browser_download_url'];
|
$latestBuildFileLink = $updaterDownloader['assets'][0]['browser_download_url'];
|
||||||
$SHAFileHash = $updaterDownloader['assets'][0]['digest'] ?? '';
|
|
||||||
|
|
||||||
// Check updater file
|
// Check updater file
|
||||||
$updaterFile = readUpdaterFile();
|
$updaterFile = readUpdaterFile();
|
||||||
|
@ -47,12 +39,10 @@ if (\z4kn4fein\SemVer\Version::greaterThan($getVersion, $currentVersion)) {
|
||||||
]), UPDATER_FILE, replace_content: true);
|
]), UPDATER_FILE, replace_content: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get MD5 / sha256 checksum
|
// Get MD5 checksum
|
||||||
$buildFileChecksum = '';
|
$buildFileChecksum = '';
|
||||||
if (!empty($SHAFileHash)) {
|
if (isset($latestBuildFileLink)) {
|
||||||
$buildFileChecksum = $SHAFileHash;
|
$buildFileChecksum = strtoupper(md5_file($latestBuildFileLink));
|
||||||
} else {
|
|
||||||
$buildFileChecksum = 'MD5: ' . strtoupper(md5_file($latestBuildFileLink));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build data array
|
// Build data array
|
||||||
|
@ -66,4 +56,5 @@ if (\z4kn4fein\SemVer\Version::greaterThan($getVersion, $currentVersion)) {
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data[] = ['latest_check_timestamp' => TIMENOW];
|
||||||
$this->store('check_updates', $data);
|
$this->store('check_updates', $data);
|
||||||
|
|
|
@ -2196,8 +2196,6 @@ function infoByIP(string $ipAddress, int $port = 0): array
|
||||||
}
|
}
|
||||||
|
|
||||||
$context = stream_context_create($contextOptions);
|
$context = stream_context_create($contextOptions);
|
||||||
|
|
||||||
try {
|
|
||||||
$response = file_get_contents(config()->get('ip2country_settings.endpoint') . $ipAddress, context: $context);
|
$response = file_get_contents(config()->get('ip2country_settings.endpoint') . $ipAddress, context: $context);
|
||||||
|
|
||||||
if ($response !== false) {
|
if ($response !== false) {
|
||||||
|
@ -2211,11 +2209,6 @@ function infoByIP(string $ipAddress, int $port = 0): array
|
||||||
'continentCode' => $json['continentCode']
|
'continentCode' => $json['continentCode']
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
bb_log("[FreeIPAPI] Failed to get IP info for: $ipAddress" . LOG_LF);
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
|
||||||
bb_log("[FreeIPAPI] " . $e->getMessage() . LOG_LF);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($data)) {
|
if (empty($data)) {
|
||||||
|
|
|
@ -117,7 +117,6 @@ $template->assign_vars([
|
||||||
'USER_HIDE_CAT' => (BB_SCRIPT == 'index'),
|
'USER_HIDE_CAT' => (BB_SCRIPT == 'index'),
|
||||||
|
|
||||||
'USER_LANG' => $userdata['user_lang'],
|
'USER_LANG' => $userdata['user_lang'],
|
||||||
'USER_LANG_DIRECTION' => (isset($bb_cfg['lang'][$userdata['user_lang']]['rtl']) && $bb_cfg['lang'][$userdata['user_lang']]['rtl'] === true) ? 'rtl' : 'ltr',
|
|
||||||
|
|
||||||
'INCLUDE_BBCODE_JS' => !empty($page_cfg['include_bbcode_js']),
|
'INCLUDE_BBCODE_JS' => !empty($page_cfg['include_bbcode_js']),
|
||||||
'USER_OPTIONS_JS' => IS_GUEST ? '{}' : json_encode($user->opt_js, JSON_THROW_ON_ERROR),
|
'USER_OPTIONS_JS' => IS_GUEST ? '{}' : json_encode($user->opt_js, JSON_THROW_ON_ERROR),
|
||||||
|
|
|
@ -142,7 +142,6 @@ switch ($mode) {
|
||||||
if (!$pr_data = DB()->fetch_row($sql)) {
|
if (!$pr_data = DB()->fetch_row($sql)) {
|
||||||
bb_die($lang['PROFILE_NOT_FOUND']);
|
bb_die($lang['PROFILE_NOT_FOUND']);
|
||||||
}
|
}
|
||||||
$pr_data['user_birthday'] = $pr_data['user_birthday']->format('Y-m-d');
|
|
||||||
if (IN_DEMO_MODE && isset($_COOKIE['user_lang'])) {
|
if (IN_DEMO_MODE && isset($_COOKIE['user_lang'])) {
|
||||||
$pr_data['user_lang'] = $_COOKIE['user_lang'];
|
$pr_data['user_lang'] = $_COOKIE['user_lang'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,8 +30,6 @@ if (!$profiledata = get_userdata($_GET[POST_USERS_URL], profile_view: true)) {
|
||||||
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
bb_die($lang['NO_USER_ID_SPECIFIED']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$profiledata['user_birthday'] = $profiledata['user_birthday']->format('Y-m-d');
|
|
||||||
|
|
||||||
if (!$ranks = $datastore->get('ranks')) {
|
if (!$ranks = $datastore->get('ranks')) {
|
||||||
$datastore->update('ranks');
|
$datastore->update('ranks');
|
||||||
$ranks = $datastore->get('ranks');
|
$ranks = $datastore->get('ranks');
|
||||||
|
|
|
@ -232,7 +232,6 @@ class User
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->data['user_birthday'] = $this->data['user_birthday']->format('Y-m-d');
|
|
||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,10 +53,8 @@ class TorrentFileList
|
||||||
$this->build_filelist_array();
|
$this->build_filelist_array();
|
||||||
|
|
||||||
if ($this->multiple) {
|
if ($this->multiple) {
|
||||||
if (isset($this->files_ary['/'])) {
|
|
||||||
if (!empty($this->files_ary['/'])) {
|
if (!empty($this->files_ary['/'])) {
|
||||||
$this->files_ary = $this->files_ary + $this->files_ary['/'];
|
$this->files_ary = array_merge($this->files_ary, $this->files_ary['/']);
|
||||||
}
|
|
||||||
unset($this->files_ary['/']);
|
unset($this->files_ary['/']);
|
||||||
}
|
}
|
||||||
$filelist = $html->array2html($this->files_ary);
|
$filelist = $html->array2html($this->files_ary);
|
||||||
|
|
|
@ -38,13 +38,6 @@ class Updater
|
||||||
*/
|
*/
|
||||||
public string $savePath;
|
public string $savePath;
|
||||||
|
|
||||||
/**
|
|
||||||
* LTS version pattern (v2.8.*)
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
private const LTS_VERSION_PATTERN = '/^v2\.8\.\d+$/';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stream context
|
* Stream context
|
||||||
*
|
*
|
||||||
|
@ -137,67 +130,23 @@ class Updater
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns information of latest TorrentPier LTS version (v2.8.*) available
|
* Returns information of latest TorrentPier version available
|
||||||
*
|
*
|
||||||
* @param bool $allowPreReleases
|
* @param bool $allowPreReleases
|
||||||
* @return array
|
* @return array
|
||||||
* @throws Exception
|
|
||||||
*/
|
*/
|
||||||
public function getLastVersion(bool $allowPreReleases = true): array
|
public function getLastVersion(bool $allowPreReleases = true): array
|
||||||
{
|
{
|
||||||
// Filter releases to get only LTS versions (v2.8.*)
|
|
||||||
$ltsVersions = array_filter($this->jsonResponse, function ($release) {
|
|
||||||
return preg_match(self::LTS_VERSION_PATTERN, $release['tag_name']);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (empty($ltsVersions)) {
|
|
||||||
throw new Exception('No LTS versions (v2.8.*) found');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sort LTS versions by version number (descending)
|
|
||||||
usort($ltsVersions, function ($a, $b) {
|
|
||||||
return version_compare($b['tag_name'], $a['tag_name']);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!$allowPreReleases) {
|
if (!$allowPreReleases) {
|
||||||
foreach ($ltsVersions as $release) {
|
foreach ($this->jsonResponse as $index) {
|
||||||
if (isset($release['prerelease']) && $release['prerelease']) {
|
if (isset($index['prerelease']) && $index['prerelease']) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
return $release;
|
|
||||||
|
return $index;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no stable LTS versions found
|
return $this->jsonResponse[0];
|
||||||
throw new Exception('No stable LTS versions (v2.8.*) found');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $ltsVersions[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all available LTS versions (v2.8.*)
|
|
||||||
*
|
|
||||||
* @param bool $allowPreReleases
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function getAllLTSVersions(bool $allowPreReleases = true): array
|
|
||||||
{
|
|
||||||
// Filter releases to get only LTS versions (v2.8.*)
|
|
||||||
$ltsVersions = array_filter($this->jsonResponse, function ($release) use ($allowPreReleases) {
|
|
||||||
$isLTSVersion = preg_match(self::LTS_VERSION_PATTERN, $release['tag_name']);
|
|
||||||
|
|
||||||
if (!$allowPreReleases && isset($release['prerelease']) && $release['prerelease']) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $isLTSVersion;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Sort LTS versions by version number (descending)
|
|
||||||
usort($ltsVersions, function ($a, $b) {
|
|
||||||
return version_compare($b['tag_name'], $a['tag_name']);
|
|
||||||
});
|
|
||||||
|
|
||||||
return array_values($ltsVersions);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!-- IF TPL_ADMIN_FRAMESET -->
|
<!-- IF TPL_ADMIN_FRAMESET -->
|
||||||
<!--========================================================================-->
|
<!--========================================================================-->
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html dir="{USER_LANG_DIRECTION}" lang="{USER_LANG}">
|
<html lang="{$bb_cfg['default_lang']}">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="{CONTENT_ENCODING}">
|
<meta charset="{CONTENT_ENCODING}">
|
||||||
<link rel="shortcut icon" href="{SITE_URL}favicon.png" type="image/x-icon">
|
<link rel="shortcut icon" href="{SITE_URL}favicon.png" type="image/x-icon">
|
||||||
|
@ -160,7 +160,7 @@
|
||||||
<!-- IF updater.UPDATE_AVAILABLE -->
|
<!-- IF updater.UPDATE_AVAILABLE -->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="row1" nowrap="nowrap" width="25%"><b>{L_UPDATE_AVAILABLE}:</b></td>
|
<td class="row1" nowrap="nowrap" width="25%"><b>{L_UPDATE_AVAILABLE}:</b></td>
|
||||||
<td class="row2"><b>{updater.NEW_VERSION_NUMBER}</b><!-- IF updater.NEW_VERSION_SIZE --> ({L_SIZE}: {updater.NEW_VERSION_SIZE})<!-- ENDIF --> · <a target="_blank" href="{updater.NEW_VERSION_DL_LINK}">{L_DOWNLOAD}</a> · <a target="_blank" href="{updater.NEW_VERSION_LINK}">{L_CHANGELOG}</a><!-- IF updater.NEW_VERSION_HASH --> · <span class="copyElement" data-clipboard-text="{updater.NEW_VERSION_HASH}" title="{L_COPY_TO_CLIPBOARD}">{updater.NEW_VERSION_HASH}</span><!-- ENDIF --></td>
|
<td class="row2"><b>{updater.NEW_VERSION_NUMBER}</b><!-- IF updater.NEW_VERSION_SIZE --> ({L_SIZE}: {updater.NEW_VERSION_SIZE})<!-- ENDIF --> · <a target="_blank" href="{updater.NEW_VERSION_DL_LINK}">{L_DOWNLOAD}</a> · <a target="_blank" href="{updater.NEW_VERSION_LINK}">{L_CHANGELOG}</a><!-- IF updater.NEW_VERSION_MD5 --> · <span class="copyElement" data-clipboard-text="{updater.NEW_VERSION_MD5}" title="{L_COPY_TO_CLIPBOARD}">MD5: {updater.NEW_VERSION_MD5}</span><!-- ENDIF --></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- END updater -->
|
<!-- END updater -->
|
||||||
|
|
|
@ -6,6 +6,30 @@
|
||||||
</ul>
|
</ul>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
|
<h1 class="pagetitle">{L_BT_FLIST_ANNOUNCERS_LIST}</h1>
|
||||||
|
<table class="forumline">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>{L_BT_FLIST_ANNOUNCERS}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<!-- BEGIN announcers -->
|
||||||
|
<tbody>
|
||||||
|
<tr class="{announcers.ROW_CLASS} tCenter">
|
||||||
|
<td>{announcers.ROW_NUMBER}</td>
|
||||||
|
<td>{announcers.ANNOUNCER}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<!-- END announcers -->
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td class="catBottom warnColor1" colspan="2">{L_BT_FLIST_ANNOUNCERS_NOTICE}</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
<br/>
|
||||||
|
|
||||||
<h1 class="pagetitle">{L_BT_FLIST}</h1>
|
<h1 class="pagetitle">{L_BT_FLIST}</h1>
|
||||||
<table class="forumline">
|
<table class="forumline">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html dir="{USER_LANG_DIRECTION}" lang="{USER_LANG}">
|
<html lang="{$bb_cfg['default_lang']}">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="{CONTENT_ENCODING}">
|
<meta charset="{CONTENT_ENCODING}">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
|
|
|
@ -565,7 +565,6 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
$poster_from = ($postrow[$i]['user_from'] && !$poster_guest) ? $postrow[$i]['user_from'] : '';
|
$poster_from = ($postrow[$i]['user_from'] && !$poster_guest) ? $postrow[$i]['user_from'] : '';
|
||||||
$poster_joined = !$poster_guest ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i') : '';
|
$poster_joined = !$poster_guest ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], 'Y-m-d H:i') : '';
|
||||||
$poster_longevity = !$poster_guest ? delta_time($postrow[$i]['user_regdate']) : '';
|
$poster_longevity = !$poster_guest ? delta_time($postrow[$i]['user_regdate']) : '';
|
||||||
$poster_birthday = $postrow[$i]['user_birthday']->format('Y-m-d');
|
|
||||||
$post_id = $postrow[$i]['post_id'];
|
$post_id = $postrow[$i]['post_id'];
|
||||||
$mc_type = (int)$postrow[$i]['mc_type'];
|
$mc_type = (int)$postrow[$i]['mc_type'];
|
||||||
$mc_comment = $postrow[$i]['mc_comment'];
|
$mc_comment = $postrow[$i]['mc_comment'];
|
||||||
|
@ -716,7 +715,7 @@ for ($i = 0; $i < $total_posts; $i++) {
|
||||||
'DELETE' => $delpost_btn,
|
'DELETE' => $delpost_btn,
|
||||||
'IP' => $ip_btn,
|
'IP' => $ip_btn,
|
||||||
|
|
||||||
'POSTER_BIRTHDAY' => user_birthday_icon($poster_birthday, $postrow[$i]['user_id']),
|
'POSTER_BIRTHDAY' => user_birthday_icon($postrow[$i]['user_birthday'], $postrow[$i]['user_id']),
|
||||||
|
|
||||||
'MC_COMMENT' => $mc_type ? bbcode2html($mc_comment) : '',
|
'MC_COMMENT' => $mc_type ? bbcode2html($mc_comment) : '',
|
||||||
'MC_BBCODE' => $mc_type ? $mc_comment : '',
|
'MC_BBCODE' => $mc_type ? $mc_comment : '',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue