[pLog-svn] r4787 - plugins/branches/lifetype-1.2/authimage

oscar at devel.lifetype.net oscar at devel.lifetype.net
Mon Feb 19 15:55:46 EST 2007


Author: oscar
Date: 2007-02-19 15:55:46 -0500 (Mon, 19 Feb 2007)
New Revision: 4787

Modified:
   plugins/branches/lifetype-1.2/authimage/pluginauthimage.class.php
Log:
this small change saves us 500kb of memory and a couple thousand method calls when index.php loads its plugins...


Modified: plugins/branches/lifetype-1.2/authimage/pluginauthimage.class.php
===================================================================
--- plugins/branches/lifetype-1.2/authimage/pluginauthimage.class.php	2007-02-19 20:54:56 UTC (rev 4786)
+++ plugins/branches/lifetype-1.2/authimage/pluginauthimage.class.php	2007-02-19 20:55:46 UTC (rev 4787)
@@ -20,22 +20,32 @@
         var $default;
         var $cacheFolder;
         
-        function PluginAuthImage()
+        function PluginAuthImage( $source = "" )
         {
             $this->PluginBase();
             
             $this->id      = "authimage";
             $this->author  = "Mark Wu";
-            $this->desc    = 'This plugin offers extra comment authentication for LifeType. The idea is inspired by <a href="http://www.gudlyf.com/index.php?p=376">WordPress AuthImage Plugin</a> written by Gudlyf.';
+            $this->desc    = 'This plugin offers extra comment authentication for LifeType.';
             $this->version = '1.0.1';
 
             $this->locales = Array( "en_UK" , "zh_TW" , "zh_CN", "es_ES", "de_DE" );
-            
-            $this->init();              
+
+			if( $source == "index" )
+				$this->init();
+			else
+				$this->initAdmin();
         }
 
 		function init()
 		{
+			// register the filter
+			$this->registerFilter( "AuthImageFilter" );
+			$this->registerBlogAction( "AuthImageShow", "PluginAuthImageShowAction" );
+		}
+		
+		function initAdmin()
+		{
             include_once( PLOG_CLASS_PATH."class/template/menu/menu.class.php" );
 
 			// register the filter
@@ -50,7 +60,7 @@
 			if( !$menu->entryExists( "/menu/controlCenter/manageAntiSpamPlugins" ))						
 				$this->addMenuEntry( "/menu/controlCenter", "manageAntiSpamPlugins", "", "" );
 				
-            $this->addMenuEntry( "/menu/controlCenter/manageAntiSpamPlugins", "AuthImage", "?op=authimage", "" );
+            $this->addMenuEntry( "/menu/controlCenter/manageAntiSpamPlugins", "AuthImage", "?op=authimage", "" );			
 		}
  
 		function register()
@@ -68,7 +78,7 @@
 			$this->key = $blogSettings->getValue( "plugin_authimage_key" );
 			$this->expiredTime = $blogSettings->getValue( "plugin_authimage_expiredtime" );
 			if ($this->expiredTime == "") $this->expiredTime = 3600;
-			$this->default = $blogSettings->getValue( "plugin_authimage_default" );
+			$this->default = $blogSettings->getValue( "plugin_authimage_default" );			
 		}
 
 	    function isEnabled()



More information about the pLog-svn mailing list