Merge branch 'main' into develop

This commit is contained in:
slawkens
2026-01-15 21:47:07 +01:00
7 changed files with 24 additions and 15 deletions

View File

@@ -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 = '<html><head></head><body>' . $body . '<br/><br/>' . $signature_html . '</body></html>';
else
$tmp_body = $body . '<br/><br/>' . $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 . '<br/><br/>' . $signature_html;
$mailer->isHTML(isset($body[0]) > 0);
$mailer->From = setting('core.mail_address');
$mailer->Sender = setting('core.mail_address');

View File

@@ -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,
]);
}
}
?>

View File

@@ -70,7 +70,7 @@ foreach($posts as &$post) {
}
$post['group'] = $groupName;
$post['player_link'] = getPlayerLink($player->getName());
$post['player_link'] = '<a href="' . getPlayerLink($player, false) . '" style="position: relative;">' . $player->getName() . '</a>';
$post['vocation'] = $player->getVocationName();

View File

@@ -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);

View File

@@ -33,6 +33,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
<td class="LabelV">Name:</td>
<td style="width:80%;" >{{ player.name }}</td>
</tr>
{{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_NAME') }}
<tr>
<td class="LabelV" >Hide Account:</td>
<td>
@@ -42,6 +43,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
{% if player.group_id > 1 %} (you will be also hidden on the Team page!){% endif %}
</td>
</tr>
{{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_HIDE_ACCOUNT') }}
</table>
</div>
</div>
@@ -65,6 +67,7 @@ If you do not want to specify a certain field, just leave it blank.<br/><br/>
<td class="LabelV" ><span>Comment:</span></td>
<td style="width:80%;"><textarea name="comment" rows="10" cols="50" wrap="virtual">{{ player.comment|raw }}</textarea><br>[max. length: 2000 chars, 50 lines (ENTERs)]</td>
</tr>
{{ hook('HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_COMMENT') }}
</table>
</div>
</div>

View File

@@ -114,7 +114,7 @@
</tr>
<tr style="background-color: {{ config.darkborder }};" >
<td>Last Login:</td>
<td>{{ "now"|date("j F Y, G:i:s") }}</td>
<td>{{ account_logged.getCustomField('web_lastlogin')|date("j F Y, G:i:s") }}</td>
</tr>
{% autoescape false %}
<tr style="background-color: {{ config.lightborder }};" >