This commit is contained in:
Shish 2019-11-27 12:13:04 +00:00
parent 21b983ac85
commit 6b2304af93
7 changed files with 25 additions and 15 deletions

View file

@ -347,7 +347,8 @@ class Database
} }
} }
public function raw_db(): PDO { public function raw_db(): PDO
{
return $this->db; return $this->db;
} }
} }

View file

@ -1,9 +1,15 @@
<?php <?php
use MicroCRUD\{StringColumn,DateColumn,TextColumn,EnumColumn,Table}; use MicroCRUD\StringColumn;
use MicroCRUD\DateColumn;
use MicroCRUD\TextColumn;
use MicroCRUD\EnumColumn;
use MicroCRUD\Table;
class IPBanTable extends Table { class IPBanTable extends Table
function __construct(\PDO $db, $token=null) { {
public function __construct(\PDO $db, $token=null)
{
parent::__construct($db, $token); parent::__construct($db, $token);
$this->table = "bans"; $this->table = "bans";

View file

@ -353,7 +353,8 @@ class Notes extends Extension
$notesPerPage = $config->get_int('notesNotesPerPage'); $notesPerPage = $config->get_int('notesNotesPerPage');
//$result = $database->get_all("SELECT * FROM pool_images WHERE pool_id=:pool_id", ['pool_id'=>$poolID]); //$result = $database->get_all("SELECT * FROM pool_images WHERE pool_id=:pool_id", ['pool_id'=>$poolID]);
$result = $database->execute(" $result = $database->execute(
"
SELECT DISTINCT image_id SELECT DISTINCT image_id
FROM notes FROM notes
WHERE enable = :enable WHERE enable = :enable

View file

@ -188,11 +188,13 @@ class Wiki extends Extension
global $database; global $database;
$wpage = $event->wikipage; $wpage = $event->wikipage;
try { try {
$database->Execute(" $database->Execute(
"
INSERT INTO wiki_pages(owner_id, owner_ip, date, title, revision, locked, body) INSERT INTO wiki_pages(owner_id, owner_ip, date, title, revision, locked, body)
VALUES (:owner_id, :owner_ip, now(), :title, :revision, :locked, :body)", VALUES (:owner_id, :owner_ip, now(), :title, :revision, :locked, :body)",
["owner_id"=>$event->user->id, "owner_ip"=>$_SERVER['REMOTE_ADDR'], ["owner_id"=>$event->user->id, "owner_ip"=>$_SERVER['REMOTE_ADDR'],
"title"=>$wpage->title, "revision"=>$wpage->revision, "locked"=>$wpage->locked?'Y':'N', "body"=>$wpage->body]); "title"=>$wpage->title, "revision"=>$wpage->revision, "locked"=>$wpage->locked?'Y':'N', "body"=>$wpage->body]
);
} catch (Exception $e) { } catch (Exception $e) {
throw new WikiUpdateException("Somebody else edited that page at the same time :-("); throw new WikiUpdateException("Somebody else edited that page at the same time :-(");
} }