Index: openacs.org-dev/packages/forums/www/forum-view-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/www/forum-view-postgresql.xql,v diff -u -r1.6 -r1.7 --- openacs.org-dev/packages/forums/www/forum-view-postgresql.xql 11 Dec 2002 16:37:18 -0000 1.6 +++ openacs.org-dev/packages/forums/www/forum-view-postgresql.xql 1 Jul 2003 17:07:00 -0000 1.7 @@ -23,7 +23,7 @@ - + select fm.message_id, fm.subject, @@ -45,4 +45,48 @@ + + + + select fm.message_id, + fm.subject, + fm.user_id, + person__name(fm.user_id) as user_name, + fm.posting_date, + fm.state, + (select count(*) + from $forums_table fm1 + where fm1.forum_id = :forum_id + and fm1.tree_sortkey between tree_left(fm.tree_sortkey) and tree_right(fm.tree_sortkey)) as n_messages, + to_char(fm.last_child_post, 'Mon DD YYYY HH24:MI:SS') as last_child_post, + case when fm.last_child_post > (now() - 1) then 't' else 'f' end as new_p + from forums_messages_approved fm + where fm.forum_id = :forum_id + and fm.parent_id is null + order by fm.last_child_post desc + + + + + + select fm.message_id, + fm.subject, + fm.user_id, + person__name(fm.user_id) as user_name, + fm.posting_date, + fm.state, + (select count(*) + from $forums_table fm1 + where fm1.forum_id = :forum_id + and fm1.tree_sortkey between tree_left(fm.tree_sortkey) and tree_right(fm.tree_sortkey)) as n_messages, + to_char(fm.last_child_post, 'Mon DD YYYY HH24:MI:SS') as last_child_post, + case when fm.last_child_post > (now() - 1) then 't' else 'f' end as new_p + from forums_messages fm + where fm.forum_id = :forum_id + and fm.parent_id is null + and fm.message_id IN (CURRENT_PAGE_SET) + order by fm.last_child_post desc + + + Index: openacs.org-dev/packages/forums/www/forum-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/www/forum-view.adp,v diff -u -r1.14 -r1.15 --- openacs.org-dev/packages/forums/www/forum-view.adp 26 Jan 2003 13:54:11 -0000 1.14 +++ openacs.org-dev/packages/forums/www/forum-view.adp 1 Jul 2003 17:06:59 -0000 1.15 @@ -26,8 +26,7 @@ - - + Sort by most recent reply Index: openacs.org-dev/packages/forums/www/forum-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/www/forum-view.tcl,v diff -u -r1.10 -r1.11 --- openacs.org-dev/packages/forums/www/forum-view.tcl 2 Feb 2003 00:03:02 -0000 1.10 +++ openacs.org-dev/packages/forums/www/forum-view.tcl 1 Jul 2003 17:07:00 -0000 1.11 @@ -10,6 +10,7 @@ } -query { {page 1} forum_id:integer,notnull + {mode ""} } @@ -59,23 +60,35 @@ } set query messages_select + +# sort by latest reply +if {[string equal $mode latest]} { + set query messages_select_latest +} + +# just unanswered questions +if {[string equal $mode unanswered]} { + set query messages_select_unanswered +} + set forums_table forums_messages_approved if {$moderate_p} { # set query messages_select_moderator set forums_table forums_messages } +set paginator_name paginated_messages$forum_id$mode # paginator stuff -paginator create $query paginated_messages $forum(name) -pagesize 30 -groupsize 10 -contextual +paginator create $query $paginator_name "" -pagesize 30 -groupsize 10 -contextual -paginator get_data display_data paginated_messages messages "" message_id $page +paginator get_data ${query}_display_data $paginator_name messages "" message_id $page -paginator get_display_info paginated_messages info $page +paginator get_display_info $paginator_name info $page -set group [paginator get_group paginated_messages $page] +set group [paginator get_group $paginator_name $page] -paginator get_context paginated_messages pages [paginator get_pages paginated_messages $group] -paginator get_context paginated_messages groups [paginator get_groups paginated_messages $group 10] +paginator get_context $paginator_name pages [paginator get_pages $paginator_name $group] +paginator get_context $paginator_name groups [paginator get_groups $paginator_name $group 10] set notification_chunk [notification::display::request_widget \ -type forums_forum_notif \