]> git.wh0rd.org Git - tt-rss.git/commitdiff
code cleanup; ccache category calculation for cid=0 corrected
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 17 Jan 2009 06:57:33 +0000 (07:57 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 17 Jan 2009 06:57:33 +0000 (07:57 +0100)
README
backend.php
functions.php
update_daemon2.php
update_daemon_loop.php

diff --git a/README b/README
index a040066a9323cf1bd1d4ec23466f1eec36073f2d..a278b44a437500b71673fe1f7f2d7d777ca57a41 100644 (file)
--- a/README
+++ b/README
@@ -4,7 +4,7 @@ Tiny Tiny RSS
 Web-based news feed aggregator, designed to allow you to read news from 
 any location, while feeling as close to a real desktop application as possible.
 
-       http://tt-rss.spb.ru
+       http://tt-rss.org
 
 Copyright (C) 2005 Andrew Dolgov unless stated otherwise.
 
@@ -27,7 +27,7 @@ Licensed under GNU GPL version 2
 Features Overview
 =================
 
-       Updates: http://tt-rss.spb.ru/trac/wiki/FeatureList
+       Updates: http://tt-rss.org/trac/wiki/FeatureList
 
        * Server-side application, user only needs a web browser
        * Supports RSS, RDF, Atom feeds using Magpie or SimplePie library
@@ -43,7 +43,7 @@ Requirements
                Basically, Firefox, Konqueror or MSIE6 are okay. See here
                for more information:
 
-               http://tt-rss.spb.ru/trac/wiki/CompatibleBrowsers
+               http://tt-rss.org/trac/wiki/CompatibleBrowsers
 
        * Web server, for example Apache
        * PHP (requires PHP4 DOMXML extension)
@@ -56,7 +56,7 @@ Requirements
 Installation Notes
 ==================
 
-       Updates: http://tt-rss.spb.ru/trac/wiki/InstallationNotes
+       Updates: http://tt-rss.org/trac/wiki/InstallationNotes
 
        * If you are upgrading from the previous version, don't forget to update 
        schema and logout.
@@ -80,10 +80,10 @@ Installation Notes
 See also
 ========
 
-       * FAQ:                          http://tt-rss.spb.ru/trac/wiki/FrequentlyAskedQuestions
-       * Forum:                                http://tt-rss.spb.ru/forum
-       * Wiki:                         http://tt-rss.spb.ru/trac/wiki/WikiStart
-       * Bug Tracker:          http://tt-rss.spb.ru/trac/report
+       * FAQ:                          http://tt-rss.org/trac/wiki/FrequentlyAskedQuestions
+       * Forum:                                http://tt-rss.org/forum
+       * Wiki:                         http://tt-rss.org/trac/wiki/WikiStart
+       * Bug Tracker:          http://tt-rss.org/trac/report
 
 Contact
 =======
index c2efc73d6f0e43a63f72dcb676334e8663590482..b7419dede41d0e4affe9642d671fb50ec2f371cb 100644 (file)
                        update_daemon_common($link, 0, true, true);
                        print " -->";
 
-                       // FIXME : old feed update way. To be removed.
-                       //$result = db_query($link, "SELECT id FROM ttrss_users");
-
-                       //while ($line = db_fetch_assoc($result)) {
-                       //      $user_id = $line["id"];
-                       //      print "<!-- updating feeds of uid $user_id -->";
-                       //      update_all_feeds($link, false, $user_id);
-                       //}
-
                        print "<rpc-reply>
                                <message msg=\"All feeds updated\"/>
                        </rpc-reply>";
index ebd3cff1ada2dcf36c10252c99d6c23a75127068..c4ecc78ecaeacc408c8968a98916d87462560556 100644 (file)
 
                db_query($link, "insert into ttrss_feeds (owner_uid,title,feed_url)
                        values ('$uid', 'Tiny Tiny RSS: New Releases',
-                       'http://tt-rss.spb.ru/releases.rss')");
+                       'http://tt-rss.org/releases.rss')");
 
                db_query($link, "insert into ttrss_feeds (owner_uid,title,feed_url)
                        values ('$uid', 'Tiny Tiny RSS: Forum',
-                       'http://tt-rss.spb.ru/forum/rss.php')");
+                       'http://tt-rss.org/forum/rss.php')");
        }
 
        function logout_user() {
 
        }
 
