Refactor all PLUS System

Refactor PLUS System + Fix some bugs
This commit is contained in:
novgorodschi catalin
2026-05-20 10:57:02 +03:00
parent 3f32e21333
commit 0934806e8d
22 changed files with 841 additions and 2275 deletions
+31 -3
View File
@@ -1,8 +1,36 @@
<?php
////////////// made by alq0rsan /////////////////////////
if($session->gold >= 100 && $session->sit == 0 && $session->goldclub == 0) {
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."users set goldclub = 1, gold = gold - 100 where `id`='".$session->uid."'");
// Gold Club activation 100 gold, atomic
$uid = (int)$session->uid;
if($session->sit != 0) {
header("Location: plus.php?id=3"); exit;
}
// un singur query care face tot
mysqli_query($database->dblink,
"UPDATE ".TB_PREFIX."users
SET goldclub = 1, gold = gold - 100
WHERE id = $uid AND gold >= 100 AND goldclub = 0"
);
if(mysqli_affected_rows($database->dblink) == 1) {
// succes update sesiunea
$session->gold -= 100;
$session->goldclub = 1;
$_SESSION['gold'] = $session->gold;
$_SESSION['goldclub'] = 1;
if(isset($database->cache)) {
$database->cache->delete('user:'.$uid);
}
// log
mysqli_query($database->dblink,
"INSERT INTO ".TB_PREFIX."gold_fin_log (wid, action, time)
VALUES (0, 'Gold Club activated', ".time().")"
);
}
header("Location: plus.php?id=3");
exit;
?>