]> git.wh0rd.org Git - tt-rss.git/commitdiff
feed editor improvements
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 24 Nov 2005 07:25:09 +0000 (08:25 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 24 Nov 2005 07:25:09 +0000 (08:25 +0100)
backend.php
functions.php

index 0ee60a3f8a9721d307bf18ebcc9c462df4cff898..1ff981ace9559a69c9dcbb8d93cc76af08cf0fbf 100644 (file)
        
                        print "<p><table width=\"100%\" class=\"prefFeedList\" id=\"prefFeedList\">";
                        print "<tr class=\"title\">
-                                               <td>&nbsp;</td>
-                                               <td>Select</td>
+                                               <td width=\"3%\">&nbsp;</td>
+                                               <td width=\"3%\">Select</td>
                                                <td width=\"20%\">
                                                        <a href=\"javascript:updateFeedList('title')\">Title</a></td>
                                                <td width=\"20%\">
                                <td width=\"10%\">
                                        <a href=\"javascript:updateFeedList('purge_interval')\">Purge Days</a>
                                </td>
-                               <td>
-                                       <a href=\"javascript:updateFeedList('last_updated')\">Last updated</a>
-                               </td>                           
                        </tr>";
                        
                        $lnum = 0;
        
                                        print "<td><input onclick='toggleSelectRow(this);' 
                                        type=\"checkbox\" id=\"FRCHK-".$line["id"]."\"></td>";
+
+                                       $edit_title = truncate_string($edit_title, 40);
+                                       $edit_link = truncate_string($edit_link, 60);
        
                                        print "<td><a href=\"javascript:editFeed($feed_id);\">" . 
                                                $edit_title . "</a></td>";              
        
                                        print "<td><input disabled=\"true\" type=\"checkbox\" 
                                                id=\"FRCHK-".$line["id"]."\"></td>";
-       
+
+                                       $edit_title = truncate_string($edit_title, 40);
+                                       $edit_link = truncate_string($edit_link, 60);
+
                                        print "<td>$edit_title</td>";           
                                        print "<td>$edit_link</td>";            
        
                                                
                                }
        
-                               if (!$line["last_updated"]) $line["last_updated"] = "Never";
+/*                             if (!$line["last_updated"]) $line["last_updated"] = "Never";
        
-                               print "<td>" . $line["last_updated"] . "</td>";
+                               print "<td>" . $line["last_updated"] . "</td>"; */
                                
                                print "</tr>";
        
index e479c28b7821d58a60b0553907a49c662cae6155..817e6d71c84d41f9f275410563970b208e364c00 100644 (file)
                        initialize_user_prefs($link, 1); 
                }
        }
+
+       function truncate_string($str, $max_len) {
+               if (strlen($str) > $max_len) {
+                       return substr($str, 0, $max_len) . "...";
+               } else {
+                       return $str;
+               }
+       }
 ?>