Changeset 1729

Show
Ignore:
Timestamp:
06/08/07 21:30:23 (18 months ago)
Author:
cfriesen
Message:

show all folders, even ones with 0 feeds in them.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/admin/folders.php

    r1687 r1729  
    5353    ."</tr>\n"; 
    5454 
    55  
    56     $sql = 
    57         sprintf("select f.id, f.name, count(*) from %s f, %s c where c.parent=f.id group by id", 
    58                 getTable('folders'), getTable('channels') 
    59                ); 
     55        $sql = "SELECT f.id, f.name, count(c.id) AS cnt " 
     56                 . "FROM " . getTable('folders') . " f " 
     57                 . "LEFT JOIN " . getTable('channels') . " c " 
     58                 . "  ON c.parent=f.id " 
     59                 . "GROUP BY f.id, f.name "; 
    6060 
    6161    if (getConfig('rss.config.absoluteordering')) { 
    62         $sql .=" order by f.position asc"; 
     62        $sql .=" ORDER BY f.position ASC"; 
    6363    } else { 
    64         $sql .=" order by f.name asc"; 
    65     } 
    66  
    67  
     64        $sql .=" ORDER BY f.name ASC"; 
     65    } 
    6866 
    6967    $res = rss_query($sql);