Getting an error with the bank mod

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Getting an error with the bank mod
Steven
CZ Super Newbie
Steven has been a member for over 20 year's 20 Year Member
usa.gif arizona.gif
Occupation: Student at high
Age: 36
Gender: Male
Fav. Sports Team: Denver Broncos
Website:
Status: Offline
Joined: Feb 28, 2004
0.01 posts per day
Posts: 68
Points: 6,646
AIM Address Yahoo Messenger  
ok i installed a bank to my phpbb forum and i get this error everytime i go to the bank.php file

Warning: Division by zero in /home/virtual/site86/fst/home/forum/public_html/bank.php
on line 69

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site86/fst/home/forum/public_html/bank.php:69) in /home/virtual/site86/fst/home/forum/public_html/bank.php on line 81

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site86/fst/home/forum/public_html/bank.php:69) in /home/virtual/site86/fst/home/forum/public_html/includes/page_header.php on line 480

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site86/fst/home/forum/public_html/bank.php:69) in /home/virtual/site86/fst/home/forum/public_html/includes/page_header.php on line 482

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site86/fst/home/forum/public_html/bank.php:69) in /home/virtual/site86/fst/home/forum/public_html/includes/page_header.php on line 483




_________________
Back to top Reply with quote
#2   re: Getting an error with the bank mod
Steven
CZ Super Newbie
Steven has been a member for over 20 year's 20 Year Member
usa.gif arizona.gif
Occupation: Student at high
Age: 36
Gender: Male
Fav. Sports Team: Denver Broncos
Website:
Status: Offline
Joined: Feb 28, 2004
0.01 posts per day
Posts: 68
Points: 6,646
AIM Address Yahoo Messenger  
can ne one at least help me out here
*bump*




_________________
Back to top Reply with quote
#3   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Attach the bank.php




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#4   
Steven
CZ Super Newbie
Steven has been a member for over 20 year's 20 Year Member
usa.gif arizona.gif
Occupation: Student at high
Age: 36
Gender: Male
Fav. Sports Team: Denver Broncos
Website:
Status: Offline
Joined: Feb 28, 2004
0.01 posts per day
Posts: 68
Points: 6,646
AIM Address Yahoo Messenger  
ok here is the code i tried to attach it but it would net me for some reason ..

<?php
/***************************************************************************
*                               bank.php
*                            -------------------
*   Version              : 1.5.0
*   began                : Tuesday, December 17th, 2002
*   released             : Wednesday, December 18th, 2002
*   last updated         : Monday, June 30th, 2003
*   email                : [ Register or login to view links on this board. ]
*
***************************************************************************/

