Show
Ignore:
Timestamp:
08/24/06 01:14:02 (2 years ago)
Author:
cfriesen
Message:

Feel free to scream if this breaks something...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/cls/channels.php

    r1539 r1544  
    169169 
    170170        _pf(' ... totalCount');      
    171         $sql =  
    172         "select count(*) from ".getTable("item") . "i , " . getTable('channels') . " c " 
    173              
    174             ." where i.cid=c.id and not(i.unread & ".RSS_MODE_DELETED_STATE.") " 
    175             ." and not (c.mode & " .RSS_MODE_DELETED_STATE.")" 
     171        $sql ="select count(*) from ".getTable("item") . "i "  
     172               ."inner join " . getTable('channels') . " c " 
     173         ."  on c.id = i.cid " 
     174                 ." where not(i.unread & ".RSS_MODE_DELETED_STATE.") " 
     175               ." and not (c.mode & " .RSS_MODE_DELETED_STATE.")" 
    176176            . (hidePrivate()? " and not(unread & ".RSS_MODE_PRIVATE_STATE.")":""); 
    177177             
     
    218218            //get unread count per folder                                                                         
    219219            $sql = "select f.id, f.name, count(*) as cnt " 
    220             ." from " 
    221             .getTable('item') ." i, " 
    222             .getTable('channels') . " c, " 
    223             .getTable('folders') ." f " 
     220            ." from " .getTable('item') ." i " 
     221            ." inner join " . getTable('channels') . " c on c.id = i.cid " 
     222            ." inner join " . getTable('folders') ." f on f.id = c.parent " 
    224223            ." where i.unread & ". RSS_MODE_UNREAD_STATE 
    225224            ." and not(i.unread & ". RSS_MODE_DELETED_STATE .")"; 
     
    228227            } 
    229228            $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE .") "; 
    230             $sql .= " and i.cid=c.id and c.parent=f.id " 
    231             ." group by f.id";  
     229            $sql .= " group by f.id"; 
    232230            _pf('query'); 
    233231            $res = rss_query($sql); 
     
    249247    function populate() { 
    250248        _pf('FeedList->populate() ...'); 
    251         $sql = "select "." c.id, c.title, c.url, c.siteurl, f.name, c.parent, c.icon, c.descr, c.mode "." from ".getTable("channels")." c, " 
    252         .getTable("folders")." f "." where f.id = c.parent"; 
     249        $sql = "select "." c.id, c.title, c.url, c.siteurl, f.name, c.parent, c.icon, c.descr, c.mode "." from ".getTable("channels")." c " 
     250        ."inner join " . getTable("folders")." f on f.id = c.parent"; 
    253251 
    254252        if (hidePrivate()) {