]> git.wh0rd.org - tt-rss.git/blobdiff - modules/pref-instances.php
implement fetching and exporting of shared feeds
[tt-rss.git] / modules / pref-instances.php
index 45df2eb398bae5a9a59dac27643e281ab80e43dd..d3510c2877ba6a5137b75c152aecd59fd5fdb3dc 100644 (file)
@@ -24,8 +24,9 @@
 
                        if (db_num_rows($result) == 0) {
                                db_query($link, "INSERT INTO ttrss_linked_instances
-                                       (access_url, access_key, last_connected) VALUES
-                                       ('$access_url', '$access_key', '1970-01-01')");
+                                       (access_url, access_key, last_connected, last_status_in, last_status_out)
+                                       VALUES
+                                       ('$access_url', '$access_key', '1970-01-01', -1, -1)");
 
                        }
 
@@ -74,6 +75,8 @@
                                style=\"width: 20em\" name=\"access_key\" id=\"instance_edit_key\"
                                value=\"$access_key\">";
 
+                       print "<p class='insensitive'>" . __("Use one access key for both linked instances.");
+
                        print "</div>";
 
                        print "<div class=\"dlgButtons\">
 
                print "</div>"; #toolbar
 
-               $result = db_query($link, "SELECT * FROM ttrss_linked_instances
+               $result = db_query($link, "SELECT *,
+                       (SELECT COUNT(*) FROM ttrss_linked_feeds
+                               WHERE instance_id = ttrss_linked_instances.id) AS num_feeds
+                       FROM ttrss_linked_instances
                        ORDER BY $sort");
 
                print "<p class=\"insensitive\" style='margin-left : 1em;'>" . __("You can connect other instances of Tiny Tiny RSS to this one to share Popular feeds. Link to this instance of Tiny Tiny RSS by using this URL:");
                        <td align='center' width=\"5%\">&nbsp;</td>
                        <td width=''><a href=\"#\" onclick=\"updateInstanceList('access_url')\">".__('Instance URL')."</a></td>
                        <td width='20%'><a href=\"#\" onclick=\"updateInstanceList('access_key')\">".__('Access key')."</a></td>
-                       <td width='20%'><a href=\"#\" onclick=\"updateUsersList('last_connected')\">".__('Last connected')."</a></td>
+                       <td width='10%'><a href=\"#\" onclick=\"updateUsersList('last_connected')\">".__('Last connected')."</a></td>
+                       <td width='10%'><a href=\"#\" onclick=\"updateUsersList('num_feeds')\">".__('Stored feeds')."</a></td>
                        </tr>";
 
                $lnum = 0;
                        print "<td $onclick>" . htmlspecialchars($line['access_url']) . "</td>";
                        print "<td $onclick>" . htmlspecialchars($access_key) . "</td>";
                        print "<td $onclick>" . htmlspecialchars($line['last_connected']) . "</td>";
+                       print "<td $onclick>" . htmlspecialchars($line['num_feeds']) . "</td>";
 
                        print "</tr>";