Author Topic: How to limit bank usage?  (Read 7564 times)

Offline tazpot

How to limit bank usage?
« on: May 17, 2006, 11:55:57 pm »
Is there a way that i can limit the number of times a member can use the bank in a day or maybe make it so that they need a minimum amount of credits before they can add it to the bank?   i.e  minimum deposit amount set to 200 credits  :D


Offline Basil Beard

Re: How to limit bank usage?
« Reply #1 on: May 18, 2006, 03:51:29 am »
Yes. Wouldn't be too hard. You would simply have to edit the bank code. Find this part

Code: [Select]
            //if user is trying to deposit more money than they have
            if ($_POST['amount'] > $row['money']) {
                $context['shop_buy_message'] = $txt['shop_dont_have_much'];
            //if trying to deposit less than 0
            } elseif ($_POST['amount'] <= 0) {
                $context['shop_buy_message'] = $txt['shop_no_negative'];
}

Add
Code: [Select]
elseif ($_POST['amount'] <= 200) {
                $context['shop_buy_message'] = "You must desposit at least 200 credits";
}

And yay! Actually, it would be best to edit the shop.english.php file or whatever its called with a
Code: [Select]
$txt['shop_less_200'] = "You must desposit at least 200 credits";
line and change it to
Code: [Select]
elseif ($_POST['amount'] <= 200) {
                $context['shop_buy_message'] = $txt['shop_less_200'];
}
Arrrrr!

Offline tazpot

Re: How to limit bank usage?
« Reply #2 on: May 20, 2006, 08:24:26 am »
Cheers Basil i think that will do perfect, i will give it a go asap  O0

Offline Daniel15

Re: How to limit bank usage?
« Reply #3 on: May 20, 2006, 09:21:47 am »
Hmmm, maybe something I could add to the next SMFShop version?

* daniel15 adds this idea to the 'TODO' list :)

Offline lelele

Re: How to limit bank usage?
« Reply #4 on: May 20, 2006, 01:11:51 pm »
That is great!!! I was just thinking it would be great to be able to do that. Thanks Basil!!!

Offline daniel16

Re: How to limit bank usage?
« Reply #5 on: May 21, 2006, 02:05:29 pm »
Hmmm, maybe something I could add to the next SMFShop version?

* daniel15 adds this idea to the 'TODO' list :)

You have to do the thing i forget first.
Hello users welcome to hell

Offline tazpot

Re: How to limit bank usage?
« Reply #6 on: May 22, 2006, 03:55:30 am »
 O0 Excellent work Basil, it works like a dream O0

Offline lelele

Re: How to limit bank usage?
« Reply #7 on: May 22, 2006, 11:56:28 am »
Yes, its working great here too!


Offline tazpot

Re: How to limit bank usage?
« Reply #8 on: May 25, 2006, 05:37:56 pm »
Basil how would i reduce the amount  to say 100.
I have tried by changing
Code: [Select]
elseif ($_POST['amount'] <= 200) {
to
Code: [Select]
elseif ($_POST['amount'] <= 100) {and changing the corresponding english.txt  and 'shop_less_200' to 'shop_less_100' 
when i try to deposit 100 it say's i need more?

Offline Basil Beard

Re: How to limit bank usage?
« Reply #9 on: May 25, 2006, 10:02:38 pm »
Nope. That should be fine. You don't even need to change shop_less_200. Thats just a string variable. Calling it shop_less_200 just helps someone else better understand the code.
Arrrrr!

Offline tazpot

Re: How to limit bank usage?
« Reply #10 on: May 27, 2006, 08:23:19 pm »
I will try again and see what happens.

i changed the shop_less_200 just to make things more obvious in the future  :)

Offline Daniel15

Re: How to limit bank usage?
« Reply #11 on: May 27, 2006, 10:39:09 pm »
Maybe, instead of shop_less_200, call it something like shop_deposit_too_small? It would be a lot easier to remember :P