[pLog-svn] r4551 - plog/branches/lifetype-1.1.5/class/action

Jon Daley plogworld at jon.limedaley.com
Wed Jan 17 21:47:59 GMT 2007


 	Is there any other place that this code is used?  I copied the 
stuff from blogaction to resourceserveraction.


On Wed, 17 Jan 2007, jondaley at devel.lifetype.net wrote:

> Author: jondaley
> Date: 2007-01-17 21:19:39 +0000 (Wed, 17 Jan 2007)
> New Revision: 4551
>
> Modified:
>   plog/branches/lifetype-1.1.5/class/action/blogaction.class.php
>   plog/branches/lifetype-1.1.5/class/action/resourceserveraction.class.php
> Log:
> fixed resource issue being not found when using {blogdomain} in the subdomain_base_url and not using {blogname} in the custom URLs.  It worked as long as the blogId was in the session variables, so rather difficult to track down.
>
> Modified: plog/branches/lifetype-1.1.5/class/action/blogaction.class.php
> ===================================================================
> --- plog/branches/lifetype-1.1.5/class/action/blogaction.class.php	2007-01-17 21:05:57 UTC (rev 4550)
> +++ plog/branches/lifetype-1.1.5/class/action/blogaction.class.php	2007-01-17 21:19:39 UTC (rev 4551)
> @@ -222,19 +222,15 @@
>             }
>
>             // fetch the BlogInfo object
> +            include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
> +            $blogs = new Blogs();
>             if( $blogId ) {
> -				include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
> -                $blogs = new Blogs();
>                 $this->_blogInfo = $blogs->getBlogInfo( $blogId );
>             }
>             else if($blogName){
> -				include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
> -                $blogs = new Blogs();
>                 $this->_blogInfo = $blogs->getBlogInfoByName( $blogName );
>             }
>             else{
> -				include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
> -                $blogs = new Blogs();
>                 $this->_blogInfo = $blogs->getBlogInfoByDomain( $blogDomain );
>             }
>
>
> Modified: plog/branches/lifetype-1.1.5/class/action/resourceserveraction.class.php
> ===================================================================
> --- plog/branches/lifetype-1.1.5/class/action/resourceserveraction.class.php	2007-01-17 21:05:57 UTC (rev 4550)
> +++ plog/branches/lifetype-1.1.5/class/action/resourceserveraction.class.php	2007-01-17 21:19:39 UTC (rev 4551)
> @@ -63,20 +63,26 @@
> 			if( $config->getValue( "subdomains_enabled" )) {
> 				$subdomainInfo = Subdomains::getSubdomainInfoFromRequest();
>
> -				if( $subdomainInfo["username"] != "" && $this->_request->getValue( 'blogUserName' ) == "" )
> -					$this->_request->setValue( 'blogUserName', $subdomainInfo["username"] );
> -				if( $subdomainInfo["blogname"] != "" && $this->_request->getValue( 'blogName' ) == "" )
> -					$this->_request->setValue( 'blogName', $subdomainInfo["blogname"] );
> +                if( !empty($subdomainInfo["blogdomain"]) && $this->_request->getValue( 'blogDomain' ) == "" ) {
> +                    $this->_request->setValue( 'blogDomain', $subdomainInfo["blogdomain"] );
> +                }
> +                if( !empty($subdomainInfo["username"]) && $this->_request->getValue( 'blogUserName' ) == "" ) {
> +                    $this->_request->setValue( 'blogUserName', $subdomainInfo["username"] );
> +                }
> +                if( !empty($subdomainInfo["blogname"]) && $this->_request->getValue( 'blogName' ) == "" ) {
> +                    $this->_request->setValue( 'blogName', $subdomainInfo["blogname"] );
> +                }
> 			}
>
>     		$blogId = $this->_request->getValue( 'blogId' );
>     		$blogName = $this->_request->getValue( 'blogName' );
>     		$userId = $this->_request->getValue( 'userId' );
>     		$userName = $this->_request->getValue( 'blogUserName' );
> +            $blogDomain = $this->_request->getValue( 'blogDomain' );
>
>             // if there is a "blogId" parameter, it takes precedence over the
>             // "user" parameter.
> -            if( !$blogId && !$blogName ) {
> +            if( !$blogId && !$blogName && !$blogDomain) {
>             	// check if there was a user parameter
>                 if( !empty($userName) ) {
>                 	// if so, check to which blogs the user belongs
> @@ -110,12 +116,17 @@
>             }
>
>             // fetch the BlogInfo object
> -			include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
> +            include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
>             $blogs = new Blogs();
> -            if( $blogId )
> +            if( $blogId ) {
>                 $this->_blogInfo = $blogs->getBlogInfo( $blogId );
> -            else
> +            }
> +            else if($blogName){
>                 $this->_blogInfo = $blogs->getBlogInfoByName( $blogName );
> +            }
> +            else{
> +                $this->_blogInfo = $blogs->getBlogInfoByDomain( $blogDomain );
> +            }
>         }
>
> 		function validate()
>
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn
>

-- 
Jon Daley
http://jon.limedaley.com/

Goodness is the harvest that is produced
from the seeds the peacemakers plant in peace.
-- James 3:18


More information about the pLog-svn mailing list