]> 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 2ee6d2d8bc7ab833c25548ad162528a3f7c4a350..3332c3bd25ba92036c91a84c942a878c871876cf 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -180,6 +180,9 @@ Version 0.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 f317b45e39c7522e2715ab6e89ed4ce042c0f0cd..60f6008a0c18d629806ba576aa59b53dbcb91049 100644 (file)
--- a/index.php
+++ b/index.php
@@ -218,9 +218,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');