]> git.wh0rd.org - tt-rss.git/commitdiff
import articles which have no link or guid (hello, microsoft); include guids in expor...
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 26 Sep 2006 06:44:05 +0000 (07:44 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 26 Sep 2006 06:44:05 +0000 (07:44 +0100)
backend.php
functions.php

index ebbf33a687da4595b271640ed0f6054e3a6f3563..719cb1b162c17529469c2c5648a75082537a9148 100644 (file)
                        if ($entry_author) {
                                $entry_author = " - by $entry_author";
                        }
-                       
-                       print "<tr><td><a $link_target href=\"" . $line["link"] . "\">" . $line["title"] . 
-                               "</a>$entry_author</td>";
+
+                       if ($line["link"]) {
+                               print "<tr><td><a $link_target href=\"" . $line["link"] . "\">" . 
+                                       $line["title"] . "</a>$entry_author</td>";
+                       } else {
+                               print "<tr><td>" . $line["title"] . "$entry_author</td>";
+                       }
 
                        $parsed_updated = date(get_pref($link, 'LONG_DATE_FORMAT'), 
                                strtotime($line["updated"]));
index cfad6cc79c50a21cde1d759b5adebeea3a6ac60a..56c7780719b05fc94c28e45092e45886695e8551 100644 (file)
                
                                        if (!$entry_guid) $entry_guid = $item["guid"];
                                        if (!$entry_guid) $entry_guid = $item["link"];
-       
+                                       if (!$entry_guid) $entry_guid = make_guid_from_title($item["title"]);
+
                                        if (!$entry_guid) continue;
        
                                        $entry_timestamp = "";
                                        if (!$entry_link) $entry_link = $item["link"];
        
                                        if (!$entry_title) continue;
-                                       if (!$entry_link) continue;
+#                                      if (!$entry_link) continue;
 
                                        $entry_link = strip_tags($entry_link);
 
                                $content_query_part = "content as content_preview,";
                                
                                $query = "SELECT 
+                                               guid,
                                                ttrss_entries.id,ttrss_entries.title,
                                                SUBSTRING(updated,1,16) as updated,
                                                unread,feed_id,marked,link,last_read,
                                $feed_kind = "Tags";
        
                                $result = db_query($link, "SELECT
+                                       guid,
                                        ttrss_entries.id as id,title,
                                        SUBSTRING(updated,1,16) as updated,
                                        unread,feed_id,
 
                while ($line = db_fetch_assoc($result)) {
                        print "<item>";
+                       print "<id>" . htmlspecialchars($line["guid"]) . "</id>";
                        print "<link>" . htmlspecialchars($line["link"]) . "</link>";
 
                        $rfc822_date = date('r', strtotime($line["updated"]));
                return htmlspecialchars(db_unescape_string($s));
        }
 
+       function make_guid_from_title($title) {
+               return preg_replace("/[ \"\',.:;]/", "-", 
+                       mb_strtolower(strip_tags($title)));
+       }
+
 ?>