Skip to content

Commit

Permalink
Replace queries usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Derkades committed May 31, 2022
1 parent 4d587ef commit 55204bc
Show file tree
Hide file tree
Showing 58 changed files with 275 additions and 275 deletions.
2 changes: 1 addition & 1 deletion core/classes/Core/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ public static function updateCheck(): string {
}

$queries = new Queries();
$queries->update('settings', ['name', 'version_update'], [
DB::getInstance()->update('settings', ['name', 'version_update'], [
'value' => $to_db
]);
}
Expand Down
4 changes: 2 additions & 2 deletions core/classes/Misc/Announcements.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static function getPagesCsv(?string $pages_json = null): ?string {
public function edit(int $id, array $pages, array $groups, string $text_colour, string $background_colour, string $icon, bool $closable, string $header, string $message, int $order): bool {
$queries = new Queries();

$queries->update('custom_announcements', $id, [
DB::getInstance()->update('custom_announcements', $id, [
'pages' => json_encode($pages),
'groups' => json_encode($groups),
'text_colour' => $text_colour,
Expand Down Expand Up @@ -173,7 +173,7 @@ public function resetCache(): void {
public function create(User $user, array $pages, array $groups, string $text_colour, string $background_colour, string $icon, bool $closable, string $header, string $message, int $order): bool {
$queries = new Queries();

$queries->create('custom_announcements', [
DB::getInstance()->insert('custom_announcements', [
'pages' => json_encode($pages),
'groups' => json_encode($groups),
'text_colour' => $text_colour,
Expand Down
6 changes: 3 additions & 3 deletions core/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@
$user_ip_logged = DB::getInstance()->get('users_ips', ['ip', $ip])->results();
if (!count($user_ip_logged)) {
// Create the entry now
$queries->create('users_ips', [
DB::getInstance()->insert('users_ips', [
'user_id' => $user->data()->id,
'ip' => $ip
]);
Expand All @@ -583,15 +583,15 @@

if (!isset($already_logged)) {
// Not yet logged, do so now
$queries->create('users_ips', [
DB::getInstance()->insert('users_ips', [
'user_id' => $user->data()->id,
'ip' => $ip
]);
}
} else {
// Does the entry already belong to the current user?
if ($user_ip_logged[0]->user_id != $user->data()->id) {
$queries->create('users_ips', [
DB::getInstance()->insert('users_ips', [
'user_id' => $user->data()->id,
'ip' => $ip
]);
Expand Down
Loading

0 comments on commit 55204bc

Please sign in to comment.