Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added FORUM_SHORT_POST

  • Loading branch information...
commit 4d871a721b2a5deaf407cb1ed6ae03da75dde13e 1 parent b62f150
martin authored

Showing 1 changed file with 8 additions and 5 deletions. Show diff stats Hide diff stats

  1. +8 5 mod/forum/lib.php
13 mod/forum/lib.php
@@ -18,7 +18,10 @@
18 18 "2" => get_string("postrating2", "forum"),
19 19 "1" => get_string("postrating1", "forum") );
20 20
21   -$FORUM_LONG_POST = 600;
  21 +$FORUM_SHORT_POST = 300; // Less than this is "short"
  22 +
  23 +$FORUM_LONG_POST = 600; // More than this is "long"
  24 +
22 25
23 26
24 27 /// FUNCTIONS ///////////////////////////////////////////////////////////
@@ -232,13 +235,13 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link
232 235 }
233 236
234 237 function forum_shorten_post($message) {
235   - global $FORUM_LONG_POST;
  238 + global $FORUM_LONG_POST, $FORUM_SHORT_POST;
236 239
237 240 if (strlen($message) > $FORUM_LONG_POST) {
238   - // Look for the first return between 100 and $FORUM_LONG_POST
239   - $shortmessage = substr($message, 100, $FORUM_LONG_POST);
  241 + // Look for the first return between $FORUM_SHORT_POST and $FORUM_LONG_POST
  242 + $shortmessage = substr($message, $FORUM_SHORT_POST, $FORUM_LONG_POST);
240 243 if ($pos = strpos($shortmessage, "\n")) {
241   - return substr($message, 0, 100 + $pos);
  244 + return substr($message, 0, $FORUM_SHORT_POST + $pos);
242 245 } else {
243 246 return substr($message, 0, $FORUM_LONG_POST)."...";
244 247 }

0 comments on commit 4d871a7

Please sign in to comment.
Something went wrong with that request. Please try again.