Our Sponsors



PHP Nuke themes, stock photos, icons, drupal themes and more.
Custom jobs at low cost, free lancers and service buyers.



Western Studios :: View topic - Need help with bank mod...
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups     ProfileProfile   Log inLog in 


Need help with bank mod...



 
Post new topic   Reply to topicprinter friendly version    Western Studios Forum Index -> Hack and Mods
Western Studios

WS Newbie
WS Newbie
~PHP Nuke User~


Posts: 5
Next Group: 45 posts
Skeletron wrote:

Hi, I recently installed the bank mod on my site which is running phpnuke 8.1, I noticed after I had installed the mod that it said up to 7.5 but it was showing up on my site but not in the admin panel. I went through the files and reuploaded it then I noticed that it was down in the "users admin" so I guess it was there all along, then I configured it and went to the bank on my forums and it worked and said createa bank account, so I did, then I wanted to test it so I typed in an amount and click deposit and then it came up with a message saying "You do not have that much to deposite!" so I went through the bank.php over and over again and never found anything wrong and tryed different things and I can't for the life of me figure out whats wrong. I will add the depostie section of the code below so that maybe you can tell me whats wrong.

Thanks, Tyler


Code:
//start of deposit page
elseif ($_REQUEST['action'] == "deposit")
{
   $template->set_filenames(array( 'body' => 'bank_body.tpl'));
   if ( !$userdata['session_logged_in'] )
   {
      $redirect = "bank.$phpEx&action=deposit&deposit=$deposit";
      $redirect .= ( isset($user_id) ) ? '&user_id=' . $user_id : '';
      header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true));
   }
   $deposit = round($_REQUEST['deposit']);
   if ((!is_numeric($deposit)) || ($deposit > 1)) { message_die(GENERAL_MESSAGE, $lang['error_deposit']); }
   if ($deposit > $userdata['user_points']) { message_die(GENERAL_MESSAGE, $lang['error_not_enough_deposit'].'!'); }
   $newbalance = $row['holding'] + $deposit;
   $newtotaldep = $row['totaldeposit'] + $deposit;
   $newpoints = $userdata['user_points'] - $deposit;
   $sql = "update " . USERS_TABLE . " set user_points='$newpoints' where user_id='{$userdata['user_id']}'";
   if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Updating User Points!<br>'.mysql_error()); }
   $sql = "update phpbb_bank set holding='$newbalance', totaldeposit='$newtotaldep' where name='{$userdata['user_id']}'";
   if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Updating User Points!<br>'.mysql_error()); }
   $newtotaldeps = $board_config['banktotaldeposits'] + $deposit;
   $sql = "update " . CONFIG_TABLE . " set config_value='$newtotaldeps' where config_name='banktotaldeposits'";
   if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Updating Total Deposits!<br>'.mysql_error()); }

   $bankcommands = '<tr><td class="row2"><span class="gensmall">'.$lang['have_deposit'].' '.$deposit.' '.$board_config['points_name'].' '.$lang['to_account'].'<br>'.$lang['new_balance'].' '.$newbalance.'.<br>'.$lang['leave_with'].' '.$newpoints.' '.$board_config['points_name'].' '.$lang['on_hand'].'.</span></td></tr>';
   $banklocation = ' -> <a href="'.append_sid("bank.".$phpEx).'" class="nav">'.$board_config['bankname'].'</a> -> <a href="'.append_sid("bank.$phpEx?action=deposit&deposit=$deposit").'" class="nav">'.$lang['deposit'].' '.$board_config['points_name'].'</a>';


Posted: Tue Oct 09, 2007 12:58 am

Western Studios

Site Admin
Site Admin
~PHP Nuke User~

Platinum Subscriber

Posts: 3333
Staff
Next Group: 1667 posts
admin(Mark) wrote:

That error seems to be generated from the following line:
Code:
if ($deposit > $userdata['user_points']) { message_die(GENERAL_MESSAGE, $lang['error_not_enough_deposit'].'!'); }


Do you have enough points? or does your nuke_users table have a user_points column?

Posted: Tue Oct 09, 2007 1:04 am

Western Studios

WS Newbie
WS Newbie
~PHP Nuke User~


Posts: 5
Next Group: 45 posts
Skeletron wrote:

I have plenty of points so I don't think it would be that and also I was just typing in like 1 and 10 points to deposite. With the nuke_users take I do have the points colum so I yea. This is realy weird how it does this. Just once I tryed this just to see if it changed anything but I swiched the ">" to a "-" and it made it say "Invalid number or invalid charechter"

Posted: Tue Oct 09, 2007 1:14 am

Western Studios

Site Admin
Site Admin
~PHP Nuke User~

Platinum Subscriber

Posts: 3333
Staff
Next Group: 1667 posts
admin(Mark) wrote:

Lets do a test to see if the script is getting the user_points. On a new line above the codes I pointed to in my previous post, add the following then save and retry. It should echo your points.

Code:
echo $userdata['user_points']


Let me know if your points are displayed above the error.

Posted: Tue Oct 09, 2007 1:31 am

Post new topic   Reply to topic    Western Studios Forum Index -> PHP Nuke -> Hack and Mods All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts What is this site missing? 5 admin 1717 Sat Aug 30, 2008 2:31 am
strik9 View latest post
No new posts Site Search 0 admin 1233 Thu Aug 05, 2004 2:21 am
admin View latest post
No new posts New site design 4 admin 1373 Tue Apr 13, 2004 10:18 am
admin View latest post
This topic is locked: you cannot edit posts or make replies. Site logo 3 Greener 1732 Wed Feb 25, 2004 11:48 am
admin View latest post
 
Forums ©