SlayingWorld
Active Member
Hello, i've used the search function but the results are outdated, and im not that very familiar with SQL commands.
Mission: Give out 30 days of free premium to new accounts.
Problem: Znote ACC Maker updates "znote_accounts" instead of the "accounts" table. Cant just insert the "premdays => '30'" in the array because that section is not valid in the znote_accounts.
Currently Using:
Latest Version of Znote from Znote/ZnoteAAC (https://github.com/Znote/ZnoteAAC)
Just a basic question, whats the SQL command that i need to update my "premdays" with 30 days on the account_id that was created.
I have tried editing register.php from:
to:
adding the:
in the array does not work because whenever you create a new account the Znote Acc Maker updates the znote_accounts table in that php file not the accounts file.
Heres what my phpMyAdmin tables look:
I tried messing with this section of the code, but since im pretty bad with SQL Database commands i cant figure it out:
I tried adding a :
and placed it here:
But it just bugs out and the page does not even load.
Mission: Give out 30 days of free premium to new accounts.
Problem: Znote ACC Maker updates "znote_accounts" instead of the "accounts" table. Cant just insert the "premdays => '30'" in the array because that section is not valid in the znote_accounts.
Currently Using:
Latest Version of Znote from Znote/ZnoteAAC (https://github.com/Znote/ZnoteAAC)
Just a basic question, whats the SQL command that i need to update my "premdays" with 30 days on the account_id that was created.
I have tried editing register.php from:
PHP:
//Register
if ($config['ServerEngine'] !== 'OTHIRE') {
$register_data = array(
'name' => $_POST['username'],
'password' => $_POST['password'],
'email' => $_POST['email'],
'created' => time(),
'ip' => getIPLong(),
'flag' => $_POST['flag']
);
} else {
$register_data = array(
'id' => $_POST['username'],
'password' => $_POST['password'],
'email' => $_POST['email'],
'created' => time(),
'ip' => getIPLong(),
'flag' => $_POST['flag']
);
}
to:
PHP:
//Register
if ($config['ServerEngine'] !== 'OTHIRE') {
$register_data = array(
'name' => $_POST['username'],
'password' => $_POST['password'],
'email' => $_POST['email'],
'created' => time(),
'ip' => getIPLong(),
'flag' => $_POST['flag'],
'premdays' => '30'
);
} else {
$register_data = array(
'id' => $_POST['username'],
'password' => $_POST['password'],
'email' => $_POST['email'],
'created' => time(),
'ip' => getIPLong(),
'flag' => $_POST['flag'],
'premdays' => '30'
);
}
adding the:
PHP:
'premdays' => '30'
Heres what my phpMyAdmin tables look:
I tried messing with this section of the code, but since im pretty bad with SQL Database commands i cant figure it out:
PHP:
// Authenticate user, fetch user id and activation key
$auid = (isset($_GET['u']) && (int)$_GET['u'] > 0) ? (int)$_GET['u'] : false;
$akey = (isset($_GET['k']) && (int)$_GET['k'] > 0) ? (int)$_GET['k'] : false;
// Find a match
$user = mysql_select_single("SELECT `id`, `active`, `active_email` FROM `znote_accounts` WHERE `account_id`='$auid' AND `activekey`='$akey' LIMIT 1;");
if ($user !== false) {
$user = (int) $user['id'];
$active = (int) $user['active'];
$active_email = (int) $user['active_email'];
// Enable the account to login
if ($active == 0 || $active_email == 0) {
mysql_update("UPDATE `znote_accounts` SET `active`='1', `active_email`='1' WHERE `id`= $user LIMIT 1;");
}
echo '<h1>Congratulations!</h1> <p>Your account has been created. You may now login to create a character.</p>';
} else {
echo '<h1>Authentication failed</h1> <p>Either the activation link is wrong, or your account is already activated.</p>';
}
} else {
if (empty($_POST) === false && empty($errors) === true) {
if ($config['log_ip']) {
znote_visitor_insert_detailed_data(1);
}
//Register
I tried adding a :
PHP:
mysql_update("UPDATE `accounts` SET `premdays`='30' WHERE `id`= $user LIMIT 1;");
and placed it here:
PHP:
// Authenticate user, fetch user id and activation key
$auid = (isset($_GET['u']) && (int)$_GET['u'] > 0) ? (int)$_GET['u'] : false;
$akey = (isset($_GET['k']) && (int)$_GET['k'] > 0) ? (int)$_GET['k'] : false;
// Find a match
$user = mysql_select_single("SELECT `id`, `active`, `active_email` FROM `znote_accounts` WHERE `account_id`='$auid' AND `activekey`='$akey' LIMIT 1;");
if ($user !== false) {
$user = (int) $user['id'];
$active = (int) $user['active'];
$active_email = (int) $user['active_email'];
// Enable the account to login
if ($active == 0 || $active_email == 0) {
mysql_update("UPDATE `znote_accounts` SET `active`='1', `active_email`='1' WHERE `id`= $user LIMIT 1;");
mysql_update("UPDATE `accounts` SET `premdays`='30' WHERE `id`= $user LIMIT 1;");
}
echo '<h1>Congratulations!</h1> <p>Your account has been created. You may now login to create a character.</p>';
} else {
echo '<h1>Authentication failed</h1> <p>Either the activation link is wrong, or your account is already activated.</p>';
}
} else {
if (empty($_POST) === false && empty($errors) === true) {
if ($config['log_ip']) {
znote_visitor_insert_detailed_data(1);
}
//Register
But it just bugs out and the page does not even load.
Last edited: