This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
pointsystemlib/pointsystemlib.php

40 lines
1.2 KiB
PHP

<?php
function loaddb() {
global $config;
$db = json_decode(file_get_contents($config["dbfile"]));
return $db;
}
function savedb($data) {
global $config;
return file_put_contents($config["dbfile"], json_encode($data));
}
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="", $force=true) {}
function paypoint($byname, $toname, $point, $reason="") {}
function logpoint($name) {}
function banpoint($name, $point, $by="ANON_ADM", $len="perm", $reason="", $id=0) {}
function infobanpoint($name, $id) {}
function chechtimebanpoint($name, $id) {}
function unbanpoint($name, $id) {}
function banspoints($name) {}
function reservepoint($name, $point="1", $id=0) {}
function unreservepoint($name, $id, $renurn=false) {}
function reservespoints($name) {}
?>