]> git.wh0rd.org Git - tt-rss.git/commitdiff
support for comments attribute (schema updated)
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 26 Aug 2005 05:11:41 +0000 (06:11 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 26 Aug 2005 05:11:41 +0000 (06:11 +0100)
backend.php
functions.php
tt-rss.css
ttrss_schema.sql

index 3d304655ab329569f1818ad4b1d6dde9bfe7af17..1ae88917e6721102b72f9ea5e8e6743850406fdb 100644 (file)
 
                $result = pg_query("UPDATE ttrss_entries SET unread = false,last_read = NOW() WHERE id = '$id'");
 
-               $result = pg_query("SELECT title,link,content,feed_id,
+               $result = pg_query("SELECT title,link,content,feed_id,comments,
                        (SELECT icon_url FROM ttrss_feeds WHERE id = feed_id) as icon_url 
                        FROM ttrss_entries
                        WHERE   id = '$id'");
                        print "<tr class=\"titleTop\"><td align=\"right\"><b>Title:</b></td>
                                <td width=\"100%\">".$line["title"]."</td>
                                <td>&nbsp;</td></tr>";
-                               
+
+                       if ($line["comments"] && $line["comments"] != $line["link"]) {
+//                             print "<tr class=\"titleInner\"><td align=\"right\"><b>Comments:</b></td>
+//                                     <td><a href=\"".$line["comments"]."\">".$line["comments"]."</a></td>
+//                                     <td>&nbsp;</td> </tr>";
+
+                               $comments_prompt = "(<a href=\"".$line["comments"]."\">Comments</a>)";
+                       }
+                       
                        print "<tr class=\"titleBottom\"><td align=\"right\"><b>Link:</b></td>
-                               <td><a href=\"".$line["link"]."\">".$line["link"]."</a></td>
-                               <td>&nbsp;</td> </tr>";
+                               <td><a href=\"".$line["link"]."\">".$line["link"]."</a> $comments_prompt</td>
+                               <td>&nbsp;</td></tr>";
                        print "<tr><td valign=\"top\" class=\"post\" 
                                colspan=\"2\">" . $line["content"] . "</td>
                                <td valign=\"top\">$feed_icon</td>
index e769e79ea38305be5bd0ea6089bfb4290decf475..aac7322329470bdd6a93be500c2a53f61e78fbed 100644 (file)
 
                                $content_hash = "SHA1:" . sha1(strip_tags($entry_content));
 
+                               $entry_comments = $item["comments"];
+
                                $result = pg_query($link, "
                                        SELECT 
                                                id,last_read,no_orig_date,title,feed_id,content_hash,
 
                                if (pg_num_rows($result) == 0) {
 
+                                       $entry_guid = pg_escape_string($entry_guid);
                                        $entry_content = pg_escape_string($entry_content);
                                        $entry_title = pg_escape_string($entry_title);
                                        $entry_link = pg_escape_string($entry_link);
+                                       $entry_comments = pg_escape_string($entry_comments);
 
                                        $query = "INSERT 
                                                INTO ttrss_entries 
                                                        content, 
                                                        content_hash,
                                                        feed_id, 
+                                                       comments,
                                                        no_orig_date) 
                                                VALUES
                                                        ('$entry_title', 
                                                        '$entry_content', 
                                                        '$content_hash',
                                                        '$feed', 
+                                                       '$entry_comments',
                                                        $no_orig_date)";
 
                                        $result = pg_query($link, $query);
                                                $last_read_qpart = 'last_read = null,';
                                        }
 
-//                                     if ($orig_timestamp < $entry_timestamp) {
+//                                     if (!$no_orig_date && $orig_timestamp < $entry_timestamp) {
 //                                             $last_read_qpart = 'last_read = null,';
 //                                     }
 
+                                       $entry_comments = pg_escape_string($entry_comments);
                                        $entry_content = pg_escape_string($entry_content);
-                                       $entry_title = pg_escape_string($entry_title);
+                                       $entry_title = pg_escape_string($entry_title);                                  
                                        $entry_link = pg_escape_string($entry_link);
-
+                       
                                        $query = "UPDATE ttrss_entries 
                                                SET 
                                                        $last_read_qpart 
                                                        link = '$entry_link', 
                                                        updated = '$entry_timestamp_fmt',
                                                        content = '$entry_content',
+                                                       comments = '$entry_comments',
                                                        content_hash = '$content_hash'
                                                WHERE
                                                        id = '$orig_entry_id'";
index 8c16790eb626296559f67653fa222d406cc4cd0d..104964472a7ea0a58fc90c44fa2ef59e53d02d7b 100644 (file)
@@ -98,9 +98,6 @@ input {
 table.main td.toolbar {
        height : 40px;
        background-color : #f0f0f0;
-       /* background-image : url("shadow_top.png");
-       background-position : bottom left;
-       background-repeat : repeat-x; */
        padding-right : 10px;
        padding-left : 10px;
        font-size : small;
@@ -200,17 +197,6 @@ table.main td.notify {
        font-weight : bold;
 }
 
-li {
-       list-style-type : none;
-
-}
-
-ul {
-       margin : 0px;
-       padding : 0px;
-       border : 1px solid #f0f0f0;
-}
-
 .invisible {
        display : none;
 }
@@ -251,7 +237,6 @@ table.prefFeedList tr.title td {
        font-weight : bold;
 }
 
-
 .evenSelected {
        background-color : #e0e0ff;
 }
@@ -344,22 +329,6 @@ table.postTable tr.titleBottom td {
 
 }
 
-/*
-table.postTable tr.titleTop td {
-       padding : 5px 10px 0px 10px;
-}
-
-table.postTable tr.titleBottom td {
-       padding : 3px 10px 5px 10px;    
-}
-
-table.postTable tr.headerRow td.headers, table.postTable tr.headerRow td.iconBox {
-       background : #f0f0f0;
-       border-width : 0px 0px 1px 0px;
-       border-color : #d0d0d0;
-       border-style : solid;
-}*/
-
 table.postTable td.post {
        padding : 20px;
 
index 0ee3a7558d1fb41af67f96e51a2b332bf054e5e3..e986a2685cb2544d3a08310d05d05e89a20ea81d 100644 (file)
@@ -38,5 +38,6 @@ create table ttrss_entries (id serial not null primary key,
        last_read timestamp,
        date_entered timestamp not null default NOW(),
        no_orig_date boolean not null default false,
+       comments varchar(250) not null default '',
        unread boolean not null default true);