From 8ac9ead2e7e6328a69decf4e475d16b17aa82e37 Mon Sep 17 00:00:00 2001 From: Graham Cole <chckens@sucs.org> Date: Tue, 21 Oct 2008 12:01:45 +0000 Subject: [PATCH] tweak motd to rtrim post bodies again, and don't wordwrap uris --- components/motd.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/motd.php b/components/motd.php index 0eebddb..dac87a8 100644 --- a/components/motd.php +++ b/components/motd.php @@ -1,5 +1,5 @@ <?php -$motd_file = "/tmp/motd.txt"; +$motd_file = "/home/honorary/chckens/motd.txt"; function decode_entities($text, $quote_style = ENT_COMPAT) { if (function_exists('html_entity_decode')) { @@ -42,18 +42,19 @@ $body = str_replace(" ", " ", $body); // remove hyperlinks, collect to display later $body = preg_replace(":<a href=['\"](.+?)['\"].*?>(.*?)</a>:e", "'\\2['.linkcounter('\\1').']'", $body); $body = strip_tags($body); +$body = decode_entities($body); +$body = wordwrap($body, 75, "\n ", 1); +$body = rtrim($body); +$motd .=" ".$body."\n"; if (isset($uris)) { - $body .= "----\n"; + $footer = "----\n"; foreach ($uris as $urinum => $uri) { - $body .= " [$urinum]: $uri\n"; + $footer .= " [$urinum]: $uri\n"; //remove uri from list so it won't show up on the next post unset($uris[$urinum]); } -} -$body = decode_entities($body); -$body = wordwrap($body, 75, "\n ", 1); -$body = rtrim($body); -$motd .=" ".$body."\n"; + $motd .= " ".$footer; +} $motd .= str_pad($nitem['author'], 78, " ", STR_PAD_LEFT)."\n\n"; } $motd .= "---------------------------- [ http://sucs.org/ ] -----------------------------\n"; -- GitLab