Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor improvements #251

Merged
merged 2 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion bt/includes/init_tr.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
7 changes: 4 additions & 3 deletions library/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion library/includes/core/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
11 changes: 7 additions & 4 deletions library/includes/cron/jobs/clean_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) ."
");
if ($log_days_keep != 0)
{
DB()->query("
DELETE FROM ". BB_LOG ."
WHERE log_time < ". (TIMENOW - 86400*$log_days_keep) ."
");
}
11 changes: 7 additions & 4 deletions library/includes/cron/jobs/clean_pm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) ."
");
}