Changeset 3447

Show
Ignore:
Timestamp:
06/18/07 02:54:10 (17 months ago)
Author:
inureyes
Message:

#408

  • 팀블로그 출력관련 쿼리 줄이기
Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/components/Textcube.Core.php

    r3432 r3447  
    6262 
    6363    function myBlog(){ 
    64         global $database, $owner, $blogURL, $_SERVER, $blog, $service; 
     64        global $database, $owner, $blogURL, $blog, $service; 
    6565         
    6666        if($service['type'] == "path") 
     
    7171        $blogn = "<select id=\"teamblog\" onchange=\"location.href='{$blogURL}/owner/setting/teamblog/changeBlog/?bs='+this.value+'&path={$Path}'\">"; 
    7272     
    73         if( Acl::check('group.administrators') && Acl::check('group.teambloggers') ) { 
     73        //if( Acl::check('group.administrators') && Acl::check('group.teambloggers') ) { 
     74        if( Acl::check('group.owners')) { 
    7475            if($owner == $_SESSION['admin']) $myblogsel = ' selected="selected"'; 
    7576            $blogn .= '<option value="'.$owner.'" '. $myblogsel .'>'._t('내 블로그').'</option>'; 
    7677        } 
    7778     
    78         $teamblogInfo = DBQuery::queryAll("SELECT * FROM ".$database['prefix']."Teamblog WHERE userid='".$_SESSION['admin']."'"); 
    79         foreach($teamblogInfo as $res){ 
    80             if($res['teams'] == $owner && $owner == $_SESSION['admin'] ){ 
     79        $teamblogInfo = DBQuery::queryAll("SELECT t.teams, b.title, u.name 
     80                FROM {$database['prefix']}Teamblog t  
     81                LEFT JOIN {$database['prefix']}BlogSettings b ON b.owner = t.teams 
     82                LEFT JOIN {$database['prefix']}Users u ON u.userid = t.teams 
     83                WHERE t.userid='".$_SESSION['admin']."'"); 
     84        foreach($teamblogInfo as $teamInfo){ 
     85            if($teamInfo['teams'] == $owner && $owner == $_SESSION['admin'] ){ 
    8186                continue; 
    8287            } else { 
    83                 $title = DBQuery::queryCell("SELECT title FROM ".$database['prefix']."BlogSettings WHERE owner='".$res['teams']."'"); 
    84                 if(empty($title)){ 
    85                     $title = _f('%1 님의 블로그',DBQuery::queryCell("SELECT name FROM ".$database['prefix']."Users WHERE userid='".$res['teams']."'")); 
     88                if(empty($teamInfo['title'])){ 
     89                    $title = _f('%1 님의 블로그',$teamInfo['name']); 
    8690                } 
    87                 $blogn .= '<option value="' . $res['teams'] . '"'; 
    88                 if($res['teams'] == $owner) $blogn .= ' selected="selected"'; 
     91                $blogn .= '<option value="' . $teamInfo['teams'] . '"'; 
     92                if($teamInfo['teams'] == $owner) $blogn .= ' selected="selected"'; 
    8993                $blogn .= '>' . $title . '</option>'; 
    9094            } 
  • trunk/lib/config.php

    r3441 r3447  
    44/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) 
    55define('TEXTCUBE_NAME', 'Textcube'); 
    6 define('TEXTCUBE_VERSION', '1.5 Alpha 6'); 
     6define('TEXTCUBE_VERSION', '1.5 pre-Beta'); 
    77define('TEXTCUBE_COPYRIGHT', 'Copyright &copy; 2004-2007. Needlworks / Tatter Network Foundation. All rights reserved. Licensed under the GPL.'); 
    88define('TEXTCUBE_HOMEPAGE', 'http://www.textcube.com/');