[geeklog-cvs] geeklog: {contributedby_user} and {contributedby_fullname} weren...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Mar 1 04:19:27 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/a488a2867ab6
changeset: 6810:a488a2867ab6
user:      Dirk Haun <dirk at haun-online.de>
date:      Sun Mar 01 10:19:16 2009 +0100
description:
{contributedby_user} and {contributedby_fullname} weren't set in the story templates (bug #0000821)

diffstat:

5 files changed, 25 insertions(+), 9 deletions(-)
public_html/article.php        |    2 ++
public_html/docs/history       |    2 ++
public_html/docs/theme.html    |    2 ++
system/classes/story.class.php |    7 +++++++
system/lib-story.php           |   21 ++++++++++++---------

diffs (96 lines):

diff -r 40ee788859dc -r a488a2867ab6 public_html/article.php
--- a/public_html/article.php	Sun Mar 01 09:38:38 2009 +0100
+++ b/public_html/article.php	Sun Mar 01 10:19:16 2009 +0100
@@ -122,6 +122,8 @@
                 $story->{$varname} = $output[$fieldname];
             }
         }
+        $story->_username = $output['username'];
+        $story->_fullname = $output['fullname'];
     }
 
     if ($output == STORY_PERMISSION_DENIED) {
diff -r 40ee788859dc -r a488a2867ab6 public_html/docs/history
--- a/public_html/docs/history	Sun Mar 01 09:38:38 2009 +0100
+++ b/public_html/docs/history	Sun Mar 01 10:19:16 2009 +0100
@@ -11,6 +11,8 @@
 + (TBD) Comment moderation and editable comments, by Jared Wenerd
 
 Other changes:
+- {contributedby_user} and {contributedby_fullname} weren't set in the story
+  templates (bug #0000821) [Dirk]
 - Reinstated old definitions of the {start_contributedby_anchortag},
   {end_contributedby_anchortag}, and {contributedby_author} variables, i.e. the
   two anchortag variables are set again and _author contains the name only (bug
diff -r 40ee788859dc -r a488a2867ab6 public_html/docs/theme.html
--- a/public_html/docs/theme.html	Sun Mar 01 09:38:38 2009 +0100
+++ b/public_html/docs/theme.html	Sun Mar 01 10:19:16 2009 +0100
@@ -198,6 +198,8 @@
 <h2><a name="changes">Theme changes in Geeklog 1.6.0</a></h2>
 
 <ul>
+<li>Bugfix: The variables <tt>{contributedby_user}</tt> and
+    <tt>{contributedby_fullname}</tt> were always empty.</li>
 <li>The two variables <tt>{start_contributedby_anchortag}</tt> and
     <tt>{end_contributedby_anchortag}</tt> were not set any more (since Geeklog
     1.5.0). Instead, the link to the author's profile was added to
diff -r 40ee788859dc -r a488a2867ab6 system/classes/story.class.php
--- a/system/classes/story.class.php	Sun Mar 01 09:38:38 2009 +0100
+++ b/system/classes/story.class.php	Sun Mar 01 10:19:16 2009 +0100
@@ -363,6 +363,13 @@
             if (array_key_exists($fieldname, $story)) {
                 $this->{$varname}= stripslashes($story[$fieldname]);
             }
+        }
+
+        if (array_key_exists('username', $story)) {
+            $this->_username = $story['username'];
+        }
+        if (array_key_exists('fullname', $story)) {
+            $this->_fullname = $story['fullname'];
         }
 
         // Overwrite the date with the timestamp.
diff -r 40ee788859dc -r a488a2867ab6 system/lib-story.php
--- a/system/lib-story.php	Sun Mar 01 09:38:38 2009 +0100
+++ b/system/lib-story.php	Sun Mar 01 10:19:16 2009 +0100
@@ -114,20 +114,21 @@
     }
     $article->set_var( 'story_id', $story->getSid() );
 
-    if( $_CONF['contributedbyline'] == 1 )
-    {
-        $article->set_var( 'lang_contributed_by', $LANG01[1] );
-        $article->set_var( 'contributedby_uid', $story->DisplayElements('uid') );
+    if ($_CONF['contributedbyline'] == 1) {
+        $article->set_var('lang_contributed_by', $LANG01[1]);
+        $article->set_var('contributedby_uid', $story->DisplayElements('uid'));
+
         $fullname = $story->DisplayElements('fullname');
-        $article->set_var( 'contributedby_user', $story->DisplayElements('username') );
-        if (empty ($fullname)) {
-            $article->set_var( 'contributedby_fullname', $story->DisplayElements('username') );
+        $username = $story->DisplayElements('username');
+        $article->set_var('contributedby_user', $username);
+        if (empty($fullname)) {
+            $article->set_var('contributedby_fullname', $username);
         } else {
-            $article->set_var( 'contributedby_fullname',$story->DisplayElements('fullname') );
+            $article->set_var('contributedby_fullname',$fullname);
         }
 
         $authorname = COM_getDisplayName($story->DisplayElements('uid'),
-                            $story->DisplayElements('username'), $fullname);
+                                         $username, $fullname);
         $article->set_var('contributedby_author', $authorname);
         $article->set_var('author', $authorname);
 
@@ -1441,6 +1442,8 @@
             $varname = '_' . $fieldname;
             $output[$fieldname] = $story->{$varname};
         }
+        $output['username'] = $story->_username;
+        $output['fullname'] = $story->_fullname;
 
         if ($args['gl_svc']) {
             if (($output['statuscode'] == STORY_ARCHIVE_ON_EXPIRE) ||



More information about the geeklog-cvs mailing list