[pLog-svn] r5522 - in plugins/branches/lifetype-1.2: . topreadposts unported

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Mon Jun 11 00:06:37 EDT 2007


Author: jondaley
Date: 2007-06-11 00:06:37 -0400 (Mon, 11 Jun 2007)
New Revision: 5522

Added:
   plugins/branches/lifetype-1.2/topreadposts/
Removed:
   plugins/branches/lifetype-1.2/unported/topreadposts/
Modified:
   plugins/branches/lifetype-1.2/topreadposts/plugintopreadposts.class.php
   plugins/branches/lifetype-1.2/topreadposts/readme.txt
Log:
ported to 1.2

Copied: plugins/branches/lifetype-1.2/topreadposts (from rev 5423, plugins/branches/lifetype-1.2/unported/topreadposts)

Modified: plugins/branches/lifetype-1.2/topreadposts/plugintopreadposts.class.php
===================================================================
--- plugins/branches/lifetype-1.2/unported/topreadposts/plugintopreadposts.class.php	2007-05-19 14:19:53 UTC (rev 5423)
+++ plugins/branches/lifetype-1.2/topreadposts/plugintopreadposts.class.php	2007-06-11 04:06:37 UTC (rev 5522)
@@ -1,7 +1,6 @@
 <?php
 
     lt_include( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );
     
     /**
      * Plugin that offers features to returns the top read posts object of current blog
@@ -13,23 +12,24 @@
         var $pluginEnabled;
         var $maxPosts;  
     
-        function PluginTopReadPosts()
+        function PluginTopReadPosts($source="")
         {
-            $this->PluginBase();
+            $this->PluginBase($source);
   
             $this->id = "topreadposts";
             $this->author = "Mark Wu";
             $this->desc = "This plugin offers the rank list of articles by ".
                 "number of times read.";  
+            $this->version = "20070710";
 
             $this->prefix = Db::getPrefix();
             
             $this->locales = Array( "en_UK" , "zh_TW" , "zh_CN" );
-            
-            $this->init(); 
+            if($source == "admin")
+                $this->initAdmin(); 
         }
 
-		function init()
+		function initAdmin()
 		{
             $this->registerAdminAction( "topreadposts", "PluginTopReadPostsConfigAction" );
 			$this->registerAdminAction( "updateTopReadPostsConfig", "PluginTopReadPostsUpdateConfigAction" );
@@ -57,6 +57,7 @@
          */
         function getTopReadPosts($maxPosts = 0, $based = 'BLOG')
         {
+            lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );
             $articles = new Articles();
             $blogId = $this->blogInfo->getId();
             
@@ -93,5 +94,17 @@
 
             return $topreadposts; 
         }
+
+		function getPluginConfigurationKeys()
+		{
+			lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+			
+			return( Array(
+				Array( "name" => "plugin_topreadposts_enabled", "type" => "boolean" ),
+				Array( "name" => "plugin_topreadposts_maxposts",
+                       "validator" => new IntegerValidator(),
+                       "type" => "integer", "allowEmpty" => true )
+			));
+		}
     }
 ?>
\ No newline at end of file

Modified: plugins/branches/lifetype-1.2/topreadposts/readme.txt
===================================================================
--- plugins/branches/lifetype-1.2/unported/topreadposts/readme.txt	2007-05-19 14:19:53 UTC (rev 5423)
+++ plugins/branches/lifetype-1.2/topreadposts/readme.txt	2007-06-11 04:06:37 UTC (rev 5522)
@@ -1,7 +1,6 @@
 Plugin: Top Read Posts
 Author: Mark Wu
 Release Date: 2006/11/07
-Version: 1.1
 
 This plugin offers the rank list of articles by number of reads. Usage as follow:
 



More information about the pLog-svn mailing list