[geeklog-cvs] geeklog: The comment submission form didn't show the user's full...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jan 17 12:52:27 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/995ee34758f8
changeset: 6683:995ee34758f8
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Jan 17 18:51:14 2009 +0100
description:
The comment submission form didn't show the user's full name when $_CONF['show_fullname'] was enabled

diffstat:

2 files changed, 20 insertions(+), 7 deletions(-)
public_html/docs/history |    2 ++
system/lib-comment.php   |   25 ++++++++++++++++++-------

diffs (63 lines):

diff -r 6470a0d263f3 -r 995ee34758f8 public_html/docs/history
--- a/public_html/docs/history	Sat Jan 17 16:48:55 2009 +0100
+++ b/public_html/docs/history	Sat Jan 17 18:51:14 2009 +0100
@@ -3,6 +3,8 @@
 Jan ??, 2009 (1.5.2)
 ------------
 
+- The comment submission form didn't show the user's full name when
+  $_CONF['show_fullname'] was enabled [Dirk]
 - Comments were always showing the username, even when $_CONF['show_fullname']
   was enabled (reported and patch provided by mystral-kk, bug #0000800)
 - Fixed story preview losing the story when the sid already existed (bug
diff -r 6470a0d263f3 -r 995ee34758f8 system/lib-comment.php
--- a/system/lib-comment.php	Sat Jan 17 16:48:55 2009 +0100
+++ b/system/lib-comment.php	Sat Jan 17 18:51:14 2009 +0100
@@ -638,7 +638,8 @@
 */
 function CMT_commentForm($title,$comment,$sid,$pid='0',$type,$mode,$postmode)
 {
-    global $_CONF, $_TABLES, $_USER, $LANG03, $LANG12, $LANG_LOGIN;
+    global $_CONF, $_TABLES, $_USER, $LANG03, $LANG12, $LANG_LOGIN,
+           $LANG_ACCESS;
 
     $retval = '';
 
@@ -782,21 +783,31 @@
             $comment_template->set_var('site_admin_url', $_CONF['site_admin_url']);
             $comment_template->set_var('layout_url', $_CONF['layout_url']);
             $comment_template->set_var('start_block_postacomment', COM_startBlock($LANG03[1]));
-            $comment_template->set_var('lang_username', $LANG03[5]);
+            if ($_CONF['show_fullname'] == 1) {
+                $comment_template->set_var('lang_username', $LANG_ACCESS['name']);
+            } else {
+                $comment_template->set_var('lang_username', $LANG03[5]);
+            }
             $comment_template->set_var('sid', $sid);
             $comment_template->set_var('pid', $pid);
             $comment_template->set_var('type', $type);
 
             if (!empty($_USER['username'])) {
                 $comment_template->set_var('uid', $_USER['uid']);
-                $comment_template->set_var('username', $_USER['username']);
-                $comment_template->set_var('action_url', $_CONF['site_url'] . '/users.php?mode=logout');
-                $comment_template->set_var('lang_logoutorcreateaccount', $LANG03[03]);
+                $name = COM_getDisplayName($_USER['uid'], $_USER['username'],
+                    $_USER['fullname']);
+                $comment_template->set_var('username', $name);
+                $comment_template->set_var('action_url',
+                    $_CONF['site_url'] . '/users.php?mode=logout');
+                $comment_template->set_var('lang_logoutorcreateaccount',
+                    $LANG03[03]);
             } else {
                 $comment_template->set_var('uid', 1);
                 $comment_template->set_var('username', $LANG03[24]);
-                $comment_template->set_var('action_url', $_CONF['site_url'] . '/users.php?mode=new');
-                $comment_template->set_var('lang_logoutorcreateaccount', $LANG03[04]);
+                $comment_template->set_var('action_url',
+                    $_CONF['site_url'] . '/users.php?mode=new');
+                $comment_template->set_var('lang_logoutorcreateaccount',
+                    $LANG03[04]);
             }
 
             if ($postmode == 'html') {



More information about the geeklog-cvs mailing list