From 4c8e3800b419997ae92c9940cf7f04ca3c957024 Mon Sep 17 00:00:00 2001 From: artemuhi Date: Thu, 22 Feb 2024 12:16:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=BD=D0=B5=D1=81=D0=BA=D0=BE=D0=BB=D1=8C=D0=BA?= =?UTF-8?q?=D0=BE=20=D0=BD=D0=BE=D0=B2=D1=8B=D1=85=20=D1=84=D1=83=D0=BD?= =?UTF-8?q?=D0=BA=D1=86=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pointsystemlib.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/pointsystemlib.php b/pointsystemlib.php index 2991189..bc3ccb2 100644 --- a/pointsystemlib.php +++ b/pointsystemlib.php @@ -8,11 +8,25 @@ function savedb($data) { global $config; return file_put_contents($config["dbfile"], json_encode($data)); } -function createuser($name, $basepoint=0) {} -function removeuser($name) {} -function points($name) {} +function createuser($name, $basepoint=0.0) { + $db = loaddb(); + $db["points"][$name] = $basepoint; + $db["logs"][$name][] = "Init wallet:" . $basepoint; + savedb($db); +} +function removeuser($name) { + $db = loaddb(); + unset($db["points"][$name], $db["logs"][$name]); + savedb($db); +} +function points($name) { + chechtimebanpoint(); + $db = loaddb(); + $temp = $db["points"][$name]; + return $temp; +} function addpoint($name, $point, $reason="") {} -function rmpoint($name, $point, $reason="") {} +function rmpoint($name, $point, $reason="", $force=true) {} function paypoint($byname, $toname, $point, $reason="") {} function logpoint($name) {} function banpoint($name, $point, $by="ANON_ADM", $len="perm", $reason="", $id=0) {}