]> git.mxchange.org Git - friendica.git/blob - mod/share.php
Merge branch 'master' of https://github.com/friendica/friendica
[friendica.git] / mod / share.php
1 <?php
2
3 require_once('bbcode.php');
4
5 function share_init(&$a) {
6
7         $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
8         if((! $post_id) || (! local_user()))
9                 killme();
10
11         $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
12                 intval($post_id)
13         );
14         if(! count($r) || $r[0]['private'])
15                 killme();
16
17         $o = '';
18
19 //      if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) {
20                 $o .= "\xE2\x99\xb2" . ' [url=' . $r[0]['author-link'] . ']' . $r[0]['author-name'] . '[/url]' . "\n";
21                 if($r[0]['title'])
22                         $o .= '[b]' . $r[0]['title'] . '[/b]' . "\n";
23                 $o .= $r[0]['body'] . "\n";
24 //      }
25 //      else {
26 //              $o .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
27 //              if($r[0]['title'])
28 //                      $o .= '<strong>' . $r[0]['title'] . '</strong><br />';
29 //              $o .= $r[0]['body'] . "\n";
30 //      }
31         echo $o;
32         killme();  
33 }