@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | |
29 | 29 | $query = ("SELECT " . implode(', ', $selection) .", rel.ancestor as parent_id ") . |
30 | 30 | |
31 | - ("FROM " . static::$table . " ent ") . |
|
31 | + ("FROM " . static::$table . " ent ") . |
|
32 | 32 | |
33 | - ("LEFT JOIN " . static::$table_relations . " rel ON rel.descendant = ent.id AND rel.depth = 1 ") . |
|
33 | + ("LEFT JOIN " . static::$table_relations . " rel ON rel.descendant = ent.id AND rel.depth = 1 ") . |
|
34 | 34 | |
35 | - ("WHERE ent.visibility = " . VISIBILITY_PUBLISHED . " AND ent.access <= " . Auth::get('rank') . " AND ") . |
|
35 | + ("WHERE ent.visibility = " . VISIBILITY_PUBLISHED . " AND ent.access <= " . Auth::get('rank') . " AND ") . |
|
36 | 36 | |
37 | - ("ent.locked = 0 AND ent.slug = '" . addslashes($slug) . "' LIMIT 1"); |
|
37 | + ("ent.locked = 0 AND ent.slug = '" . addslashes($slug) . "' LIMIT 1"); |
|
38 | 38 | |
39 | 39 | # Select entity from DB |
40 | 40 | |
@@ -55,17 +55,17 @@ discard block |
||
55 | 55 | |
56 | 56 | $query = ("UPDATE " . static::$table . " ent JOIN (") . |
57 | 57 | |
58 | - ("SELECT rel.descendant as id, GROUP_CONCAT(ens.name ORDER BY rls.depth DESC SEPARATOR '/') slug ") . |
|
58 | + ("SELECT rel.descendant as id, GROUP_CONCAT(ens.name ORDER BY rls.depth DESC SEPARATOR '/') slug ") . |
|
59 | 59 | |
60 | - ("FROM " . static::$table_relations . " rel ") . |
|
60 | + ("FROM " . static::$table_relations . " rel ") . |
|
61 | 61 | |
62 | - ("JOIN " . static::$table_relations . " rls ON rls.descendant = rel.descendant ") . |
|
62 | + ("JOIN " . static::$table_relations . " rls ON rls.descendant = rel.descendant ") . |
|
63 | 63 | |
64 | - ("JOIN " . static::$table . " ens ON ens.id = rls.ancestor ") . |
|
64 | + ("JOIN " . static::$table . " ens ON ens.id = rls.ancestor ") . |
|
65 | 65 | |
66 | - ("WHERE rel.ancestor = " . $this->id . " GROUP BY rel.descendant") . |
|
66 | + ("WHERE rel.ancestor = " . $this->id . " GROUP BY rel.descendant") . |
|
67 | 67 | |
68 | - (") slg ON slg.id = ent.id SET ent.locked = 1, ent.slug = slg.slug"); |
|
68 | + (") slg ON slg.id = ent.id SET ent.locked = 1, ent.slug = slg.slug"); |
|
69 | 69 | |
70 | 70 | if (!(DB::send($query) && DB::getLast()->status)) return false; |
71 | 71 | |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | |
74 | 74 | $query = ("UPDATE " . static::$table . " ent JOIN (") . |
75 | 75 | |
76 | - ("SELECT rel.descendant as id FROM " . static::$table_relations . " rel ") . |
|
76 | + ("SELECT rel.descendant as id FROM " . static::$table_relations . " rel ") . |
|
77 | 77 | |
78 | - ("JOIN " . static::$table . " enc ON enc.id = rel.descendant AND enc.locked = 1 ") . |
|
78 | + ("JOIN " . static::$table . " enc ON enc.id = rel.descendant AND enc.locked = 1 ") . |
|
79 | 79 | |
80 | - ("LEFT JOIN " . static::$table . " end ON end.id != enc.id AND end.slug = enc.slug ") . |
|
80 | + ("LEFT JOIN " . static::$table . " end ON end.id != enc.id AND end.slug = enc.slug ") . |
|
81 | 81 | |
82 | - ("WHERE end.id IS NULL GROUP BY rel.descendant") . |
|
82 | + ("WHERE end.id IS NULL GROUP BY rel.descendant") . |
|
83 | 83 | |
84 | - (") chk ON chk.id = ent.id SET ent.locked = 0"); |
|
84 | + (") chk ON chk.id = ent.id SET ent.locked = 0"); |
|
85 | 85 | |
86 | 86 | if (!(DB::send($query) && DB::getLast()->status)) return false; |
87 | 87 |