Index: openacs.org-dev/www/bboard-migr/msg-migr.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/www/bboard-migr/msg-migr.tcl,v diff -u -r1.1 -r1.2 --- openacs.org-dev/www/bboard-migr/msg-migr.tcl 10 Jul 2002 19:29:04 -0000 1.1 +++ openacs.org-dev/www/bboard-migr/msg-migr.tcl 15 Jul 2002 20:16:40 -0000 1.2 @@ -1,7 +1,11 @@ #hardcode if you're not in the correct package instance... +# which package are we using +#set bboard_package "bboard" +set bboard_package "forums" + #set package_id [ad_conn package_id] -set package_id 3189 +set package_id 3928 set olddb [ns_db gethandle acs32] @@ -57,27 +61,41 @@ set mime_type "text/plain; format=flowed" } - set new_created_id [bboard_message_new -reply_to $new_reply_to_id \ - -sender $new_user_id -title $one_line -mime_type $mime_type \ - -content $message -context_id $new_forum_id \ - -creation_ip $originating_ip \ - -sent_date $posting_time -] - bboard_message_set_status \ + set category_id "" + set new_category_id $category_id + + if {[string equal $bboard_package "bboard"]} { + set new_created_id [bboard_message_new -reply_to $new_reply_to_id \ + -sender $new_user_id -title $one_line -mime_type $mime_type \ + -content $message -context_id $new_forum_id \ + -creation_ip $originating_ip \ + -sent_date $posting_time] + + bboard_message_set_status \ -message_id $new_created_id \ -forum_id $new_forum_id -status "unmoderated" - if {![empty_string_p $category]} { - db_1row q "select category_id as new_category_id - from bboard_categories - where short_name = '$category' - and forum_id=$new_forum_id" - db_dml q "insert into bboard_category_message_map - (message_id, category_id) - values (:new_created_id, :new_category_id)" + if {![empty_string_p $category]} { + db_1row q "select category_id as new_category_id + from bboard_categories + where short_name = '$category' + and forum_id=$new_forum_id" + db_dml q "insert into bboard_category_message_map + (message_id, category_id) + values (:new_created_id, :new_category_id)" + } + + } else { + # assume it's the new "forums" package +#ns_return 200 text/plain "new_forum_id=$new_forum_id\n new_reply_to_id=$new_reply_to_id\n one_line=$one_line\n message=$message\n parent_id=$new_reply_to_id\n html_p=$html_p\n new_user_id=$new_user_id" +#return + set new_created_id [forum::message::new -forum_id $new_forum_id \ + -message_id "" -parent_id $new_reply_to_id \ + -subject $one_line -content $message \ + -html_p $html_p -user_id $new_user_id] }