[pLog-svn] r2447 - plog/branches/plog-1.0.2/class/action

mark at devel.plogworld.net mark at devel.plogworld.net
Sun Sep 4 15:22:38 GMT 2005


Author: mark
Date: 2005-09-04 15:22:37 +0000 (Sun, 04 Sep 2005)
New Revision: 2447

Modified:
   plog/branches/plog-1.0.2/class/action/blogaction.class.php
   plog/branches/plog-1.0.2/class/action/resourceserveraction.class.php
Log:
Add some "else" statement to blogId look out founction. This can make sure if pLog can not find propreiate blogId , it will use default_blog_id as the blogId.

Modified: plog/branches/plog-1.0.2/class/action/blogaction.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/action/blogaction.class.php	2005-09-03 21:27:38 UTC (rev 2446)
+++ plog/branches/plog-1.0.2/class/action/blogaction.class.php	2005-09-04 15:22:37 UTC (rev 2447)
@@ -154,7 +154,7 @@
             // "user" parameter.
             if( !$blogId && !$blogName ) {
             	// check if there was a user parameter
-                 if( !empty($userName) ) {
+                if( !empty($userName) ) {
                 	// if so, check to which blogs the user belongs
                 	$users = new Users();
                  	$userInfo = $users->getUserInfoFromUsername( $userName );
@@ -165,7 +165,11 @@
                         // get the first one (any better rule for this?)
                     	if( !empty($userBlogs)) {						
 	                		$blogId = $userBlogs[0]->getId();
+                        } else {
+                        	$blogId = $this->_config->getValue('default_blog_id');
                         }
+                    } else {
+                    	$blogId = $this->_config->getValue('default_blog_id');
                     }
                 }
                 else {
@@ -178,6 +182,8 @@
                         $blogId = $this->_config->getValue('default_blog_id');                        
                     }
                 }
+            } else {
+            	$blogId = $this->_config->getValue('default_blog_id');
             }
 			
             // fetch the BlogInfo object

Modified: plog/branches/plog-1.0.2/class/action/resourceserveraction.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/action/resourceserveraction.class.php	2005-09-03 21:27:38 UTC (rev 2446)
+++ plog/branches/plog-1.0.2/class/action/resourceserveraction.class.php	2005-09-04 15:22:37 UTC (rev 2447)
@@ -60,7 +60,7 @@
             // "user" parameter.
             if( !$blogId && !$blogName ) {
             	// check if there was a user parameter
-                 if( !empty($userName) ) {
+                if( !empty($userName) ) {
                 	// if so, check to which blogs the user belongs
                 	$users = new Users();
                  	$userInfo = $users->getUserInfoFromUsername( $userName );
@@ -71,7 +71,11 @@
                         // get the first one (any better rule for this?)
                     	if( !empty($userBlogs)) {						
 	                		$blogId = $userBlogs[0]->getId();
+                        } else{
+                        	$blogId = $this->_config->getValue('default_blog_id');
                         }
+                    } else{
+                    	$blogId = $this->_config->getValue('default_blog_id');
                     }
                 }
                 else {
@@ -84,6 +88,8 @@
                         $blogId = $this->_config->getValue('default_blog_id');                        
                     }
                 }
+            } else {
+            	$blogId = $this->_config->getValue('default_blog_id');
             }
 			
             // fetch the BlogInfo object




More information about the pLog-svn mailing list