[pLog-svn] r4257 - in plugins/branches/lifetype-1.1: . recommended
unported
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Wed Nov 8 03:18:35 GMT 2006
Author: jondaley
Date: 2006-11-08 03:18:34 +0000 (Wed, 08 Nov 2006)
New Revision: 4257
Added:
plugins/branches/lifetype-1.1/recommended/
plugins/branches/lifetype-1.1/recommended/class/
plugins/branches/lifetype-1.1/recommended/locale/
plugins/branches/lifetype-1.1/recommended/pluginrecommended.class.php
plugins/branches/lifetype-1.1/recommended/readme.txt
plugins/branches/lifetype-1.1/recommended/templates/
Removed:
plugins/branches/lifetype-1.1/recommended/class/
plugins/branches/lifetype-1.1/recommended/locale/
plugins/branches/lifetype-1.1/recommended/pluginrecommended.class.php
plugins/branches/lifetype-1.1/recommended/templates/
plugins/branches/lifetype-1.1/unported/recommended/
Log:
updated for 1.1
Copied: plugins/branches/lifetype-1.1/recommended (from rev 4222, plugins/branches/lifetype-1.1/unported/recommended)
Copied: plugins/branches/lifetype-1.1/recommended/class (from rev 4256, plugins/branches/lifetype-1.1/unported/recommended/class)
Copied: plugins/branches/lifetype-1.1/recommended/locale (from rev 4256, plugins/branches/lifetype-1.1/unported/recommended/locale)
Deleted: plugins/branches/lifetype-1.1/recommended/pluginrecommended.class.php
===================================================================
--- plugins/branches/lifetype-1.1/unported/recommended/pluginrecommended.class.php 2006-11-01 04:26:31 UTC (rev 4222)
+++ plugins/branches/lifetype-1.1/recommended/pluginrecommended.class.php 2006-11-08 03:18:34 UTC (rev 4257)
@@ -1,94 +0,0 @@
-<?php
-
- include_once( PLOG_CLASS_PATH."class/plugin/pluginbase.class.php" );
- include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
- include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
-
- /**
- * Plugin that offers features to returns the top read posts object of current blog
- */
- class PluginRecommended extends PluginBase
- {
-
- var $prefix;
- var $pluginEnabled;
- var $recommendedPosts;
-
- function PluginRecommended()
- {
- $this->PluginBase();
-
- $this->id = "recommended";
- $this->author = "Jon Daley";
- $this->desc = "This plugin offers a list of recommended articles, selected by the blog owner";
-
- $this->prefix = Db::getPrefix();
-
- $this->locales = Array( "en_UK" );
- $this->recommendedPosts = Array();
-
- $this->init();
- }
-
- function init()
- {
- $this->registerAdminAction( "recommended", "PluginRecommendedConfigAction" );
- $this->registerAdminAction( "updateRecommendedConfig",
- "PluginRecommendedUpdateConfigAction" );
-
- $menu =& Menu::getMenu();
- if( !$menu->entryExists( "/menu/controlCenter/manageTopPlugins" ))
- $this->addMenuEntry( "/menu/controlCenter", "manageTopPlugins", "", "", true, false );
- $this->addMenuEntry( "/menu/controlCenter/manageTopPlugins", "Recommended", "?op=recommended", "" );
- }
-
- function register(){
- $blogSettings = $this->blogInfo->getSettings();
- $this->pluginEnabled = $blogSettings->getValue( "plugin_recommended_enabled" );
- $this->recommendedPosts = $blogSettings->getValue( "plugin_recommended_posts" );
- }
-
- function isEnabled()
- {
- return $this->pluginEnabled;
- }
-
- /**
- * Returns the posts object of current blog
- */
- function getPosts()
- {
- if(!$this->recommendedPosts)
- return Array();
-
- $articles = new Articles();
- $blogId = $this->blogInfo->getId();
- $query = "SELECT * FROM ".$this->prefix."articles";
- $query .= " WHERE blog_id = ".$blogId." AND status = 1";
- $count = 0;
- foreach($this->recommendedPosts as $id){
- $count++;
- if($count == 1){
- $query .= " AND id = " . $id;
- }
- else{
- $query .= " OR id = " . $id;
- }
- }
- $query .= " ORDER BY num_reads DESC";
-
- $result = $articles->_db->Execute( $query );
-
- if( !$result )
- return false;
-
- $recommended = Array();
- while( $row = $result->FetchRow()) {
- $article = $articles->_fillArticleInformation( $row );
- array_push( $recommended, $article);
- }
-
- return $recommended;
- }
- }
-?>
\ No newline at end of file
Copied: plugins/branches/lifetype-1.1/recommended/pluginrecommended.class.php (from rev 4256, plugins/branches/lifetype-1.1/unported/recommended/pluginrecommended.class.php)
Copied: plugins/branches/lifetype-1.1/recommended/readme.txt (from rev 4256, plugins/branches/lifetype-1.1/unported/recommended/readme.txt)
Copied: plugins/branches/lifetype-1.1/recommended/templates (from rev 4256, plugins/branches/lifetype-1.1/unported/recommended/templates)
More information about the pLog-svn
mailing list