aboutsummaryrefslogtreecommitdiffstats
path: root/mod/share.php
diff options
context:
space:
mode:
authorVasudev Kamath <kamathvasudev@gmail.com>2012-07-06 22:47:27 +0530
committerVasudev Kamath <kamathvasudev@gmail.com>2012-07-06 22:47:27 +0530
commitba4db236ecff1ffdb56adc2715b3f53515f8cb34 (patch)
treef0b9928aade8aab95d1608890fde1918ce163754 /mod/share.php
parent6e4760dd9c512147309b5e4a98d25216610f81da (diff)
parenta122fecf50d06856a2ada8b564f711fb52c327f0 (diff)
downloadvolse-hubzilla-ba4db236ecff1ffdb56adc2715b3f53515f8cb34.tar.gz
volse-hubzilla-ba4db236ecff1ffdb56adc2715b3f53515f8cb34.tar.bz2
volse-hubzilla-ba4db236ecff1ffdb56adc2715b3f53515f8cb34.zip
Merge branch 'master' of git://github.com/friendica/friendica
Diffstat (limited to 'mod/share.php')
-rw-r--r--mod/share.php29
1 files changed, 14 insertions, 15 deletions
diff --git a/mod/share.php b/mod/share.php
index c7525113e..761220ad7 100644
--- a/mod/share.php
+++ b/mod/share.php
@@ -8,26 +8,25 @@ function share_init(&$a) {
if((! $post_id) || (! local_user()))
killme();
- $r = q("SELECT item.*, contact.network FROM `item` left join contact on `item`.`contact-id` = `contact`.`id` WHERE `item`.`id` = %d LIMIT 1",
- intval($post_id)
+ $r = q("SELECT item.*, contact.network FROM `item`
+ left join contact on `item`.`contact-id` = `contact`.`id`
+ WHERE `item`.`id` = %d AND `item`.`uid` = %d LIMIT 1",
+
+ intval($post_id),
+ intval(local_user())
);
- if(! count($r) || ($r[0]['private'] && ($r[0]['network'] != NETWORK_FEED)))
+ if(! count($r) || ($r[0]['private'] == 1))
killme();
$o = '';
-// if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) {
- $o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]' . "\n";
- if($r[0]['title'])
- $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n";
- $o .= $r[0]['body'] . "\n";
-// }
-// else {
-// $o .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
-// if($r[0]['title'])
-// $o .= '<strong>' . $r[0]['title'] . '</strong><br />';
-// $o .= $r[0]['body'] . "\n";
-// }
+ $o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author-link'] . ']' . $r[0]['author-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" : '');
+
echo $o;
killme();
}