From 3fe14dff0a903ceebef9d0707fc1fe50845dd13f Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 15 Jun 2023 16:40:52 +0700 Subject: [PATCH] Fixed $bb_cfg['pm_days_keep'] (#180) * Fixed $bb_cfg['pm_days_keep'] * Update CHANGELOG.md --- CHANGELOG.md | 1 + install/sql/mysql.sql | 43 +++++++++++++------------ install/upgrade/changes.txt | 1 + library/config.php | 2 +- library/includes/cron/jobs/clean_pm.php | 10 ++++++ 5 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 library/includes/cron/jobs/clean_pm.php diff --git a/CHANGELOG.md b/CHANGELOG.md index d87d078a..ff703ab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ **Merged pull requests:** - Release v2.1.5-2023.06 πŸŽ‰ +- Fixed $bb_cfg['pm_days_keep'] [\#180](https://github.com/torrentpier/torrentpier-lts/pull/180) ([belomaxorka](https://github.com/belomaxorka)) - IP storage bugfix [\#177](https://github.com/torrentpier/torrentpier-lts/pull/177) ([belomaxorka](https://github.com/belomaxorka)) - Minor improvements [\#172](https://github.com/torrentpier/torrentpier-lts/pull/172), [\#175](https://github.com/torrentpier/torrentpier-lts/pull/175), [\#176](https://github.com/torrentpier/torrentpier-lts/pull/176), [\#178](https://github.com/torrentpier/torrentpier-lts/pull/178), [\#179](https://github.com/torrentpier/torrentpier-lts/pull/179) ([belomaxorka](https://github.com/belomaxorka)) - Fixed empty user search box [\#171](https://github.com/torrentpier/torrentpier-lts/pull/171) ([belomaxorka](https://github.com/belomaxorka)) diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index dd91625d..4f62a3d6 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -560,27 +560,28 @@ CREATE TABLE IF NOT EXISTS `bb_cron` ( -- ---------------------------- -- Records of bb_cron -- ---------------------------- -INSERT INTO `bb_cron` VALUES ('', '1', 'Attach maintenance', 'attach_maintenance.php', 'daily', '', '05:00:00', '40', '', '', '', '1', '', '0', '1', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Board maintenance', 'board_maintenance.php', 'daily', '', '05:00:00', '40', '', '', '', '1', '', '0', '1', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Prune forums', 'prune_forums.php', 'daily', '', '05:00:00', '50', '', '', '', '1', '', '0', '1', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Prune topic moved stubs', 'prune_topic_moved.php', 'daily', '', '05:00:00', '60', '', '', '', '1', '', '0', '1', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Logs cleanup', 'clean_log.php', 'daily', '', '05:00:00', '70', '', '', '', '1', '', '0', '1', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Tracker maintenance', 'tr_maintenance.php', 'daily', '', '05:00:00', '90', '', '', '', '1', '', '0', '1', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Clean dlstat', 'clean_dlstat.php', 'daily', '', '05:00:00', '100', '', '', '', '1', '', '0', '1', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Prune inactive users', 'prune_inactive_users.php', 'daily', '', '05:00:00', '110', '', '', '', '1', '', '0', '1', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Sessions cleanup', 'sessions_cleanup.php', 'interval', '', '', '255', '', '', '00:03:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'DS update cat_forums', 'ds_update_cat_forums.php', 'interval', '', '', '255', '', '', '00:05:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'DS update stats', 'ds_update_stats.php', 'interval', '', '', '255', '', '', '00:10:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Flash topic view', 'flash_topic_view.php', 'interval', '', '', '255', '', '', '00:10:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Clean search results', 'clean_search_results.php', 'interval', '', '', '255', '', '', '00:10:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Tracker cleanup and dlstat', 'tr_cleanup_and_dlstat.php', 'interval', '', '', '20', '', '', '00:15:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Accrual seedbonus', 'tr_seed_bonus.php', 'interval', '', '', '25', '', '', '00:15:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Make tracker snapshot', 'tr_make_snapshot.php', 'interval', '', '', '10', '', '', '00:10:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Seeder last seen', 'tr_update_seeder_last_seen.php', 'interval', '', '', '255', '', '', '01:00:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', '', '', '255', '', '', '06:00:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Cache garbage collector', 'cache_gc.php', 'interval', '', '', '255', '', '', '00:05:00', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Sitemap update', 'sitemap.php', 'daily', '', '06:00:00', '30', '', '', '', '0', '', '0', '0', '0'); -INSERT INTO `bb_cron` VALUES ('', '1', 'Update forums atom', 'update_forums_atom.php', 'interval', '', '', '255', '', '', '00:15:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('1', '1', 'Attach maintenance', 'attach_maintenance.php', 'daily', '', '05:00:00', '40', '', '', '', '1', '', '0', '1', '0'); +INSERT INTO `bb_cron` VALUES ('2', '1', 'Board maintenance', 'board_maintenance.php', 'daily', '', '05:00:00', '40', '', '', '', '1', '', '0', '1', '0'); +INSERT INTO `bb_cron` VALUES ('3', '1', 'Prune forums', 'prune_forums.php', 'daily', '', '05:00:00', '50', '', '', '', '1', '', '0', '1', '0'); +INSERT INTO `bb_cron` VALUES ('4', '1', 'Prune topic moved stubs', 'prune_topic_moved.php', 'daily', '', '05:00:00', '60', '', '', '', '1', '', '0', '1', '0'); +INSERT INTO `bb_cron` VALUES ('5', '1', 'Logs cleanup', 'clean_log.php', 'daily', '', '05:00:00', '70', '', '', '', '1', '', '0', '1', '0'); +INSERT INTO `bb_cron` VALUES ('6', '1', 'PM cleanup', 'clean_pm.php', 'daily', '', '05:00:00', '70', '', '', '', '1', '', '0', '1', '0'); +INSERT INTO `bb_cron` VALUES ('7', '1', 'Tracker maintenance', 'tr_maintenance.php', 'daily', '', '05:00:00', '90', '', '', '', '1', '', '0', '1', '0'); +INSERT INTO `bb_cron` VALUES ('8', '1', 'Clean dlstat', 'clean_dlstat.php', 'daily', '', '05:00:00', '100', '', '', '', '1', '', '0', '1', '0'); +INSERT INTO `bb_cron` VALUES ('9', '1', 'Prune inactive users', 'prune_inactive_users.php', 'daily', '', '05:00:00', '110', '', '', '', '1', '', '0', '1', '0'); +INSERT INTO `bb_cron` VALUES ('10', '1', 'Sessions cleanup', 'sessions_cleanup.php', 'interval', '', '', '255', '', '', '00:03:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('11', '1', 'DS update cat_forums', 'ds_update_cat_forums.php', 'interval', '', '', '255', '', '', '00:05:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('12', '1', 'DS update stats', 'ds_update_stats.php', 'interval', '', '', '255', '', '', '00:10:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('13', '1', 'Flash topic view', 'flash_topic_view.php', 'interval', '', '', '255', '', '', '00:10:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('14', '1', 'Clean search results', 'clean_search_results.php', 'interval', '', '', '255', '', '', '00:10:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('15', '1', 'Tracker cleanup and dlstat', 'tr_cleanup_and_dlstat.php', 'interval', '', '', '20', '', '', '00:15:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('16', '1', 'Accrual seedbonus', 'tr_seed_bonus.php', 'interval', '', '', '25', '', '', '00:15:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('17', '1', 'Make tracker snapshot', 'tr_make_snapshot.php', 'interval', '', '', '10', '', '', '00:10:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('18', '1', 'Seeder last seen', 'tr_update_seeder_last_seen.php', 'interval', '', '', '255', '', '', '01:00:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('19', '1', 'Tracker dl-complete count', 'tr_complete_count.php', 'interval', '', '', '255', '', '', '06:00:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('20', '1', 'Cache garbage collector', 'cache_gc.php', 'interval', '', '', '255', '', '', '00:05:00', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('21', '1', 'Sitemap update', 'sitemap.php', 'daily', '', '06:00:00', '30', '', '', '', '0', '', '0', '0', '0'); +INSERT INTO `bb_cron` VALUES ('22', '1', 'Update forums atom', 'update_forums_atom.php', 'interval', '', '', '255', '', '', '00:15:00', '0', '', '0', '0', '0'); -- ---------------------------- -- Table structure for `bb_disallow` diff --git a/install/upgrade/changes.txt b/install/upgrade/changes.txt index aa858949..9edf5c0b 100644 --- a/install/upgrade/changes.txt +++ b/install/upgrade/changes.txt @@ -92,3 +92,4 @@ UPDATE `bb_sessions` SET `session_ip` = '0'; ALTER TABLE `bb_sessions` CHANGE `session_ip` `session_ip` varchar(42) NOT NULL DEFAULT '0'; UPDATE `bb_banlist` SET `ban_ip` = '0'; ALTER TABLE `bb_banlist` CHANGE `ban_ip` `ban_ip` varchar(42) NOT NULL DEFAULT '0'; +INSERT INTO `bb_cron` VALUES ('999', '1', 'PM cleanup', 'clean_pm.php', 'daily', '', '05:00:00', '70', '', '', '', '1', '', '0', '1', '0'); diff --git a/library/config.php b/library/config.php index 9e7070e8..a48c68fe 100644 --- a/library/config.php +++ b/library/config.php @@ -486,7 +486,7 @@ $bb_cfg['autocorrect_wkl'] = true; // autocorrect wrong keyboard // Posting $bb_cfg['prevent_multiposting'] = true; // replace "reply" with "edit last msg" if user (not admin or mod) is last topic poster -$bb_cfg['max_smilies'] = 10; // МаксимальноС число смайлов Π² постС (0 - Π±Π΅Π· ограничСния) +$bb_cfg['max_smilies'] = 25; // МаксимальноС число смайлов Π² постС (0 - Π±Π΅Π· ограничСния) // PM $bb_cfg['privmsg_disable'] = false; // ΠΎΡ‚ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ систСму Π»ΠΈΡ‡Π½Ρ‹Ρ… сообщСний Π½Π° Ρ„ΠΎΡ€ΡƒΠΌΠ΅ diff --git a/library/includes/cron/jobs/clean_pm.php b/library/includes/cron/jobs/clean_pm.php new file mode 100644 index 00000000..1db96633 --- /dev/null +++ b/library/includes/cron/jobs/clean_pm.php @@ -0,0 +1,10 @@ +query(" + DELETE FROM ". BB_PRIVMSGS ." + WHERE privmsgs_date < ". (TIMENOW - 86400*$pm_days_keep) ." +");