Show no date for a story without one.

Such a story showed the date of the story before it, or caused a warning when it came first.
This commit is contained in:
tim
2026-09-26 15:27:51 +02:00
parent 71f768bff2
commit 8d6282348c
2 changed files with 17 additions and 2 deletions
+4 -2
View File
@@ -18,6 +18,7 @@ function display_stories($id = NULL) {
$page = '';
$nolink = NULL;
$posted = FALSE;
$date = '';
if ($action == 'preview') {
global $file_src;
@@ -65,8 +66,9 @@ searches the title, author, date, and the text of each article.</p>'."\n";
$entry_id = (int)$entry['id'];
$queue_url = $entry['queue_url'] ? 1 : 0;
$title = h($entry['title']);
$entry_date = $date;
if ($entry['date'])
$date = '<time datetime="'.date("Y-m-d\TH:i:sP", strtotime($entry['date'])).'">' .
$entry_date = '<time datetime="'.date("Y-m-d\TH:i:sP", strtotime($entry['date'])).'">' .
date("Y-m-d H:i", strtotime($entry['date'])) . '</time>';
$page .= '<li class="box">';
$page .= '<article>';
@@ -90,7 +92,7 @@ date("Y-m-d H:i", strtotime($entry['date'])) . '</time>';
if ($entry['hidden'])
$page .= '<span class="right red">[hidden]</span>';
$page .= '<dt class="author">By</dt> <dd class="author">' . h($entry['author']) . '</dd>';
$page .= '<dt class="date">Posted</dt> <dd class="date">' . $date . '</dd>';
$page .= '<dt class="date">Posted</dt> <dd class="date">' . $entry_date . '</dd>';
$page .= '</dl>';
if (isset($file_src)) {
$page .= '<img src="'.h($file_src).'" alt="'.$title.'" />';