[教學] Bank Mod 不能存小數解決方法 v1.0.1

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
kp3011
竹貓忠實會員
竹貓忠實會員
文章: 384
註冊時間: 2004-05-15 21:16
來自: HKG

[教學] Bank Mod 不能存小數解決方法 v1.0.1

文章 kp3011 »

#################################################################
## MOD Title: Solution to deposit decimals in Bank Mod
## MOD Author: Jisp Cheung <cheungpuipan@netvigator.com>
## MOD Description: With this MOD a user is able to deposit / withdraw decimals into the bank, which cannot be done before.
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 3 Minutes
## MOD required before installing: Bank Mod
## Files To Edit: bank.php
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
##############################################################
## MOD History:
##
## YYYY-MM-DD - Version x.x.x
## - version notes go here
##
## ------------
## 26 Sept 2004 - Modified
## 24 Sept 2004 - The publication of the MOD
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
# OPEN bank.php

# FIND
$holding = round($holding);
# REPLACE WITH
$holding = round($holding,2); * NOTE1

# FIND
$deposit = round($_REQUEST['deposit']);
# REPLACE WITH
$deposit = round($_REQUEST['deposit'],2); *NOTE1

# FIND
$withdraw = round($_REQUEST['withdraw']);
# REPLACE WITH
$withdraw = round($_REQUEST['withdraw'],2); *NOTE1

# FIND
if ((!is_numeric($deposit)) || ($deposit < 1))
# REPLACE WITH
if ((!is_numeric($deposit)) || ($deposit < 0)) *NOTE2

# FIND
if ((!is_numeric($withdraw)) || ($withdraw < 1))
# REPLACE WITH
if ((!is_numeric($withdraw)) || ($withdraw < 0)) *NOTE2

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

*NOTE1: Replace the 2 to 1 if your currency has 1 decimal place and 3 if 3 decimals places and so on.
(如果您的貨幣有1個小數位, 請將 2 換成 1, 3個小數位則換成3, 如此類推)
*NOTE2: Replace the 0 in the last two steps to 0.1 if your currency has one decimal place or 0.01 if two and so on.
It has been tested in my site and it was all right.
(最後兩步中, 如果您的貨幣有一個小數位請以 0.1 取代 0 , 兩個則以 0.01 取代, 如此類推)

當然, 請謹記於bank資料表中更改接受的數字格式
主題已鎖定

回到「非官方認證外掛」