+
+ // if the post contains a picture and a link then the system tries to cut the post earlier.
+ // So the link and the picture can be posted.
+ if (($image != "") AND ($orig_link != $image)) {
+ $msg2 = substr($msg, 0, ($max_char - 40) - (strlen($msglink)));
+ $lastchar = substr($msg2, -1);
+ $msg2 = substr($msg2, 0, -1);
+ $pos = strrpos($msg2, "\n");
+ if ($pos > 0)
+ $msg = substr($msg2, 0, $pos);
+ else if ($lastchar == "\n")
+ $msg = trim($msg2);
+ }
+