[pLog-svn] r1722 - in plog/branches/plog-1.1-ben/class: dao view/admin

ork at devel.plogworld.net ork at devel.plogworld.net
Mon Apr 4 23:59:44 GMT 2005


Author: ork
Date: 2005-04-04 23:59:43 +0000 (Mon, 04 Apr 2005)
New Revision: 1722

Modified:
   plog/branches/plog-1.1-ben/class/dao/articlecategory.class.php
   plog/branches/plog-1.1-ben/class/dao/articlecomments.class.php
   plog/branches/plog-1.1-ben/class/dao/articles.class.php
   plog/branches/plog-1.1-ben/class/dao/bloginfo.class.php
   plog/branches/plog-1.1-ben/class/dao/sitestatistics.class.php
   plog/branches/plog-1.1-ben/class/view/admin/adminnewpostview.class.php
Log:
mainly reorganized includes.. added a getSetting() method to blogInfo .. maybe we'll do some caching there later on.. 


Modified: plog/branches/plog-1.1-ben/class/dao/articlecategory.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/articlecategory.class.php	2005-04-04 23:58:26 UTC (rev 1721)
+++ plog/branches/plog-1.1-ben/class/dao/articlecategory.class.php	2005-04-04 23:59:43 UTC (rev 1722)
@@ -25,6 +25,8 @@
 
 		function ArticleCategory( $name, $url, $blogId, $inMainPage, $description = "", $numArticles = 0, $properties = Array(), $id = -1, $lastModification=null, $parentId = null)
 		{
+	        include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
 			$this->DbObject();
 			$this->_name = $name;
             $this->_url = $url;
@@ -178,6 +180,8 @@
 		 */
 		function getArticles( $status = POST_STATUS_PUBLISHED )
 		{
+	        include_once( PLOG_CLASS_PATH."class/dao/articles.class.php" );
+
 			if( !is_array( $this->_articles[$status] ) || $this->_articles[$status] == null ) {
 				$articles = new Articles();
 				// you've got to love these huge method calls...

Modified: plog/branches/plog-1.1-ben/class/dao/articlecomments.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/articlecomments.class.php	2005-04-04 23:58:26 UTC (rev 1721)
+++ plog/branches/plog-1.1-ben/class/dao/articlecomments.class.php	2005-04-04 23:59:43 UTC (rev 1722)
@@ -135,6 +135,7 @@
 		 */
 		function getPostCommentsByIds( $ids, $order = COMMENT_ORDER_NEWEST_FIRST, $status = COMMENT_STATUS_ALL )
 		{
+	        include_once( PLOG_CLASS_PATH."class/dao/usercomment.class.php" );
 
 			$query = "SELECT * FROM ".$this->getPrefix()."articles_comments WHERE article_id IN (".$ids.")";
             if( $status != COMMENT_STATUS_ALL )
@@ -266,6 +267,8 @@
          */
         function _fillCommentInformation( $row )
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/usercomment.class.php" );
+
         	// ---
             // this stuff is another disgusting hack to make comments
             // be aware of time differences that may have been set by

Modified: plog/branches/plog-1.1-ben/class/dao/articles.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/articles.class.php	2005-04-04 23:58:26 UTC (rev 1721)
+++ plog/branches/plog-1.1-ben/class/dao/articles.class.php	2005-04-04 23:59:43 UTC (rev 1722)
@@ -1133,6 +1133,8 @@
 		 */
 		function _fillArticleHeaderInformation( $query_result, $includeHiddenFields = true )
         {
+            include_once( PLOG_CLASS_PATH.'class/dao/article.class.php' );
+
 			$id = $query_result['id'];
 			if( isset($this->cache[$id])) {
 				return($this->cache[$id]);

Modified: plog/branches/plog-1.1-ben/class/dao/bloginfo.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/bloginfo.class.php	2005-04-04 23:58:26 UTC (rev 1721)
+++ plog/branches/plog-1.1-ben/class/dao/bloginfo.class.php	2005-04-04 23:59:43 UTC (rev 1722)
@@ -1,12 +1,6 @@
 <?php
 
 	include_once( PLOG_CLASS_PATH."class/database/dbobject.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/blogsettings.class.php" );
-	include_once( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );
-	include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
-	include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
 	
 	/**
 	 * \ingroup DAO
@@ -47,6 +41,8 @@
 
         function BlogInfo( $blog, $owner, $about, $settings, $id = -1 )
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/blogsettings.class.php" );
+
             $this->setBlog( $blog );
             $this->_owner = $owner;
             $this->_about = $about;
@@ -116,9 +112,18 @@
          */
         function getSettings()
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/blogsettings.class.php" );
+
             return $this->_settings;
         }
 
+        function getSetting( $setting )
+        {
+	        include_once( PLOG_CLASS_PATH."class/dao/blogsettings.class.php" );
+
+            return $this->_settings->getValue( $setting );
+        }
+
         /**
          * returns a key from the blog settings
          */
@@ -127,7 +132,7 @@
             if( !$this->_settings )
                 return "";
 
-            return $this->_settings->getValue( $value );
+            return $this->getSetting( $value );
         }
 
         /**
@@ -173,6 +178,8 @@
          */
         function getCreateDateObject( )
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+
             // if it hasn't been loaded yet...
             if( $this->_createTimestamp == null ) {
                 $blogs = new Blogs();
@@ -186,6 +193,8 @@
          */
         function getUpdateDateObject( )
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+
             if( $this->_updateTimestamp == null ) {
                 $blogs = new Blogs();
                 $this->setUpdateDate( $blogs->getBlogUpdateDate( $this->getId()));
@@ -198,6 +207,8 @@
          */
         function getTotalPosts( )
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+
             if( $this->_totalPosts == null ) {
                 $blogs = new Blogs();
                 $this->_totalPosts = $blogs->getBlogTotalPosts( $this->getId());
@@ -210,6 +221,8 @@
          */
         function getTotalComments( )
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+
             if( $this->_totalComments == null ) {
                 $blogs = new Blogs();
                 $this->_totalComments = $blogs->getBlogTotalComments( $this->getId());
@@ -222,6 +235,8 @@
          */
         function getTotalTrackbacks( )
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+
             if( $this->_totalTrackbacks == null ) {
                 $blogs = new Blogs();
                 $this->_totalTrackbacks = $blogs->getBlogTotalTrackbacks( $this->getId());
@@ -234,6 +249,8 @@
          */
         function getViewedTotal( )
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+
             if( $this->_viewedTotal == null ) {
                 $blogs = new Blogs();
                 $this->_viewedTotal = $blogs->getBlogViewedTotal( $this->getId());
@@ -248,6 +265,8 @@
          */
         function getOwnerInfo()
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
+
             if( $this->_ownerInfo == null ) {
                 $users = new Users();
                 $ownerInfo = $users->getUserInfoFromId( $this->_owner );
@@ -262,6 +281,8 @@
          */
         function getUsersInfo( )
         {
+	        include_once( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
+
             if( $this->_usersInfo == null ) {
                 $userpermissions = new UserPermissions();
                 $blogUsers = $userpermissions->getBlogUsers( $this->getId());
@@ -286,6 +307,8 @@
          */
         function setBlog( $blog )
         {
+	        include_once( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+
             $tf = new Textfilter();
             $this->_blog = $tf->filterAllHTML($blog);
         }
@@ -382,7 +405,7 @@
          */
         function getTemplate()
         {
-            return $this->_settings->getValue( "template");
+            return $this->getSetting( "template");
         }
 
         /**
@@ -412,6 +435,8 @@
          */
         function getBlogRequestGenerator()
         {
+	        include_once( PLOG_CLASS_PATH."class/net/requestgenerator.class.php" );
+
             return RequestGenerator::getRequestGenerator( $this );
         }
 
@@ -460,7 +485,7 @@
         {
             if( $this->_locale == null ) {
                 include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
-                $this->_locale =& Locales::getLocale( $this->_settings->getValue( "locale" ), "en_UK" );
+                $this->_locale =& Locales::getLocale( $this->getSetting( "locale" ), "en_UK" );
             }
 
             return $this->_locale;
@@ -511,7 +536,7 @@
          */
         function getResourcesQuota()
         {
-            $quota = $this->_settings->getValue( "resources_quota" );
+            $quota = $this->getSetting( "resources_quota" );
 
             // if there is no quota for this blog, then fetch it from the global
             // settings

Modified: plog/branches/plog-1.1-ben/class/dao/sitestatistics.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/dao/sitestatistics.class.php	2005-04-04 23:58:26 UTC (rev 1721)
+++ plog/branches/plog-1.1-ben/class/dao/sitestatistics.class.php	2005-04-04 23:59:43 UTC (rev 1722)
@@ -45,6 +45,8 @@
 
         function getNumberOfPostsToday()
         {
+            include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
         	$today = new Timestamp();
             $todayTimestamp = $today->getYear().$today->getMonth().$today->getDay();
         	$query = "SELECT COUNT(*) AS total FROM ".$this->getPrefix()."articles".
@@ -55,6 +57,8 @@
 
         function getNumberOfPostsThisMonth()
         {
+            include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
         	$today = new Timestamp();
             $monthTimestamp = $today->getYear().$today->getMonth();
         	$query = "SELECT COUNT(*) AS total FROM ".$this->getPrefix()."articles".

Modified: plog/branches/plog-1.1-ben/class/view/admin/adminnewpostview.class.php
===================================================================
--- plog/branches/plog-1.1-ben/class/view/admin/adminnewpostview.class.php	2005-04-04 23:58:26 UTC (rev 1721)
+++ plog/branches/plog-1.1-ben/class/view/admin/adminnewpostview.class.php	2005-04-04 23:59:43 UTC (rev 1722)
@@ -20,7 +20,9 @@
 
         function render()
         {
-           // fetch the categories
+            require_once( PLOG_CLASS_PATH."class/dao/articlestatus.class.php" );
+
+            // fetch the categories
             $categories = new ArticleCategories();
             $blogSettings = $this->_blogInfo->getSettings();
             $categoriesOrder = $blogSettings->getValue( "categories_order" );




More information about the pLog-svn mailing list