From: <ys...@us...> - 2004-02-04 15:42:47
|
Update of /cvsroot/ngetsuite/ngetsuite/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12272/web Modified Files: group.rhtml Log Message: orphan articles link + fixed bug that may crash update Index: group.rhtml =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/web/group.rhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** group.rhtml 4 Feb 2004 03:07:57 -0000 1.2 --- group.rhtml 4 Feb 2004 15:40:22 -0000 1.3 *************** *** 82,86 **** <a href="group.rhtml?group=<%= web.group._fullname %>&date=<%=iso%>"><%=display%></a> | <% } %> ! <a href="group.rhtml?date=any">any</a> <div class="group"><%= web.date_str %></div> --- 82,86 ---- <a href="group.rhtml?group=<%= web.group._fullname %>&date=<%=iso%>"><%=display%></a> | <% } %> ! <a href="group.rhtml?group=<%= web.group._fullname %>&date=any">any</a> <div class="group"><%= web.date_str %></div> *************** *** 104,107 **** --- 104,130 ---- </tr> <% } %> + + <tr> + <td colspan="2"> + <% + # Count "orphan" articles + + orphanq = "select count(*), sum(`size`) from `articles` " + orphanq += "where `release`='' " + + orphanq += "and DATE_FORMAT(`time`, '%Y-%m-%d')='#{web.date}' " if web.date != "any" + orphanq += "group by `release`" + + @orphsth = NgetSuite::Db.dbh.execute orphanq + + orphans = String.new + + @orphsth.fetch { |row| + orphans = "#{row[0]} \"orphans\", taking up #{NgetSuite::Utils.pretty_size(row[1])}" + } + %> + <a href="orphans.rhtml?group=<%= web.group %>&date=<%= web.date %>"><%= orphans %></a> + </td> + </tr> </table> |