From 3488c9cc28490ee8a5adfb03c1908b6a23def899 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Fri, 28 Jun 2024 12:38:43 +0700 Subject: [PATCH] Minor improvements (#1525) * Minor improvements * Update posting_tpl.tpl * Update CHANGELOG.md * Updated * Update clean_pm.php * Update mysql.sql * Update mysql.sql * Update mysql.sql * Update mysql.sql * Update mysql.sql --- CHANGELOG.md | 2 +- admin/admin_bt_forum_cfg.php | 2 +- install/sql/mysql.sql | 2 +- library/ajax/edit_user_profile.php | 9 ------- library/includes/cron/jobs/clean_pm.php | 24 ++++++++++++++++++- library/includes/torrent_announce_urls.php | 2 +- .../templates/default/usercp_viewprofile.tpl | 10 ++++---- styles/templates/posting_tpl.tpl | 4 ++-- 8 files changed, 33 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c2c35ed6..10512eb47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ - Some security improvements 🔑 [\#1503](https://github.com/torrentpier/torrentpier/pull/1503), [\#1505](https://github.com/torrentpier/torrentpier/pull/1505) ([belomaxorka](https://github.com/belomaxorka)) - Some improvements for integrity checker [\#1501](https://github.com/torrentpier/torrentpier/pull/1501) ([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)) -- 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) ([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) ([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) diff --git a/admin/admin_bt_forum_cfg.php b/admin/admin_bt_forum_cfg.php index 1068b7d0d..516708d8a 100644 --- a/admin/admin_bt_forum_cfg.php +++ b/admin/admin_bt_forum_cfg.php @@ -26,7 +26,7 @@ $cfg = []; * All config names with default values */ $default_cfg_str = array( - 'bt_announce_url' => 'http://demo.torrentpier.com/bt/', + 'bt_announce_url' => 'https://torrentpier.duckdns.org/bt/', ); $default_cfg_bool = array( diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index df99ec3d7..9904731bf 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -997,7 +997,7 @@ CREATE TABLE IF NOT EXISTS `bb_posts_text` -- ---------------------------- INSERT INTO `bb_posts_text` VALUES ('1', - 'Thank you for installing the new — TorrentPier Cattle!\n\nWhat to do next? First of all configure your site in the administration panel (link in the bottom).\n\nChange main options: site description, number of messages per topic, time zone, language by default, seed-bonus options, birthdays etc... Create a couple of forums, delete or change this one. Change settings of categories to allow registration of torrents, change announcer url. If you will have questions or want additional modifications of the engine, [url=https://torrentpier.com/]visit our forum[/url] (you can use english, we will try to help in any case).\n\nIf you want to help with the translations: [url=https://crowdin.com/project/torrentpier]Crowdin[/url].\n\nWe are sure that you will be able to create the best tracker available.\nGood luck!'); + 'Thank you for installing the new — TorrentPier Cattle!\n\nWhat to do next? First of all configure your site in the administration panel (link in the bottom).\n\nChange main options: site description, number of messages per topic, time zone, language by default, seed-bonus options, birthdays etc... Create a couple of forums, delete or change this one. Change settings of categories to allow registration of torrents, change announcer url. If you will have questions or want additional modifications of the engine, [url=https://torrentpier.com/]visit our forum[/url] (you can use english, we will try to help in any case).\n\nIf you want to help with the translations: [url=https://crowdin.com/project/torrentpier]Crowdin[/url].\n\nOur GitHub organization: [url=https://github.com/torrentpier]https://github.com/torrentpier[/url].\nOur SourceForge repository: [url=https://sourceforge.net/projects/torrentpier-engine]https://sourceforge.net/projects/torrentpier-engine[/url].\nOur demo website: [url=https://torrentpier.duckdns.org]https://torrentpier.duckdns.org[/url].\n\nWe are sure that you will be able to create the best tracker available!\nGood luck! 😉'); -- ---------------------------- -- Table structure for `bb_privmsgs` diff --git a/library/ajax/edit_user_profile.php b/library/ajax/edit_user_profile.php index 886e9f242..17cf223be 100644 --- a/library/ajax/edit_user_profile.php +++ b/library/ajax/edit_user_profile.php @@ -109,15 +109,6 @@ switch ($field) { $this->response['new_value'] = htmlCHR($value); break; - case 'user_regdate': - case 'user_lastvisit': - $tz = TIMENOW + (3600 * $bb_cfg['board_timezone']); - if (($value = strtotime($value, $tz)) < $bb_cfg['board_startdate'] or $value > TIMENOW) { - $this->ajax_die($lang['INVALID_DATE'] . $this->request['value']); - } - $this->response['new_value'] = bb_date($value, 'Y-m-d H:i', false); - break; - case 'u_up_total': case 'u_down_total': case 'u_up_release': diff --git a/library/includes/cron/jobs/clean_pm.php b/library/includes/cron/jobs/clean_pm.php index f0d0eef7b..788c920ff 100644 --- a/library/includes/cron/jobs/clean_pm.php +++ b/library/includes/cron/jobs/clean_pm.php @@ -14,5 +14,27 @@ if (!defined('BB_ROOT')) { $pm_days_keep = (int)$bb_cfg['pm_days_keep']; if ($pm_days_keep !== 0) { - DB()->query("DELETE FROM " . BB_PRIVMSGS . " WHERE privmsgs_date < " . (TIMENOW - 86400 * $pm_days_keep)); + $per_cycle = 20000; + $row = DB()->fetch_row("SELECT MIN(privmsgs_id) AS start_id, MAX(privmsgs_id) AS finish_id FROM " . BB_PRIVMSGS); + $start_id = (int)$row['start_id']; + $finish_id = (int)$row['finish_id']; + + while (true) { + set_time_limit(600); + $end_id = $start_id + $per_cycle - 1; + + DB()->query(" + DELETE pm, pmt + FROM " . BB_PRIVMSGS . " pm + LEFT JOIN " . BB_PRIVMSGS_TEXT . " pmt ON(pmt.privmsgs_text_id = pm.privmsgs_id) + WHERE pm.privmsgs_id BETWEEN $start_id AND $end_id + AND pm.privmsgs_date < " . (TIMENOW - 86400 * $pm_days_keep) . " + "); + + if ($end_id > $finish_id) { + break; + } + + $start_id += $per_cycle; + } } diff --git a/library/includes/torrent_announce_urls.php b/library/includes/torrent_announce_urls.php index c32f10b4e..9535389be 100644 --- a/library/includes/torrent_announce_urls.php +++ b/library/includes/torrent_announce_urls.php @@ -17,7 +17,7 @@ $announce_urls = $additional_announce_urls = []; // Allowed Announcer URLs // ------------------------------------------------------------------------------------------------------------------------------ // Examples: -// $announce_urls[] = 'http://demo.torrentpier.com/bt/announce.php'; +// $announce_urls[] = 'https://torrentpier.duckdns.org/bt/announce.php'; // $announce_urls[] = 'http://tracker.openbittorrent.com:80/announce'; // $announce_urls[] = 'udp://tracker.openbittorrent.com:6969/announce'; // ------------------------------------------------------------------------------------------------------------------------------ diff --git a/styles/templates/default/usercp_viewprofile.tpl b/styles/templates/default/usercp_viewprofile.tpl index 7a428e972..0d2634b7b 100644 --- a/styles/templates/default/usercp_viewprofile.tpl +++ b/styles/templates/default/usercp_viewprofile.tpl @@ -72,8 +72,6 @@ {action: "edit_user_profile", id: "username"} {action: "edit_user_profile", id: "user_email"} -{action: "edit_user_profile", id: "user_regdate"} -{action: "edit_user_profile", id: "user_lastvisit"} {action: "edit_user_profile", id: "user_website"} {action: "edit_user_profile", id: "user_occ"} {action: "edit_user_profile", id: "user_interests"} @@ -321,8 +319,8 @@ ajax.callback.index_data = function(data) { {L_JOINED}: - - {USER_REGDATE} + + {USER_REGDATE} [ {L_MANAGE_USER} ]