Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/index-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/news-aggregator/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/index.adp,v diff -u -r1.15 -r1.16 --- openacs-4/packages/news-aggregator/www/index.adp 17 Jul 2018 15:42:42 -0000 1.15 +++ openacs-4/packages/news-aggregator/www/index.adp 18 Jul 2018 13:36:11 -0000 1.16 @@ -1,9 +1,18 @@ - @page_title@ - @context@ - + @page_title;literal@ + @context;literal@ + @page_title;literal@ + + +

@@ -20,7 +29,7 @@ This page lists the most recent items from the feeds you've subscribed to. - + You can hit the Purge button to clean out the page. Clicking the Save icon Save will prevent an item from being purged. Click on the #news-aggregator.Post# icon Post this item to your Weblog to add the item to your weblog. @@ -44,7 +53,6 @@ @items.title@#news-aggregator.updated_x_time_ago# - Technorati Cosmos @@ -78,7 +86,7 @@ - + Index: openacs-4/packages/news-aggregator/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/www/index.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/news-aggregator/www/index.tcl 9 May 2018 15:33:33 -0000 1.17 +++ openacs-4/packages/news-aggregator/www/index.tcl 18 Jul 2018 13:36:11 -0000 1.18 @@ -5,7 +5,7 @@ @creation-date 28-06-2003 } { aggregator_id:integer,optional - purge_p:boolean,optional + {purge_p:boolean,optional false} } set user_id [ad_conn user_id] @@ -31,7 +31,7 @@ if { !$aggregator_id && $per_user_aggregators_p } { - set user_name [db_string select_user_name {}] + set user_name [person::name -person_id $user_id] set aggregator_name "${user_name}'s News Aggregator" set aggregator_id [news_aggregator::aggregator::new \ @@ -47,7 +47,8 @@ -package_id $package_id } - ad_returnredirect "$aggregator_id" + ad_returnredirect $aggregator_id + ad_script_abort } if { $aggregator_id == 0 } { @@ -57,22 +58,27 @@ -privilege write] if { $write_p } { ad_returnredirect "settings" + ad_script_abort } ad_returnredirect "public-aggregators" + ad_script_abort } set write_p [permission::permission_p \ -object_id $aggregator_id \ -privilege write] -db_1row aggregator_info {} +set info [news_aggregator::aggregator::aggregator_info \ + -aggregator_id $aggregator_id] +set aggregator_name [dict get $info aggregator_name] +set aggregator_description [dict get $info aggregator_description] +set public_p [dict get $info public_p] #if { $public_p == "f" } { # permission::require_permission \ # -object_id $aggregator_id \ # -privilege write #} - set page_title $aggregator_name set context [list $page_title] @@ -84,36 +90,25 @@ set create_url "${package_url}/aggregator" -set limit [parameter::get -parameter "number_of_items_shown"] -set sql_limit [expr {7*$limit}] - -set top 0 -set bottom 1073741824 - -set counter 0 - -if { [info exists purge_p] && $public_p == "f" && $purge_p == "f" } { - set purge_p 0 -} elseif { $public_p == "t" } { - set purge_p 0 -} elseif { !$enable_purge_p } { - set purge_p 0 -} else { - set purge_p 1 -} - # We only handle purges if the aggregator is not public -if { $purge_p } { -# set items_purges [db_map items_purges] - set purges [db_list_of_lists purges ""] - set saved_items [db_list saved_items ""] +if { $enable_purge_p || !$public_p || $purge_p } { + set purges [db_list_of_lists purges { + select top, bottom + from na_purges + where aggregator_id = :aggregator_id + order by top desc, bottom desc + }] + set saved_items [db_list saved_items { + select item_id + from na_saved_items + where aggregator_id = :aggregator_id + }] } else { -# set items_purges "" set purges [list] set saved_items [list] } -if { $purge_p } { +if { $enable_purge_p || !$public_p || $purge_p } { set items_query [news_aggregator::aggregator::items_sql \ -aggregator_id $aggregator_id \ -package_id $package_id \ @@ -126,14 +121,21 @@ -limit_multiple 1] } + +set limit [parameter::get -parameter "number_of_items_shown"] + +set top 0 +set bottom 1073741824 + +set counter 0 + db_multirow -extend { content diff source_url save_url unsave_url item_blog_url - technorati_url item_guid_link pub_date } items items $items_query { @@ -175,15 +177,11 @@ } } - if { $item_permalink_p == "t" } { - set item_guid_link $item_original_guid - } else { - set item_guid_link $item_link - } + set item_guid_link [expr {$item_permalink_p ? $item_original_guid : $item_link}] - set diff [news_aggregator::last_scanned -diff [expr {([clock seconds] - [clock scan $last_scanned]) / 60}]] + set diff [news_aggregator::last_scanned \ + -diff [expr {([clock seconds] - [clock scan $last_scanned]) / 60}]] set source_url [export_vars -base source {source_id}] - set technorati_url "http://www.technorati.com/cosmos/links.html?url=$link&sub=Get+Link+Cosmos" set localtime [clock scan [lc_time_utc_to_local $item_pub_date] -gmt 1] set utctime [clock scan $item_pub_date -gmt 1] @@ -193,7 +191,7 @@ set pub_date [clock format $localtime -format "%m-%d %H:%M"] } - if {$write_p eq "1"} { + if {$write_p} { if {$item_id ni $saved_items} { set save_url [export_vars -base "${url}item-save" {item_id}] set unsave_url "" @@ -214,12 +212,11 @@ } } -if { $enable_purge_p - && [info exists top] && $top ne "" - && [info exists bottom] && $bottom ne "" - && $top >= $bottom && $public_p == "f" - && [permission::permission_p -party_id $user_id -object_id $aggregator_id -privilege write] } { - +set purge [expr {$enable_purge_p + && $top >= $bottom + && !$public_p + && $write_p}] +if {$purge} { ad_form -name purge -action "[ad_conn package_url]$aggregator_id/purge" -form { {purge_top:integer(hidden) {value $top} @@ -232,14 +229,10 @@ {html {accesskey "p"}} } } - set purge 1 - -} else { - set purge 0 } -set purge_off_url "[ad_conn package_url]$aggregator_id/?purge_p=f" -set purge_on_url "[ad_conn package_url]$aggregator_id" +set purge_off_url ${return_url}/?purge_p=f +set purge_on_url ${return_url}/?purge_p=t # Local variables: # mode: tcl Fisheye: Tag 1.4 refers to a dead (removed) revision in file `openacs-4/packages/news-aggregator/www/index.xql'. Fisheye: No comparison available. Pass `N' to diff?