summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-24 08:25:09 +0100
committerAndrew Dolgov <[email protected]>2005-11-24 08:25:09 +0100
commit3547842a4f194a04ac027425988c6b84273c3989 (patch)
tree098d9662670fecc0eab2744de0b7b21a59c2c9f1 /functions.php
parentc5d8841e9177becec6a1680661448387bb0d75d5 (diff)
feed editor improvements
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php8
1 files changed, 8 insertions, 0 deletions
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;
+ }
+ }
?>