## EasyMod 0.3.0 Compatible
##############################################################
## MOD Title: Bank Mod
## MOD Author: Zarath < null@null.com > ( Jamie ) http://www.zarath.com
## MOD Description: A bank system for your forums.
## MOD Version: 2.0.0
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
## Files To Edit:	viewtopic.php
## 			includes/constants.php
##			includes/page_header.php
##			includes/usercp_viewprofile.php
##			templates/*/overall_header.tpl
##			templates/*/profile_view_body.tpl
##			templates/*/viewtopic_body.tpl
## Included Files:	bank.php
## 			admin/admin_bank.php
## 			language/lang_english/lang_bank.php
## 			templates/bank_body.tpl
## 			templates/admin/bank_config_body.tpl
## 			templates/admin/bank_edit_user.tpl
## 			images/icon_bank.gif
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.zarath.com
## for the latest version of this MOD.
##############################################################
## Author Notes: Please note, I will not give any kind of email 
##               or PM support. Post in the relevant threads on
##               http://forums.zarath.com
##
##############################################################
## MOD History:
##
##   2006-01-06 - Version 2.0.0
##      - Rewrite
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

 
#-----[ COPY ]------------------------------------------ 
#
copy bank.php to bank.php
copy admin/admin_bank.php to admin/admin_bank.php
copy language/lang_english/lang_bank.php to language/lang_english/lang_bank.php
copy templates/bank_body.tpl to templates/subSilver/bank_body.tpl
copy templates/admin/bank_config_body.tpl to templates/subSilver/admin/bank_config_body.tpl
copy templates/admin/bank_edit_user.tpl to templates/subSilver/admin/bank_edit_user.tpl
copy images/icon_bank.gif to templates/subSilver/images/icon_bank.gif

#
#-----[ SQL ]------------------------------------------
#
# You can either alter the table prefix and run this through phpMyAdmin or
# upload the sql_update.php file to your forum index and run it from an
# admin account. No need to do both... SQL install file is made for MySQL.
#
ALTER TABLE `phpbb_bank` CHANGE `name` `user_id` INT ( 10 ) NOT NULL;

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
define('BANK_TABLE', $table_prefix.'bank');

#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php

#
#-----[ FIND ]------------------------------------------
#
	'L_BANK' => 'Bank',

#
#-----[ REPLACE WITH ]------------------------------------------
#
	'L_BANK' => $lang['bank'],

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars(array(
	'USERNAME' => $profiledata['username'],

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Bank Code
if ( empty($holding[$poster_id]) )
{
	$sql = "SELECT holding
		FROM " . BANK_TABLE . "
		WHERE user_id = '{$profiledata['user_id']}'";
	$result = $db->sql_query($sql);
	$bank_row = $db->sql_fetchrow($result);

	$bank_row['holding'] = ( empty($bank_row['holding']) ) ? '0' : $bank_row['holding'];
}

#
#-----[ FIND ]------------------------------------------
#
	'YIM' => $yim,

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'BANK_GOLD' => $bank_row['holding'],
	'L_POINTS_NAME' => $board_config['points_name'],

#
#-----[ FIND ]------------------------------------------
#
	'L_INTERESTS' => $lang['Interests'],

#
#-----[ AFTER, ADD ]------------------------------------------
#
	'L_BANK' => $lang['bank'],

# 
#-----[ OPEN ]------------------------------------------ 
#
 language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
#
?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
$lang['bank'] = 'Bank';

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
	$template->assign_block_vars('postrow', array(

#
#-----[ BEFORE, ADD ]------------------------------------------
#
	// Bank Code
	$holding = ( empty($holding) ) ? array() : $holding;
	if ( empty($holding[$poster_id]) )
	{
		$sql = "SELECT holding
			FROM " . BANK_TABLE . "
			WHERE user_id = '$poster_id'";
		$result = $db->sql_query($sql);
		$bank_row = $db->sql_fetchrow($result);

		$holding[$poster_id] = ( $bank_row['holding'] ) ? $bank_row['holding'] : '0';
		$bank_row = '';
	}
#
#-----[ FIND ]------------------------------------------
#
		'EDITED_MESSAGE' => $l_edited_by,

#
#-----[ AFTER, ADD ]------------------------------------------
#
		'L_BANK' => $lang['bank'],
		'BANK_GOLD' => $holding[$poster_id],
		'L_POINTS_NAME' => $board_config['points_name'],
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------
#
<a href="{U_BANK}" class="mainmenu">{BANK}</a>
#
#-----[ REPLACE WITH ]------------------------------------------
#
&nbsp; &nbsp;<a href="{U_BANK}" class="mainmenu"><img src="templates/subSilver/images/icon_bank.gif" width="12" height="13" border="0" alt="{L_BANK}" hspace="3" />{L_BANK}</a>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl

#
#-----[ FIND ]------------------------------------------
#
		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
		  <td> <b><span class="gen">{INTERESTS}</span></b></td>
		</tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#
		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_BANK}:</span></td>
		  <td> <span class="gen">{BANK_GOLD} {L_POINTS_NAME}</span></td>
		</tr>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#
{postrow.POSTER_FROM}

#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.POSTER_FROM}

#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<br />{postrow.L_BANK}: {postrow.BANK_GOLD} {postrow.L_POINTS_NAME}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM