fix caching frontend_display
authorgarvinhicking <garvinhicking>
Tue, 2 May 2006 07:59:38 +0000 (07:59 +0000)
committergarvinhicking <garvinhicking>
Tue, 2 May 2006 07:59:38 +0000 (07:59 +0000)
include/functions_entries.inc.php
plugins/serendipity_event_entryproperties/serendipity_event_entryproperties.php

index fb9e675ebfbd18b0d2625671b8bf6ebd65b892a0..8b997e38c1aee93a802d647de786091067efd599 100644 (file)
@@ -902,7 +902,11 @@ function serendipity_printEntries($entries, $extended = 0, $preview = false, $sm
                 $entry['authorid'] = $serendipity['authorid'];
             }
 
-            serendipity_plugin_api::hook_event('frontend_display', $entry);
+            $addData = array('from' => 'functions_entries:printEntries');
+            if ($entry['is_cached']) {
+                $addData['no_scramble'] = true;
+            }
+            serendipity_plugin_api::hook_event('frontend_display', $entry, $addData);
 
             if ($preview) {
                 $entry['author']   = $entry['realname'];
@@ -1174,7 +1178,7 @@ function serendipity_updertEntry($entry) {
     }
 
     if (!serendipity_db_bool($entry['isdraft'])) {
-        serendipity_plugin_api::hook_event('frontend_display', $entry, array('no_scramble' => true));
+        serendipity_plugin_api::hook_event('frontend_display', $entry, array('no_scramble' => true, 'from' => 'functions_entries:updertEntry'));
         serendipity_handle_references($entry['id'], $serendipity['blogTitle'], $entry['title'], $entry['body'] . $entry['extended'], $newEntry);
     }
 
index 9c953cecc86e66fd89026ee997bec99a60e5630e..83687c100f7a37e5b0590707ad8421d9bf5885f3 100644 (file)
@@ -478,7 +478,8 @@ class serendipity_event_entryproperties extends serendipity_event
                     if ($is_cache) {
                         // Previous calls to frontend_display used the "no_scramble" atteribute to not tinker with the data.
                         // We now need to call those plugins that have not yet operated before.
-                        serendipity_plugin_api::hook_event('frontend_display_cache', $eventData);
+                        $to_addData = array('from' => 'entryproperties:' . $event);
+                        serendipity_plugin_api::hook_event('frontend_display_cache', $eventData, $to_addData);
                         $serendipity['POST']['properties']['cache_body']     = $eventData['body'];
                         $serendipity['POST']['properties']['cache_extended'] = $eventData['extended'];
                     }