Index: openacs-4/packages/lars-blogger/tcl/entry-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/entry-procs.tcl,v diff -u -r1.21 -r1.21.2.1 --- openacs-4/packages/lars-blogger/tcl/entry-procs.tcl 27 Feb 2004 18:59:52 -0000 1.21 +++ openacs-4/packages/lars-blogger/tcl/entry-procs.tcl 25 Apr 2004 14:22:04 -0000 1.21.2.1 @@ -73,6 +73,9 @@ # Is this a publish? if { [template::util::is_true $draft_p] && ![template::util::is_true $entry(draft_p)] } { lars_blogger::entry::publish -entry_id $entry_id -package_id $entry(package_id) + } else { + # Update instance/user feeds if needed + lars_blog_setup_feed -package_id $entry(package_id) } lars_blog_flush_cache $entry(package_id) Index: openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl,v diff -u -r1.19 -r1.19.2.1 --- openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl 27 Feb 2004 18:58:31 -0000 1.19 +++ openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.tcl 25 Apr 2004 14:22:04 -0000 1.19.2.1 @@ -32,18 +32,17 @@ } # check whether there's been a feed setup for this instance - set exists_instance_feed_p [db_string exists_instance_feed_p {}] + set subscr_id [db_string instance_feed_subscr_id {} -default {}] - if { [string equal $exists_instance_feed_p "0"] } { + if { [empty_string_p $subscr_id] } { # Setup an RSS feed for this instance set channel_link [lars_blog_public_package_url] set subscr_id [db_exec_plsql create_subscr {}] db_dml update_subscr {} - - # Run it now - rss_gen_report $subscr_id - } + } + # Run it now + rss_gen_report $subscr_id } if { [parameter::get -parameter "user_rss_feed_p" -package_id $package_id -default 0] } { @@ -53,13 +52,13 @@ if { [empty_string_p $summary_context_id] } { # Setup a channel for this instance - set summary_context_id [db_exec_plsql create_user_channel {}] + set summary_context_id [db_exec_plsql create_user_channel {}] } # check whether there's been a feed setup for this user - set exists_user_feed_p [db_string exists_user_feed_p {}] + set subscr_id [db_string user_feed_subscr_id {} -default {}] - if { !$exists_user_feed_p } { + if { [empty_string_p $subscr_id] } { set screen_name [acs_user::get_element -user_id $creation_user -element screen_name] if { ![empty_string_p $screen_name] } { @@ -68,13 +67,14 @@ set subscr_id [db_exec_plsql create_subscr {}] db_dml update_subscr {} - - # Run it now - rss_gen_report $subscr_id } else { ns_log Warning "lars-blogger: User $creation_user has no screen_name, cannot setup an RSS feed for user" } } + if { ![empty_string_p $subscr_id] } { + # Run it now + rss_gen_report $subscr_id + } } } Index: openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.xql,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.xql 27 Feb 2004 18:30:58 -0000 1.7 +++ openacs-4/packages/lars-blogger/tcl/lars-blogger-procs.xql 25 Apr 2004 14:22:04 -0000 1.7.2.1 @@ -11,9 +11,9 @@ - + - select count(*) + select subscr_id from rss_gen_subscrs s, acs_sc_impls i, weblogger_channels w @@ -35,9 +35,9 @@ - + - select count(*) + select subscr_id from rss_gen_subscrs s, acs_sc_impls i, weblogger_channels w