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.8 -r1.9 --- openacs.org-dev/packages/forums/www/forum-view-postgresql.xql 1 Jul 2003 17:37:23 -0000 1.8 +++ openacs.org-dev/packages/forums/www/forum-view-postgresql.xql 1 Jul 2003 17:46:53 -0000 1.9 @@ -134,4 +134,56 @@ + + + + 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 + and fm.last_child_post > :second_to_last_visit + 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.last_child_post > :second_to_last_visit + and fm.message_id IN (CURRENT_PAGE_SET) + order by fm.last_child_post desc + + + + + + select second_to_last_visit from cc_users where user_id=:user_id + + + 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.17 -r1.18 --- openacs.org-dev/packages/forums/www/forum-view.adp 1 Jul 2003 17:37:23 -0000 1.17 +++ openacs.org-dev/packages/forums/www/forum-view.adp 1 Jul 2003 17:46:53 -0000 1.18 @@ -26,7 +26,7 @@ - Sort by most recent replySort by original post date
View unanswered posts
+ Sort by most recent replySort by original post date
View unanswered posts

New posts since your last visit
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.11 -r1.12 --- openacs.org-dev/packages/forums/www/forum-view.tcl 1 Jul 2003 17:07:00 -0000 1.11 +++ openacs.org-dev/packages/forums/www/forum-view.tcl 1 Jul 2003 17:46:53 -0000 1.12 @@ -71,6 +71,12 @@ set query messages_select_unanswered } +# since last visit +if {![string equal $user_id 0] && [string equal $mode sincelastvisit]} { + set query messages_select_sincelastvisit + set second_to_last_visit [db_string get_last_visit ""] +} + set forums_table forums_messages_approved if {$moderate_p} { # set query messages_select_moderator