From 46a89910aea43d0af6ace66de315fff87ee2d53a Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 25 Feb 2013 19:06:31 -0800 Subject: partial port of embedded shares --- mod/share.php | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'mod/share.php') diff --git a/mod/share.php b/mod/share.php index 33aa9eede..f0b14541f 100644 --- a/mod/share.php +++ b/mod/share.php @@ -17,15 +17,22 @@ function share_init(&$a) { xchan_query($r); - $o = '[share]' . "\n"; - - $o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author']['xchan_url'] . ']' . $r[0]['author']['xchan_name'] . '[/url]' . "\n"; - if($r[0]['title']) - $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n"; - $o .= $r[0]['body'] . "\n" ; - - $o .= (($r[0]['plink']) ? '[url=' . $r[0]['plink'] . ']' . t('link') . '[/url]' . "\n" : '') . '[/share]'; + if (strpos($r[0]['body'], "[/share]") !== false) { + $pos = strpos($r[0]['body'], "[share"); + $o = substr($r[0]['body'], $pos); + } else { + $o = "[share author='".str_replace("'", "'",$r[0]['author']['xchan_name']). + "' profile='".$r[0]['author']['xchan_url'] . + "' avatar='".$r[0]['author']['xchan_photo_s']. + "' link='".$r[0]['plink']. + "' posted='".$r[0]['created']."']\n"; + if($r[0]['title']) + $o .= '[b]'.$r[0]['title'].'[/b]'."\n"; + $o .= $r[0]['body']; + $o.= "[/share]"; + } echo $o; - killme(); + killme(); + } -- cgit v1.2.3