different hack for old sqlite

This commit is contained in:
Shish 2020-10-26 22:43:47 +00:00
parent cc06df171a
commit 634124e17f
3 changed files with 9 additions and 8 deletions

View file

@ -217,6 +217,7 @@ class SQLite extends DBEngine
$data = str_replace(SCORE::BOOL_Y, "'$this->BOOL_Y'", $data); $data = str_replace(SCORE::BOOL_Y, "'$this->BOOL_Y'", $data);
$data = str_replace(SCORE::BOOL_N, "'$this->BOOL_N'", $data); $data = str_replace(SCORE::BOOL_N, "'$this->BOOL_N'", $data);
$data = str_replace(SCORE::BOOL, "CHAR(1)", $data); $data = str_replace(SCORE::BOOL, "CHAR(1)", $data);
$data = str_replace("DEFAULT FALSE", "DEFAULT 0", $data);
return $data; return $data;
} }

View file

@ -133,13 +133,13 @@ class PrivateImage extends Extension
if ($show_private) { if ($show_private) {
$event->add_querylet( $event->add_querylet(
new Querylet( new Querylet(
"private != :true OR owner_id = :private_owner_id", "private = :false OR owner_id = :private_owner_id",
["private_owner_id"=>$user->id, "true"=>true] ["private_owner_id"=>$user->id, "false"=>false]
) )
); );
} else { } else {
$event->add_querylet( $event->add_querylet(
new Querylet("private != :true", ["true"=>true]) new Querylet("private = :false", ["false"=>false])
); );
} }
} }
@ -153,8 +153,8 @@ class PrivateImage extends Extension
$query = ""; $query = "";
switch ($matches[1]) { switch ($matches[1]) {
case "no": case "no":
$query .= "private != :true"; $query .= "private = :false";
$params["true"] = true; $params["false"] = false;
break; break;
case "yes": case "yes":
$query .= "private = :true"; $query .= "private = :true";
@ -168,8 +168,8 @@ class PrivateImage extends Extension
} }
break; break;
case "any": case "any":
$query .= "private != :true OR owner_id = :private_owner_id"; $query .= "private = :false OR owner_id = :private_owner_id";
$params["true"] = true; $params["false"] = false;
$params["private_owner_id"] = $user->id; $params["private_owner_id"] = $user->id;
break; break;
} }

View file

@ -97,7 +97,7 @@ class Trash extends Extension
$matches = []; $matches = [];
if (is_null($event->term) && $this->no_trash_query($event->context)) { if (is_null($event->term) && $this->no_trash_query($event->context)) {
$event->add_querylet(new Querylet("trash != :true", ["true"=>true])); $event->add_querylet(new Querylet("trash = :false", ["false"=>false]));
} }
if (is_null($event->term)) { if (is_null($event->term)) {