diff --git a/CHANGELOG.md b/CHANGELOG.md
index eecc32916..5db2d09c4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,7 +14,7 @@
- Fixed issue with poll_users cleaning at every cron job startup [\#1390](https://github.com/torrentpier/torrentpier/pull/1390) ([belomaxorka](https://github.com/belomaxorka))
- Improved word censor 🤐 [\#1393](https://github.com/torrentpier/torrentpier/pull/1393) ([belomaxorka](https://github.com/belomaxorka))
- Used hashing for filenames generation [\#1385](https://github.com/torrentpier/torrentpier/pull/1385) ([belomaxorka](https://github.com/belomaxorka))
-- Minor improvements [\#1382](https://github.com/torrentpier/torrentpier/pull/1382), [\#1383](https://github.com/torrentpier/torrentpier/pull/1383), [\#1391](https://github.com/torrentpier/torrentpier/pull/1391) ([belomaxorka](https://github.com/belomaxorka))
+- Minor improvements [\#1382](https://github.com/torrentpier/torrentpier/pull/1382), [\#1383](https://github.com/torrentpier/torrentpier/pull/1383), [\#1391](https://github.com/torrentpier/torrentpier/pull/1391), [\#1398](https://github.com/torrentpier/torrentpier/pull/1398) ([belomaxorka](https://github.com/belomaxorka))
- Some bugfixes [\#1380](https://github.com/torrentpier/torrentpier/pull/1380) ([belomaxorka](https://github.com/belomaxorka))
- New Crowdin updates [\#1384](https://github.com/torrentpier/torrentpier/pull/1384), [\#1389](https://github.com/torrentpier/torrentpier/pull/1389), [\#1392](https://github.com/torrentpier/torrentpier/pull/1392) ([Exileum](https://github.com/Exileum))
diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql
index b79dd72e0..5f98cebda 100644
--- a/install/sql/mysql.sql
+++ b/install/sql/mysql.sql
@@ -548,9 +548,9 @@ VALUES ('allow_autologin', '1'),
('seed_bonus_points', ''),
('seed_bonus_tor_size', '0'),
('seed_bonus_user_regdate', '0'),
- ('site_desc', 'A little text to describe your forum'),
+ ('site_desc', 'Bull-powered BitTorrent tracker engine'),
('sitemap_time', ''),
- ('sitename', 'TorrentPier - Bull-powered BitTorrent tracker engine'),
+ ('sitename', 'TorrentPier'),
('smilies_path', 'styles/images/smiles'),
('static_sitemap', ''),
('topics_per_page', '50'),
diff --git a/library/includes/functions.php b/library/includes/functions.php
index 927bbd0f0..78f1e1de7 100644
--- a/library/includes/functions.php
+++ b/library/includes/functions.php
@@ -2172,7 +2172,14 @@ function send_pm($user_id, $subject, $message, $poster_id = BOT_UID)
DB()->query("UPDATE " . BB_USERS . " SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . TIMENOW . ", user_newest_pm_id = $pm_id WHERE user_id = $user_id");
}
-function profile_url($data, $target_blank = false)
+/**
+ * Generates link to profile
+ *
+ * @param array $data
+ * @param bool $target_blank
+ * @return string
+ */
+function profile_url(array $data, bool $target_blank = false): string
{
global $bb_cfg, $lang, $datastore;
@@ -2181,33 +2188,33 @@ function profile_url($data, $target_blank = false)
$ranks = $datastore->get('ranks');
}
+ $username = !empty($data['username']) ? $data['username'] : $lang['GUEST'];
+ $user_id = !empty($data['user_id']) ? (int)$data['user_id'] : GUEST_UID;
$user_rank = !empty($data['user_rank']) ? $data['user_rank'] : 0;
+ $title = '';
+ $style = 'colorUser';
if (isset($ranks[$user_rank])) {
$title = $ranks[$user_rank]['rank_title'];
- $style = $ranks[$user_rank]['rank_style'];
+ if ($bb_cfg['color_nick']) {
+ $style = $ranks[$user_rank]['rank_style'];
+ }
}
+
if (empty($title)) {
- $title = $lang['USER'];
+ $title = match ($user_id) {
+ GUEST_UID => $lang['GUEST'],
+ BOT_UID => $username,
+ default => $lang['USER'],
+ };
}
- if (empty($style)) {
- $style = 'colorUser';
- }
-
- if (!$bb_cfg['color_nick']) {
- $style = '';
- }
-
- $username = !empty($data['username']) ? $data['username'] : $lang['GUEST'];
- $user_id = (!empty($data['user_id']) && $username != $lang['GUEST']) ? $data['user_id'] : GUEST_UID;
$profile = '' . $username . '';
-
- if (!in_array($user_id, explode(',', EXCLUDED_USERS)) && $username) {
+ if (!in_array($user_id, explode(',', EXCLUDED_USERS))) {
$target_blank = $target_blank ? ' target="_blank" ' : '';
$profile = '' . $profile . '';
- if (getBanInfo((int)$user_id)) {
+ if (getBanInfo($user_id)) {
return '' . $profile . '';
}
}
diff --git a/library/includes/ucp/register.php b/library/includes/ucp/register.php
index 709e8146f..6d87539d9 100644
--- a/library/includes/ucp/register.php
+++ b/library/includes/ucp/register.php
@@ -159,10 +159,12 @@ if ($submit) {
// Валидация данных
$cur_pass_valid = $adm_edit;
+$can_edit_tpl = [];
foreach ($profile_fields as $field => $can_edit) {
- // Проверка на возможность редактирования
- if ((bool)$can_edit === false) {
+ $can_edit = (bool)$can_edit;
+ $can_edit_tpl['CAN_EDIT_' . strtoupper($field)] = $can_edit;
+ if ($can_edit === false) {
// TODO: При continue; не устанавливаются переменные ($tp_data) шаблона прописанные в case
// continue;
}
@@ -195,7 +197,6 @@ foreach ($profile_fields as $field => $can_edit) {
$db_data['username'] = $username;
}
}
- $tp_data['CAN_EDIT_USERNAME'] = $can_edit;
$tp_data['USERNAME'] = $pr_data['username'];
break;
@@ -669,6 +670,7 @@ if ($submit && !$errors) {
}
}
+$template->assign_vars($can_edit_tpl);
$template->assign_vars($tp_data);
$template->assign_vars([
diff --git a/styles/templates/default/usercp_register.tpl b/styles/templates/default/usercp_register.tpl
index 5fc461994..cd2fb0c26 100644
--- a/styles/templates/default/usercp_register.tpl
+++ b/styles/templates/default/usercp_register.tpl
@@ -70,7 +70,7 @@