[geeklog-cvs] geeklog: Set the page title when viewing a poll

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Feb 15 14:14:33 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9a83087b80b0
changeset: 6781:9a83087b80b0
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Feb 14 17:02:00 2009 +0100
description:
Set the page title when viewing a poll

diffstat:

2 files changed, 6 insertions(+), 5 deletions(-)
public_html/docs/history    |    1 +
public_html/polls/index.php |   10 +++++-----

diffs (45 lines):

diff -r 035f447a8da7 -r 9a83087b80b0 public_html/docs/history
--- a/public_html/docs/history	Thu Feb 12 12:22:39 2009 +0100
+++ b/public_html/docs/history	Sat Feb 14 17:02:00 2009 +0100
@@ -58,6 +58,7 @@
 
 Polls plugin
 ------------
+- Set the page title when viewing a poll [Dirk]
 - Added auto installation support [Dirk]
 - Added support for PLG_getItemInfo, PLG_itemSaved, PLG_itemDeleted [Dirk]
 - Extended length of poll IDs to 40 characters (feature request #0000754) [Dirk]
diff -r 035f447a8da7 -r 9a83087b80b0 public_html/polls/index.php
--- a/public_html/polls/index.php	Thu Feb 12 12:22:39 2009 +0100
+++ b/public_html/polls/index.php	Sat Feb 14 17:02:00 2009 +0100
@@ -143,7 +143,7 @@
     $msg = COM_applyFilter($_REQUEST['msg'], true);
 }
 
-if (isset($pid)) {
+if (! empty($pid)) {
     $questions_sql = "SELECT question,qid FROM {$_TABLES['pollquestions']} "
     . "WHERE pid='$pid' ORDER BY qid";
     $questions = DB_query($questions_sql);
@@ -160,8 +160,9 @@
                $_CONF['cookie_path'], $_CONF['cookiedomain'],
                $_CONF['cookiesecure']);
     $display .= COM_siteHeader() . POLLS_pollsave($pid, $aid);
-} else if (isset($pid)) {
-    $display .= COM_siteHeader();
+} elseif (! empty($pid)) {
+    $topic = DB_getItem ($_TABLES['polltopics'], 'topic', "pid = '{$pid}'");
+    $display .= COM_siteHeader('menu', $topic);
     if ($msg > 0) {
         $display .= COM_showMessage($msg, 'polls');
     }
@@ -169,8 +170,7 @@
         $display .= COM_startBlock (
                 $LANG_POLLS['not_saved'], '',
                 COM_getBlockTemplate ('_msg_block', 'header'))
-            . $LANG_POLLS['answer_all'] . ' "'
-            . DB_getItem ($_TABLES['polltopics'], 'topic', "pid = '{$pid}'") . '"'
+            . $LANG_POLLS['answer_all'] . ' "' . $topic . '"'
             . COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
     }
     if (DB_getItem($_TABLES['polltopics'], 'is_open', "pid = '$pid'") != 1) {



More information about the geeklog-cvs mailing list