[pLog-svn] r997 - plog/trunk/class/action

Oscar Renalias phunkphorce at gmail.com
Tue Feb 8 15:20:44 GMT 2005


hold on, not so quick!!! This code is needed so that there can be urls
like index.php?op=Default&userName=oscar or
/blog/whatever_blog/user/oscar. These urls will list only the posts by
this user.

Oscar


On Tue,  8 Feb 2005 14:46:09 +0000 (GMT), ork at devel.plogworld.net
<ork at devel.plogworld.net> wrote:
> Author: ork
> Date: 2005-02-08 14:46:09 +0000 (Tue, 08 Feb 2005)
> New Revision: 997
> 
> Modified:
>    plog/trunk/class/action/blogaction.class.php
> Log:
> userParam is not set.. thus there is whole if block that'll never be
> executed.. fine with me :) the less code the better..
> 
> Modified: plog/trunk/class/action/blogaction.class.php
> ===================================================================
> --- plog/trunk/class/action/blogaction.class.php        2005-02-08 14:20:11 UTC (rev 996)
> +++ plog/trunk/class/action/blogaction.class.php        2005-02-08 14:46:09 UTC (rev 997)
> @@ -147,21 +147,22 @@
>              // "user" parameter.
>              if( !$blogId && !$blogName ) {
>                 // check if there was a user parameter
> -                if( $userParam ) {
> -                       // if so, check to which blogs the user belongs
> -                       $users = new Users();
> -                       $userInfo = $users->getUserInfoFromUsername( $userName );
> -                    // if the user exists and is valid...
> -                       if( $userInfo ) {
> -                       $userBlogs = $users->getUsersBlogs( $userInfo->getId());
> -                        // check if he or she belogs to any blog. If he or she does, simply
> -                        // get the first one (any better rule for this?)
> -                       if( !empty($userBlogs)) {
> -                                       $blogId = $userBlogs[0]->getId();
> -                        }
> -                    }
> -                }
> -                else {
> +                // TBD: remove all this code if really not needed..
> +                // if( $userParam ) {
> +                //     // if so, check to which blogs the user belongs
> +                //     $users = new Users();
> +                //     $userInfo = $users->getUserInfoFromUsername( $userName );
> +                //    // if the user exists and is valid...
> +                //     if( $userInfo ) {
> +                //     $userBlogs = $users->getUsersBlogs( $userInfo->getId());
> +                //        // check if he or she belogs to any blog. If he or she does, simply
> +                //        // get the first one (any better rule for this?)
> +                //     if( !empty($userBlogs)) {
> +                   //                  $blogId = $userBlogs[0]->getId();
> +                //        }
> +                //    }
> +                //}
> +                //else {
>                      // if there is no user parameter, we take the blogId from the session
>                      if( $this->_session->getValue('blogId') != '' ) {
>                         $blogId = $this->_session->getValue('blogId');
> @@ -170,7 +171,7 @@
>                          // get the default blog id from the database
>                          $blogId = $this->_config->getValue('default_blog_id');
>                      }
> -                }
> +                //}
>              }
> 
>              // fetch the BlogInfo object
> @@ -234,4 +235,4 @@
>                         return true;
>                 }
>      }
> -?>
> \ No newline at end of file
> +?>
> 
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.plogworld.net
> http://devel.plogworld.net/mailman/listinfo/plog-svn
>



More information about the pLog-svn mailing list