From 7054dbbb2d39f81b3a9d580cf3485f7dae9bc856 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 25 Sep 2023 00:25:06 +0700 Subject: [PATCH] Minor improvements (#264) * Minor improvements * Update CHANGELOG.md --- CHANGELOG.md | 2 +- admin/admin_user_search.php | 2 +- group.php | 2 +- library/config.php | 14 ++++++++------ library/includes/ucp/viewprofile.php | 2 +- memberlist.php | 4 ++-- viewtopic.php | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f9111b7..59702ea2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ - Added missing translation in admin_ug_auth [\#254](https://github.com/torrentpier/torrentpier-lts/pull/254) ([belomaxorka](https://github.com/belomaxorka)) - Support for IDN domains [\#252](https://github.com/torrentpier/torrentpier-lts/pull/252) ([belomaxorka](https://github.com/belomaxorka), [kovalensky](https://github.com/kovalensky)) - 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), [\#251](https://github.com/torrentpier/torrentpier-lts/pull/251), [\#253](https://github.com/torrentpier/torrentpier-lts/pull/253), [\#255](https://github.com/torrentpier/torrentpier-lts/pull/255), [\#256](https://github.com/torrentpier/torrentpier-lts/pull/256), [\#257](https://github.com/torrentpier/torrentpier-lts/pull/257), [\#258](https://github.com/torrentpier/torrentpier-lts/pull/258), [\#259](https://github.com/torrentpier/torrentpier-lts/pull/259), [\#261](https://github.com/torrentpier/torrentpier-lts/pull/261), [\#262](https://github.com/torrentpier/torrentpier-lts/pull/262), [\#263](https://github.com/torrentpier/torrentpier-lts/pull/263) ([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), [\#253](https://github.com/torrentpier/torrentpier-lts/pull/253), [\#255](https://github.com/torrentpier/torrentpier-lts/pull/255), [\#256](https://github.com/torrentpier/torrentpier-lts/pull/256), [\#257](https://github.com/torrentpier/torrentpier-lts/pull/257), [\#258](https://github.com/torrentpier/torrentpier-lts/pull/258), [\#259](https://github.com/torrentpier/torrentpier-lts/pull/259), [\#261](https://github.com/torrentpier/torrentpier-lts/pull/261), [\#262](https://github.com/torrentpier/torrentpier-lts/pull/262), [\#263](https://github.com/torrentpier/torrentpier-lts/pull/263), [\#264](https://github.com/torrentpier/torrentpier-lts/pull/264) ([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/admin/admin_user_search.php b/admin/admin_user_search.php index 7260c7fd..1386a1ac 100644 --- a/admin/admin_user_search.php +++ b/admin/admin_user_search.php @@ -1037,7 +1037,7 @@ else 'ROW_CLASS' => $row_class, 'USER' => profile_url($rowset[$i]), 'EMAIL' => $rowset[$i]['user_email'], - 'JOINDATE' => bb_date($rowset[$i]['user_regdate'], $bb_cfg['date_format']), + 'JOINDATE' => bb_date($rowset[$i]['user_regdate'], $bb_cfg['reg_date_format']), 'LASTVISIT' => bb_date($rowset[$i]['user_lastvisit'], $bb_cfg['last_visit_date_format']), 'POSTS' => $rowset[$i]['user_posts'], 'BAN' => ( ( !isset($banned[$rowset[$i]['user_id']]) ) ? $lang['NOT_BANNED'] : $lang['BANNED'] ), diff --git a/group.php b/group.php index d2225776..3227ee37 100644 --- a/group.php +++ b/group.php @@ -17,7 +17,7 @@ function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$ global $lang, $images, $bb_cfg; $from = (!empty($row['user_from'])) ? $row['user_from'] : $lang['NOSELECT']; - $joined = bb_date($row['user_regdate'], $bb_cfg['date_format']); + $joined = bb_date($row['user_regdate'], $bb_cfg['reg_date_format']); $user_time = (!empty($row['user_time'])) ? bb_date($row['user_time']) : $lang['NONE']; $posts = ($row['user_posts']) ? $row['user_posts'] : 0; $pm = ($bb_cfg['text_buttons']) ? ''. $lang['SEND_PM_TXTB'] .'' : '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; diff --git a/library/config.php b/library/config.php index 12ec247f..be5fe98e 100644 --- a/library/config.php +++ b/library/config.php @@ -378,7 +378,11 @@ define('CRON_ALLOWED', TRIGGERS_DIR .'cron_allowed'); define('CRON_RUNNING', TRIGGERS_DIR .'cron_running'); // Date format -$bb_cfg['date_format'] = 'Y-m-d H:i'; +$bb_cfg['date_format'] = 'Y-m-d'; // общий формат даты (оставлено для обратной совместимости. Если есть возможность, то используйте лучше одну из переменных ниже, исходя из целей) +$bb_cfg['current_time_date_format'] = 'd-M H:i'; // формат блока "текущее время" на сайте +$bb_cfg['reg_date_format'] = 'Y-m-d H:i'; // формат даты регистрации пользователя +$bb_cfg['last_visit_date_format'] = 'Y-m-d H:i'; // формат даты последнего визита на сайте +$bb_cfg['last_post_date_format'] = 'd-M-y H:i'; // формат даты последнего поста (на странице просмотра форума и на главной) // Subforums $bb_cfg['sf_on_first_page_only'] = true; @@ -451,6 +455,9 @@ $bb_cfg['pm_days_keep'] = 0; // время хранени // Actions log $bb_cfg['log_days_keep'] = 365; // время хранения истории действий (0 - без ограничения) +// Poll +$bb_cfg['poll_max_days'] = 180; // сколько дней с момента создания темы опрос будет активным + // Users $bb_cfg['color_nick'] = true; // Окраска ников пользователей по user_rank $bb_cfg['user_not_activated_days_keep'] = 7; // "not activated" == "not finished registration" @@ -488,11 +495,6 @@ $bb_cfg['translate_dates'] = true; // in displaying time $bb_cfg['use_word_censor'] = true; // использовать цензор слов $bb_cfg['show_jumpbox'] = true; // показывать ли jumpbox -$bb_cfg['current_time_date_format'] = 'd-M H:i'; // формат блока "текущее время" на сайте -$bb_cfg['last_visit_date_format'] = 'Y-m-d H:i'; // формат даты последнего визита на сайте -$bb_cfg['last_post_date_format'] = 'd-M-y H:i'; // формат даты последнего поста (на странице просмотра форума и на главной) -$bb_cfg['poll_max_days'] = 180; // сколько дней с момента создания темы опрос будет активным - $bb_cfg['allow_change'] = array( 'language' => true, 'dateformat' => true, diff --git a/library/includes/ucp/viewprofile.php b/library/includes/ucp/viewprofile.php index 3e151aea..bbf8992d 100644 --- a/library/includes/ucp/viewprofile.php +++ b/library/includes/ucp/viewprofile.php @@ -87,7 +87,7 @@ $template->assign_vars(array( 'USERNAME' => $profiledata['username'], 'PROFILE_USER_ID' => $profiledata['user_id'], 'PROFILE_USER' => $profile_user_id, - 'USER_REGDATE' => bb_date($profiledata['user_regdate'], $bb_cfg['date_format'], false), + 'USER_REGDATE' => bb_date($profiledata['user_regdate'], $bb_cfg['reg_date_format'], false), 'POSTER_RANK' => ($poster_rank) ? "". $poster_rank ."" : $lang['USER'], 'RANK_IMAGE' => $rank_image, 'RANK_SELECT' => $rank_select, diff --git a/memberlist.php b/memberlist.php index d681dcb5..5f6a4371 100644 --- a/memberlist.php +++ b/memberlist.php @@ -167,7 +167,7 @@ if ($result = DB()->fetch_rowset($sql)) { $user_id = $row['user_id']; $from = $row['user_from']; - $joined = bb_date($row['user_regdate'], $bb_cfg['date_format']); + $joined = bb_date($row['user_regdate'], $bb_cfg['reg_date_format']); $posts = $row['user_posts']; $pm = ($bb_cfg['text_buttons']) ? ''. $lang['SEND_PM_TXTB'] .'' : '' . $lang['SEND_PRIVATE_MESSAGE'] . ''; @@ -240,4 +240,4 @@ $template->assign_vars(array( 'PAGE_TITLE' => $lang['MEMBERLIST'], )); -print_page('memberlist.tpl'); \ No newline at end of file +print_page('memberlist.tpl'); diff --git a/viewtopic.php b/viewtopic.php index 3d28009b..5dba3b1b 100644 --- a/viewtopic.php +++ b/viewtopic.php @@ -659,7 +659,7 @@ for($i = 0; $i < $total_posts; $i++) $max_post_time = max($max_post_time, $postrow[$i]['post_time']); $poster_posts = ($poster_id != GUEST_UID) ? $postrow[$i]['user_posts'] : ''; $poster_from = ($postrow[$i]['user_from'] && $poster_id != GUEST_UID ) ? $postrow[$i]['user_from'] : ''; - $poster_joined = ($poster_id != GUEST_UID) ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], $bb_cfg['date_format']) : ''; + $poster_joined = ($poster_id != GUEST_UID) ? $lang['JOINED'] . ': ' . bb_date($postrow[$i]['user_regdate'], $bb_cfg['reg_date_format']) : ''; $poster_longevity = ($poster_id != GUEST_UID) ? delta_time($postrow[$i]['user_regdate']) : ''; $post_id = $postrow[$i]['post_id']; $mc_type = $postrow[$i]['mc_type'];