Index: openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql 23 Feb 2002 16:23:51 -0000 1.3
+++ openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql 25 Feb 2002 13:29:56 -0000 1.4
@@ -171,6 +171,16 @@
message_id in bboard_messages_all.message_id%TYPE
);
+ function new_p (
+ message_id in bboard_messages_all.message_id%TYPE,
+ user_id in users.user_id%TYPE
+ ) return char;
+
+ procedure mark_read (
+ message_id in bboard_messages_all.message_id%TYPE,
+ user_id in users.user_id%TYPE
+ );
+
end bboard_message;
/
show errors
@@ -691,6 +701,64 @@
acs_message.delete(message_id);
end remove;
+
+ function new_p (
+ message_id in bboard_messages_all.message_id%TYPE,
+ user_id in users.user_id%TYPE
+ ) return char
+ is
+ v_track_new char(1);
+ v_user_has_viewed_p char(1);
+ v_newness_threshhold date;
+ v_message_date date;
+ begin
+ -- figure out if this forum tracks individual messages
+ select track_new_postings_p into v_track_new from bboard_forums where forum_id = (select forum_id from bboard_forum_message_map where message_id= new_p.message_id);
+
+ -- if it does, check if the user has viewed the message
+ if v_track_new ='t' then
+ v_user_has_viewed_p:= 'f';
+
+ select 't' into v_user_has_viewed_p from dual where exists
+ (select 1 from bboard_message_user_map where message_id= new_p.message_id and user_id= new_p.user_id);
+
+ return v_user_has_viewed_p;
+ end if;
+
+ -- otherwise, look up the user preference parameter for newness
+ -- currently hacked, cause no preference mechanism
+ select second_to_last_visit into v_newness_threshhold
+ from users where user_id= new_p.user_id;
+
+ -- calculate if the message is new according to the preference
+ select sent_date into v_message_date from acs_messages
+ where message_id= new_p.message_id;
+
+ if (v_message_date > v_newness_threshhold) then
+ return 't';
+ else
+ return 'f';
+ end if;
+ end new_p;
+
+ procedure mark_read (
+ message_id in bboard_messages_all.message_id%TYPE,
+ user_id in users.user_id%TYPE
+ )
+ is
+ v_track_new char(1);
+ begin
+ -- figure out if this forum tracks individual messages
+ select track_new_postings_p into v_track_new from bboard_forums where forum_id = (select forum_id from bboard_forum_message_map where message_id= mark_read.message_id);
+
+ -- if it doesn't, stop here
+ if v_track_new = 't' then
+ insert into bboard_message_user_map
+ (message_id, user_id, view_date) values
+ (message_id, user_id, sysdate);
+ end if;
+ end mark_read;
+
end bboard_message;
/
show errors
Index: openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl 24 Feb 2002 22:19:39 -0000 1.3
+++ openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl 25 Feb 2002 13:29:56 -0000 1.4
@@ -904,6 +904,16 @@
return "full"
}
+ad_proc -public bboard_forum_name {
+} {
+ return "Bboard"
+}
+
+ad_proc -public bboard_forum_name_plural {
+} {
+ return "Bboards"
+}
+
ad_proc -public bboard_alert_from_address {
} {
Returns an appropriate from address for bboard alerts.
Index: openacs-4/packages/sloan-bboard/www/forum-entry.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/forum-entry.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/sloan-bboard/www/forum-entry.adp 23 Feb 2002 16:23:52 -0000 1.2
+++ openacs-4/packages/sloan-bboard/www/forum-entry.adp 25 Feb 2002 13:29:56 -0000 1.3
@@ -11,7 +11,7 @@
-
Forum Type:
+
<%= [bboard_forum_name] %> Type:
@@ -105,6 +105,6 @@
Admin
- [Move messages to other forum]
+ [Move messages to other <%= [bboard_forum_name] %>]
[Set Permissions]
-
\ No newline at end of file
+
Index: openacs-4/packages/sloan-bboard/www/forum.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/forum.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/sloan-bboard/www/forum.tcl 18 Feb 2002 13:21:06 -0000 1.2
+++ openacs-4/packages/sloan-bboard/www/forum.tcl 25 Feb 2002 13:29:56 -0000 1.3
@@ -66,12 +66,15 @@
set package_id [ad_conn package_id]
+set user_id [ad_conn user_id]
+
if [string equal $moderated_p "f"] {
db_multirow messages messages_select {
select message_id, title, num_replies,
first_names||' '||last_name as full_name,
- to_char(last_reply_date,'MM/DD/YY hh12:Mi am') as last_updated
+ to_char(last_reply_date,'MM/DD/YY hh12:Mi am') as last_updated,
+ bboard_message.new_p(message_id, :user_id) as new_p
from bboard_messages_all b, persons
where forum_id = :forum_id
and sent_date > decode(:last_n_days, 0, '1976-01-01', sysdate - :last_n_days)
Index: openacs-4/packages/sloan-bboard/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/www/index.adp,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/sloan-bboard/www/index.adp 15 Feb 2002 21:27:07 -0000 1.1
+++ openacs-4/packages/sloan-bboard/www/index.adp 25 Feb 2002 13:29:56 -0000 1.2
@@ -1,11 +1,11 @@
@context_bar@
-Forums
+@bboard_forum_name_plural@
[Manage Subscriptions]
- There are no forums available.
+ There are no @bboard_forum_name_plural@ available.