Changeset 3309

Show
Ignore:
Timestamp:
05/21/07 18:17:45 (20 months ago)
Author:
inureyes
Message:

#408

  • DB 쿼리 시 대소문자 부분 처리.
  • 이제 비효율 쿼리 제거 갑니다.
Files:
1 modified

Legend:

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

    r3299 r3309  
    4141    function name(){ 
    4242        requireComponent('Eolin.PHP.Core'); 
    43         global $database, $owner, $entry, $_SESSION; 
     43        global $database, $owner, $entry; 
    4444 
    4545        $res = DBQuery::queryRow("SELECT * FROM ".$database['prefix']."Teamblog WHERE teams='$owner' and userid='$owner' " ); 
     
    5858        $styleS = ''; 
    5959        $styleE = ''; 
    60      
    61         $ttmp = DBQuery::queryRow("SELECT * FROM ".$database['prefix']."Teamblog WHERE teams='".$owner."' and userid='".$_SESSION['admin']."' " ); 
    62         $stmp = DBQuery::queryRow("SELECT * FROM ".$database['prefix']."TeamEntryRelations WHERE owner='".$owner."' and id='".$entry['id']."'"); 
    63         $itmp = DBQuery::queryRow("SELECT a.*, b.name FROM {$database['prefix']}Teamblog a, {$database['prefix']}Users b WHERE a.teams='".$owner."' and a.userid='".$stmp['team']."' AND a.userid=b.userid"); 
     60 
     61        $ttmp = DBQuery::queryRow("SELECT *  
     62                FROM ".$database['prefix']."Teamblog  
     63                WHERE teams='".$owner."'  
     64                    and userid='".$_SESSION['admin']."'"); 
     65        $stmp = DBQuery::queryRow("SELECT *  
     66                FROM ".$database['prefix']."TeamEntryRelations  
     67                WHERE owner='".$owner."'  
     68                    and id='".$entry['id']."'"); 
     69        $itmp = DBQuery::queryRow("SELECT a.*, b.name  
     70                FROM {$database['prefix']}Teamblog a,  
     71                    {$database['prefix']}Users b  
     72                WHERE a.teams='".$owner."'  
     73                    AND a.userid='".$stmp['team']."'  
     74                    AND a.userid=b.userid"); 
    6475  
    6576        if(empty($font_style)){ 
     
    8899        } 
    89100     
    90         if(($ttmp['Posting'] == 1) || ($stmp['Team'] == $_SESSION['admin'])) $name[2] = 1; 
     101        if(($ttmp['posting'] == 1) || ($stmp['team'] == $_SESSION['admin'])) $name[2] = 1; 
    91102  
    92103        return $name; 
     
    94105 
    95106    function PC(){ 
    96         global $database, $owner, $_SESSION; 
     107        global $database, $owner; 
    97108        $itmp = DBQuery::queryRow("SELECT * FROM ".$database['prefix']."Teamblog WHERE teams='".$owner."' and userid='".$_SESSION['admin']."'"); 
    98109        $access = 0; 
    99         if(!empty($itmp['Posting'])) $access = 1; 
     110        if(!empty($itmp['posting'])) $access = 1; 
    100111        return $access; 
    101112     } 
    102113       
    103114     function AC(){ 
    104         global $database, $owner, $_SESSION; 
     115        global $database, $owner; 
    105116        $itmp = DBQuery::queryRow("SELECT * FROM ".$database['prefix']."Teamblog WHERE teams='".$owner."' and userid='".$_SESSION['admin']."'"); 
    106117        $access = 0; 
     
    111122      
    112123     function myBlog(){ 
    113         global $database, $owner, $_SESSION, $blogURL, $_SERVER, $blog, $service; 
     124        global $database, $owner, $blogURL, $_SERVER, $blog, $service; 
    114125         
    115126        if($service['type'] == "path")