From 3547842a4f194a04ac027425988c6b84273c3989 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 24 Nov 2005 08:25:09 +0100 Subject: feed editor improvements --- functions.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'functions.php') diff --git a/functions.php b/functions.php index e479c28b7..817e6d71c 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; + } + } ?> -- cgit v1.2.3