From 591c396df4e9d7799a552a94a7c69ede58fecb6e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 27 Nov 2005 16:17:49 +0100 Subject: [PATCH] content preview in headlines list, option SHOW_CONTENT_PREVIEW --- backend.php | 38 +++++++++++++---------------------- schema/ttrss_schema_mysql.sql | 1 + schema/ttrss_schema_pgsql.sql | 2 ++ tt-rss.css | 5 +++++ 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/backend.php b/backend.php index 9d22a3d09..c6c0bbace 100644 --- a/backend.php +++ b/backend.php @@ -964,7 +964,8 @@ 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 @@ -987,7 +988,8 @@ 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 @@ -1019,24 +1021,6 @@ $id = $line["id"]; $feed_id = $line["feed_id"]; -// printf("L %d (%s) > U %d (%s) = %d
", -// 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 = "\"Updated\""; - - } else { - - $update_pic = "\"Updated\""; - - } */ - if ($line["last_read"] == "" && ($line["unread"] != "t" && $line["unread"] != "1")) { @@ -1075,15 +1059,21 @@ print "$marked_pic"; - print " + print " ".$line["updated"].""; if ($line["feed_title"]) { - print "$content_link"; + print "$content_link"; print " ".$line["feed_title"].""; - } else { - print "$content_link"; + } else { + print "$content_link"; + if (get_pref($link, 'SHOW_CONTENT_PREVIEW')) { + $content_preview = truncate_string(strip_tags($line["content_preview"]), + 100); + print " - $content_preview"; + } + print ""; } print ""; diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 7abbc1f49..b7a9686b1 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -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, diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index f3bd606a2..dbd43b5e7 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -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, diff --git a/tt-rss.css b/tt-rss.css index 9da226bc8..9eabfd929 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -700,3 +700,8 @@ table.headlinesSubToolbar td.headlineTitle { text-align : right; } +span.contentPreview { + font-size : x-small; + color : gray; + font-weight : normal; +}