Go Back   vb.org Archive > News and Announcements > vBulletin Pre-Sales Questions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-25-2002, 03:25 AM
DalaiLamaBob DalaiLamaBob is offline
 
Join Date: Sep 2002
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help! Bank Hack Overflow Hack

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
Quote:
//########################## 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
Quote:
//########################## 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='".ti me()."' WHERE userid='$bbuserinfo[userid]'");
}

}
}
Reply With Quote
  #2  
Old 09-25-2002, 04:41 AM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

DalaiLamaBob, please have the licensed owner of that forum go to this page and enter your username, to show you are working on a licensed forum. Thank you.
Reply With Quote
  #3  
Old 09-25-2002, 09:07 AM
Cold Steel's Avatar
Cold Steel Cold Steel is offline
 
Join Date: Nov 2001
Location: Manhattan
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Steve Machol
DalaiLamaBob, please have the licensed owner of that forum go to this page and enter your username, to show you are working on a licensed forum. Thank you.
Done.
Reply With Quote
  #4  
Old 09-25-2002, 08:45 PM
Steve Machol's Avatar
Steve Machol Steve Machol is offline
 
Join Date: Nov 2001
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks!
Reply With Quote
  #5  
Old 09-26-2002, 05:42 AM
DalaiLamaBob DalaiLamaBob is offline
 
Join Date: Sep 2002
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess it just took a couple days to kick in. It works....
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:38 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04029 seconds
  • Memory Usage 2,200KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete