git.shiar.nl
/
minimedit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
page: placeholder options
[minimedit.git]
/
nieuws.inc.php
diff --git
a/nieuws.inc.php
b/nieuws.inc.php
index 7e723e4095e68febd3abde4fcc957217320168f8..3d88a263810e58205354a7459f65890fe64505a7 100644
(file)
--- a/
nieuws.inc.php
+++ b/
nieuws.inc.php
@@
-6,12
+6,11
@@
$monthname = ['?',
function shownewsdate($url)
{
function shownewsdate($url)
{
- $parts = pathinfo($url);
- $year = pathinfo($parts['dirname'], PATHINFO_FILENAME);
- @list ($month, $day) = explode('-', $parts['filename'], 3);
+ if (!preg_match('</(\d{4})/(\d{2})/(\d{2})->', $url, $parts)) return;
global $monthname;
global $monthname;
- return sprintf('<small class="date">%s %s %s</small>',
- intval($day), $monthname[intval($month)], $year);
+ return implode(' ', array_filter([
+ intval($parts[3]), $parts[2] > 0 ? $monthname[intval($parts[2])] : '', $parts[1],
+ ]));
}
function shownewsarticle($url, $link = TRUE, $title = NULL)
}
function shownewsarticle($url, $link = TRUE, $title = NULL)
@@
-44,10
+43,11
@@
function shownews($root, $limit = 5)
}
}
}
}
-function printtoc($
roo
t)
+function printtoc($
inpu
t)
{
{
+ if (!is_array($input)) $input = glob("$input/*.html");
print '<ul>';
print '<ul>';
- foreach (array_reverse(
glob("$root/*.html")
) as $page) {
+ foreach (array_reverse(
$input
) as $page) {
$title = fgets(fopen($page, 'r'));
$title = strip_tags($title);
$linkurl = preg_replace('/\.html$/', '', $page);
$title = fgets(fopen($page, 'r'));
$title = strip_tags($title);
$linkurl = preg_replace('/\.html$/', '', $page);