我的解决办法、、
把里面两个汉字的中间加空格
然后找到
class\action\blogaction.class.php"(192,22):
class\action\blogaction.class.php"(198,22):
修改原来的print( 'ERROR: The blog does not exist.');为
print( 'ERROR: The blog does not exist.<a href="
http://infoblog.cn">Go to Homepage</a>' );
把
// if there is a "blogId" parameter, it takes precedence over the
// "user" parameter.
if( !$blogId && !$blogName ) {
// check if there was a user parameter
if( !empty($userName) ) {
// 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(), BLOG_STATUS_ACTIVE );
// 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');
}
else {
// get the default blog id from the database
$blogId = $this->_config->getValue('default_blog_id');
}
}
}
改為
// if there is a "blogId" parameter, it takes precedence over the
// "user" parameter.
if( !$blogId && !$blogName ) {
// check if there was a user parameter
if( !empty($userName) ) {
// 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(), BLOG_STATUS_ACTIVE );
// 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 {
$blogId = $this->_config->getValue('default_blog_id');
}
}
else {
// if there is no user parameter, we take the blogId from the session
if( $this->_session->getValue('blogId') != '' ) {
$blogId = $this->_session->getValue('blogId');
}
else {
// get the default blog id from the database
$blogId = $this->_config->getValue('default_blog_id');
}
}
} else {
$blogId = $this->_config->getValue('default_blog_id');
}
你測試看看,當找不到 blog 時,應該會直接 到 default blog ...
如果可以,我會把他 commit 到 1.0.2 的 SVN 中。
Mark