Initial value determined by:
UPDATE issues SET updated = greatest(created, closed, (
SELECT max(created) FROM comments WHERE page = issues.link
));
$_POST = [];
}
-$query = $Db->query('SELECT * FROM issues ORDER BY created DESC');
+$query = $Db->query('SELECT * FROM issues ORDER BY updated DESC');
ob_start();
print '<ul>';
"/$Page/{$row->id}/{$row->link}",
sprintf($row->closed ? '<strike>%s</strike>' : '%s',
htmlspecialchars($row->subject)),
- showdate(array_slice(preg_split('/\D/', $row->created), 0, 3))
+ showdate(array_slice(preg_split('/\D/', $row->updated), 0, 3))
);
print "</li>\n";
}
body text,
created timestamptz DEFAULT now(),
closed timestamptz DEFAULT now(),
+ updated timestamptz NOT NULL DEFAULT now(),
author text,
id serial NOT NULL PRIMARY KEY
);
if (!$query->rowCount()) {
throw new Exception('Fout bij opslaan');
}
+ if (@list ($cat, $issue) = explode('/', $Page) and ctype_digit($issue)) {
+ $Db->query(
+ 'UPDATE issues SET updated = now() WHERE page = ? AND id = ?',
+ [$cat, $issue]
+ );
+ }
$_POST['reply'] = NULL;
}
catch (Exception $e) {