aboutsummaryrefslogtreecommitdiffstats
path: root/mod/lockview.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-02-03 23:25:33 -0800
committerFriendika <info@friendika.com>2011-02-03 23:25:33 -0800
commit5c98032893d945644c6da6bdf99484c0c8cb7e45 (patch)
treef2e86708d3823603a70bb02dcb90634b44996fe0 /mod/lockview.php
parent1eef647edbdaec9effb765c95075b4295c694f12 (diff)
parentb5c3fb1545b67b2cce501e916483606300fe82a9 (diff)
downloadvolse-hubzilla-5c98032893d945644c6da6bdf99484c0c8cb7e45.tar.gz
volse-hubzilla-5c98032893d945644c6da6bdf99484c0c8cb7e45.tar.bz2
volse-hubzilla-5c98032893d945644c6da6bdf99484c0c8cb7e45.zip
Merge branch 'photos' of https://github.com/fabrixxm/friendika into fabrixxm-photos
Diffstat (limited to 'mod/lockview.php')
-rw-r--r--mod/lockview.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/mod/lockview.php b/mod/lockview.php
index a886effeb..9e64e2608 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))