From: Andrew Dolgov Date: Thu, 24 Nov 2005 07:25:09 +0000 (+0100) Subject: feed editor improvements X-Git-Tag: schema_feature_freeze_for_1.1~107 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3547842a4f194a04ac027425988c6b84273c3989;p=tt-rss.git feed editor improvements --- diff --git a/backend.php b/backend.php index 0ee60a3f..1ff981ac 100644 --- a/backend.php +++ b/backend.php @@ -1165,8 +1165,8 @@ print "

"; print " - - + + - "; $lnum = 0; @@ -1226,6 +1223,9 @@ print ""; + + $edit_title = truncate_string($edit_title, 40); + $edit_link = truncate_string($edit_link, 60); print ""; @@ -1257,7 +1257,10 @@ print ""; - + + $edit_title = truncate_string($edit_title, 40); + $edit_link = truncate_string($edit_link, 60); + print ""; print ""; @@ -1320,9 +1323,9 @@ } - if (!$line["last_updated"]) $line["last_updated"] = "Never"; +/* if (!$line["last_updated"]) $line["last_updated"] = "Never"; - print ""; + print ""; */ print ""; diff --git a/functions.php b/functions.php index e479c28b..817e6d71 100644 --- a/functions.php +++ b/functions.php @@ -701,4 +701,12 @@ 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; + } + } ?>
 Select Select Title @@ -1185,9 +1185,6 @@ Purge Days - Last updated -
" . $edit_title . "$edit_title$edit_link" . $line["last_updated"] . "" . $line["last_updated"] . "