-       function getCategoryUnread($link, $cat) {
+       function getCategoryUnread($link, $cat, $owner_uid = false) {
+
+               if (!$owner_uid) $owner_uid = $_SESSION["uid"];
 
                if ($cat >= 0) {
 
 
                        $result = db_query($link, "SELECT id FROM ttrss_feeds WHERE $cat_query 
                                        AND hidden = false
-                                       AND owner_uid = " . $_SESSION["uid"]);
+                                       AND owner_uid = " . $owner_uid);
        
                        $cat_feeds = array();
                        while ($line = db_fetch_assoc($result)) {
                        $result = db_query($link, "SELECT COUNT(int_id) AS unread 
                                FROM ttrss_user_entries,ttrss_entries 
                                WHERE   unread = true AND ($match_part) AND id = ref_id 
-                               AND $age_qpart AND owner_uid = " . $_SESSION["uid"]);
+                               AND $age_qpart AND owner_uid = " . $owner_uid);
        
                        $unread = 0;
        
                $age_qpart = getMaxAgeSubquery();
 
                if ($is_cat) {
-                       return getCategoryUnread($link, $n_feed);               
+                       return getCategoryUnread($link, $n_feed, $owner_uid);           
                } else if ($n_feed == -1) {
                        $match_part = "marked = true";
                } else if ($n_feed == -2) {
                return $unread;
        }
 
-       /* FIXME this needs reworking */
-
        function getGlobalUnread($link, $user_id = false) {
 
                if (!$user_id) {
                return $ret_arr;
        }
 
-/*     function getFeedCounter($link, $id) {
-       
-               $result = db_query($link, "SELECT 
-                               count(id) as count,last_error
-                       FROM ttrss_entries,ttrss_user_entries,ttrss_feeds
-                       WHERE feed_id = '$id' AND unread = true
-                       AND ttrss_user_entries.feed_id = ttrss_feeds.id
-                       AND ttrss_user_entries.ref_id = ttrss_entries.id");
-       
-                       $count = db_fetch_result($result, 0, "count");
-                       $last_error = htmlspecialchars(db_fetch_result($result, 0, "last_error"));
-                       
-                       print "<counter type=\"feed\" id=\"$id\" counter=\"$count\" error=\"$last_error\"/>";           
-       } */
-
        function getFeedCounters($link, $smart_mode = SMART_RPC_COUNTERS, $active_feed = false) {
 
                $age_qpart = getMaxAgeSubquery();
 
                $old_counters = $_SESSION["fctr_last_value"];
 
-/*             $result = db_query($link, "SELECT id,last_error,parent_feed,
-                       ".SUBSTRING_FOR_DATE."(last_updated,1,19) AS last_updated,
-                       (SELECT count(id) 
-                               FROM ttrss_entries,ttrss_user_entries 
-                               WHERE feed_id = ttrss_feeds.id AND 
-                                       ttrss_user_entries.ref_id = ttrss_entries.id
-                               AND unread = true AND owner_uid = ".$_SESSION["uid"].") as count
-                       FROM ttrss_feeds WHERE owner_uid = ".$_SESSION["uid"] . "
-                       AND parent_feed IS NULL"); */
-
 /*             $query = "SELECT ttrss_feeds.id,
                                ttrss_feeds.title,
                                ".SUBSTRING_FOR_DATE."(ttrss_feeds.last_updated,1,19) AS last_updated, 
        }
 
        function check_for_update($link, $brief_fmt = true) {
-               $releases_feed = "http://tt-rss.spb.ru/releases.rss";
+               $releases_feed = "http://tt-rss.org/releases.rss";
 
                if (!CHECK_FOR_NEW_VERSION || $_SESSION["access_level"] < 10) {
                        return;
                                } else {
                                        return "New version of Tiny-Tiny RSS ($latest_version) is available:
                                                <div class='milestoneDetails'>$content</div>
-                                               Visit <a target=\"_blank\" href=\"http://tt-rss.spb.ru/\">official site</a> for
+                                               Visit <a target=\"_blank\" href=\"http://tt-rss.org/\">official site</a> for
                                                download and update information.";      
                                }
 
                        $table = "ttrss_cat_counters_cache";
                }
 
-               if ($is_cat && $feed_id > 0) {
+               if ($is_cat && $feed_id >= 0) {
                        if ($feed_id != 0) {
                                $cat_qpart = "cat_id = '$feed_id'";
                        } else {
index a85bc1f5260ebd266c50ccf6c68ba34f3f4839dc..45ba2fbf287e0a54d31151d9266e36650dc1093d 100644 (file)
                                                print "warning: unable to create stampfile";
                                        }       
 
-                                       // $last_purge = 0;
-
-                                       // if (time() - $last_purge > PURGE_INTERVAL) {
-
                                        // FIXME : $last_purge is of no use in a multiprocess update.
                                        // FIXME : We ALWAYS purge old posts.
                                        _debug("Purging old posts (random 30 feeds)...");
                                        global_purge_old_posts($link, true, 30);
 
-                                       //      $last_purge = time();
-                                       // }
-
                                        // Call to the feed batch update function 
                                        // or regenerate feedbrowser cache
 
index c82ee561b9c17d3022b12a9736730aff1a33211c..d3c760d87a73f5c849592ce01e4c5921cbf051ce 100644 (file)
@@ -76,7 +76,7 @@
                update_daemon_common($link);
        } else {
                $count = update_feedbrowser_cache($link);
-               print "Finished, $count feeds processed.\n";
+               _debug("Finished, $count feeds processed.");
        }