[pLog-svn] r2390 - in plog/branches/plog-1.0.2/class: action action/admin dao dao/customfields locale

pwestbro at devel.plogworld.net pwestbro at devel.plogworld.net
Tue Aug 2 17:14:13 GMT 2005


Author: pwestbro
Date: 2005-08-02 17:14:13 +0000 (Tue, 02 Aug 2005)
New Revision: 2390

Modified:
   plog/branches/plog-1.0.2/class/action/admin/adminnewpostaction.class.php
   plog/branches/plog-1.0.2/class/action/commentaction.class.php
   plog/branches/plog-1.0.2/class/action/resourceserveraction.class.php
   plog/branches/plog-1.0.2/class/action/viewarticleaction.class.php
   plog/branches/plog-1.0.2/class/action/viewarticletrackbacksaction.class.php
   plog/branches/plog-1.0.2/class/dao/articlecomments.class.php
   plog/branches/plog-1.0.2/class/dao/customfields/customfields.class.php
   plog/branches/plog-1.0.2/class/locale/locale.class.php
Log:
Fixed more problems where warnings and notices were being printed to the logs


Modified: plog/branches/plog-1.0.2/class/action/admin/adminnewpostaction.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/action/admin/adminnewpostaction.class.php	2005-08-02 12:20:46 UTC (rev 2389)
+++ plog/branches/plog-1.0.2/class/action/admin/adminnewpostaction.class.php	2005-08-02 17:14:13 UTC (rev 2390)
@@ -29,7 +29,7 @@
         function perform()
         {
 	        $categories = new ArticleCategories();
-            $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId(), false, $categoriesOrder );
+            $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId() );
             // but make sure that we have at least one!
             if( count($blogCategories) == 0) {
             	$this->_view = new AdminTemplatedView( $this->_blogInfo, "newpostcategory" );

Modified: plog/branches/plog-1.0.2/class/action/commentaction.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/action/commentaction.class.php	2005-08-02 12:20:46 UTC (rev 2389)
+++ plog/branches/plog-1.0.2/class/action/commentaction.class.php	2005-08-02 17:14:13 UTC (rev 2390)
@@ -81,9 +81,7 @@
 			}			
 
             // if everything's fine, we set up the article object for the view
-            $this->_view->setValue( "category", $category );
             $this->_view->setValue( "post", $article );
-            $this->_view->setValue( "user", $user );
             $this->_view->setValue( "parentId", $this->_parentId );
 			$this->_view->setValue( "comments", $postComments );
 			$this->_view->setValue( "postcomments", $postComments );

Modified: plog/branches/plog-1.0.2/class/action/resourceserveraction.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/action/resourceserveraction.class.php	2005-08-02 12:20:46 UTC (rev 2389)
+++ plog/branches/plog-1.0.2/class/action/resourceserveraction.class.php	2005-08-02 17:14:13 UTC (rev 2390)
@@ -194,7 +194,7 @@
 				$this->_view = new ResourceServerView();
 				$this->_view->addHeaderResponse( "HTTP/1.1 404 Not Found" );
 				$this->_view->addHeaderResponse( "Status: 404 Not Found" );
-				$this->_view->addHeaderResponse( "X-pLog-Error: Resource $resId not found" );		
+				$this->_view->addHeaderResponse( "X-pLog-Error: Resource $this->resId not found" );		
 				
 				return false;
 			}

Modified: plog/branches/plog-1.0.2/class/action/viewarticleaction.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/action/viewarticleaction.class.php	2005-08-02 12:20:46 UTC (rev 2389)
+++ plog/branches/plog-1.0.2/class/action/viewarticleaction.class.php	2005-08-02 17:14:13 UTC (rev 2390)
@@ -74,11 +74,14 @@
 		 * @private
 		 * updates the article referrers given an id
 		 */
-		function _updateArticleReferrersById($articleId){
-			$referrers = new Referers();
-			$referrers->addReferer( $_SERVER['HTTP_REFERER'], 
-									$articleId, $this->_blogInfo->getId());
-		}
+        function _updateArticleReferrersById($articleId){
+            if ( array_key_exists( 'HTTP_REFERER', $_SERVER ) )
+            {
+                $referrers = new Referers();
+                $referrers->addReferer( $_SERVER['HTTP_REFERER'], 
+                                        $articleId, $this->_blogInfo->getId());
+            }
+        }
 		/**
 		 * @private
 		 * updates the article referrers, given a slug

Modified: plog/branches/plog-1.0.2/class/action/viewarticletrackbacksaction.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/action/viewarticletrackbacksaction.class.php	2005-08-02 12:20:46 UTC (rev 2389)
+++ plog/branches/plog-1.0.2/class/action/viewarticletrackbacksaction.class.php	2005-08-02 17:14:13 UTC (rev 2390)
@@ -115,7 +115,6 @@
 			
             // if everything's fine, we set up the article object for the view
             $this->_view->setValue( "post", $article );
-            $this->_view->setValue( "user", $user );
             $this->_view->setValue( "trackbacks", $article->getTrackbacks());
             $this->setCommonData();
 

Modified: plog/branches/plog-1.0.2/class/dao/articlecomments.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/dao/articlecomments.class.php	2005-08-02 12:20:46 UTC (rev 2389)
+++ plog/branches/plog-1.0.2/class/dao/articlecomments.class.php	2005-08-02 17:14:13 UTC (rev 2390)
@@ -339,9 +339,15 @@
             // now that we've got the time difference, we can
             // calculate what would the "real" date...
             $date = Timestamp::getDateWithOffset( $date, $timeDiff );
+		
+            $spam_rate = 0;
+            if ( array_key_exists( "spam_rate", $row ) )
+            {
+                $spam_rate = $row["spam_rate"];
+            }
 
-        	$comment = new UserComment( $row["article_id"],
-            							$row["parent_id"],
+            $comment = new UserComment( $row["article_id"],
+                                        $row["parent_id"],
                                         $row["topic"],
                                         $row["text"],
                                         $date,
@@ -349,7 +355,7 @@
                                         $row["user_email"],
                                         $row["user_url"],
                                         $row["client_ip"],
-                                        $row["spam_rate"],
+                                        $spam_rate,
                                         $row["status"],
                                         $row["id"] );
 

Modified: plog/branches/plog-1.0.2/class/dao/customfields/customfields.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/dao/customfields/customfields.class.php	2005-08-02 12:20:46 UTC (rev 2389)
+++ plog/branches/plog-1.0.2/class/dao/customfields/customfields.class.php	2005-08-02 17:14:13 UTC (rev 2390)
@@ -90,7 +90,7 @@
 			          WHERE blog_id = $blogId";
 			if( !$includeHidden )
 				$query .= " AND hidden = 0 ";
-			$query .= " ORDER BY date ASC $limits";
+			$query .= " ORDER BY date ASC";
 					  
 			$result = $this->Execute( $query, $page, $itemsPerPage );
 			

Modified: plog/branches/plog-1.0.2/class/locale/locale.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/locale/locale.class.php	2005-08-02 12:20:46 UTC (rev 2389)
+++ plog/branches/plog-1.0.2/class/locale/locale.class.php	2005-08-02 17:14:13 UTC (rev 2390)
@@ -112,6 +112,12 @@
 			if( File::isReadable( $fileName ))
 				include( $fileName );
 
+			// The following is just to handle the case where there isn't
+			// a valid local file.
+			if ( !isset($messages) || !is_array( $messages ) )
+			{
+				$messages = array();
+			}
 			$this->_messages = $messages;
 
             unset($messages);




More information about the pLog-svn mailing list