]> git.wh0rd.org Git - tt-rss.git/commitdiff
ccache: remove obsolete data on feed/category removal
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 11 Mar 2009 13:22:32 +0000 (16:22 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 11 Mar 2009 13:22:32 +0000 (16:22 +0300)
functions.php
modules/pref-feeds.php

index ee1e8fbe8979544b97cc67fcd1ec48927a611719..4c867f26c198109af584787bfe2116c46cb2b65b 100644 (file)
                        value = 0 WHERE owner_uid = '$owner_uid'");
        }
 
+       function ccache_remove($link, $feed_id, $owner_uid, $is_cat = false) {
+
+               if (!$is_cat) {
+                       $table = "ttrss_counters_cache";
+               } else {
+                       $table = "ttrss_cat_counters_cache";
+               }
+
+               db_query($link, "DELETE FROM $table WHERE
+                       feed_id = '$feed_id' AND owner_uid = '$owner_uid'");
+
+       }
+
        function ccache_update_all($link, $owner_uid) {
 
                if (get_pref($link, 'ENABLE_FEED_CATS', $owner_uid)) {
index e92ad6ebd7f53fd87c6cbf27cbe7fa38ab85aff7..36a0e4d326e43b4e17c658fe1999e85c886403b9 100644 (file)
                                        if (file_exists($icons_dir . "/$id.ico")) {
                                                unlink($icons_dir . "/$id.ico");
                                        }
+
+                                       ccache_remove($link, $id, $_SESSION["uid"]);
+
                                } else {
                                        label_remove($link, -11-$id, $_SESSION["uid"]);
+                                       ccache_remove($link, -11-$id, $_SESSION["uid"]);
                                }
                        }
                }
                                                if ($num_feeds == 0) {
                                                        db_query($link, "DELETE FROM ttrss_feed_categories
                                                                WHERE id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+
+                                                       ccache_remove($link, $id, $_SESSION["uid"], true);
+
                                                } else {
        
                                                        print format_warning(__("Unable to delete non empty feed categories."));