From d610f25a48815da2d0b4a90fc098c3d003550183 Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Sat, 29 Aug 2020 12:34:22 +0200 Subject: [PATCH] Switching from tokenhash to userdir and from path to link --- jensmemes.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jensmemes.php b/jensmemes.php index 6c44b02..cf6cebb 100644 --- a/jensmemes.php +++ b/jensmemes.php @@ -110,7 +110,8 @@ if ($method == "GET") { while ($row = mysqli_fetch_array($res_users, MYSQLI_ASSOC)) { $user = new stdClass(); $user->name = $row["name"]; - $user->tokenhash = md5($row["token"]); + $user->tokenhash = $row["userdir"]; + $user->userdir = $row["userdir"]; $user->dayuploads = $row["uploadsLast24H"]; array_push($users, $user); } @@ -161,6 +162,7 @@ function checksql($res) { function memesArray($query) { global $jmcon; + global $jmurl; $memes = array(); $res_memes = mysqli_query($jmcon, $query); @@ -170,6 +172,7 @@ function memesArray($query) { $meme->id = $row["id"]; $path = $row["path"]; $path = str_replace(" ", "%20", $path); + $meme->link = $jmurl . $path; $meme->path = $path; $meme->category = $row["cat"]; $meme->user = $row["user"];