DalaiLamaBob
09-25-2002, 03:25 AM
I am trying to help create a hack for www.aForums.com
I don't own the site so I can't post to the other forums here. I am just trying to help with the coding.
The point of the hack of the hack is to make it so people don't horde money in the bank. So my idea was to make it so that anything over 5000 is put back into their pocket. After looking at the code I figured the best place to add the change was after the interest was calculated so any interest would be overflowed too.
The problem is my changes don't seem to do anything. Nothing good or bad. At least nothing I have been able to see.
Original Code
//########################## functions ##################
function showbankmoney() {
global $DB_site,$bbuserinfo;
$savemoneytime= $DB_site->query_first("
SELECT savemt FROM user WHERE userid='$bbuserinfo[userid]'");
$banktime = $savemoneytime[savemt];
if ($banktime != 0){
$presenttime=(time()-$banktime)/86400;
if ($presenttime>1)
{
$presenttime=floor($presenttime);
$userbank = $DB_site->query_first("
SELECT bank FROM user WHERE userid='$bbuserinfo[userid]'");
$userbankmoney= $userbank[bank];
$userbankmoney=floor($userbankmoney*(pow(1.1,$pres enttime)));
$DB_site->query("UPDATE user SET
bank=$userbankmoney,savemt='".time()."' WHERE userid='$bbuserinfo[userid]'");
}
}
}
Modified Code
//########################## functions ##################
function showbankmoney() {
global $DB_site,$bbuserinfo;
$savemoneytime= $DB_site->query_first("
SELECT savemt FROM user WHERE userid='$bbuserinfo[userid]'");
$banktime = $savemoneytime[savemt];
if ($banktime != 0){
$presenttime=(time()-$banktime)/86400;
if ($presenttime>1)
{
$presenttime=floor($presenttime);
$userbank = $DB_site->query_first("
SELECT bank,storep FROM user WHERE userid='$bbuserinfo[userid]'");
$userbankmoney= $userbank[bank];
$usermoney= $userbank[storep];
$userbankmoney=floor($userbankmoney*(pow(1.1,$pres enttime)));
if ($userbankmoney>5000)
{
$usermoney= $usermoney+$userbankmoney-5000;
$userbankmoney= 5000;
}
$DB_site->query("UPDATE user SET
storep=$usermoney,bank=$userbankmoney,savemt='".time()."' WHERE userid='$bbuserinfo[userid]'");
}
}
}
I don't own the site so I can't post to the other forums here. I am just trying to help with the coding.
The point of the hack of the hack is to make it so people don't horde money in the bank. So my idea was to make it so that anything over 5000 is put back into their pocket. After looking at the code I figured the best place to add the change was after the interest was calculated so any interest would be overflowed too.
The problem is my changes don't seem to do anything. Nothing good or bad. At least nothing I have been able to see.
Original Code
//########################## functions ##################
function showbankmoney() {
global $DB_site,$bbuserinfo;
$savemoneytime= $DB_site->query_first("
SELECT savemt FROM user WHERE userid='$bbuserinfo[userid]'");
$banktime = $savemoneytime[savemt];
if ($banktime != 0){
$presenttime=(time()-$banktime)/86400;
if ($presenttime>1)
{
$presenttime=floor($presenttime);
$userbank = $DB_site->query_first("
SELECT bank FROM user WHERE userid='$bbuserinfo[userid]'");
$userbankmoney= $userbank[bank];
$userbankmoney=floor($userbankmoney*(pow(1.1,$pres enttime)));
$DB_site->query("UPDATE user SET
bank=$userbankmoney,savemt='".time()."' WHERE userid='$bbuserinfo[userid]'");
}
}
}
Modified Code
//########################## functions ##################
function showbankmoney() {
global $DB_site,$bbuserinfo;
$savemoneytime= $DB_site->query_first("
SELECT savemt FROM user WHERE userid='$bbuserinfo[userid]'");
$banktime = $savemoneytime[savemt];
if ($banktime != 0){
$presenttime=(time()-$banktime)/86400;
if ($presenttime>1)
{
$presenttime=floor($presenttime);
$userbank = $DB_site->query_first("
SELECT bank,storep FROM user WHERE userid='$bbuserinfo[userid]'");
$userbankmoney= $userbank[bank];
$usermoney= $userbank[storep];
$userbankmoney=floor($userbankmoney*(pow(1.1,$pres enttime)));
if ($userbankmoney>5000)
{
$usermoney= $usermoney+$userbankmoney-5000;
$userbankmoney= 5000;
}
$DB_site->query("UPDATE user SET
storep=$usermoney,bank=$userbankmoney,savemt='".time()."' WHERE userid='$bbuserinfo[userid]'");
}
}
}