From: Michael Vogel Date: Sat, 3 May 2014 09:54:40 +0000 (+0200) Subject: gpluspost: Some design changes to the output. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0e9d6b4043f0cb03b6e9fd50adf61f0897939b03;p=friendica-addons.git gpluspost: Some design changes to the output. --- 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"; } }