]> git.mxchange.org Git - friendica.git/blob - mod/viewsrc.php
add remove_user hook (it looks like dreamhost changed all my file permissions, this...
[friendica.git] / mod / viewsrc.php
1 <?php
2
3
4 function viewsrc_content(&$a) {
5
6         if(! local_user()) {
7                 notice( t('Access denied.') . EOL);
8                 return;
9         }
10
11         $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
12
13         if(! $item_id) {
14                 $a->error = 404;
15                 notice( t('Item not found.') . EOL);
16                 return;
17         }
18
19         $r = q("SELECT `item`.`body` FROM `item` 
20                 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
21                 AND `item`.`id` = '%s' LIMIT 1",
22                 intval(local_user()),
23                 dbesc($item_id)
24         );
25
26         if(count($r))
27                 $o .= str_replace("\n",'<br />',$r[0]['body']);
28         return $o;
29 }
30