Index: openacs.org-dev/packages/forums/forums.info =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/forums.info,v diff -u -r1.3 -r1.4 --- openacs.org-dev/packages/forums/forums.info 5 Sep 2002 17:27:43 -0000 1.3 +++ openacs.org-dev/packages/forums/forums.info 17 Apr 2003 14:28:53 -0000 1.4 @@ -47,12 +47,19 @@ + + + + + + + @@ -75,6 +82,7 @@ + @@ -83,12 +91,17 @@ + + + + + @@ -113,9 +126,7 @@ - - - + Index: openacs.org-dev/packages/forums/sql/postgresql/forums-forums-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/sql/postgresql/forums-forums-create.sql,v diff -u -r1.2 -r1.3 --- openacs.org-dev/packages/forums/sql/postgresql/forums-forums-create.sql 10 Jul 2002 18:42:30 -0000 1.2 +++ openacs.org-dev/packages/forums/sql/postgresql/forums-forums-create.sql 17 Apr 2003 14:29:42 -0000 1.3 @@ -61,6 +61,11 @@ name varchar(200) constraint forums_name_nn not null, + short_name varchar(50) + constraint forums_short_name_un + unique + constraint forums_short_name_nn + not null, charter varchar(2000), presentation_type varchar(100) constraint forums_presentation_type_nn Index: openacs.org-dev/packages/forums/tcl/messages-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/tcl/messages-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs.org-dev/packages/forums/tcl/messages-procs.tcl 31 Oct 2002 18:32:36 -0000 1.8 +++ openacs.org-dev/packages/forums/tcl/messages-procs.tcl 17 Apr 2003 14:30:35 -0000 1.9 @@ -18,6 +18,7 @@ {-content:required} {-html_p "f"} {-user_id ""} + {-posting_date ""} } { create a new message } { @@ -29,7 +30,7 @@ # Prepare the variables for instantiation set extra_vars [ns_set create] - oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {forum_id message_id parent_id subject content html_p user_id} + oacs_util::vars_to_ns_set -ns_set $extra_vars -var_list {forum_id message_id parent_id subject content html_p user_id posting_date} db_transaction { set message_id [package_instantiate_object -extra_vars $extra_vars forums_message] @@ -52,28 +53,44 @@ set forum_id $message(forum_id) set url "[ad_url][db_string select_forums_package_url {}]" - set new_content "" - append new_content "Forum: $message(forum_name)
\n" - append new_content "Thread: $message(root_subject)
\n" - append new_content "Author: $message(user_name)
\n" - append new_content "Posted: $message(posting_date)
" - append new_content "\n
\n" - append new_content $message(content) + ## JCD: new_content not used for now. + #set new_content "" + #append new_content "Forum: $message(forum_name)
\n" + #append new_content "Thread: $message(root_subject)
\n" + #append new_content "Author: $message(user_name)
\n" + #append new_content "\n
\n" + #append new_content $message(content) + #append new_content "

-------------------
" + ## send text for now. + ## only convert if it is not already text + #set new_content [ad_html_to_text $new_content] - # send text for now. - if { $message(html_p) == "t" } { - set body_text [ad_html_to_text $message(content)] - } else { - set body_text [wrap_string $message(content) 72] - } + set new_content "" + append new_content "Forum: $message(forum_name) +Thread: $message(root_subject) +Author: $message(user_name) <$message(user_email)> + +" + if { $message(html_p) } { + append new_content "[ad_html_to_text $message(content)]" + } else { + append new_content "[wrap_string $message(content)]" + } + append new_content " + +-- +To post a reply to this email or view this message go to: +${url}message-view?message_id=$message(root_message_id)" + + # Do the notification for the forum notification::new \ -type_id [notification::type::get_type_id \ -short_name forums_forum_notif] \ -object_id $message(forum_id) \ -response_id $message(message_id) \ - -notif_subject $message(subject) \ + -notif_subject "\[$message(forum_name)\] $message(subject)" \ -notif_text $new_content # Eventually we need notification for the root message too @@ -82,7 +99,7 @@ -short_name forums_message_notif] \ -object_id $message(root_message_id) \ -response_id $message(message_id) \ - -notif_subject $message(subject) \ + -notif_subject "\[$message(forum_name)\] $message(subject)" \ -notif_text $new_content } @@ -169,6 +186,15 @@ db_foreach get_notifications_for_delete {} { db_exec_plsql delete_notification {} } + + + #delete all rows in notifications table also -DaveB + db_foreach get_notifications_for_delete {} { + db_exec_plsql delete_notification {} + } + + + # Remove the message db_exec_plsql delete_message {} } Index: openacs.org-dev/packages/forums/www/index-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/forums/www/index-postgresql.xql,v diff -u -r1.3 -r1.4 --- openacs.org-dev/packages/forums/www/index-postgresql.xql 11 Dec 2002 16:37:18 -0000 1.3 +++ openacs.org-dev/packages/forums/www/index-postgresql.xql 17 Apr 2003 14:31:25 -0000 1.4 @@ -9,7 +9,7 @@ (select count(*) from forums_messages where forums_messages.forum_id = forums_forums_enabled.forum_id - and 1 = tree_level(forums_messages.tree_sortkey)) as n_threads, + and parent_id is null) as n_threads, to_char(last_post, 'Mon DD YYYY HH24:MI:SS') as last_post, case when last_post > (now() - 1) then 't' else 'f' end as new_p from forums_forums_enabled