diff options
Diffstat (limited to 'tpl/notes/inc_relativestree.php')
-rw-r--r-- | tpl/notes/inc_relativestree.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tpl/notes/inc_relativestree.php b/tpl/notes/inc_relativestree.php index fd47ab4..295e552 100644 --- a/tpl/notes/inc_relativestree.php +++ b/tpl/notes/inc_relativestree.php @@ -4,10 +4,10 @@ $notes_tree = array(); $notes_parents = array(); $n = sql("SELECT id, parent, title FROM notes ". - "WHERE owner = " . $note['owner'] . + "WHERE owner = ?" . ($note['owner'] == $user['id'] ? " " : " AND public != 0 ") . - "ORDER BY title ASC"); -while ($nn = mysql_fetch_assoc($n)) { + "ORDER BY title ASC", $note['owner']); +while ($nn = $n->fetch()) { $notes_parents[$nn['id']] = $nn['parent']; if (isset($notes_tree[$nn['parent']])) { $notes_tree[$nn['parent']][] = $nn; |