Skip to content
Snippets Groups Projects
Commit 8ac9ead2 authored by Graham Cole's avatar Graham Cole
Browse files

tweak motd to rtrim post bodies again, and don't wordwrap uris

parent 5cb81486
No related branches found
No related tags found
No related merge requests found
<?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("&nbsp;", " ", $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";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment