]> git.wh0rd.org Git - tt-rss.git/commitdiff
show last article date in pref feeds
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 30 Sep 2006 07:29:22 +0000 (08:29 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 30 Sep 2006 07:29:22 +0000 (08:29 +0100)
backend.php

index bbc62e132cbd3d0b16462ed4256492bf6a91793c..a921d75d63d3d54e317abd14611b1e34140f11a1 100644 (file)
                                F2.title AS parent_title,
                                C1.title AS category,
                                F1.hidden,
-                               F1.include_in_digest
+                               F1.include_in_digest,
+                               (SELECT SUBSTRING(MAX(updated),1,16) FROM ttrss_user_entries, 
+                                       ttrss_entries WHERE ref_id = ttrss_entries.id 
+                                       AND feed_id = F1.id) AS last_article
                        FROM 
                                ttrss_feeds AS F1 
                                LEFT JOIN ttrss_feeds AS F2
 
                                print "
                                        <td width='40%'><a href=\"javascript:updateFeedList('title')\">Title</a></td>
-                                       <td width='45%'><a href=\"javascript:updateFeedList('feed_url')\">Feed</a></td>
+                                       <td width='35%'><a href=\"javascript:updateFeedList('feed_url')\">Feed</a></td>
+                                       <td width='15%'><a href=\"javascript:updateFeedList('last_article')\">Last&nbsp;Article</a></td>
                                        <td width='15%' align='right'><a href=\"javascript:updateFeedList('last_updated')\">Updated</a></td>";
                        }
                        
                                        $last_updated = date($short_date, strtotime($last_updated));
                                }
 
+                               $last_article = $line["last_article"];
+
+                               if (get_pref($link, 'HEADLINES_SMART_DATE')) {
+                                       $last_article = smart_date_time(strtotime($last_article));
+                               } else {
+                                       $short_date = get_pref($link, 'SHORT_DATE_FORMAT');
+                                       $last_article = date($short_date, strtotime($last_article));
+                               }
+
                                if (get_pref($link, 'ENABLE_FEED_CATS') && $cur_cat_id != $cat_id) {
                                        $lnum = 0;
                                
                                                print "<td width='3%'>&nbsp;</td>";
                                        }
 
-                                       print "<td width='40%'><a href=\"javascript:updateFeedList('title')\">Title</a></td>
-                                               <td width='45%'><a href=\"javascript:updateFeedList('feed_url')\">Feed</a></td>
+                                       print "<td width='35%'><a href=\"javascript:updateFeedList('title')\">Title</a></td>
+                                               <td width='35%'><a href=\"javascript:updateFeedList('feed_url')\">Feed</a></td>
+                                               <td width='15%'><a href=\"javascript:updateFeedList('last_article')\">Last&nbsp;Article</a></td>
                                                <td width='15%' align='right'><a href=\"javascript:updateFeedList('last_updated')\">Updated</a></td>";
 
                                        $cur_cat_id = $cat_id;
                                print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
                                        $edit_link . "</a></td>";               
 
+                               print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
+                                       "$last_article</a></td>";
+
                                print "<td align='right'><a href=\"javascript:editFeed($feed_id);\">" . 
                                        "$last_updated</a></td>";