Index: openacs-4/packages/sloan-bboard/sql/oracle/bboard-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/sql/oracle/bboard-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/sloan-bboard/sql/oracle/bboard-create.sql 18 Feb 2002 20:56:18 -0000 1.2 +++ openacs-4/packages/sloan-bboard/sql/oracle/bboard-create.sql 23 Feb 2002 16:23:51 -0000 1.3 @@ -138,10 +138,13 @@ not null constraint bboard_forums_moderated_p_ck check (moderated_p in ('t','f')), - format varchar(200) default 'q-and-a' - constraint bboard_forums_format_nn not null - constraint bboard_forums_format_ck - check (format in ('q-and-a','thread')), + forum_type varchar(200) default 'q-and-a' + constraint bboard_forums_forum_type_nn not null + constraint bboard_forums_forum_type_ck + check (forum_type in ('q-and-a','thread')), + track_new_postings_p char(1) default 'f' + constraint bboard_forums_track_new_ck + check (track_new_postings_p in ('t','f')), bboard_id integer constraint bboard_forums_bboard_id_nn not null @@ -177,6 +180,24 @@ create index bboard_fmm_status_idx on bboard_forum_message_map (status); +-- +-- For tracking individual views on messages +-- (This is a client request, but I still think this will be problematic - ben) +-- +create table bboard_message_user_map ( + message_id integer + constraint bboard_mum_message_id_fk + references acs_messages (message_id) + on delete cascade, + user_id integer + constraint bboard_mum_user_id_fk + references users (user_id) + on delete cascade, + view_date date default sysdate + constraint bboard_mum_view_date_nn + not null +); + -- bboard categories -- -- these are for intra-forum categorization 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.2 -r1.3 --- openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql 18 Feb 2002 20:56:18 -0000 1.2 +++ openacs-4/packages/sloan-bboard/sql/oracle/bboard-packages.sql 23 Feb 2002 16:23:51 -0000 1.3 @@ -19,7 +19,7 @@ short_name in bboard_forums.short_name%TYPE, charter in bboard_forums.charter%TYPE default null, moderated_p in bboard_forums.moderated_p%TYPE default 'f', - format in bboard_forums.format%TYPE default 'q-and-a', + forum_type in bboard_forums.forum_type%TYPE default 'q-and-a', bboard_id in bboard_forums.bboard_id%TYPE, context_id in acs_objects.context_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -202,7 +202,7 @@ short_name in bboard_forums.short_name%TYPE, charter in bboard_forums.charter%TYPE default null, moderated_p in bboard_forums.moderated_p%TYPE default 'f', - format in bboard_forums.format%TYPE default 'q-and-a', + forum_type in bboard_forums.forum_type%TYPE default 'q-and-a', bboard_id in bboard_forums.bboard_id%TYPE, context_id in acs_objects.context_id%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, @@ -224,8 +224,8 @@ object_type => object_type ); insert into bboard_forums - (forum_id, short_name, charter, moderated_p, format, bboard_id) - values (v_forum_id, short_name, charter, moderated_p, format, bboard_id); + (forum_id, short_name, charter, moderated_p, forum_type, bboard_id) + values (v_forum_id, short_name, charter, moderated_p, forum_type, bboard_id); return v_forum_id; end new; Index: openacs-4/packages/sloan-bboard/sql/postgresql/bboard-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/sql/postgresql/bboard-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/sql/postgresql/bboard-create.sql 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/sql/postgresql/bboard-create.sql 23 Feb 2002 16:23:51 -0000 1.2 @@ -154,6 +154,13 @@ not null constraint bboard_forums_moderated_p_ck check (moderated_p in ('t','f')), + forum_type varchar(200) default 'q-and-a' + constraint bboard_forums_forum_type_nn not null + constraint bboard_forums_forum_type_ck + check (forum_type in ('q-and-a','thread')), + track_new_postings_p char(1) default 'f' + constraint bboard_forums_track_new_ck + check (track_new_postings_p in ('t','f')), bboard_id integer constraint bboard_forums_bboard_id_nn not null @@ -191,6 +198,24 @@ create index bboard_fmm_status_idx on bboard_forum_message_map (status); +-- +-- For tracking individual views on messages +-- (This is a client request, but I still think this will be problematic - ben) +-- +create table bboard_message_user_map ( + message_id integer + constraint bboard_mum_message_id_fk + references acs_messages (message_id) + on delete cascade, + user_id integer + constraint bboard_mum_user_id_fk + references users (user_id) + on delete cascade, + view_date date default now() + constraint bboard_mum_view_date_nn + not null +); + -- bboard categories -- -- these are for intra-forum categorization Index: openacs-4/packages/sloan-bboard/sql/postgresql/bboard-packages.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/sql/postgresql/bboard-packages.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/sql/postgresql/bboard-packages.sql 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/sql/postgresql/bboard-packages.sql 23 Feb 2002 16:23:51 -0000 1.2 @@ -27,20 +27,21 @@ ' language 'plpgsql'; -create function bboard_forum__new (integer, varchar, varchar, char, integer, - integer, timestamp, integer, varchar, varchar) +create function bboard_forum__new (integer, varchar, varchar, char, varchar, + integer, integer, timestamp, integer, varchar, varchar) returns integer as ' declare p_forum_id alias for $1; -- default null p_short_name alias for $2; p_charter alias for $3; -- default null p_moderated_p alias for $4; -- default ''f'' - p_bboard_id alias for $5; - p_context_id alias for $6; -- default null - p_creation_date alias for $7; -- default now() - p_creation_user alias for $8; -- default null - p_creation_ip alias for $9; -- default null - p_object_type alias for $10; -- default ''bboard_forum'' + p_forum_type alias for $5; + p_bboard_id alias for $6; + p_context_id alias for $7; -- default null + p_creation_date alias for $8; -- default now() + p_creation_user alias for $9; -- default null + p_creation_ip alias for $10; -- default null + p_object_type alias for $11; -- default ''bboard_forum'' v_context_id integer; v_forum_id integer; begin @@ -55,8 +56,8 @@ ); insert into bboard_forums - (forum_id, short_name, charter, moderated_p, bboard_id) - values (v_forum_id, p_short_name, p_charter, p_moderated_p, p_bboard_id); + (forum_id, short_name, charter, moderated_p, forum_type, bboard_id) + values (v_forum_id, p_short_name, p_charter, p_moderated_p, p_forum_type, p_bboard_id); return v_forum_id; end; ' language 'plpgsql'; Index: openacs-4/packages/sloan-bboard/tcl/bboard-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/tcl/bboard-procs-oracle.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/tcl/bboard-procs-oracle.xql 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/tcl/bboard-procs-oracle.xql 23 Feb 2002 16:23:51 -0000 1.2 @@ -23,6 +23,7 @@ short_name => :short_name, charter => :charter, moderated_p => :moderated_p, + forum_type => :forum_type, bboard_id => :bboard_id, context_id => :context_id, creation_user => :creation_user, Index: openacs-4/packages/sloan-bboard/tcl/bboard-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/sloan-bboard/tcl/bboard-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/sloan-bboard/tcl/bboard-procs-postgresql.xql 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/tcl/bboard-procs-postgresql.xql 23 Feb 2002 16:23:51 -0000 1.2 @@ -17,6 +17,7 @@ :short_name, :charter, :moderated_p, + :forum_type, :bboard_id, :context_id, now(), 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.1 -r1.2 --- openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl 15 Feb 2002 21:27:06 -0000 1.1 +++ openacs-4/packages/sloan-bboard/tcl/bboard-procs.tcl 23 Feb 2002 16:23:51 -0000 1.2 @@ -40,6 +40,7 @@ ad_proc -public bboard_forum_new { {-forum_id ""} {-short_name:required} + {-forum_type "q-and-a"} {-charter ""} {-moderated_p f} {-bboard_id:required} @@ -56,6 +57,7 @@ short_name => :short_name, charter => :charter, moderated_p => :moderated_p, + forum_type => :forum_type, bboard_id => :bboard_id, context_id => :context_id, creation_user => :creation_user, @@ -90,7 +92,7 @@ ad_proc -public bboard_forum_get { {-forum_id:required} {-column_array:required} -} { + } { Get the columns for a given forum into an array variable. } { upvar $rowvar row @@ -885,6 +887,23 @@ } } +# A new proc to figure out how a user wishes to see things +ad_proc -public bboard_user_view_pref { + {-user_id ""} +} { + Check what viewing preference a user has. + Implemented for dotLRN. + + @author ben@openforce.biz +} { + if {[empty_string_p $user_id]} { + set user_id [ad_conn user_id] + } + + # FIXME: fix this when we have real user preference tracking + return "summary" +} + 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.1 -r1.2 --- openacs-4/packages/sloan-bboard/www/forum-entry.adp 15 Feb 2002 21:27:07 -0000 1.1 +++ openacs-4/packages/sloan-bboard/www/forum-entry.adp 23 Feb 2002 16:23:52 -0000 1.2 @@ -10,6 +10,13 @@
-" + for {set i $prev_depth} {$i > $replies(thread_depth)} {incr i -1} { + template::adp_puts "" + } } set prev_depth $replies(thread_depth) %> -" } if {$replies(thread_depth) < $prev_depth} { - template::adp_puts "
-+ forum_id="@forum_id@" user_id=@replies.user_id@ reply_p=@replies_p@>-