Index: openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/Attic/xowiki-portlet-procs.tcl,v diff -u -r1.56 -r1.57 --- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 25 May 2007 10:13:30 -0000 1.56 +++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 11 Jun 2007 12:21:17 -0000 1.57 @@ -1684,15 +1684,17 @@ # there must be a better way to handle temporaray tables safely.... catch {db_dml [my qn drop_temp_table] {drop table XOWIKI_TEMP_TABLE }} - db_dml [my qn get_n_most_revent_contributions] { - create temporary table XOWIKI_TEMP_TABLE as - select i.item_id, revision_id, creation_user - from cr_revisions cr, cr_items i, acs_objects o - where cr.item_id = i.item_id and i.parent_id = :folder_id - and o.object_id = revision_id - order by revision_id desc limit :max_activities - } + set sql "create global temporary table XOWIKI_TEMP_TABLE as " + append sql [::xo::db::sql select \ + -vars "i.item_id, revision_id, creation_user" \ + -from "cr_revisions cr, cr_items i, acs_objects o" \ + -where "cr.item_id = i.item_id and i.parent_id = $folder_id \ + and o.object_id = revision_id" \ + -orderby "revision_id desc" \ + -limit $max_activities] + db_dml [my qn get_n_most_recent_contributions] $sql + set total 0 db_foreach [my qn get_activities] { select count(revision_id),item_id, creation_user Index: openacs-4/packages/xowiki/www/prototypes/contributors.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/prototypes/contributors.page,v diff -u -r1.2 -r1.3 --- openacs-4/packages/xowiki/www/prototypes/contributors.page 18 Mar 2007 00:12:35 -0000 1.2 +++ openacs-4/packages/xowiki/www/prototypes/contributors.page 11 Jun 2007 12:21:17 -0000 1.3 @@ -12,12 +12,12 @@ Field count -label "Page Revisions" -html { align right } } - db_foreach get_contributors {select count(object_id), creation_user + db_foreach get_contributors {select count(object_id) as count, creation_user from acs_objects o, cr_revisions cr,cr_items ci where object_id = revision_id and parent_id = :folder_id and cr.item_id = ci.item_id - group by creation_user order by count desc; + group by creation_user order by count desc } { if {$creation_user eq ""} continue t1 add \