This commit is contained in:
Fabio Comuni 2011-02-03 17:25:10 +01:00
parent bed0391e6f
commit c15c550a06
1 changed files with 14 additions and 14 deletions

View File

@ -4,21 +4,21 @@
function lockview_content(&$a) { function lockview_content(&$a) {
$type = (($a->argc > 1) ? $a->argv[1] : 0); $type = (($a->argc > 1) ? $a->argv[1] : 0);
if (is_numeric($type)) { if (is_numeric($type)) {
$item_id = intval($type); $item_id = intval($type);
$type='item'; $type='item';
} else { } else {
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0); $item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
} }
if(! $item_id) if(! $item_id)
killme(); killme();
if (!in_array($type, array('item','photo','event'))) if (!in_array($type, array('item','photo','event')))
killme(); killme();
$r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1", $r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1",
dbesc($type), dbesc($type),
intval($item_id) intval($item_id)
); );
if(! count($r)) if(! count($r))
@ -80,11 +80,11 @@ function lockview_content(&$a) {
} }
if (count($l)>0) { if (count($l)>0) {
echo $o . implode(', ', $l); echo $o . implode(', ', $l);
} else { } else {
echo $o . t('nobody'); echo $o . t('nobody');
} }
killme(); killme();
} }