]> git.wh0rd.org Git - tt-rss.git/commitdiff
content preview in headlines list, option SHOW_CONTENT_PREVIEW
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 27 Nov 2005 15:17:49 +0000 (16:17 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 27 Nov 2005 15:17:49 +0000 (16:17 +0100)
backend.php
schema/ttrss_schema_mysql.sql
schema/ttrss_schema_pgsql.sql
tt-rss.css

index 9d22a3d09332797fa5610796ae4c11386cc9d531..c6c0bbace3696b0e6d5a0d49af93725f9aa8a7ec 100644 (file)
                                        unread,feed_id,marked,link,last_read,
                                        SUBSTRING(last_read,1,19) as last_read_noms,
                                        $vfeed_query_part
-                                       SUBSTRING(updated,1,19) as updated_noms
+                                       SUBSTRING(updated,1,19) as updated_noms,
+                                       SUBSTRING(content,1,101) as content_preview
                                FROM
                                        ttrss_entries,ttrss_user_entries
                                WHERE
                                marked,link,last_read,
                                SUBSTRING(last_read,1,19) as last_read_noms,
                                $vfeed_query_part
-                               SUBSTRING(updated,1,19) as updated_noms
+                               SUBSTRING(updated,1,19) as updated_noms,
+                               SUBSTRING(content,1,101) as content_preview
                                FROM
                                        ttrss_entries,ttrss_user_entries,ttrss_tags
                                WHERE
                        $id = $line["id"];
                        $feed_id = $line["feed_id"];
 
-//                     printf("L %d (%s) &gt; U %d (%s) = %d<br>", 
-//                             strtotime($line["last_read_noms"]), $line["last_read_noms"],
-//                             strtotime($line["updated"]), $line["updated"],
-//                             strtotime($line["last_read"]) >= strtotime($line["updated"]));
-
-/*                     if ($line["last_read"] != "" && $line["updated"] != "" &&
-                               strtotime($line["last_read_noms"]) < strtotime($line["updated_noms"])) {
-
-                               $update_pic = "<img id='FUPDPIC-$id' src=\"images/updated.png\" 
-                                       alt=\"Updated\">";
-
-                       } else {
-
-                               $update_pic = "<img id='FUPDPIC-$id' src=\"images/blank_icon.gif\" 
-                                       alt=\"Updated\">";
-
-                       } */
-
                        if ($line["last_read"] == "" && 
                                        ($line["unread"] != "t" && $line["unread"] != "1")) {
 
 
                        print "<td valign='center' align='center'>$marked_pic</td>";
 
-                       print "<td width='20%'>
+                       print "<td width='15%'>
                                <a href=\"javascript:view($id,$feed_id);\">".$line["updated"]."</a></td>";
 
                        if ($line["feed_title"]) {                      
-                               print "<td width='55%'>$content_link</td>";
+                               print "<td width='65%'>$content_link</td>";
                                print "<td width='20%'>
                                        <a href='javascript:viewfeed($feed_id)'>".$line["feed_title"]."</a></td>";
-                       } else {
-                               print "<td width='75%'>$content_link</td>";
+                       } else {                        
+                               print "<td width='85%'>$content_link";
+                               if (get_pref($link, 'SHOW_CONTENT_PREVIEW')) {
+                                       $content_preview = truncate_string(strip_tags($line["content_preview"]), 
+                                               100);
+                                       print "<span class=\"contentPreview\"> - $content_preview</span>";
+                               }
+                               print "</td>";
                        }
 
                        print "</tr>";
index 7abbc1f49a6bd65c7ca251dec1e47339cff96972..b7a9686b1bb705880b4747b30282476ff5f0ba29 100644 (file)
@@ -198,6 +198,7 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_CATS', 1, 'false', 'Enable feed categories',2);
 
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SHOW_CONTENT_PREVIEW', 1, 'true', 'Show content preview in headlines list',2);
 
 create table ttrss_user_prefs (
    owner_uid integer not null,
index f3bd606a27fadc27e5f78624b138ac734e978b59..dbd43b5e7d104cffe4bd0b06fb602db46dc2a064 100644 (file)
@@ -180,6 +180,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_FEED_CATS', 1, 'false', 'Enable feed categories',2);
 
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('SHOW_CONTENT_PREVIEW', 1, 'true', 'Show content preview in headlines list',2);
+
 create table ttrss_user_prefs (
        owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
        pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE,
index 9da226bc8fe2f65e92bfd5d158da18454d359fdf..9eabfd929f243eaf91bdd23eefca772d795ce565 100644 (file)
@@ -700,3 +700,8 @@ table.headlinesSubToolbar td.headlineTitle {
        text-align : right;
 }
 
+span.contentPreview {
+       font-size : x-small;
+       color : gray;
+       font-weight : normal;
+}