]> git.mjollnir.org Git - s9y.git/commitdiff
Fix karma bars not appearing on summary pages:
authorslothman <slothman>
Sat, 19 Apr 2008 04:21:55 +0000 (04:21 +0000)
committerslothman <slothman>
Sat, 19 Apr 2008 04:21:55 +0000 (04:21 +0000)
Create a footer if none exists and add the bar to it.

plugins/serendipity_event_karma/serendipity_event_karma.php

index 01ed261f1754a3fe9242bd46884cd75f763b4ec0..4f66899caa8c0a4b9f568b2e50d4b1994e5fd679 100644 (file)
@@ -1117,17 +1117,33 @@ END_IMG_CSS;
                                     $textual_visits = $this->get_config('textual_visits', 'true');
                                 }
 
-                                // Where's the footer?  Normally it would be 
-                                // in addData['extended']; but if the cache
-                                // plugin is used, it's elsewhere.  This
-                                // method retrieves it either way.
+                                // Where's the footer?  Normally it would be
+                                // in eventData[n]['add_footer'] but if the
+                                // cache plugin is used, it's in 
+                                // eventData[n]['properties']['ep_cache_add_footer'].
+                                // This method retrieves it either way.
                                 $footer = &$this->getFieldReference('add_footer', $eventData[$i]);
-                                /*--JAM: Probably time to delete this
-                                // Create a footer if one doesn't already exist
-                                if (!isset($eventData[$i]['add_footer'])) {
-                                $eventData[$i]['add_footer'] = '';
+
+                                // Depending on what existed, $footer could
+                                // be referencing the cached version, the
+                                // uncached version, or even a new empty 
+                                // string.  In particular, if $eventData[$i] 
+                                // has no properties, and no 'add_footer' key, 
+                                // $footer is referencing a new empty string,
+                                // so adding a karma bar to $footer would do 
+                                // nothing.
+                                //
+                                // We could be referencing an empty uncached
+                                // 'add_footer', but empty cache entries are
+                                // never returned.
+                                //
+                                // Reference a footer that will be printed
+                                if (empty($footer) && !isset($eventData[$i]['add_footer'])) {
+                                  $eventData[$i]['add_footer'] = '';
+                                  $footer = &$eventData[$i]['add_footer'];
+                                  // It's still empty, but it's referencing
+                                  // the right place.
                                 }
-                                 */
 
                                 if ($track_exits) {
                                     $footer .= $this->getExits($entryid, true);