diff --git a/gpluspost/gpluspost.php b/gpluspost/gpluspost.php index 92ee8375..5f691985 100644 --- a/gpluspost/gpluspost.php +++ b/gpluspost/gpluspost.php @@ -321,6 +321,7 @@ function gpluspost_createmsg($b) { $image = htmlspecialchars_decode($image); $body = $b["body"]; + if ($b["title"] != "") $body = "*".$b["title"]."*\n\n".$body; @@ -558,6 +559,7 @@ function gpluspost_init() { function gpluspost_feeditem($pid, $uid) { global $a; + require_once('include/api.php'); require_once('include/bbcode.php'); require_once("include/html2plain.php"); require_once("include/network.php"); @@ -569,6 +571,11 @@ function gpluspost_feeditem($pid, $uid) { $item['body'] = bb_CleanPictureLinks($item['body']); + $item['body'] = bb_remove_share_information($item['body'], true); + + if ($item["title"] != "") + $item['body'] = "*".$item["title"]."*\n\n".$item['body']; + // Looking for the first image $image = ''; if(preg_match("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/is",$item['body'],$matches)) @@ -593,8 +600,12 @@ function gpluspost_feeditem($pid, $uid) { $body = $item['body']; + $body = preg_replace("(\[b\](.*?)\[\/b\])ism",'*$1*',$body); + $body = preg_replace("(\[i\](.*?)\[\/i\])ism",'_$1_',$body); + $body = preg_replace("(\[s\](.*?)\[\/s\])ism",'-$1-',$body); + // At first convert the text to html - $html = bbcode($body, false, false, 2); + $html = bbcode(api_clean_plain_items($body), false, false, 2); // Then convert it to plain text $msg = trim(html2plain($html, 0, true)); @@ -655,6 +666,11 @@ function gpluspost_feeditem($pid, $uid) { $msglink = htmlspecialchars(html_entity_decode($msglink)); + if (strpos($msg, $msglink) == 0) + $msg .= "\n".$msglink; + + $msg = nl2br($msg); + $title = str_replace("&", "&", $title); //$html = str_replace("&", "&", $html); @@ -668,7 +684,7 @@ function gpluspost_feeditem($pid, $uid) { echo "\t\t\n\t\t\t\n"; echo "\t\t\t".$item["author-link"]."\n\t\t\n"; //echo ''; - echo "\t\t".'\n"; + echo "\t\t".'\n"; echo "\t\n"; } }