diff --git a/system/functions.php b/system/functions.php index 992f9fe2..a1ca6b72 100644 --- a/system/functions.php +++ b/system/functions.php @@ -880,11 +880,12 @@ function getWorldName($id) * * @param string $to Recipient email address. * @param string $subject Subject of the message. - * @param string $body Message body in html format. + * @param string $body Message body in HTML format. * @param string $altBody Alternative message body, plain text. * @return bool PHPMailer status returned (success/failure). + * @throws \PHPMailer\PHPMailer\Exception */ -function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) +function _mail(string $to, string $subject, string $body, string $altBody = ''): bool { global $mailer, $config; @@ -902,12 +903,6 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) $mailer->clearAllRecipients(); } - $signature_html = setting('core.mail_signature_html'); - if($add_html_tags && isset($body[0])) - $tmp_body = '' . $body . '

' . $signature_html . ''; - else - $tmp_body = $body . '

' . $signature_html; - $mailOption = setting('core.mail_option'); if($mailOption == MAIL_SMTP) { @@ -934,6 +929,9 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true) $mailer->isMail(); } + $signature_html = setting('core.mail_signature_html'); + $tmp_body = $body . '

' . $signature_html; + $mailer->isHTML(isset($body[0]) > 0); $mailer->From = setting('core.mail_address'); $mailer->Sender = setting('core.mail_address'); diff --git a/system/pages/account/characters/change-comment.php b/system/pages/account/characters/change-comment.php index 919e6aa6..8ea9a734 100644 --- a/system/pages/account/characters/change-comment.php +++ b/system/pages/account/characters/change-comment.php @@ -51,6 +51,8 @@ if($player_name != null) { 'description' => 'The character information has been changed.' )); $show_form = false; + + $hooks->trigger(HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_SUCCESS, ['player' => $player]); } } } else { @@ -70,9 +72,11 @@ if($show_form) { } if(isset($player) && $player) { - $twig->display('account.characters.change-comment.html.twig', array( - 'player' => $player->toArray() - )); + $_player = $player->toArray(); + $_player['id'] = $player->id; // Hack, as it's somehow missing in the toArray() function + + $twig->display('account.characters.change-comment.html.twig', [ + 'player' => $_player, + ]); } } -?> diff --git a/system/pages/forum/show_thread.php b/system/pages/forum/show_thread.php index ceeb2602..441cf0da 100644 --- a/system/pages/forum/show_thread.php +++ b/system/pages/forum/show_thread.php @@ -70,7 +70,7 @@ foreach($posts as &$post) { } $post['group'] = $groupName; - $post['player_link'] = getPlayerLink($player->getName()); + $post['player_link'] = '' . $player->getName() . ''; $post['vocation'] = $player->getVocationName(); diff --git a/system/src/global.php b/system/src/global.php index a140bdde..a5701f00 100644 --- a/system/src/global.php +++ b/system/src/global.php @@ -28,6 +28,10 @@ define('HOOK_CHARACTERS_AFTER_CHARACTERS', ++$i); define('HOOK_LOGIN', ++$i); define('HOOK_LOGIN_ATTEMPT', ++$i); define('HOOK_LOGOUT', ++$i); +define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_SUCCESS', ++$i); +define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_NAME', ++$i); +define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_HIDE_ACCOUNT', ++$i); +define('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_COMMENT', ++$i); define('HOOK_ACCOUNT_CHANGE_PASSWORD_AFTER_OLD_PASSWORD', ++$i); define('HOOK_ACCOUNT_CHANGE_PASSWORD_AFTER_NEW_PASSWORD', ++$i); define('HOOK_ACCOUNT_CHANGE_PASSWORD_POST', ++$i); diff --git a/system/templates/account.characters.change-comment.html.twig b/system/templates/account.characters.change-comment.html.twig index ab8fb384..5d3a6912 100644 --- a/system/templates/account.characters.change-comment.html.twig +++ b/system/templates/account.characters.change-comment.html.twig @@ -33,6 +33,7 @@ If you do not want to specify a certain field, just leave it blank.

Name: {{ player.name }} + {{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_NAME') }} Hide Account: @@ -42,6 +43,7 @@ If you do not want to specify a certain field, just leave it blank.

{% if player.group_id > 1 %} (you will be also hidden on the Team page!){% endif %} + {{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_HIDE_ACCOUNT') }} @@ -65,6 +67,7 @@ If you do not want to specify a certain field, just leave it blank.

Comment:
[max. length: 2000 chars, 50 lines (ENTERs)] + {{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_COMMENT') }} diff --git a/system/templates/account.management.html.twig b/system/templates/account.management.html.twig index 7df72d9e..546c44ff 100644 --- a/system/templates/account.management.html.twig +++ b/system/templates/account.management.html.twig @@ -114,7 +114,7 @@ Last Login: - {{ "now"|date("j F Y, G:i:s") }} + {{ account_logged.getCustomField('web_lastlogin')|date("j F Y, G:i:s") }} {% autoescape false %} diff --git a/templates/tibiacom/account.management.html.twig b/templates/tibiacom/account.management.html.twig index 649eba36..d5fc70b4 100644 --- a/templates/tibiacom/account.management.html.twig +++ b/templates/tibiacom/account.management.html.twig @@ -151,7 +151,7 @@ Last Login: - {{ "now"|date("j F Y, G:i:s") }} + {{ account_logged.getCustomField('web_lastlogin')|date("j F Y, G:i:s") }} {% autoescape false %}