]> git.wh0rd.org - tt-rss.git/commitdiff
disable linking for feeds already linked to
authorAndrew Dolgov <fox@bah.spb.su>
Thu, 29 Dec 2005 17:46:11 +0000 (18:46 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Thu, 29 Dec 2005 17:46:11 +0000 (18:46 +0100)
backend.php

index 467d1af0e644f1e86bd9e3cd4aae6253e5966231..067995b860e750f3586d729addf4d88fdaf25ad8 100644 (file)
                        $row_class = toggleEvenOdd($row_class);
                        print "<tr class='$row_class'><td>Link to:</td>";
 
+                       $tmp_result = db_query($link, "SELECT COUNT(id) AS count
+                               FROM ttrss_feeds WHERE parent_feed = '$feed_id'");
+
+                       $linked_count = db_fetch_result($tmp_result, 0, "count");
+
+
                        $parent_feed = db_fetch_result($result, 0, "parent_feed");
-               
-                       print "<select id=\"iedit_parent_feed\">";
+
+                       if ($linked_count > 0) {
+                               $disabled = "disabled";
+                       }
+
+                       print "<select $disabled  id=\"iedit_parent_feed\">";
+                       
                        print "<option id=\"0\">Not linked</option>";
 
                        if (get_pref($link, 'ENABLE_FEED_CATS')) {