]> git.wh0rd.org Git - tt-rss.git/commitdiff
support rescoring by tags
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 9 Nov 2010 18:48:42 +0000 (21:48 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 9 Nov 2010 18:48:42 +0000 (21:48 +0300)
modules/pref-feeds.php

index 68fb7717262222a083925842b238c66f5de12ba6..770414620337bfa2d79ee7e49366b9800276289c 100644 (file)
 
                                $filters = load_filters($link, $id, $_SESSION["uid"], 6);
 
-                               $result = db_query($link, "SELECT title, content, link, ref_id FROM
+                               $result = db_query($link, "SELECT 
+                                       title, content, link, ref_id, author,".
+                                       SUBSTRING_FOR_DATE."(updated, 1, 19) AS updated
+                                       FROM
                                                ttrss_user_entries, ttrss_entries 
                                                WHERE ref_id = id AND feed_id = '$id' AND 
                                                        owner_uid = " .$_SESSION['uid']."
 
                                while ($line = db_fetch_assoc($result)) {
 
+                                       $tags = get_article_tags($link, $line["ref_id"]);
+
                                        $article_filters = get_article_filters($filters, $line['title'], 
-                                               $line['content'], $line['link']);
+                                               $line['content'], $line['link'], strtotime($line['updated']), 
+                                               $line['author'], $tags);
                                        
                                        $new_score = calculate_article_score($article_filters);
 
 
                                $filters = load_filters($link, $id, $_SESSION["uid"], 6);
 
-                               $tmp_result = db_query($link, "SELECT title, content, link, ref_id FROM
+                               $tmp_result = db_query($link, "SELECT 
+                                       title, content, link, ref_id, author,".
+                                               SUBSTRING_FOR_DATE."(updated, 1, 19) AS updated
+                                               FROM
                                                ttrss_user_entries, ttrss_entries 
                                                WHERE ref_id = id AND feed_id = '$id' AND 
                                                        owner_uid = " .$_SESSION['uid']."
 
                                while ($line = db_fetch_assoc($tmp_result)) {
 
+                                       $tags = get_article_tags($link, $line["ref_id"]);
+
                                        $article_filters = get_article_filters($filters, $line['title'], 
-                                               $line['content'], $line['link']);
-                                       
+                                               $line['content'], $line['link'], strtotime($line['updated']), 
+                                               $line['author'], $tags);
+
                                        $new_score = calculate_article_score($article_filters);
 
                                        if (!$scores[$new_score]) $scores[$new_score] = array();