aboutsummaryrefslogtreecommitdiffstats
path: root/mod/lockview.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-02-03 17:20:40 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2011-02-03 17:20:40 +0100
commit9b3131861f8ab6485791c667e4d514a53a34bb80 (patch)
tree25a4e4b0450832b84dfa790e1819c32a774f4d10 /mod/lockview.php
parent042aa2e169310bc23398d0558455a61fe1e86a92 (diff)
downloadvolse-hubzilla-9b3131861f8ab6485791c667e4d514a53a34bb80.tar.gz
volse-hubzilla-9b3131861f8ab6485791c667e4d514a53a34bb80.tar.bz2
volse-hubzilla-9b3131861f8ab6485791c667e4d514a53a34bb80.zip
Extend lockview to show info on items, photos and events
Diffstat (limited to 'mod/lockview.php')
-rw-r--r--mod/lockview.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/mod/lockview.php b/mod/lockview.php
index a886effeb..a99628b6e 100644
--- a/mod/lockview.php
+++ b/mod/lockview.php
@@ -2,12 +2,23 @@
function lockview_content(&$a) {
-
- $item_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
+
+ $type = (($a->argc > 1) ? $a->argv[1] : 0);
+ if (is_numeric($type)) {
+ $item_id = intval($type);
+ $type='item';
+ } else {
+ $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
+ }
+
if(! $item_id)
killme();
- $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1",
+ if (!in_array($type, array('item','photo','event')))
+ killme();
+
+ $r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1",
+ dbesc($type),
intval($item_id)
);
if(! count($r))
@@ -37,6 +48,7 @@ function lockview_content(&$a) {
dbesc(implode(', ', $allowed_groups))
);
if(count($r))
+ if($item['uid'] != local_user())
foreach($r as $rr)
$l[] = '<b>' . $rr['name'] . '</b>';
}
@@ -68,7 +80,11 @@ function lockview_content(&$a) {
}
- echo $o . implode(', ', $l);
+ if (count($l)>0) {
+ echo $o . implode(', ', $l);
+ } else {
+ echo $o . t('nobody');
+ }
killme();
}