Ticket #318 (closed enhancement: fixed)

Opened 3 years ago

Last modified 8 months ago

add unread to do-not-prune list

Reported by: Disconnect Assigned to: mbonetti
Priority: normal Milestone: Gregarius 0.5.5
Component: FEATURES Version:
Severity: normal Keywords: prune unread admin items dev-feedback
Cc:

Description

--- items.php.orig      2005-12-28 14:25:39.000000000 -0500
+++ items.php   2005-12-28 14:25:43.000000000 -0500
@@ -44,6 +44,8 @@
       . "<option>" . LBL_ADMIN_PRUNE_MONTHS . "</option>\n"
       . "<option>" . LBL_ADMIN_PRUNE_YEARS . "</option>\n"
       . "</select></p>\n"
+      . "<p><label for=\"prune_include_unread\">".LBL_ADMIN_PRUNE_INCLUDE_UNREAD."</label>\n"
+      . "<input type=\"checkbox\" id=\"prune_include_unread\" name=\"prune_include_unread\" value=\"1\"/></p>\n"
       . "<p><label for=\"prune_include_sticky\">".LBL_ADMIN_PRUNE_INCLUDE_STICKY."</label>\n"
       . "<input type=\"checkbox\" id=\"prune_include_sticky\" name=\"prune_include_sticky\" value=\"1\"/></p>\n"
       . "<p><label for=\"prune_exclude_tags\">".LBL_ADMIN_PRUNE_EXCLUDE_TAGS."</label>\n"
@@ -99,6 +101,11 @@
                 $sql .= " and ifnull(i.pubdate, i.added) <  '$prune_older_date'";
             }

+            if (!array_key_exists('prune_include_unread', $_REQUEST)
+                || $_REQUEST['prune_include_unread'] != '1') {
+
+                $sql .= " and not(unread & " .FEED_MODE_UNREAD_STATE .") ";
+            }
             if (!array_key_exists('prune_include_sticky', $_REQUEST)
                 || $_REQUEST['prune_include_sticky'] != '1') {

and add

define ('LBL_ADMIN_PRUNE_INCLUDE_UNREAD','Delete Unread items too: ');

to intl/*.php (sorry, haven't got translations..)

Change History

12/28/05 23:42:28 changed by mbonetti

  • keywords changed from prune unread admin items to prune unread admin items dev-feedback.
  • status changed from new to assigned.

I think this makes sense. Will try to apply the patch and give it some testing.

12/28/05 23:43:12 changed by mbonetti

  • component changed from PLUGINS to FEATURES.

02/05/06 04:13:41 changed by sathish@sathish.net

I tried this patch and it works for me. But the delete of items (~5000 items in ~50k items / ~100 feeds) took too much time and failed (time out?) few times before it completed.. i guess it might be possible to make the original delete code more efficient (like joining with tables instead of for $items as $item) thanks, Sathish

02/05/06 04:19:09 changed by sathish@sathish.net

Oh, I forgot to add that the count shown before its getting delete might be wrong now (or in the original.. i never seem to be able to match most counts shown with those in tables, so i might be wrong)

02/22/06 13:35:13 changed by sdcosta

up we definitely have to improve that code.

06/17/06 15:48:16 changed by cfriesen

The same should be done for flag, sticky looks like it's there.

11/03/07 00:29:52 changed by cfriesen

  • status changed from assigned to closed.
  • resolution set to fixed.

Closed by [1772]