Skip to content

Commit

Permalink
Use word-break: break-all in guilds description + character comment
Browse files Browse the repository at this point in the history
  • Loading branch information
slawkens committed Feb 16, 2024
1 parent 7469be6 commit 191ad25
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion system/pages/characters.php
Expand Up @@ -400,7 +400,7 @@ function retrieve_former_name($name)
'rank' => isset($guild_name) ? $rank_of_player->getName() : null,
'link' => isset($guild_name) ? getGuildLink($guild_name) : null
),
'comment' => !empty($comment) ? wordwrap(nl2br($comment), 60, "<br/>", true) : null,
'comment' => !empty($comment) ? nl2br($comment) : null,
'skills' => isset($skills) ? $skills : null,
'quests_enabled' => $quests_enabled,
'quests' => isset($quests) ? $quests : null,
Expand Down
4 changes: 2 additions & 2 deletions system/pages/guilds/list_of_guilds.php
Expand Up @@ -25,7 +25,7 @@
$description = $guild->getCustomField('description');
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
if ($count < $config['guild_description_lines_limit'])
$description = wordwrap(nl2br($description), 60, "<br />", true);
$description = nl2br($description);

$guildName = $guild->getName();
$guilds[] = array('name' => $guildName, 'logo' => $guild_logo, 'link' => getGuildLink($guildName, false), 'description' => $description);
Expand All @@ -36,4 +36,4 @@
'guilds' => $guilds,
'logged' => isset($logged) ? $logged : false,
'isAdmin' => admin(),
));
));
4 changes: 2 additions & 2 deletions system/pages/guilds/show.php
Expand Up @@ -83,7 +83,7 @@
$description = $guild->getCustomField('description');
$description_with_lines = str_replace(array("\r\n", "\n", "\r"), '<br />', $description, $count);
if($count < $config['guild_description_lines_limit'])
$description = wordwrap(nl2br($description), 60, "<br />", true);
$description = nl2br($description);
//$description = $description_with_lines;

$guild_owner = $guild->getOwner();
Expand Down Expand Up @@ -159,4 +159,4 @@
'invited_list' => $invited_list,
'show_accept_invite' => $show_accept_invite,
'useGuildNick' => $useGuildNick
));
));
2 changes: 1 addition & 1 deletion system/templates/characters.html.twig
Expand Up @@ -142,7 +142,7 @@
{% set rows = rows + 1 %}
<tr bgcolor="{{ getStyle(rows) }}">
<td valign="top">Comment:</td>
<td>{{ comment|raw }}</td>
<td style="word-break: break-all">{{ comment|raw }}</td>
</tr>
{% endif %}

Expand Down
2 changes: 1 addition & 1 deletion system/templates/guilds.list.html.twig
Expand Up @@ -44,7 +44,7 @@
<img src="images/guilds/{{ guild.logo }}" width="64" height="64">
</td>

<td>
<td style="word-break: break-all">
<span{% if guild.description is not empty %} valign="top"{% endif %}>
<b>{{ guild.name }}</b>{% if isAdmin %}<a href="?subtopic=guilds&action=delete_by_admin&guild={{ guild.name }}"> - Delete this guild (for ADMIN only!)</a>{% endif %}
</span>
Expand Down
2 changes: 1 addition & 1 deletion system/templates/guilds.view.html.twig
Expand Up @@ -47,7 +47,7 @@
<table style="width:100%;">
<tbody>
<tr>
<td>
<td style="word-break: break-all">
<div id="GuildInformationContainer">
{% if description is not empty %}
{{ description|raw }}
Expand Down

0 comments on commit 191ad25

Please sign in to comment.