Minor improvements (#1484)

* Minor improvements

* Update CHANGELOG.md

* Update modcp.php

* Update modcp_split.tpl

* Update main.php

* Update viewtopic.tpl

* Update CHANGELOG.md

* Update Emailer.php

* Updated

* Update common.php
This commit is contained in:
Roman Kelesidis 2024-06-04 17:08:27 +07:00 committed by GitHub
commit bf9536dece
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 31 additions and 35 deletions

View file

@ -19,8 +19,8 @@
- Demo mode: Allow registering torrents by default [\#1440](https://github.com/torrentpier/torrentpier/pull/1440) ([belomaxorka](https://github.com/belomaxorka))
- Temp: Removed showing forum description in `viewforum.php` [\#1465](https://github.com/torrentpier/torrentpier/pull/1465) ([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), [\#1458](https://github.com/torrentpier/torrentpier/pull/1458), [\#1461](https://github.com/torrentpier/torrentpier/pull/1461), [\#1462](https://github.com/torrentpier/torrentpier/pull/1462), [\#1467](https://github.com/torrentpier/torrentpier/pull/1467), [\#1469](https://github.com/torrentpier/torrentpier/pull/1469), [\#1472](https://github.com/torrentpier/torrentpier/pull/1472), [\#1477](https://github.com/torrentpier/torrentpier/pull/1477), [\#1480](https://github.com/torrentpier/torrentpier/pull/1480), [\#1481](https://github.com/torrentpier/torrentpier/pull/1481), [\#1482](https://github.com/torrentpier/torrentpier/pull/1482) ([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))
- 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), [\#1461](https://github.com/torrentpier/torrentpier/pull/1461), [\#1462](https://github.com/torrentpier/torrentpier/pull/1462), [\#1467](https://github.com/torrentpier/torrentpier/pull/1467), [\#1469](https://github.com/torrentpier/torrentpier/pull/1469), [\#1472](https://github.com/torrentpier/torrentpier/pull/1472), [\#1477](https://github.com/torrentpier/torrentpier/pull/1477), [\#1480](https://github.com/torrentpier/torrentpier/pull/1480), [\#1481](https://github.com/torrentpier/torrentpier/pull/1481), [\#1482](https://github.com/torrentpier/torrentpier/pull/1482), [\#1484](https://github.com/torrentpier/torrentpier/pull/1484) ([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), [\#1485](https://github.com/torrentpier/torrentpier/pull/1485), [\#1486](https://github.com/torrentpier/torrentpier/pull/1486) ([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), [\#1468](https://github.com/torrentpier/torrentpier/pull/1468), [\#1473](https://github.com/torrentpier/torrentpier/pull/1473), [\#1476](https://github.com/torrentpier/torrentpier/pull/1476), [\#1479](https://github.com/torrentpier/torrentpier/pull/1479) ([Exileum](https://github.com/Exileum))
## [v2.4.2](https://github.com/torrentpier/torrentpier/tree/v2.4.2) (2024-03-30)

View file

@ -172,15 +172,18 @@ switch ($bb_cfg['datastore_type']) {
$datastore = new TorrentPier\Legacy\Datastore\File($bb_cfg['cache']['db_dir'] . 'datastore/', $bb_cfg['cache']['prefix']);
}
if (CHECK_REQIREMENTS['status'] && !CACHE('bb_cache')->get('system_req')) {
/**
* Check system requirements
*/
if (CHECK_REQUIREMENTS['status'] && !CACHE('bb_cache')->get('system_req')) {
// [1] Check PHP Version
if (!\TorrentPier\Helpers\IsHelper::isPHP(CHECK_REQIREMENTS['php_min_version'])) {
die("TorrentPier requires PHP version " . CHECK_REQIREMENTS['php_min_version'] . "+ Your PHP version " . PHP_VERSION);
if (!\TorrentPier\Helpers\IsHelper::isPHP(CHECK_REQUIREMENTS['php_min_version'])) {
die("TorrentPier requires PHP version " . CHECK_REQUIREMENTS['php_min_version'] . "+ Your PHP version " . PHP_VERSION);
}
// [2] Check installed PHP Extensions on server
$data = [];
foreach (CHECK_REQIREMENTS['ext_list'] as $ext) {
foreach (CHECK_REQUIREMENTS['ext_list'] as $ext) {
if (!extension_loaded($ext)) {
$data[] = '<code style="background:#222;color:#00e01f;padding:2px 6px;border-radius:3px;">' . $ext . '</code>';
}

View file

@ -33,7 +33,7 @@ define('APP_NAME', 'TorrentPier');
define('UPDATER_URL', 'https://api.github.com/repos/torrentpier/torrentpier/releases/latest');
define('UPDATER_FILE', INT_DATA_DIR . '/updater.ver');
define('API_IP_URL', 'https://freeipapi.com/api/json/');
define('CHECK_REQIREMENTS', [
define('CHECK_REQUIREMENTS', [
'status' => true,
'php_min_version' => '8.1.0',
'ext_list' => [

View file

@ -1115,7 +1115,7 @@ $lang['COUNTRIES'] = [
'KZ' => 'Kazakhstan',
'LA' => 'Laos (Lao People\'s Democratic Republic)',
'LB' => 'Lebanon',
'LGBT' => 'Pride flag 🏳️‍🌈',
'LGBT' => 'Pride flag', // __ //
'LC' => 'Saint Lucia',
'LI' => 'Liechtenstein',
'LK' => 'Sri Lanka',
@ -1162,7 +1162,7 @@ $lang['COUNTRIES'] = [
'NZ' => 'New Zealand',
'OM' => 'Oman',
'PA' => 'Panama',
'PACE' => 'Peace flag 🕊',
'PACE' => 'Peace flag', // __ //
'PE' => 'Peru',
'PF' => 'French Polynesia',
'PG' => 'Papua New Guinea',

View file

@ -519,7 +519,7 @@ switch ($mode) {
$msg = $result ? $lang['DELETE_POSTS_SUCCESFULLY'] : $lang['NO_POSTS_REMOVED'];
bb_die(return_msg_mcp($msg));
} else {
$sql = "SELECT u.username, p.*, pt.post_text, p.post_username
$sql = "SELECT u.username, u.user_rank, p.*, pt.post_text, p.post_username
FROM " . BB_POSTS . " p, " . BB_USERS . " u, " . BB_POSTS_TEXT . " pt
WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id
@ -562,7 +562,7 @@ switch ($mode) {
$template->assign_block_vars('postrow', [
'ROW_CLASS' => $row_class,
'POSTER_NAME' => $poster,
'POSTER_NAME' => profile_url(['username' => $poster, 'user_id' => $poster_id, 'user_rank' => $postrow[$i]['user_rank']]),
'POST_DATE' => $post_date,
'MESSAGE' => $message,
'CHECKBOX' => defined('BEGIN_CHECKBOX'),

View file

@ -142,23 +142,16 @@ class Emailer
if ($bb_cfg['emailer']['smtp']['enabled']) {
if (!empty($bb_cfg['emailer']['smtp']['host'])) {
if (empty($bb_cfg['emailer']['smtp']['ssl_type'])) {
/** @var EsmtpTransport $transport external SMTP without SSL */
$transport = (new EsmtpTransport(
$bb_cfg['emailer']['smtp']['host'],
$bb_cfg['emailer']['smtp']['port']
))
->setUsername($bb_cfg['emailer']['smtp']['username'])
->setPassword($bb_cfg['emailer']['smtp']['password']);
} else {
/** @var EsmtpTransport $transport external SMTP with SSL */
$transport = (new EsmtpTransport(
$bb_cfg['emailer']['smtp']['host'],
$bb_cfg['emailer']['smtp']['port'],
$bb_cfg['emailer']['smtp']['ssl_type']
))
->setUsername($bb_cfg['emailer']['smtp']['username'])
->setPassword($bb_cfg['emailer']['smtp']['password']);
$bb_cfg['emailer']['smtp']['ssl_type'] = null;
}
/** @var EsmtpTransport $transport external SMTP with SSL */
$transport = (new EsmtpTransport(
$bb_cfg['emailer']['smtp']['host'],
$bb_cfg['emailer']['smtp']['port'],
$bb_cfg['emailer']['smtp']['ssl_type']
))
->setUsername($bb_cfg['emailer']['smtp']['username'])
->setPassword($bb_cfg['emailer']['smtp']['password']);
} else {
$transport = new EsmtpTransport('localhost', 25);
}

View file

@ -60,9 +60,9 @@ function toggle_cbox (cb_id, tr_id)
<!-- //bot end -->
<tr>
<td colspan="2" class="catBottom">
<input type="submit" name="delete_posts" value="{L_DELETE_POSTS}" style="width: 140px;">
<input type="submit" name="split_type_all" value="{L_SPLIT_POSTS}" style="width: 215px;">
<input type="submit" name="split_type_beyond" value="{L_SPLIT_AFTER}" style="width: 280px;">
<input type="submit" name="delete_posts" value="{L_DELETE_POSTS}">
<input type="submit" name="split_type_all" value="{L_SPLIT_POSTS}">
<input type="submit" name="split_type_beyond" value="{L_SPLIT_AFTER}">
</td>
</tr>
</table>
@ -91,9 +91,9 @@ function toggle_cbox (cb_id, tr_id)
<tr>
<td class="catBottom" colspan="3">
<input type="hidden" name="confirm" value="1">
<input class="liteoption" type="submit" name="delete_posts" value="{L_DELETE_POSTS}" style="width: 140px;">
<input class="liteoption" type="submit" name="split_type_all" value="{L_SPLIT_POSTS}" style="width: 210px;">
<input class="liteoption" type="submit" name="split_type_beyond" value="{L_SPLIT_AFTER}" style="width: 270px;">
<input class="liteoption" type="submit" name="delete_posts" value="{L_DELETE_POSTS}">
<input class="liteoption" type="submit" name="split_type_all" value="{L_SPLIT_POSTS}">
<input class="liteoption" type="submit" name="split_type_beyond" value="{L_SPLIT_AFTER}">
{S_HIDDEN_FIELDS}
</td>
</tr>

View file

@ -244,7 +244,7 @@ function build_poll_add_form (src_el)
<div class="med" style="margin-top: 4px;">{L_NEW_POLL_M_VOTES}:</div>
<textarea id="poll-votes-inp" rows="8" cols="10" wrap="off" class="gen" style="width: 550px;"></textarea>
<div class="med mrg_4"><i>{L_NEW_POLL_M_EXPLAIN}: {$bb_cfg['max_poll_options']})</i></div>
<div class="mrg_8 tCenter"><input onclick="window.location.reload();" type="button" class="bold" value="{L_CANCEL}" />&nbsp;&nbsp;<input id="poll-edit-submit-btn" type="button" value="{L_SUBMIT}" class="bold" style="width: 100px;" /></div>
<div class="mrg_8 tCenter"><input onclick="window.location.reload();" type="button" class="bold" value="{L_CANCEL}" />&nbsp;&nbsp;<input id="poll-edit-submit-btn" type="button" value="{L_SUBMIT}" class="bold" /></div>
</fieldset>
</td></tr></table>
</div>

View file

@ -498,7 +498,7 @@ $template->assign_vars([
'TOPIC_HAS_POLL' => $topic_has_poll,
'POLL_IS_EDITABLE' => !$poll_time_expired,
'POLL_IS_FINISHED' => ($t_data['topic_vote'] == POLL_FINISHED),
'POLL_IS_FINISHED' => ($topic_has_poll == POLL_FINISHED),
'CAN_MANAGE_POLL' => $can_manage_poll,
'CAN_ADD_POLL' => $can_add_poll
]);