Author Topic: Personal Interest Rates Item Available.  (Read 13405 times)

Offline JRSofty

Personal Interest Rates Item Available.
« on: March 27, 2007, 10:19:20 pm »
How would you like to give your users a chance to better their interest rates?

Now you can with the Personal Interest Rate project for SMFShop found here: http://intresthike.dev.dansoftaustralia.net/

Version 1.1 only adds the capability of personal interest rates and one item for buying increases.

Version 1.2 RC1 is currently out that gives two items. The original for buying an increase and the second one allows you to gamble for a better increase (administrator can set the values of both items). As well as allowing you to see your own personal interest rate bonus that it added on top of the bank interest.

I'm currently looking for people who are interested in testing the RC1 and giving me some feed back.

Enjoy

Offline feeble

Re: Personal Interest Rates Item Available.
« Reply #1 on: March 28, 2007, 07:46:12 pm »
nice mod

Offline Daniel15

Re: Personal Interest Rates Item Available.
« Reply #2 on: March 30, 2007, 07:14:25 pm »
Nice work JRSofty :)
I've yet to try this item, but it sounds excellent. Keep up the good work! :D

Offline JRSofty

Re: Personal Interest Rates Item Available.
« Reply #3 on: March 30, 2007, 07:19:52 pm »
If anyone wants a demo of it in action they can check it out at my homepage

Offline Aes-Sedai

Re: Personal Interest Rates Item Available.
« Reply #4 on: April 28, 2007, 06:19:23 pm »
Er.. how do you, once you have used the item, unuse it if you know what  I mean? Make your interest rate back to 0 again?

Offline JRSofty

Re: Personal Interest Rates Item Available.
« Reply #5 on: April 28, 2007, 06:27:30 pm »
Hmm

Hadn't thought of that.

The idea is that your members can build up a higher interest rate, I had not intended any way for a way to lower it.

If you really really want to lower it and you have access to the database you can change the column in the smf_members table, other than that it is impossible.

I will take it as an idea for an enhancement on the next version.

Offline Aes-Sedai

Re: Personal Interest Rates Item Available.
« Reply #6 on: April 28, 2007, 06:48:51 pm »
Oh, okay, that's all right. It's just that I'm having a competition and after it ends I wanted the rates to go back to 0 to resume normal buying and selling.

Offline Aes-Sedai

Re: Personal Interest Rates Item Available.
« Reply #7 on: May 02, 2007, 02:47:14 pm »
Is there any troubleshooting pages? I added the Mod, checked the code and it seems all fine - but the interest is never added every day.

Actually, the bank isn't adding interest either (this is after a few days) despite the Cron Job I set.
« Last Edit: May 02, 2007, 02:49:23 pm by Aes-Sedai »

Offline JRSofty

Re: Personal Interest Rates Item Available.
« Reply #8 on: May 16, 2007, 09:07:12 pm »
I'm still working on the troubleshooting pages and I'm just back from vacation so it may be some time before they are ready.

If the CronJob is not working and interest isn't being calculated then the Mod won't work either.

Offline Aes-Sedai

Re: Personal Interest Rates Item Available.
« Reply #9 on: May 17, 2007, 03:50:26 pm »
Indeed, it isn't.

Offline sc2

Re: Personal Interest Rates Item Available.
« Reply #10 on: July 19, 2007, 12:52:28 pm »
Hi JRSofty, this mod is a great idea, but I am having a problem I just can't seem to figure out what is wrong. I set it up and it all seems to be working fine. I gave myself the item to increase my personal interest rate to 1.5% and everyone else is on 0. Used the item, it updates my profile and also the shop pages with my new personal interest rate. I check the database and I see in the bankInterest column, I have 1.5 in my row and everyone else is on 0.

All good I thought. Until the cron job runs and EVERYBODY gets 1.5% interest, even though I should be the only one getting it and everyone else should stay the same. I checked that the dointerest.php is modified correctly and it is. I don't know what is wrong. Any help would be appreciated as I spent forever trying to work this one out!

Thank you for your time and any help you, or anyone else for that matter, can give me  :)

Oh, some extra details. I have the bank interest at 0% (with the bank enabled). When I put it on 0.2% before, and the cron job ran, everybody got an insane amount of credits... All was running well before the mod was installed. I figured I would rather have this mod and leave the bank interest at 0% because I don't mind not having it if I can get the personal interest rate working... thanks again for reading!
« Last Edit: July 19, 2007, 12:54:51 pm by sc2 »

Offline JRSofty

Re: Personal Interest Rates Item Available.
« Reply #11 on: July 19, 2007, 01:28:56 pm »
Hi Sc2 I'm on it. I'll have an answer for you within a day or so (hopefully).

[EDIT]

Good catch and I'm surprised I didn't catch this bug before.

Find
Code: [Select]
db_query("UPDATE {$db_prefix}members
  SET moneyBank = moneyBank + (moneyBank*{$interest_rate})", __FILE__, __LINE__);

Replace with:
Code: [Select]
db_query("UPDATE {$db_prefix}members
  SET moneyBank = moneyBank + (moneyBank*{$interest_rate}) WHERE ID_MEMBER = {$row['ID_MEMBER']}", __FILE__, __LINE__);

I forgot to put in the WHERE statement. so basically for each user people got extra interest. ;)

I'll be issuing a new version in the near future.
« Last Edit: July 19, 2007, 01:34:57 pm by JRSofty »

Offline sc2

Re: Personal Interest Rates Item Available.
« Reply #12 on: July 19, 2007, 01:30:59 pm »
Wow, thanks for the quick reply!! Looking forward to an answer =) Many thanks !!!!!

Offline JRSofty

Re: Personal Interest Rates Item Available.
« Reply #13 on: July 19, 2007, 01:35:31 pm »
Sorry Edited my original post.

Look above for the fix.

Offline JRSofty

Re: Personal Interest Rates Item Available.
« Reply #14 on: July 19, 2007, 01:37:39 pm »
Forgot to mention that is suppose to be in the DoInterest.php file.