[pLog-svn] r5138 - in plugins/branches/lifetype-1.2: blogtimes rsd sitemap tagcloud

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Tue Mar 20 12:58:31 EDT 2007


Author: pwestbro
Date: 2007-03-20 12:58:31 -0400 (Tue, 20 Mar 2007)
New Revision: 5138

Modified:
   plugins/branches/lifetype-1.2/blogtimes/pluginblogtimes.class.php
   plugins/branches/lifetype-1.2/rsd/pluginrsd.class.php
   plugins/branches/lifetype-1.2/sitemap/pluginsitemap.class.php
   plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php
Log:
Only register for the purge temporary folder event, if it is defined


Modified: plugins/branches/lifetype-1.2/blogtimes/pluginblogtimes.class.php
===================================================================
--- plugins/branches/lifetype-1.2/blogtimes/pluginblogtimes.class.php	2007-03-20 12:55:57 UTC (rev 5137)
+++ plugins/branches/lifetype-1.2/blogtimes/pluginblogtimes.class.php	2007-03-20 16:58:31 UTC (rev 5138)
@@ -2,13 +2,7 @@
 
     lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
     
-    // This is temporary.  Make sure that the event is defined, even when run
-    // on LifeType 1.2.0
-    if (!defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" )) {
-        define( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER", EVENT_PROCESS_BLOG_ADMIN_TEMPLATE_OUTPUT + 1);
-    }
 
-
     /**
      * Plugin that offers blogtimes for current blog
      * Original Author: Matt Mullenweg http://photomatt.net
@@ -64,10 +58,11 @@
         {
             $this->init();
             
-            // register the admin events we want
-            $this->registerNotification( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
+            if (defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" )) {
+                // register the events we want
+                $this->registerNotification( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
+            }
 
-
             $this->registerAdminAction( "blogtimes", "PluginBlogTimesConfigAction" );
             $this->registerAdminAction( "updateBlogTimesConfig", "PluginBlogTimesUpdateConfigAction" );
             
@@ -120,8 +115,17 @@
          */
         function process( $eventType, $params )
         {
+            $validEvent = false;
+            
+            // Looking for EVENT_POST_POST_ADD  or EVENT_POST_ADMIN_PURGE_TEMP_FOLDER (if defined)
+            if (($eventType == EVENT_POST_POST_ADD ) || 
+                (defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" ) && $eventType == EVENT_POST_ADMIN_PURGE_TEMP_FOLDER)) {
+                $validEvent = true;
+            }
+
+        
             // make sure we're processing the right event!
-            if( $eventType != EVENT_POST_POST_ADD && $eventType != EVENT_POST_ADMIN_PURGE_TEMP_FOLDER ) 
+            if( $validEvent == false) 
             {
                 return true;
             }

Modified: plugins/branches/lifetype-1.2/rsd/pluginrsd.class.php
===================================================================
--- plugins/branches/lifetype-1.2/rsd/pluginrsd.class.php	2007-03-20 12:55:57 UTC (rev 5137)
+++ plugins/branches/lifetype-1.2/rsd/pluginrsd.class.php	2007-03-20 16:58:31 UTC (rev 5138)
@@ -20,11 +20,6 @@
 
 	lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
 
-    // This is temporary.  Make sure that the event is defined, even when run
-    // on LifeType 1.2.0
-    if (!defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" )) {
-        define( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER", EVENT_PROCESS_BLOG_ADMIN_TEMPLATE_OUTPUT + 1);
-    }
 
 	class PluginRsd extends PluginBase
 	{
@@ -47,8 +42,10 @@
 
 		function initAdmin()
 		{		
-            // register the events we want
-            $this->registerNotification( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
+            if (defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" )) {
+                // register the events we want
+                $this->registerNotification( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
+            }
 
             $this->registerAdminAction( "rsdConfig", "PluginRsdConfigAction" );
 			$this->registerAdminAction( "updateRsdConfig", "PluginRsdUpdateConfigAction" );
@@ -103,7 +100,7 @@
         function process( $eventType, $params )
         {
             // make sure we're processing the right event!
-            if( $eventType != EVENT_POST_ADMIN_PURGE_TEMP_FOLDER ) 
+            if( !defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" ) || $eventType != EVENT_POST_ADMIN_PURGE_TEMP_FOLDER ) 
             {
                 return true;
             }

Modified: plugins/branches/lifetype-1.2/sitemap/pluginsitemap.class.php
===================================================================
--- plugins/branches/lifetype-1.2/sitemap/pluginsitemap.class.php	2007-03-20 12:55:57 UTC (rev 5137)
+++ plugins/branches/lifetype-1.2/sitemap/pluginsitemap.class.php	2007-03-20 16:58:31 UTC (rev 5138)
@@ -4,12 +4,6 @@
     // TODO: httpclient isn't used?
     lt_include( PLOG_CLASS_PATH."class/net/http/httpclient.class.php" );
     
-    // This is temporary.  Make sure that the event is defined, even when run
-    // on LifeType 1.2.0
-    if (!defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" )) {
-        define( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER", EVENT_PROCESS_BLOG_ADMIN_TEMPLATE_OUTPUT + 1);
-    }
-
     
     /**
      * implements notification of 
@@ -49,8 +43,10 @@
         {           
             $this->init();
 
-            // register the events we want
-            $this->registerNotification( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
+            if (defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" )) {
+                // register the events we want
+                $this->registerNotification( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
+            }
 
             // register an action that will allow users to see which comments have not been
             // accepted yet
@@ -91,16 +87,23 @@
          */
         function process( $eventType, $params )
         {
+            $validEvent = false;
+            
+            // Looking for EVENT_POST_POST_ADD, EVENT_POST_POST_UPDATE, EVENT_POST_POST_DELETE
+            // or EVENT_POST_ADMIN_PURGE_TEMP_FOLDER (if defined)
+            if ( $eventType == EVENT_POST_POST_ADD || 
+                 $eventType == EVENT_POST_POST_UPDATE ||
+                 $eventType == EVENT_POST_POST_DELETE ||
+                (defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" ) && $eventType == EVENT_POST_ADMIN_PURGE_TEMP_FOLDER) ) {
+                $validEvent = true;
+            }
+
             // make sure we're processing the right event!
-            if( $eventType != EVENT_POST_POST_ADD &&
-                $eventType != EVENT_POST_POST_UPDATE &&
-                $eventType != EVENT_POST_POST_DELETE &&
-                $eventType != EVENT_POST_ADMIN_PURGE_TEMP_FOLDER ) 
+            if( $validEvent == false) 
             {
                 return true;
             }
-
-
+        
             // Load all of the settings for this blog
             $this->register();
             

Modified: plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php
===================================================================
--- plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php	2007-03-20 12:55:57 UTC (rev 5137)
+++ plugins/branches/lifetype-1.2/tagcloud/plugintagcloud.class.php	2007-03-20 16:58:31 UTC (rev 5138)
@@ -2,12 +2,6 @@
 
     lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
 
-    // This is temporary.  Make sure that the event is defined, even when run
-    // on LifeType 1.2.0
-    if (!defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" )) {
-        define( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER", EVENT_PROCESS_BLOG_ADMIN_TEMPLATE_OUTPUT + 1);
-    }
-
     
     /*
      * This plugin generate TagCloud for a specific Blog
@@ -57,8 +51,10 @@
         {
             $this->init();
             
-            // register the events we want
-            $this->registerNotification( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
+            if (defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" )) {
+                // register the events we want
+                $this->registerNotification( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
+            }
                     
             $this->registerAdminAction( "tagcloud", "PluginTagCloudConfigAction" );
             $this->registerAdminAction( "updateTagCloudConfig", "PluginTagCloudUpdateConfigAction" );
@@ -96,15 +92,23 @@
          */
         function process( $eventType, $params )
         {
+            $validEvent = false;
+            
+            // Looking for EVENT_POST_POST_ADD, EVENT_POST_POST_UPDATE, EVENT_POST_POST_DELETE
+            // or EVENT_POST_ADMIN_PURGE_TEMP_FOLDER (if defined)
+            if ( $eventType == EVENT_POST_POST_ADD || 
+                 $eventType == EVENT_POST_POST_UPDATE ||
+                 $eventType == EVENT_POST_POST_DELETE ||
+                (defined( "EVENT_POST_ADMIN_PURGE_TEMP_FOLDER" ) && $eventType == EVENT_POST_ADMIN_PURGE_TEMP_FOLDER) ) {
+                $validEvent = true;
+            }
+
             // make sure we're processing the right event!
-            if( $eventType != EVENT_POST_POST_ADD &&
-                $eventType != EVENT_POST_POST_UPDATE &&
-                $eventType != EVENT_POST_POST_DELETE &&
-                $eventType != EVENT_POST_ADMIN_PURGE_TEMP_FOLDER ) 
+            if( $validEvent == false) 
             {
                 return true;
             }
-            
+        
             // Load all of the settings for this blog
             $this->register();
 



More information about the pLog-svn mailing list