aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-02-25 19:06:31 -0800
committerfriendica <info@friendica.com>2013-02-25 19:06:31 -0800
commit46a89910aea43d0af6ace66de315fff87ee2d53a (patch)
tree8f038efaebe492954d5dc6242eeee2723c58d2c3 /mod
parentb1f9c19ef96d61936516b15678ec8902dc2e24fb (diff)
downloadvolse-hubzilla-46a89910aea43d0af6ace66de315fff87ee2d53a.tar.gz
volse-hubzilla-46a89910aea43d0af6ace66de315fff87ee2d53a.tar.bz2
volse-hubzilla-46a89910aea43d0af6ace66de315fff87ee2d53a.zip
partial port of embedded shares
Diffstat (limited to 'mod')
-rw-r--r--mod/share.php25
1 files changed, 16 insertions, 9 deletions
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("'", "&#039;",$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();
+
}