From 5eafff737a9dbfdcaceac3424c129de0c1ec5f77 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 30 Jun 2023 19:52:05 +0200 Subject: [PATCH] Guilds & Characters: Use CSS word-break: break-all instead of PHP wordwrap Suggested by @anyeor --- system/pages/characters.php | 2 +- system/pages/guilds/list.php | 2 +- system/pages/guilds/show.php | 2 +- system/templates/characters.html.twig | 2 +- system/templates/guilds.list.html.twig | 2 +- system/templates/guilds.view.html.twig | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/system/pages/characters.php b/system/pages/characters.php index 339bcddc..13f88f05 100644 --- a/system/pages/characters.php +++ b/system/pages/characters.php @@ -396,7 +396,7 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil 'rank' => isset($guild_name) ? $rank_of_player->getName() : null, 'link' => isset($guild_name) ? getGuildLink($guild_name) : null ), - 'comment' => !empty($comment) ? wordwrap(nl2br($comment), 60, "
", true) : null, + 'comment' => !empty($comment) ? nl2br($comment) : null, 'skills' => isset($skills) ? $skills : null, 'quests_enabled' => $quests_enabled, 'quests' => isset($quests) ? $quests : null, diff --git a/system/pages/guilds/list.php b/system/pages/guilds/list.php index 2b65e15d..e91b644d 100644 --- a/system/pages/guilds/list.php +++ b/system/pages/guilds/list.php @@ -27,7 +27,7 @@ if(count($guilds_list) > 0) $description = $guild->getCustomField('description'); $description_with_lines = str_replace(array("\r\n", "\n", "\r"), '
', $description, $count); if ($count < $config['guild_description_lines_limit']) - $description = wordwrap(nl2br($description), 60, "
", true); + $description = nl2br($description); $guildName = $guild->getName(); $guilds[] = array('name' => $guildName, 'logo' => $guild_logo, 'link' => getGuildLink($guildName, false), 'description' => $description); diff --git a/system/pages/guilds/show.php b/system/pages/guilds/show.php index 47ce89d8..8a519c61 100644 --- a/system/pages/guilds/show.php +++ b/system/pages/guilds/show.php @@ -86,7 +86,7 @@ if(empty($guild_logo) || !file_exists(GUILD_IMAGES_DIR . $guild_logo)) $description = $guild->getCustomField('description'); $description_with_lines = str_replace(array("\r\n", "\n", "\r"), '
', $description, $count); if($count < $config['guild_description_lines_limit']) - $description = wordwrap(nl2br($description), 60, "
", true); + $description = nl2br($description); //$description = $description_with_lines; $guild_owner = $guild->getOwner(); diff --git a/system/templates/characters.html.twig b/system/templates/characters.html.twig index 94f64803..4234f2ab 100644 --- a/system/templates/characters.html.twig +++ b/system/templates/characters.html.twig @@ -142,7 +142,7 @@ {% set rows = rows + 1 %} Comment: - {{ comment|raw }} + {{ comment|raw }} {% endif %} diff --git a/system/templates/guilds.list.html.twig b/system/templates/guilds.list.html.twig index da5016b0..1f7903a6 100644 --- a/system/templates/guilds.list.html.twig +++ b/system/templates/guilds.list.html.twig @@ -44,7 +44,7 @@ - + {{ guild.name }}{% if isAdmin %} - Delete this guild (for ADMIN only!){% endif %} diff --git a/system/templates/guilds.view.html.twig b/system/templates/guilds.view.html.twig index 6f70aeca..c184605c 100644 --- a/system/templates/guilds.view.html.twig +++ b/system/templates/guilds.view.html.twig @@ -47,7 +47,7 @@ -
+
{% if descriptions is not empty %} {{ description }}