[pLog-svn] r4919 - in plugins/branches/lifetype-1.2: . recentcomments unported

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Fri Mar 2 11:07:43 EST 2007


Author: jondaley
Date: 2007-03-02 11:07:43 -0500 (Fri, 02 Mar 2007)
New Revision: 4919

Added:
   plugins/branches/lifetype-1.2/recentcomments/
Removed:
   plugins/branches/lifetype-1.2/unported/recentcomments/
Modified:
   plugins/branches/lifetype-1.2/recentcomments/pluginrecentcomments.class.php
Log:
ported to 1.2

Copied: plugins/branches/lifetype-1.2/recentcomments (from rev 4915, plugins/branches/lifetype-1.2/unported/recentcomments)

Modified: plugins/branches/lifetype-1.2/recentcomments/pluginrecentcomments.class.php
===================================================================
--- plugins/branches/lifetype-1.2/unported/recentcomments/pluginrecentcomments.class.php	2007-03-02 15:18:42 UTC (rev 4915)
+++ plugins/branches/lifetype-1.2/recentcomments/pluginrecentcomments.class.php	2007-03-02 16:07:43 UTC (rev 4919)
@@ -1,7 +1,7 @@
 <?php
 
-    include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
-    include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
     
     /**
      * Plugin that offers features to return a recent article comments from the current blog
@@ -11,31 +11,40 @@
         var $pluginEnabled;
         var $maxComments;
         
-        function PluginRecentComments()
+        function PluginRecentComments($source = "")
         {
-            $this->PluginBase();
-  
+            $this->PluginBase($source);
             $this->id = "recentcomments";
+            $this->version = "20070302";
+
             $this->author = "Mark Wu";
-            $this->desc = "This plugin offers the most recently article comments.";
+            $this->desc = "This plugin offers the most recently posted article comments.";
             $this->locales = Array( "en_UK" , "zh_TW" , "zh_CN", "es_ES" );
-            $this->init();
+
+			if( $source == "admin" )
+				$this->initAdmin();
+			else
+				$this->init();
         }
 
-		function init()
-		{
-            $this->registerBlogAction( "recentcommentsrss", "PluginRecentCommentsRssAction" );
-
+		function initAdmin(){
             $this->registerAdminAction( "recentcomments", "PluginRecentCommentsConfigAction" );
-			$this->registerAdminAction( "updateRecentCommentsConfig", "PluginRecentCommentsUpdateConfigAction" );
-			include_once( PLOG_CLASS_PATH."class/template/menu/menu.class.php" );
+			$this->registerAdminAction( "updateRecentCommentsConfig",
+                                        "PluginRecentCommentsUpdateConfigAction" );
+			lt_include( PLOG_CLASS_PATH."class/template/menu/menu.class.php" );
             
 			$menu =& Menu::getMenu();
-			if( !$menu->entryExists( "/menu/controlCenter/manageRecentPlugins" ))						
-				$this->addMenuEntry( "/menu/controlCenter", "manageRecentPlugins", "", "", true, false );			
-            $this->addMenuEntry( "/menu/controlCenter/manageRecentPlugins", "RecentComments", "?op=recentcomments", "" );            
+			if( !$menu->entryExists( "/menu/controlCenter/manageRecentPlugins" ))
+				$this->addMenuEntry( "/menu/controlCenter", "manageRecentPlugins",
+                                     "", "", true, false );			
+            $this->addMenuEntry( "/menu/controlCenter/manageRecentPlugins",
+                                 "RecentComments", "?op=recentcomments", "" );            
 		}
 
+        function init(){
+            $this->registerBlogAction( "recentcommentsrss", "PluginRecentCommentsRssAction" );
+		}
+
 		function register()
 		{
 		    $blogSettings = $this->blogInfo->getSettings();
@@ -53,7 +62,7 @@
          */
         function getRecentComments()
         {
-            include_once( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" );
+            lt_include( PLOG_CLASS_PATH."class/dao/commentscommon.class.php" );
 
             $blogId = $this->blogInfo->getId();
             $commentsCommon = new CommentsCommon();
@@ -97,13 +106,13 @@
              */
         function getArticle( $artId )
         {
-			include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );				
+			lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );				
             $articles = new Articles();
             return $articles->getArticle($artId);
         }
 
         function getRssFeedUrl(){
-            include_once( PLOG_CLASS_PATH."class/net/rawrequestgenerator.class.php" );
+            lt_include( PLOG_CLASS_PATH."class/net/rawrequestgenerator.class.php" );
 
             $rg = new RawRequestGenerator($this->blogInfo);
             $rg->addParameter( "op", "recentcommentsrss" );



More information about the pLog-svn mailing list