Index: openacs-4/packages/forums/catalog/forums.en_US.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/catalog/forums.en_US.ISO-8859-1.xml,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/forums/catalog/forums.en_US.ISO-8859-1.xml 19 Dec 2002 16:21:25 -0000 1.5 +++ openacs-4/packages/forums/catalog/forums.en_US.ISO-8859-1.xml 10 Jan 2003 15:12:45 -0000 1.6 @@ -1,6 +1,6 @@ - - + + Active Forums Administer @@ -51,7 +51,9 @@ Fwd: html Last Post + Last post in subject Email a copy of the following message: + First post in subject Forums Administration Need to provide a message to display. need to provide a message to display attachments! Index: openacs-4/packages/forums/tcl/forums-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-procs.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/forums/tcl/forums-procs.tcl 30 Nov 2002 17:35:17 -0000 1.9 +++ openacs-4/packages/forums/tcl/forums-procs.tcl 10 Jan 2003 15:12:59 -0000 1.10 @@ -126,6 +126,3 @@ } } - - - Index: openacs-4/packages/forums/tcl/messages-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/messages-procs.tcl,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/forums/tcl/messages-procs.tcl 4 Dec 2002 09:46:29 -0000 1.15 +++ openacs-4/packages/forums/tcl/messages-procs.tcl 10 Jan 2003 15:12:59 -0000 1.16 @@ -244,7 +244,33 @@ return [attachments::get_attachments -object_id $message_id] } -} + ad_proc -public subject_sort_filter { + -forum_id:required + -order_by:required + } { + Return a piece of HTML for toggling the sort order of threads (subjects) + in a forum. The user can either sort by the first postings in subjects + (the creation date of the subjects) or the last one. + @author Peter Marklund + } { + set subject_label "[_ forums.lt_First_post_in_subject]" + set child_label "[_ forums.Last_post_in_subject]" + set new_order_by [ad_decode $order_by posting_date last_child_post posting_date] + set export_vars [ad_export_vars -override [list [list order_by $new_order_by]] {order_by forum_id}] + set toggle_url "[ad_conn url]?${export_vars}" + if { [string equal $order_by posting_date] } { + # subject selected + set subject_link "$subject_label" + set child_link "$child_label" + } else { + # child selected + set subject_link "$subject_label" + set child_link "$child_label" + } + set sort_filter "$subject_link | $child_link" + return $sort_filter + } +} Index: openacs-4/packages/forums/www/forum-view-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/forum-view-oracle.xql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/forums/www/forum-view-oracle.xql 30 Nov 2002 17:35:39 -0000 1.7 +++ openacs-4/packages/forums/www/forum-view-oracle.xql 10 Jan 2003 15:13:11 -0000 1.8 @@ -19,7 +19,7 @@ from forums_messages_approved fm where fm.forum_id = :forum_id and fm.parent_id is null - order by fm.posting_date desc + order by fm.${order_by} desc @@ -40,7 +40,7 @@ from forums_messages fm where fm.forum_id = :forum_id and fm.parent_id is null - order by fm.posting_date desc + order by fm.${order_by} desc Index: openacs-4/packages/forums/www/forum-view-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/Attic/forum-view-postgresql.xql,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/forums/www/forum-view-postgresql.xql 21 Dec 2002 22:28:07 -0000 1.7 +++ openacs-4/packages/forums/www/forum-view-postgresql.xql 10 Jan 2003 15:13:11 -0000 1.8 @@ -19,7 +19,7 @@ from forums_messages_approved fm where fm.forum_id = :forum_id and fm.parent_id is null - order by fm.posting_date desc + order by fm.${order_by} desc @@ -40,7 +40,7 @@ from forums_messages_approved fm where fm.forum_id = :forum_id and fm.parent_id is null - order by fm.posting_date desc + order by fm.${order_by} desc Index: openacs-4/packages/forums/www/forum-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/forum-view.adp,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/forums/www/forum-view.adp 30 Nov 2002 17:35:39 -0000 1.17 +++ openacs-4/packages/forums/www/forum-view.adp 10 Jan 2003 15:13:11 -0000 1.18 @@ -25,6 +25,12 @@ [ #forums.Post_a_New_Message# ] + +
+
+ + Sort by: @sort_filter@ + @@ -84,8 +90,3 @@ - - - - - Index: openacs-4/packages/forums/www/forum-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/forum-view.tcl,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/forums/www/forum-view.tcl 11 Dec 2002 13:33:01 -0000 1.13 +++ openacs-4/packages/forums/www/forum-view.tcl 10 Jan 2003 15:13:11 -0000 1.14 @@ -8,6 +8,7 @@ } -query { forum_id:integer,notnull + {order_by "posting_date"} } @@ -79,4 +80,7 @@ set context [list $forum(name)] +# Sort by first or last posting in a thread (subject) +set sort_filter [forum::message::subject_sort_filter -forum_id $forum_id -order_by $order_by] + ad_return_template