X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/4867902ad83bc343db74316e54058d85627ec5f2..HEAD:/nieuws.inc.php diff --git a/nieuws.inc.php b/nieuws.inc.php deleted file mode 100644 index 3d88a26..0000000 --- a/nieuws.inc.php +++ /dev/null @@ -1,58 +0,0 @@ -', $url, $parts)) return; - global $monthname; - return implode(' ', array_filter([ - intval($parts[3]), $parts[2] > 0 ? $monthname[intval($parts[2])] : '', $parts[1], - ])); -} - -function shownewsarticle($url, $link = TRUE, $title = NULL) -{ - $html = ob_get_clean(); - $date = shownewsdate($url); - ob_start(); - print $title ?: '\1'; - print '[[1]]'; - - $title = sprintf( - $link ? '

%s

' : '

%s

', - getoutput([1 => ' '.$date.'']), - preg_replace('/\.html$/', '', $url) - ); - return preg_replace('{

(.*?)

}', $title, $html); -} - -function shownews($root, $limit = 5) -{ - if (strpos($root, '/') === FALSE) $root .= '/*'; - foreach (array_reverse(glob("$root/*.html")) as $url) { - print "
"; - ob_start(); - include $url; - print shownewsarticle($url); - print "
\n\n"; - - if (--$limit <= 0) break; - } -} - -function printtoc($input) -{ - if (!is_array($input)) $input = glob("$input/*.html"); - print '\n"; -}