Compare commits

..

3 Commits

Author SHA1 Message Date
a60988f468 Fix handling of private posts
Before, a private post would show an empty page with the footer (tags)
at the bottom. Now, a message is shown, and sensitive information is
hidden.
2018-05-13 12:28:51 +02:00
92e05e4a91 Remove blank lines 2018-05-13 12:27:42 +02:00
d3ec880dc7 Only show blog posts if their cdate has been reached 2018-05-13 12:24:09 +02:00

View File

@ -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
@ -143,8 +144,6 @@
echo '<a href="/?p=blog&t=' . $v . '">' . $v . '</a> ';
}
echo "</p>";
}
function extended() {
@ -229,10 +228,13 @@
echo '<div class="post">';
// Header is rendered in renderPost()
require $postUrl; // This will render the body
//if ($blogentry->isPublic) { // Render the blog footer
if ($blogentry->isVisible) { // Render the blog footer
//echo "<p class=\"author\">Written by $blogentry->author</p>";
renderFooter();
//}
} else {
echo("<h1>Private Post</h1>");
echo("<p>This post has not yet been made public by the publisher. Please check back again later. Thank you.</p>");
}
echo '</div>';
}
else {