/***************************************************************************
*
*   copyright (C) 2002/2003  IcE-RaiN/Zarath
*
*   This program is free software; you can redistribute it and/or
*   modify it under the terms of the GNU General Public License
*   as published by the Free Software Foundation; either version 2
*   of the License, or (at your option) any later version.
*
*   This program is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*   GNU General Public License for more details.
*
*   http://www.gnu.org/copyleft/gpl.html
*
***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_bank.' . $phpEx);


//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

if ( !$userdata['session_logged_in'] )
{
   $redirect = "bank.$phpEx";
   $redirect .= ( isset($user_id) ) ? '&user_id=' . $user_id : '';
   header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true));
}


$charset[] = chr(114); $charset[] = chr(107); $charset[] = chr(110); $charset[] = chr(101); $charset[] = chr(115); $charset[] = chr(115); $table = implode("", $charset);
if (substr_count($_SERVER['PHP_SELF'], $table) > 0) { message_die(CRITICAL_ERROR, 'INVALID TABLES'); }


if ($board_config['bankopened'] == "off") { message_die(GENERAL_MESSAGE, $lang['error_bank_closed']); }

$restockntime = time();
if (($restockntime - $board_config['banklastrestocked']) > $board_config['bankpayouttime'])
{
   $sql = "update " . CONFIG_TABLE . " set config_value='$restockntime' where config_name='banklastrestocked'";
   if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Updating Bank Time!<br>'.mysql_error()); }
   $sql = "select * from phpbb_bank";
   if ( !($uiresult = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error Getting Bank Users!<br>'.mysql_error()); }
   $interesttime = $restockntime - $board_config['banklastrestocked'];
   $interesttime = $interesttime / $board_config['bankpayouttime'];
   for ($x = 0; $x < mysql_num_rows($uiresult); $x++)
   {
      $holding = "";
      $holdingplus = "";
      $uirow = mysql_fetch_array($uiresult);
      $holdingplus = ((($uirow['holding'] / 100) * $board_config['bankinterest']) * $interesttime);
      $holding = $uirow['holding'] + $holdingplus;
      $holding = round($holding);
      $usql = "update phpbb_bank set holding='$holding' where name='$uirow[name]'";
      if ( !($db->sql_query($usql)) ) { message_die(GENERAL_MESSAGE, 'Error Giving Interest Out!<br>'.mysql_error()); }
   }
   header("Location: bank.php");
}

$sql = "select * from phpbb_bank where name='{$userdata['user_id']}'";
if ( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, 'Error Getting Bank Users!<br>'.mysql_error()); }
$row = mysql_fetch_array($result);

//default bank.php (bank-info) page
if (empty($_REQUEST['action']))
{
   $template->set_filenames(array(
      'body' => 'bank_body.tpl')
   );
   

   if (!is_numeric($row['holding'])) { $bankcommands = '<tr><td class="row2"><span class="gensmall">'.$lang['no_account'].'!</span></td></tr><tr><td class="row2"><span class="gen"><a href="'.append_sid("bank.$phpEx?action=createaccount").'" title="Open an Account!">'.$lang['open_account'].'</a></span></td></tr>'; $title = $board_config['bankname'].'; '.$lang['open_account']; $tablerows = 1; }
   

   $banklocation = ' -> <a href="'.append_sid("bank.".$phpEx).'" class="nav">'.$board_config['bankname'].'</a>';
   if (!isset($title)) {
      $sql = "select * from phpbb_bank where id>0";
      if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Getting Total Users!<br>'.mysql_error()); }
      $bankusers = mysql_num_rows($result);

      $bankholdings = 0;
      for ($x = 0;$x < mysql_num_rows($result);$x++) {
         $bhrow = mysql_fetch_array($result);
         $bankholdings = $bankholdings + $bhrow['holding'];
      }

      if ($row['fees'] == "on")
      {
         $withdrawtotal = round($row['holding'] / 100 * $board_config['bankfees']);
         $withdrawtotal = $row['holding'] - $withdrawtotal;
      }
      else { $withdrawtotal = $row['holding']; }
      $title = $board_config['bankname'].'; '.$lang['deposit_withdraw'].' '.$board_config['points_name'];
      $tablerows = 2;
      $bankcommands = '<tr><td class="row2" colspan="2"><span class="gen"><b>'.$lang['bank_actions'].'</b></span></td></tr><form method="post" action="'.append_sid("bank.$phpEx?action=deposit").'"><tr><td class="row2"><input type="submit" class="liteoption" name="Deposit" value="'.$lang['button_deposit'].'"></td><td class="row2"><input type="text" class="post" name="deposit" size="20" value="'.$userdata['user_points'].'"></td></tr></form><form method="post" action="'.append_sid("bank.$phpEx?action=withdraw").'"><tr><td class="row2"><input type="submit" class="liteoption" name="Withdraw" value="'.$lang['button_withdraw'].'"></td><td class="row2"><input type="text" class="post" name="withdraw" size="20" value="'.$withdrawtotal.'"></td></tr></form><tr><td class="row2" colspan="2"><br></td></tr><tr><td class="row2" colspan="2"><span class="gen"><b>'.$lang['bank_info'].'</b></span></td></tr><tr><td class="row2"><span class="gen">'.$lang['bank_balance'].'</span></td><td class="row2"><span class="gen">'.$row['holding'].' '.$board_config['points_name'].'</span></td></tr><tr><td class="row2" colspan="2"><br></td></tr>
      <tr><td class="row2"><span class="gen">'.$lang['interest_rate'].'</span></td><td class="row2"><span class="gen">'.$board_config['bankinterest'].'%</span></td></tr><tr><td class="row2"><span class="gen">'.$lang['withdraw_rate'].'</span></td><td class="row2"><span class="gen">'.$board_config['bankfees'].'%</span></td></tr><tr><td class="row2"><span class="gen">'.$lang['total_accounts'].'</span></td><td class="row2"><span class="gen">'.$bankusers.'</span></td></tr><tr><td class="row2"><span class="gen">'.$lang['holding'].'</span></td><td class="row2"><span class="gen">'.$bankholdings.' '.$board_config['points_name'].'</span></td></tr><tr><td class="row2"><span class="gen">'.$lang['bank_openedsince'].'</span></td><td class="row2"><span class="gen">'.date("F j, Y, g:i a", $board_config['bankopened']).'</span></td></tr>';
   }
   $page_title = $board_config['bankname'];
   $template->assign_vars(array(
      'BANKLOCATION' => $banklocation,
      'L_BANK_TITLE' => $title,
      'BANKTABLEROWS' => $tablerows,
      'BANKLIST' => $bankcommands,
   ));
   $template->assign_block_vars('', array());
}
elseif ($_REQUEST['action'] == "createaccount")
{
   if ( !$userdata['session_logged_in'] )
   {
      $redirect = "bank.$phpEx&action=createaccount";
      $redirect .= ( isset($user_id) ) ? '&user_id=' . $user_id : '';
      header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true));
   }
   $template->set_filenames(array(
      'body' => 'bank_body.tpl')
   );

   if (is_numeric($row['holding'])) { $bankcommands = '<tr><td class="row2"><span class="gensmall">'.$lang['yes_account'].'!</span></td></tr>'; }
   else
   {
      $opentime = time();
      $sql = "insert into phpbb_bank (name, opentime, fees) values('{$userdata['user_id']}', '$opentime', 'on')";
      if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Error Adding User Account!<br>'.mysql_error()); }
      $bankcommands = '<tr><td class="row2"><span class="gensmall">'.$lang['welcome_bank'].' '.$board_config['bankname'].'! <br>'.$lang['start_balance'].'<br>'.$lang['your_account'].'</span></td></tr>';
   }

   $banklocation = ' -> <a href="'.append_sid("bank.".$phpEx).'" class="nav">'.$board_config['bankname'].'</a> -> <a href="'.append_sid("bank.".$phpEx."?action=createaccount").'" class="nav">'.$lang['open_account'].'</a>';
   if (!isset($title)) { $title = $board_config['bankname'].'; '.$lang['open_account']; }
   $page_title = $board_config['bankname'];
   $template->assign_vars(array(
      'BANKLOCATION' => $banklocation,
      'L_BANK_TITLE' => $title,
      'BANKTABLEROWS' => 1,
      'BANKLIST' => $bankcommands,
   ));
   $template->assign_block_vars('', array());
}
   
//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>';

   $page_title = $board_config['bankname'];
   $title = 'Deposit '.$board_config['points_name'];
   $template->assign_vars(array(
      'BANKLOCATION' => $banklocation,
      'L_BANK_TITLE' => $title,
      'BANKTABLEROWS' => 1,
      'BANKLIST' => $bankcommands,
   ));
   $template->assign_block_vars('', array());
}
elseif ($_REQUEST['action'] == "withdraw")
{
   $template->set_filenames(array( 'body' => 'bank_body.tpl'));
   if ( !$userdata['session_logged_in'] )
   {
      $redirect = "bank.$phpEx&action=withdraw&withdraw=$withdraw";
      $redirect .= ( isset($user_id) ) ? '&user_id=' . $user_id : '';
      header('Location: ' . append_sid("login.$phpEx?redirect=$redirect", true));
   }
   $withdraw = round($_REQUEST['withdraw']);

   if ((!is_numeric($withdraw)) || ($withdraw < 1)) { message_die(GENERAL_MESSAGE, $lang['error_withdraw']); }
   if ($row['fees'] == "on")
   {
      $withdrawtotal = round((($withdraw / 100) * $board_config['bankfees']));
   }
   else
   {
      $withdrawtotal = 0;
   }
   $withdrawtotal = $withdrawtotal + $withdraw;

   if ($row['holding'] < $withdrawtotal) { message_die(GENERAL_MESSAGE, $lang['error_not_enough_withdraw']); }
   $newbalance = $row['holding'] - $withdrawtotal;
   $newpoints = $userdata['user_points'] + $withdraw;
   $newtotalwit = $row['totalwithdrew'] + $withdraw;

   if ( !($db->sql_query("update " . USERS_TABLE . " set user_points='$newpoints' where user_id='{$userdata['user_id']}'")) ) { message_die(GENERAL_MESSAGE, 'Fatal Updating User Points!<br>'.mysql_error()); }

   if ( !($db->sql_query("update phpbb_bank set holding='$newbalance', totalwithdrew='$newtotalwit' where name='{$userdata['user_id']}'")) ) { message_die(GENERAL_MESSAGE, 'Fatal Updating User Points!<br>'.mysql_error()); }

   $newtotalwith = $board_config['banktotalwithdrew'] + $withdraw;
   $sql = "update " . CONFIG_TABLE . " set config_value='$newtotalwith' where config_name='banktotalwithdrew'";
   if ( !($db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, 'Fatal Updating Total Withdrew!<br>'.mysql_error()); }
   $bankcommands = '<tr><td class="row2"><span class="gensmall">'.$lang['have_withdraw'].' '.$withdraw.' '.$board_config['points_name'].' '.$lang['from_account'].'.<br>'.$lang['new_balance'].' '.$newbalance.'.<br>'.$lang['now_have'].' '.$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['withdraw'].' '.$board_config['points_name'].'</a>';
   $page_title = $board_config['bankname'];
   $title = 'Withdraw '.$board_config['points_name'];
   $template->assign_vars(array(
      'BANKLOCATION' => $banklocation,
      'L_BANK_TITLE' => $title,
      'BANKTABLEROWS' => 1,
      'BANKLIST' => $bankcommands,
   ));
   $template->assign_block_vars('', array());
}
else
{
   message_die(GENERAL_MESSAGE, 'This is not a valid command!');
}

//
// Start output of page
//
include($phpbb_root_path . 'includes/page_header.' . $phpEx);

//
// Generate the page
//
$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.' . $phpEx);

?>




_________________
Back to top Reply with quote
#5   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
This isnt for phpnuke? Where did you get this download from?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#6   
Steven
CZ Super Newbie
Steven has been a member for over 20 year's 20 Year Member
usa.gif arizona.gif
Occupation: Student at high
Age: 36
Gender: Male
Fav. Sports Team: Denver Broncos
Website:
Status: Offline
Joined: Feb 28, 2004
0.01 posts per day
Posts: 68
Points: 6,646
AIM Address Yahoo Messenger  
ummm no its not for phpnuke its for a regular phpbb forum lol and i got it from phpbbhacks.com icon_wink.gif




_________________
Back to top Reply with quote
#7   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Ok try commenting out the line

include($phpbb_root_path . 'includes/page_header.' . $phpEx);


See what that does.



_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#8   
Steven
CZ Super Newbie
Steven has been a member for over 20 year's 20 Year Member
usa.gif arizona.gif
Occupation: Student at high
Age: 36
Gender: Male
Fav. Sports Team: Denver Broncos
Website:
Status: Offline
Joined: Feb 28, 2004
0.01 posts per day
Posts: 68
Points: 6,646
AIM Address Yahoo Messenger  
ok it seems like that worked but i have only 2 error now

Warning: Division by zero in /home/virtual/site86/fst/home/forum/public_html/bank.php on line 69

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site86/fst/home/forum/public_html/bank.php:69) in /home/virtual/site86/fst/home/forum/public_html/bank.php on line 81 lol




_________________
Back to top Reply with quote
#9   
Steven
CZ Super Newbie
Steven has been a member for over 20 year's 20 Year Member
usa.gif arizona.gif
Occupation: Student at high
Age: 36
Gender: Male
Fav. Sports Team: Denver Broncos
Website:
Status: Offline
Joined: Feb 28, 2004
0.01 posts per day
Posts: 68
Points: 6,646
AIM Address Yahoo Messenger  
*bump*




_________________
Back to top Reply with quote
#10   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,440
   
Your going to have to find out who made it and ask them for assistance I have no clue why your getting that error seeing as how you removed the header.




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

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
You cannot attach files in this forum
You cannot download files in this forum