[pLog-svn] r577 - plog/trunk/class/dao

su baochen subaochen at 126.com
Mon Dec 27 01:28:20 GMT 2004


在 2004-12-26日的 11:56 +0100,Oscar Renalias写道:
> > check if userinfo is null: null userinfo means we can not get 
> > userinfo, so just return blogId=0, this will used to redirect user to 
> > summary page in the future?
> 
> Don't know, I'd like to keep the summary separated as much as possible 
> from the core... In fact, it is getting so big that I was thinking 
> about releasing it as a separate package instead of including ig in the 
> final .tar.gz with the final version of 1.0.
> 
> One thing we can do is include it as a condition... *If* the summary is 
> available, then redirect to the summary. That shouldn't be too 
> difficult :-)

In fact, this is not really related to summary page:-)

Just thinking about what if $userinfo is null? that is, 

$userinfo = $this->getUserInfoFromUsername($username);

returns null.

Then, $userinfo->getId() will failed,and give user an ugly response...

So, if $userinfo == null, return 0 is a reasonable value? zero is not
used for useId, and zero can be, in the future, do something in
someway, I don't know:-)

 

> 
> By the way, any improvement regarding the changes to the search engine 
> and php's handling of chinese characters?

Not really, I test mysql 4.1.7 with full text search, but failed to
search Chinese:-(.

To search Chinese, my idea is that, set mysql's character set to utf8
will help, default character set of mysql (latin1?) not support Chinese
very well.

I'd like to investigate this more, but any hints from anybody are highly
appriciated!

> 
> Oscar
> 
> >
> >
> > Modified: plog/trunk/class/dao/users.class.php
> > ===================================================================
> > --- plog/trunk/class/dao/users.class.php	2004-12-23 23:38:23 UTC (rev 
> > 576)
> > +++ plog/trunk/class/dao/users.class.php	2004-12-26 02:22:47 UTC (rev 
> > 577)
> > @@ -432,7 +432,11 @@
> >              $blogs = new Blogs();
> >
> >              $userinfo = $this->getUserInfoFromUsername($username);
> > +            // if userinfo is null, this maybe because username is 
> > not exists..
> > +            // return 0 means, should go to summary page
> > +            if(!$userinfo) return 0;
> >              $userid = $userinfo->getId();
> > +            $userid = $userinfo->getId();
> >
> >          	// check if the user is the owner of any blog
> >              $owner = "SELECT id FROM ".$this->getPrefix()."blogs 
> > WHERE owner_id = ".$userid.";";
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.plogworld.net
> > http://devel.plogworld.net/mailman/listinfo/plog-svn
> >
> 
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.plogworld.net
> http://devel.plogworld.net/mailman/listinfo/plog-svn
> 
-- 
Best regards,
---
subaochen <subaochen at 126.com>





More information about the pLog-svn mailing list