[pLog-svn] r2396 - plog/branches/plog-1.0.2/class/net

pwestbro at devel.plogworld.net pwestbro at devel.plogworld.net
Wed Aug 3 19:18:20 GMT 2005


Author: pwestbro
Date: 2005-08-03 19:18:20 +0000 (Wed, 03 Aug 2005)
New Revision: 2396

Modified:
   plog/branches/plog-1.0.2/class/net/customurlhandler.class.php
Log:
Fixed bug http://bugs.plogworld.net/view.php?id=668 in
customurlhandler.class.php

Now warnings will not be repored in the custom url handler when hours and
minutes are not specified in the urls


Modified: plog/branches/plog-1.0.2/class/net/customurlhandler.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/net/customurlhandler.class.php	2005-08-03 16:26:20 UTC (rev 2395)
+++ plog/branches/plog-1.0.2/class/net/customurlhandler.class.php	2005-08-03 19:18:20 UTC (rev 2396)
@@ -110,7 +110,24 @@
 			$matched = true;
 			if( $this->_format == "permalink_format" ) {
 				$this->_includeFile = $this->_indexName;
-				$this->_params["date"] = $this->_params["year"].$this->_params["month"].$this->_params["day"].$this->_params["hours"].$this->_params["minutes"];
+				if ( array_key_exists( "year", $this->_params ) )
+				{
+					$this->_params["date"] = $this->_params["year"];
+					if( array_key_exists( "month", $this->_params ) )
+					{
+						$this->_params["date"] .= $this->_params["month"];
+						if( array_key_exists( "day", $this->_params ) )
+						{
+							$this->_params["date"] .= $this->_params["day"];
+							if ( array_key_exists( "hours", $this->_params ) )
+							{
+								$this->_params["date"] .= $this->_params["hours"];
+								if( array_key_exists( "minutes", $this->_params ) )
+									$this->_params["date"] .= $this->_params["minutes"];
+							}
+						}
+					}
+				}
 				$this->_params["op"] = "ViewArticle";
 				$this->_vars = Array( "postid" => "articleId",
 							   "postname" => "articleName",
@@ -141,7 +158,24 @@
 			}
 			elseif( $this->_format == "archive_link_format" ) {
 				$this->_includeFile = $this->_indexName;	
-				$this->_params["date"] = $this->_params["year"].$this->_params["month"].$this->_params["day"].$this->_params["hours"].$this->_params["minutes"];
+				if ( array_key_exists( "year", $this->_params ) )
+				{
+					$this->_params["date"] = $this->_params["year"];
+					if( array_key_exists( "month", $this->_params ) )
+					{
+						$this->_params["date"] .= $this->_params["month"];
+						if( array_key_exists( "day", $this->_params ) )
+						{
+							$this->_params["date"] .= $this->_params["day"];
+							if ( array_key_exists( "hours", $this->_params ) )
+							{
+								$this->_params["date"] .= $this->_params["hours"];
+								if( array_key_exists( "minutes", $this->_params ) )
+									$this->_params["date"] .= $this->_params["minutes"];
+							}
+						}
+					}
+				}
 				$this->_params["op"] = "Default";
 				$this->_vars = Array( "blogid" => "blogId",
 							   "blogname" => "blogName",
@@ -150,7 +184,24 @@
 			}
 			elseif( $this->_format == "user_posts_link_format" ) {
 				$this->_includeFile = $this->_indexName;	
-				$this->_params["date"] = $this->_params["year"].$this->_params["month"].$this->_params["day"].$this->_params["hours"].$this->_params["minutes"];
+				if ( array_key_exists( "year", $this->_params ) )
+				{
+					$this->_params["date"] = $this->_params["year"];
+					if( array_key_exists( "month", $this->_params ) )
+					{
+						$this->_params["date"] .= $this->_params["month"];
+						if( array_key_exists( "day", $this->_params ) )
+						{
+							$this->_params["date"] .= $this->_params["day"];
+							if ( array_key_exists( "hours", $this->_params ) )
+							{
+								$this->_params["date"] .= $this->_params["hours"];
+								if( array_key_exists( "minutes", $this->_params ) )
+									$this->_params["date"] .= $this->_params["minutes"];
+							}
+						}
+					}
+				}
 				$this->_params["op"] = "Default";
 				$this->_vars = Array( "blogid" => "blogId",
 							   "blogname" => "blogName",
@@ -164,7 +215,24 @@
 			elseif( $this->_format == "post_trackbacks_link_format" ) {
 				$this->_includeFile = $this->_indexName;	
 				$this->_params["op"] = "Trackbacks";
-				$this->_params["date"] = $this->_params["year"].$this->_params["month"].$this->_params["day"].$this->_params["hours"].$this->_params["minutes"];		
+				if ( array_key_exists( "year", $this->_params ) )
+				{
+					$this->_params["date"] = $this->_params["year"];
+					if( array_key_exists( "month", $this->_params ) )
+					{
+						$this->_params["date"] .= $this->_params["month"];
+						if( array_key_exists( "day", $this->_params ) )
+						{
+							$this->_params["date"] .= $this->_params["day"];
+							if ( array_key_exists( "hours", $this->_params ) )
+							{
+								$this->_params["date"] .= $this->_params["hours"];
+								if( array_key_exists( "minutes", $this->_params ) )
+									$this->_params["date"] .= $this->_params["minutes"];
+							}
+						}
+					}
+				}
 				$this->_vars = Array( "blogid" => "blogId",
 							   "blogname" => "blogName",
 							   "blogowner" => "blogUserName",							   




More information about the pLog-svn mailing list