Changeset 1544 for trunk/gregarius/feed.php
- Timestamp:
- 08/24/06 01:14:02 (4 years ago)
- Files:
-
- 1 modified
-
trunk/gregarius/feed.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gregarius/feed.php
r1509 r1544 76 76 77 77 // 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 andf.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"; 81 81 82 82 if (hidePrivate()) { … … 94 94 } else { 95 95 // 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' " 99 100 . "and t.tag like '$sqlid'"; 100 101 … … 194 195 } 195 196 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'"; 199 201 // $vfid can be numeric (t.id) or alphabetic (t.tag) 200 202 if(is_numeric($vfid)) { … … 343 345 // 1: build a list of all feeds: 344 346 $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 351 351 if (hidePrivate()) { 352 352 $sql .= " and not (c.mode & " . RSS_MODE_PRIVATE_STATE . ") "; … … 449 449 450 450 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__"; 455 454 if (hidePrivate()) { 456 455 $sql .= " and not(i.unread & " . RSS_MODE_PRIVATE_STATE . ")"; … … 513 512 $next_vfid = $first_vfid = 0; 514 513 $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"); 516 516 while (list($tid__) = rss_fetch_row($res)) { 517 517 if ($tid__ == $vfid) { … … 681 681 } else { 682 682 // "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" 685 685 ." and not(i.unread & " . RSS_MODE_DELETED_STATE .") " 686 686 ); … … 1173 1173 $sql = "select " 1174 1174 ." 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 .") "; 1181 1180 if (hidePrivate()) { 1182 1181 $sql .=" and not(c.mode & " . RSS_MODE_PRIVATE_STATE .") "; 1183 1182 } 1184 $sql .= " and not(c.mode & " . RSS_MODE_DELETED_STATE .") ";1185 1183 1186 1184 if (getConfig('rss.config.absoluteordering')) { … … 1229 1227 case 'cat': 1230 1228 $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' " 1234 1232 ." order by t.tag asc"); 1235 1233 … … 1278 1276 1279 1277 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 != '' "; 1284 1281 1285 1282 if (hidePrivate()) {
