]> git.mjollnir.org Git - s9y.git/commitdiff
Fix Bug #1260667: Do not show title of an entry, when draft.
authorgarvinhicking <garvinhicking>
Tue, 16 Aug 2005 10:27:33 +0000 (10:27 +0000)
committergarvinhicking <garvinhicking>
Tue, 16 Aug 2005 10:27:33 +0000 (10:27 +0000)
docs/NEWS
index.php

index 495b1a488d720adeac74f44a3706ea4e96852ae8..c6de0bb737862729d3f8c0cf0b3f8e7667bf5d27 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 0.8.4 ()
 ------------------------------------------------------------------------
 
+    * Hide title of an entry in the frontend, if entry is draft and not
+      displayed. Fixes Bug #1260667 (garvinhicking)
+
     * Unbundle Serendipity XML-RPC functions from the bundled distribution.
       You will now need to install the additional plugin "Post via XML-RPC"
       (serendipity_event_xmlrpc) to make entry posts via this interface.
index 70ee5dfda9153d4c72c5feff14676b02305a6470..e4ec9103d3764c7f8c1c1189ae7e637305b80b2a 100644 (file)
--- a/index.php
+++ b/index.php
@@ -164,9 +164,11 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
     $_GET['serendipity']['action'] = 'read';
     $_GET['serendipity']['id']     = $id;
 
-    $title = serendipity_db_query("SELECT title FROM {$serendipity['dbPrefix']}entries WHERE id=$id", true);
-    $serendipity['head_title']    = $title[0];
-    $serendipity['head_subtitle'] = $serendipity['blogTitle'];
+    $title = serendipity_db_query("SELECT title FROM {$serendipity['dbPrefix']}entries WHERE id=$id WHERE e.isdraft = 'false' " . (!serendipity_db_bool($serendipity['showFutureEntries']) ? " AND e.timestamp <= " . time() : ''), true);
+    if (is_array($title)) {
+        $serendipity['head_title']    = $title[0];
+        $serendipity['head_subtitle'] = $serendipity['blogTitle'];
+    }
 
     ob_start();
     include_once(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');