scratch – Diff between revs 140 and 141
?pathlinks?
Rev 140 | Rev 141 | |||
---|---|---|---|---|
Line 4... | Line 4... | |||
4 | ## Copyright (C) Wizardry and Steamworks 2017 - License: GNU GPLv3 ## |
4 | ## Copyright (C) Wizardry and Steamworks 2017 - License: GNU GPLv3 ## |
|
5 | ########################################################################### |
5 | ########################################################################### |
|
Line 6... | Line 6... | |||
6 | |
6 | |
|
7 | require_once('php/pseudocrypt.php'); |
7 | require_once('php/pseudocrypt.php'); |
|
- | 8 | require_once('php/functions.php'); |
||
8 | require_once('php/functions.php'); |
9 | require_once('php/ip.php'); |
|
Line 9... | Line 10... | |||
9 | require_once('vendor/autoload.php'); |
10 | require_once('vendor/autoload.php'); |
|
10 | |
11 | |
|
Line 95... | Line 96... | |||
95 | ## Create tags table if it does not exist. |
96 | ## Create tags table if it does not exist. |
|
96 | $db->query('CREATE TABLE IF NOT EXISTS "uploaders" ("hash" text NOT NULL COLLATE NOCASE, "ip" text COLLATE NOCASE, UNIQUE("hash") ON CONFLICT REPLACE)'); |
97 | $db->query('CREATE TABLE IF NOT EXISTS "uploaders" ("hash" text NOT NULL COLLATE NOCASE, "ip" text COLLATE NOCASE, UNIQUE("hash") ON CONFLICT REPLACE)'); |
|
Line 97... | Line 98... | |||
97 | |
98 | |
|
98 | $q = $db->prepare('REPLACE INTO "uploaders" ("hash", "ip") VALUES(:hash, :ip)'); |
99 | $q = $db->prepare('REPLACE INTO "uploaders" ("hash", "ip") VALUES(:hash, :ip)'); |
|
99 | $q->bindParam(':hash', $file); |
100 | $q->bindParam(':hash', $file); |
|
100 | $q->bindParam(':ip', $_SERVER['REMOTE_ADDR']); |
101 | $q->bindParam(':ip', get_ip_address()); |
|
Line 101... | Line 102... | |||
101 | $q->execute(); |
102 | $q->execute(); |
|
102 | |
103 | |
|
103 | $db->commit(); |
104 | $db->commit(); |