From 0eceade2fe0bb432543d8c48b3e9e6c5f3a3b00c Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 30 Oct 2011 16:28:07 -0700 Subject: [PATCH] view source of item [bbcode] usage: viewsrc/nnn --- mod/viewsrc.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 mod/viewsrc.php diff --git a/mod/viewsrc.php b/mod/viewsrc.php new file mode 100644 index 0000000000..8900e44db4 --- /dev/null +++ b/mod/viewsrc.php @@ -0,0 +1,30 @@ +argc > 1) ? intval($a->argv[1]) : 0); + + if(! $item_id) { + $a->error = 404; + notice( t('Item not found.') . EOL); + return; + } + + $r = q("SELECT `item`.`body` FROM `item` + WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 + AND `item`.`id` = '%s' LIMIT 1", + intval(local_user()), + dbesc($item_id) + ); + + if(count($r)) + $o .= str_replace("\n",'
',$r[0]['body']); + return $o; +} +