From 838f6be2d48584c5817b87ac491fd32350039380 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sun, 22 Oct 2017 00:39:25 +0200 Subject: [PATCH] fix: message sending to players via Admin now works --- Admin/Mods/sendMessage.php | 7 ++----- README | 1 + todo.txt | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Admin/Mods/sendMessage.php b/Admin/Mods/sendMessage.php index f18b115d..c4595c9e 100644 --- a/Admin/Mods/sendMessage.php +++ b/Admin/Mods/sendMessage.php @@ -9,8 +9,6 @@ ################################################################################# include_once("../../GameEngine/Account.php"); -mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS); -mysqli_select_db(SQL_DB); if (!isset($_SESSION)) session_start(); if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!"); @@ -23,9 +21,8 @@ $topic = $_POST['topic']; $message = $_POST['message']; $time = time(); -$query = "INSERT INTO ".TB_PREFIX."mdata (target, owner, topic, message, viewed, time) VALUES ('$uid', 1, '$topic', '$message', 0, '$time')"; - -mysqli_query($GLOBALS["link"], $query); +$query = "INSERT INTO ".TB_PREFIX."mdata VALUES ('', '$uid', 1, '$topic', '$message', 0, 0, 0, '$time', 0, 0, 0, 0, 0, 0)"; +mysqli_query($GLOBALS["link"], $query) OR DIE (mysqli_errno($GLOBALS["link"])); header("Location: ../../../Admin/admin.php?p=Newmessage&uid=".$uid."&msg=ok"); ?> \ No newline at end of file diff --git a/README b/README index c0d770bc..9993795f 100644 --- a/README +++ b/README @@ -39,6 +39,7 @@ martinambrus changes: 27. editing additional user data in Admin now saves them when Enter is used instead of clicking on "Save" as well 28. fixed reports pagination always staying on "All" tab 29. fix for the "fixed" :) self-kicking from an alliance +30. fixed sending messages to player via Admin Shadowss changes: diff --git a/todo.txt b/todo.txt index 69803ff6..bc7b234f 100644 --- a/todo.txt +++ b/todo.txt @@ -8,7 +8,6 @@ - disallow Support to play (single cookie for Admin and the game means support gets no village and lots of warnings when they switch to game now) - resetting res bonus in admin actually says that bonus was given after OK is pressed - quest image should glow red when new task is ready to be read (now it's only red when page is refreshed) -- sending messages to players via Admin doesn't work - check aliance invitation accepting - apparently it doesn't work too well on first try? - normalize forum tables - varchar is used for numeric values and is joined with int field - task 1 => construct woodcutter will not reload the page when finished, so it would still seem that woodcutter build is in progress