forked from Cavemanon/cavepaintings
custom primary keys
This commit is contained in:
@@ -12,6 +12,7 @@ class HashBanTable extends Table
|
||||
parent::__construct($db);
|
||||
$this->table = "image_bans";
|
||||
$this->base_query = "SELECT * FROM image_bans";
|
||||
$this->primary_key = "hash";
|
||||
$this->size = 100;
|
||||
$this->limit = 1000000;
|
||||
$this->columns = [
|
||||
@@ -102,7 +103,7 @@ class ImageBan extends Extension
|
||||
} elseif ($event->get_arg(0) == "remove") {
|
||||
$user->ensure_authed();
|
||||
$input = validate_input(["d_hash"=>"string"]);
|
||||
send_event(new RemoveImageHashBanEvent($input['hash']));
|
||||
send_event(new RemoveImageHashBanEvent($input['d_hash']));
|
||||
flash_message("Image ban removed");
|
||||
$page->set_mode(PageMode::REDIRECT);
|
||||
$page->set_redirect($_SERVER['HTTP_REFERER']);
|
||||
|
@@ -10,6 +10,7 @@ class NotATagTable extends Table
|
||||
parent::__construct($db);
|
||||
$this->table = "untags";
|
||||
$this->base_query = "SELECT * FROM untags";
|
||||
$this->primary_key = "tag";
|
||||
$this->size = 100;
|
||||
$this->limit = 1000000;
|
||||
$this->columns = [
|
||||
@@ -122,7 +123,7 @@ class NotATag extends Extension
|
||||
$t = new NotATagTable($database->raw_db());
|
||||
$t->token = $user->get_auth_token();
|
||||
$t->inputs = $_GET;
|
||||
$this->theme->display_bans($page, $t->table($t->query()), $t->paginator());
|
||||
$this->theme->display_untags($page, $t->table($t->query()), $t->paginator());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user