- Timestamp:
- 09/09/07 23:21:42 (15 months ago)
- Files:
-
- 1 modified
-
trunk/common/mvblog.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/mvblog.php
r602 r608 261 261 $text = $this->strip_invalid_xml(stripslashes($row["body"])); 262 262 $text = $this->plugman->run_hooks("text_output", $text); 263 if ($this->limit_text($text , 4000)) {263 if ($this->limit_text($text)) { 264 264 echo $text; 265 265 ?><br /><br /><a href="<?php echo $link; ?>" class="link_readmore"><?php echo gettext("read more"); ?></a><?php … … 337 337 } 338 338 /* }}} */ 339 /* limit_text($text , $length) {{{ */339 /* limit_text($text) {{{ */ 340 340 /** 341 341 * limit the length of a message 342 342 * 343 343 * @param string $text the text to limit in length 344 * @param int $length the number of chars to limit to345 344 * @return int 1 if truncated, 0 if original string is within limits 346 345 */ 347 public function limit_text(&$text , $length=4000) {346 public function limit_text(&$text) { 348 347 if (strstr($text, "##BREAKPOINT##")) { 349 348 $text = substr($text, 0, strpos($text, "##BREAKPOINT##")); 350 349 return 1; 351 350 } else { 352 if (strlen($text) > $length) { 353 $tmptxt = substr($text, $length, -1); 354 $breakpoint = ($length+(strpos($tmptxt, ">")+1)); 355 $text = substr($text, 0, $breakpoint); 356 return 1; 357 } else { 358 return 0; 359 } 351 return 0; 360 352 } 361 353 }
