Changeset 1544 for trunk/gregarius/cls

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

Feel free to scream if this breaks something...

Location:
trunk/gregarius/cls
Files:
6 modified

Legend:

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

    r1181 r1544  
    7777        if($this -> type == 'channel'){ 
    7878            $sql .= " left join " . getTable('channels') . " c on (fid=c.id)," 
    79                 .getTable('tag')." t "." where tid=t.id " 
    80                 . " and ttype = 'channel'"; 
     79                ."inner join " . getTable('tag')." t "." on tid=t.id " 
     80                . " where ttype = 'channel'"; 
    8181        }else{ 
    8282            $sql .= " left join ".getTable('item')." i on (fid=i.id)," 
    83                 .getTable('tag')." t "." where tid=t.id " 
    84                 ." and ttype = 'item'"; 
     83                ."inner join " . getTable('tag')." t "." on tid=t.id " 
     84                ." where ttype = 'item'"; 
    8585        } 
    8686 
     
    121121            $cntr ++; 
    122122        } 
    123  
    124  
    125123    } 
    126124     
  • trunk/gregarius/cls/categories.php

    r1519 r1544  
    109109            //get unread count per folder 
    110110            $sql = "select m.tid, t.tag, count(*) as cnt " 
    111             ." from " 
    112             .getTable('item') ." i, " 
    113             .getTable('channels') . " c, " 
    114             .getTable('metatag') ." m, " 
    115             .getTable('tag') . " t" 
     111            ." from " . getTable('item') ." i " 
     112            ." inner join " . getTable('channels') . " c on c.id = i.cid " 
     113            ." inner join " . getTable('metatag') ." m on m.fid = c.id " 
     114            ." inner join " . getTable('tag') . " t on t.id = m.tid " 
    116115            ." where i.unread & ". RSS_MODE_UNREAD_STATE 
    117116            ." and not(i.unread & ". RSS_MODE_DELETED_STATE .")"; 
     
    120119            } 
    121120            $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE .") "; 
    122             $sql .= " and i.cid=c.id and c.id=m.fid and m.tid=t.id" 
    123121            ." group by m.tid"; 
    124122            _pf('query'); 
     
    142140        $sql = "select " 
    143141         ." c.id, c.title, c.url, c.siteurl, t.tag, c.parent, c.icon, c.descr, c.mode, t.id " 
    144          ." from " 
    145          .getTable('channels') ." c, " 
    146          .getTable('metatag') ." m, " 
    147          .getTable('tag') . " t " 
    148          ." where m.fid = c.id and m.ttype = 'channel' " 
    149          ." and m.tid = t.id "; 
    150  
     142         ." from " . getTable('channels') ." c " 
     143         ." inner join " . getTable('metatag') ." m m.fid = c.id " 
     144         ." inner join " . getTable('tag') . " t on t.id = m.tid " 
     145         ." where m.ttype = 'channel' " 
    151146 
    152147        if (hidePrivate()) { 
  • 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()) { 
  • trunk/gregarius/cls/update.php

    r1516 r1544  
    7676 
    7777    function populate($updatePrivateAlso = false) { 
    78         $sql = "select c.id, c.url, c.title from ".getTable("channels") . " c, " 
    79                . getTable('folders') . " f "; 
    80         $sql .= " where not(c.mode & ".RSS_MODE_DELETED_STATE.") "; 
    81         $sql .= " and c.parent = f.id "; 
     78        $sql = "select c.id, c.url, c.title from ".getTable("channels") . " c " 
     79             . " inner join " . getTable('folders') . " f on f.id = c.parent " 
     80             . " where not(c.mode & ".RSS_MODE_DELETED_STATE.") "; 
    8281 
    8382        if (hidePrivate() && !$updatePrivateAlso) { 
  • trunk/gregarius/cls/wrappers/searchform.php

    r1384 r1544  
    2626# 
    2727############################################################################### 
    28  
    2928 
    3029function rss_search_title() { 
     
    9998    $sql = "select " 
    10099             ." c.id, c.title, f.name, f.id  " 
    101              ." from " . getTable("channels") ." c, " . getTable("folders"). " f " 
    102              ." where f.id=c.parent "; 
     100             ." from " . getTable("channels") ." c "  
     101         ." inner join " . getTable("folders"). " f " 
     102             ."   on f.id = c.parent "; 
    103103               
    104104    if (hidePrivate()) { 
  • trunk/gregarius/cls/wrappers/toolkit.php

    r1529 r1544  
    5555  $sql = "select " 
    5656         ." c.id, c.title, f.name, f.id  " 
    57          ." from " . getTable("channels") ." c, " . getTable("folders"). " f " 
    58          ." where f.id=c.parent "; 
     57         ." from " . getTable("channels") ." c "  
     58         ." inner join " . getTable("folders"). " f " 
     59         ."   on f.id = c.parent "; 
    5960 
    6061  if (hidePrivate()) {