diff --git a/CHANGELOG.md b/CHANGELOG.md index fee08644..8cb3b7be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - Release v2.1.5-2023.09 πŸŽ‰ - Fixed cache directory auto-creating with SQLite [\#247](https://github.com/torrentpier/torrentpier-lts/pull/247) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#245](https://github.com/torrentpier/torrentpier-lts/pull/245), [\#246](https://github.com/torrentpier/torrentpier-lts/pull/246), [\#248](https://github.com/torrentpier/torrentpier-lts/pull/248), [\#249](https://github.com/torrentpier/torrentpier-lts/pull/249), [\#250](https://github.com/torrentpier/torrentpier-lts/pull/250) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#245](https://github.com/torrentpier/torrentpier-lts/pull/245), [\#246](https://github.com/torrentpier/torrentpier-lts/pull/246), [\#248](https://github.com/torrentpier/torrentpier-lts/pull/248), [\#249](https://github.com/torrentpier/torrentpier-lts/pull/249), [\#250](https://github.com/torrentpier/torrentpier-lts/pull/250), [\#251](https://github.com/torrentpier/torrentpier-lts/pull/251) ([belomaxorka](https://github.com/belomaxorka)) ## [v2.1.5-2023.08-HotFix](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.08-HotFix) (2023-09-17) [Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.08...v2.1.5-2023.08-HotFix) diff --git a/bt/includes/init_tr.php b/bt/includes/init_tr.php index ab998950..c572c5f9 100644 --- a/bt/includes/init_tr.php +++ b/bt/includes/init_tr.php @@ -484,6 +484,6 @@ function log_error () $msg[] = 'Method : '. @$_SERVER['REQUEST_METHOD']; $msg[] = 'Request : '. trim(print_r($_REQUEST, true)) . str_repeat('_', 78) . LOG_LF; $msg[] = ''; - bb_log($msg, 'sql_error_tr'); + bb_log($msg, SQL_TR_LOG_NAME); } } diff --git a/library/config.php b/library/config.php index 5eac10ab..ece4255f 100644 --- a/library/config.php +++ b/library/config.php @@ -320,7 +320,8 @@ define('DBG_TRACKER', false); // enable tracker debug (off on production) define('COOKIE_DBG', 'bb_dbg'); // debug cookie name define('SQL_DEBUG', true); // enable forum sql & cache debug -define('SQL_LOG_NAME', 'sql_error_bb'); // mysql log filename +define('SQL_BB_LOG_NAME', 'sql_error_bb'); // mysql log filename (Board) +define('SQL_TR_LOG_NAME', 'sql_error_tr'); // mysql log filename (Tracker) define('SQL_LOG_ERRORS', true); // all SQL_xxx options enabled only if SQL_DEBUG == TRUE define('SQL_CALC_QUERY_TIME', true); // for stats define('SQL_LOG_SLOW_QUERIES', true); // log sql slow queries @@ -438,10 +439,10 @@ $bb_cfg['max_sentbox_privmsgs'] = 500; // максимальноС число сообщСний Π² ΠΏΠ°ΠΏΠΊΠ΅ ΠΎΡ‚ΠΏΡ€Π°Π²Π»Π΅Π½Π½Ρ‹Π΅ $bb_cfg['max_smilies_pm'] = 15; // максимальноС число смайлов Π² сообщСнии (0 - Π±Π΅Π· ограничСния) $bb_cfg['max_symbols_pm'] = 1500; // TODO: максимальноС число символов Π² сообщСнии (0 - Π±Π΅Π· ограничСния) -$bb_cfg['pm_days_keep'] = 180; // врСмя хранСния Π›Π‘ +$bb_cfg['pm_days_keep'] = 0; // врСмя хранСния Π›Π‘ (0 - Π±Π΅Π· ограничСния) // Actions log -$bb_cfg['log_days_keep'] = 365; // врСмя хранСния истории дСйствий +$bb_cfg['log_days_keep'] = 365; // врСмя хранСния истории дСйствий (0 - Π±Π΅Π· ограничСния) // Users $bb_cfg['color_nick'] = true; // ΠžΠΊΡ€Π°ΡΠΊΠ° Π½ΠΈΠΊΠΎΠ² ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Π΅ΠΉ ΠΏΠΎ user_rank diff --git a/library/includes/core/mysql.php b/library/includes/core/mysql.php index a535f942..6145f4bf 100644 --- a/library/includes/core/mysql.php +++ b/library/includes/core/mysql.php @@ -910,7 +910,7 @@ function log_error () $msg[] = 'PID : '. sprintf('%05d', getmypid()); $msg[] = 'Request : '. trim(print_r($_REQUEST, true)) . str_repeat('_', 78) . LOG_LF; $msg[] = ''; - bb_log($msg, SQL_LOG_NAME); + bb_log($msg, SQL_BB_LOG_NAME); } /** diff --git a/library/includes/cron/jobs/clean_log.php b/library/includes/cron/jobs/clean_log.php index 9fb3455e..dc614395 100644 --- a/library/includes/cron/jobs/clean_log.php +++ b/library/includes/cron/jobs/clean_log.php @@ -4,7 +4,10 @@ $log_days_keep = (int) $bb_cfg['log_days_keep']; -DB()->query(" - DELETE FROM ". BB_LOG ." - WHERE log_time < ". (TIMENOW - 86400*$log_days_keep) ." -"); \ No newline at end of file +if ($log_days_keep != 0) +{ + DB()->query(" + DELETE FROM ". BB_LOG ." + WHERE log_time < ". (TIMENOW - 86400*$log_days_keep) ." + "); +} diff --git a/library/includes/cron/jobs/clean_pm.php b/library/includes/cron/jobs/clean_pm.php index 1db96633..754f0d4a 100644 --- a/library/includes/cron/jobs/clean_pm.php +++ b/library/includes/cron/jobs/clean_pm.php @@ -4,7 +4,10 @@ $pm_days_keep = (int) $bb_cfg['pm_days_keep']; -DB()->query(" - DELETE FROM ". BB_PRIVMSGS ." - WHERE privmsgs_date < ". (TIMENOW - 86400*$pm_days_keep) ." -"); +if ($pm_days_keep != 0) +{ + DB()->query(" + DELETE FROM ". BB_PRIVMSGS ." + WHERE privmsgs_date < ". (TIMENOW - 86400*$pm_days_keep) ." + "); +}