From 4a7210b1c0e86b0c09ac29772833633f98672dc1 Mon Sep 17 00:00:00 2001 From: yi12345 Date: Mon, 1 Jul 2013 03:15:51 +0300 Subject: [PATCH] update --- GameEngine/Database/db_MYSQL.php | 5 +++-- GameEngine/Database/db_MYSQLi.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index f21c5309..8ce744aa 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -21,8 +21,9 @@ class MYSQL_DB { function register($username, $password, $email, $tribe, $act) { $time = time(); $timep = time() + PROTECTION; - if(strtotime(START_TIME) > time()){ - $timep = (strtotime(START_TIME) + PROTECTION); + $stime = strtotime(START_DATE)+strtotime(START_TIME)-time(); + if($stime > time()){ + $time = $stime; } $q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,act,protect,lastupdate,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, '$act', $timep, $time, $time)"; if(mysql_query($q, $this->connection)) { diff --git a/GameEngine/Database/db_MYSQLi.php b/GameEngine/Database/db_MYSQLi.php index 632847f5..58a17934 100644 --- a/GameEngine/Database/db_MYSQLi.php +++ b/GameEngine/Database/db_MYSQLi.php @@ -24,8 +24,9 @@ class MYSQLi_DB { function register($username, $password, $email, $tribe, $act) { $time = time(); $timep = time() + PROTECTION; - if(strtotime(START_TIME) > time()){ - $timep = (strtotime(START_TIME) + PROTECTION); + $stime = strtotime(START_DATE)+strtotime(START_TIME)-time(); + if($stime > time()){ + $time = $stime; } $q = "INSERT INTO " . TB_PREFIX . "users (username,password,access,email,timestamp,tribe,act,protect,lastupdate,regtime) VALUES ('$username', '$password', " . USER . ", '$email', $time, $tribe, '$act', $timep, $time, $time)"; if(mysql_query($this->connection, $q)) {