From: garvinhicking Date: Tue, 16 Aug 2005 10:27:33 +0000 (+0000) Subject: Fix Bug #1260667: Do not show title of an entry, when draft. X-Git-Tag: 0.9~206 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c2d406fd6ecea8f4efe50ede3053a27a383a1635;p=s9y.git Fix Bug #1260667: Do not show title of an entry, when draft. --- diff --git a/docs/NEWS b/docs/NEWS index 2ee6d2d..3332c3b 100644 --- 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. diff --git a/index.php b/index.php index f317b45..60f6008 100644 --- 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');