summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-10-03 12:21:46 +0400
committerAndrew Dolgov <[email protected]>2010-10-03 12:21:46 +0400
commit98d684f99ba839ff1514675f2786f0f851e5cbf6 (patch)
treeeae29c5848756215a2ed0ba6c4193df433061751 /functions.php
parent3b3a199df86b1c94d16e6c0f601e3988df37070f (diff)
parenta2d799815a95e9c76e81525d1007b38971662e6d (diff)
Merge branch 'master' of madoka.volgo-balt.ru:public_html/testbox/tt-rss
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php25
1 files changed, 12 insertions, 13 deletions
diff --git a/functions.php b/functions.php
index 958ffea8e..af5a64f37 100644
--- a/functions.php
+++ b/functions.php
@@ -228,7 +228,7 @@
} // function purge_feed
/**
- * Purge old posts from old feeds.
+ * Purge old posts from old feeds. Not used anymore, purging is done after feed update.
*
* @param mixed $link A database connection
* @param boolean $do_output Set to true to enable printed output, false by default.
@@ -236,7 +236,7 @@
* @access public
* @return void
*/
- function global_purge_old_posts($link, $do_output = false, $limit = false) {
+ /* function global_purge_old_posts($link, $do_output = false, $limit = false) {
$random_qpart = sql_random_function();
@@ -276,16 +276,9 @@
}
}
- // purge orphaned posts in main content table
- $result = db_query($link, "DELETE FROM ttrss_entries WHERE
- (SELECT COUNT(int_id) FROM ttrss_user_entries WHERE ref_id = id) = 0");
-
- if ($do_output) {
- $rows = db_affected_rows($link, $result);
- _debug("Purged $rows orphaned posts.");
- }
+ purge_orphans($link, $do_output);
- } // function global_purge_old_posts
+ } // function global_purge_old_posts */
function feed_purge_interval($link, $feed_id) {
@@ -328,10 +321,16 @@
purge_orphans($link);
}
- function purge_orphans($link) {
+ function purge_orphans($link, $do_output = false) {
+
// purge orphaned posts in main content table
- db_query($link, "DELETE FROM ttrss_entries WHERE
+ $result = db_query($link, "DELETE FROM ttrss_entries WHERE
(SELECT COUNT(int_id) FROM ttrss_user_entries WHERE ref_id = id) = 0");
+
+ if ($do_output) {
+ $rows = db_affected_rows($link, $result);
+ _debug("Purged $rows orphaned posts.");
+ }
}
function get_feed_update_interval($link, $feed_id) {