From d3ec880dc7722be2cd2dbea14d55519014dcc16d Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Sun, 13 May 2018 12:24:09 +0200 Subject: [PATCH] Only show blog posts if their cdate has been reached --- blog.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blog.php b/blog.php index ffa318e..be98e10 100644 --- a/blog.php +++ b/blog.php @@ -97,9 +97,10 @@ $blogentry->tags = explode(',', $blogentry->tags); sort($blogentry->tags); $blogentry->permalink = getServerUrl() . "/?p=blog&b=" . str_replace("/", POSTS_DIR_SEP, $blogentry->file); - $blogentry->isPublic = ($blogentry->status == "released"); + $blogentry->isVisible = ($blogentry->ctime <= time()) && (($blogentry->status == "released") || ($blogentry->status == "unlisted")); + $blogentry->isPublic = ($blogentry->status == "released") && $blogentry->isVisible; } - $renderIt = $CMS_INDEXING || ($blogentry->status == "released") || ($blogentry->status == "unlisted"); + $renderIt = $CMS_INDEXING || $blogentry->isVisible; if ($renderIt && !isset($CMS_RSS)) { if (isset($postUrl) && !$CMS_INDEXING) { // Set meta information