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: search results as article objects
[minimedit.git]
/
nieuws
/
index.php
diff --git
a/nieuws/index.php
b/nieuws/index.php
index c6234cfae29d6c98e97a14e6b0166e18e8b42fae..6ea68dc43a7fc130805a9a1ffcac7b288c905fb0 100644
(file)
--- a/
nieuws/index.php
+++ b/
nieuws/index.php
@@
-1,23
+1,32
@@
<?php
<?php
-$replyform = $Page
== 'melding' && !empty($User)
;
-@list ($year, $page) = explode('/', trim($
Args
, '/'));
+$replyform = $Page
->handler == 'melding' && $User->login
;
+@list ($year, $page) = explode('/', trim($
Page->path
, '/'));
-if ($User and $User->admin("edit $Page")) {
- print '<script src="/nieuws/edit.js"></script>'."\n";
+if (!$User) {
+ if ($Page->path) return;
+ return (new PageSearch($Page->link))->files();
+}
+
+if ($User->admin("edit {$Page->handler}")) {
+ $Page->raw = '<script src="/nieuws/edit.js"></script>'."\n" . $Page->raw;
}
if ($page and !is_numeric($page)) {
}
if ($page and !is_numeric($page)) {
- $edit = $User && $User->admin("edit $Page$Args") ? htmlspecialchars(@$_GET['edit']) : NULL;
+ $Page->meta['og:type'] = 'article';
+ $edit = $User->admin("edit {$Page->link}") ? htmlspecialchars(@$_GET['edit']) : NULL;
if ($edit) {
if ($edit) {
- $Article->title = $edit;
+ $Page->title = $edit;
+ }
+ if ($Page->dateparts) {
+ $Page->place[1] = ' <small class="date">'.showdate($Page->dateparts).'</small>';
}
}
-
if ($Article->dateparts)
{
- $P
lace[1] = ' <small class="date">'.$Article->date.'</small>
';
+
else
{
+ $P
age->place[1] = '
';
}
}
- print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $
Articl
e->raw);
- if ($User
and $User->admin("edit $Page$Args
")) {
+ print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', $
Pag
e->raw);
+ if ($User
->admin("edit {$Page->link}
")) {
$taglist = [];
$taglist = [];
- foreach (glob("
$Page
/.tags/*") as $tagpath) {
+ foreach (glob("
{$Page->handler}
/.tags/*") as $tagpath) {
$tagname = pathinfo($tagpath, PATHINFO_BASENAME);
$tagvalue = file_exists("$tagpath/$year-$page.html");
$tagtarget = is_writable($tagpath);
$tagname = pathinfo($tagpath, PATHINFO_BASENAME);
$tagvalue = file_exists("$tagpath/$year-$page.html");
$tagtarget = is_writable($tagpath);
@@
-37,13
+46,13
@@
if ($page and !is_numeric($page)) {
}
}
if ($replyform) {
}
}
if ($replyform) {
- print
placeholder_include
('reply');
+ print
$Page->widget
('reply');
}
return;
}
if ($year) {
}
return;
}
if ($year) {
- $match = $Page;
+ $match = $Page
->handler
;
$title = "Nieuws";
if (is_numeric($year) and $year > 999) {
$match .= "/$year";
$title = "Nieuws";
if (is_numeric($year) and $year > 999) {
$match .= "/$year";
@@
-57,12
+66,12
@@
if ($year) {
$match .= "/19??";
$title .= " vóór 2000";
}
$match .= "/19??";
$title .= " vóór 2000";
}
- elseif (file_exists("
$Page
/.tags/$year")) {
+ elseif (file_exists("
{$Page->handler}
/.tags/$year")) {
$match .= "/.tags/$year";
$title .= " met $year";
}
print "<h2>$title</h2>\n\n";
$match .= "/.tags/$year";
$title .= " met $year";
}
print "<h2>$title</h2>\n\n";
- print
placeholder_include
('nieuws', [$match]);
+ print
$Page->widget
('nieuws', [$match]);
return;
}
return;
}