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

Feel free to scream if this breaks something...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/feed.php

    r1509 r1544  
    7676 
    7777        // is this a folder? 
    78         $sql = "select c.id, c.parent from ". getTable('channels')." c, " 
    79                . getTable('folders') . " f " 
    80                ." where c.parent=f.id and f.name like '$sqlid' and f.id > 0"; 
     78        $sql = "select c.id, c.parent from ". getTable('channels')." c " 
     79               ." inner join " . getTable('folders') . " f on f.id = c.parent " 
     80               ." where f.name like '$sqlid' and f.id > 0"; 
    8181 
    8282        if (hidePrivate()) { 
     
    9494        } else { 
    9595            // maybe it's a virtual folder? 
    96             $sql = "select c.id, m.tid from ". getTable('channels')." c, " 
    97                    . getTable('metatag') . " m, " . getTable('tag') . " t " 
    98                    . "where c.id = m.fid and m.ttype = 'channel' and m.tid = t.id " 
     96            $sql = "select c.id, m.tid from ". getTable('channels')." c " 
     97                   ."inner join " . getTable('metatag') . " m on m.fid = c.id " 
     98                   ."inner join " . getTable('tag') . " t on t.id = m.tid " 
     99                   . "where m.ttype = 'channel' " 
    99100                   . "and t.tag like '$sqlid'"; 
    100101 
     
    194195    } 
    195196    elseif ($vfid) { 
    196         $sql = "select c.id, m.tid from ". getTable('channels')." c, " 
    197                . getTable('metatag') . " m, " . getTable('tag') . " t " 
    198                . "where c.id = m.fid and m.ttype = 'channel' and m.tid = t.id "; 
     197        $sql = "select c.id, m.tid from ". getTable('channels')." c " 
     198               ."inner join " . getTable('metatag') . " m on m.fid = c.id " 
     199               ."inner join " . getTable('tag') . " t on t.id = m.tid " 
     200               . "where m.ttype = 'channel'"; 
    199201        // $vfid can be numeric (t.id) or alphabetic (t.tag) 
    200202        if(is_numeric($vfid)) { 
     
    343345            // 1: build a list of all feeds: 
    344346            $feeds = array(); 
    345             $sql = "select c.id from " 
    346                    . getTable('channels') . " c, " 
    347                    . getTable('folders') . " f " 
    348                    . "where c.parent=f.id " 
    349                    ." and not (c.mode & " . RSS_MODE_DELETED_STATE .") " 
    350                    ; 
     347            $sql = "select c.id from " . getTable('channels') . " c " 
     348                   ."inner join " . getTable('folders') . " f on f.id = c.parent " 
     349                   . "where not (c.mode & " . RSS_MODE_DELETED_STATE .") "; 
     350 
    351351            if (hidePrivate()) { 
    352352                $sql .= " and not (c.mode & " . RSS_MODE_PRIVATE_STATE . ") "; 
     
    449449             
    450450            if( $found || !$first_fid ) { 
    451                 $sql = "select count(*) from " 
    452                        .getTable('item') ." i, " 
    453                        .getTable('channels') ." c " 
    454                        ." where i.unread & " .RSS_MODE_UNREAD_STATE ." and i.cid = c.id and c.parent = $fid__"; 
     451                $sql = "select count(*) from " . getTable('item') ." i " 
     452                       ."inner join " . getTable('channels') ." c on c.id = i.cid " 
     453                       ." where i.unread & " .RSS_MODE_UNREAD_STATE ." and c.parent = $fid__"; 
    455454                if (hidePrivate()) { 
    456455                    $sql .= " and not(i.unread & " . RSS_MODE_PRIVATE_STATE . ")"; 
     
    513512        $next_vfid = $first_vfid = 0; 
    514513        $found = false; 
    515         $res = rss_query("select distinct tid from " .getTable('metatag') ." m," .getTable('tag') ."t where m.tid = t.id order by t.tag asc"); 
     514        $res = rss_query("select distinct tid from " .getTable('metatag') ." m " 
     515             . "inner join " . getTable('tag') ."t on t.id = m.tid order by t.tag asc"); 
    516516        while (list($tid__) = rss_fetch_row($res)) { 
    517517            if ($tid__ == $vfid) { 
     
    681681} else { 
    682682    // "item mode" 
    683     $res = rss_query ("select c.title, c.icon, i.title from " . getTable("channels") ." c, " 
    684                       .getTable("item") ." i where c.id = $cid and i.cid=c.id and i.id=$iid" 
     683    $res = rss_query ("select c.title, c.icon, i.title from " . getTable("channels") ." c " 
     684                      ."inner join " . getTable("item") ." i on i.cid = c.id where c.id = $cid and i.id=$iid" 
    685685                      ." and not(i.unread & " . RSS_MODE_DELETED_STATE  .") " 
    686686                     ); 
     
    11731173            $sql = "select " 
    11741174                   ." c.id, c.title " 
    1175                    ." from " 
    1176                    .getTable("channels") ." c, " 
    1177                    . getTable("folders") ." d " 
    1178                    ." where d.id = c.parent "; 
    1179  
    1180  
     1175                   ." from " . getTable("channels") ." c " 
     1176                   ." inner join " . getTable("folders") ." d " 
     1177                   ."   on d.id = c.parent "; 
     1178 
     1179            $sql .= " where not(c.mode & " .  RSS_MODE_DELETED_STATE .") "; 
    11811180            if (hidePrivate()) { 
    11821181                $sql .=" and not(c.mode & " . RSS_MODE_PRIVATE_STATE .") "; 
    11831182            } 
    1184             $sql .= " and not(c.mode & " .  RSS_MODE_DELETED_STATE .") "; 
    11851183 
    11861184            if (getConfig('rss.config.absoluteordering')) { 
     
    12291227        case 'cat': 
    12301228            $res = rss_query(" select t.tag,t.id from  " 
    1231                              .getTable('metatag') ." m, " 
    1232                              .getTable('tag') . "t " 
    1233                              ." where  m.ttype = 'channel' and m.tid = t.id  " 
     1229                             .getTable('metatag') ." m " 
     1230                             ."inner join " . getTable('tag') . "t on t.id = m.tid " 
     1231                             ." where  m.ttype = 'channel' " 
    12341232                             ." order by t.tag asc"); 
    12351233 
     
    12781276 
    12791277        case 'folder': 
    1280             $sql = "select  f.id, f.name, count(*) from " 
    1281                    . getTable('channels') . " c, " 
    1282                    . getTable('folders') . " f " 
    1283                    ." where c.parent=f.id and f.name != '' "; 
     1278            $sql = "select  f.id, f.name, count(*) from " . getTable('channels') . " c " 
     1279                   ."inne join " . getTable('folders') . " f on f.id = c.parent " 
     1280                   ." where f.name != '' "; 
    12841281 
    12851282            if (hidePrivate()) {