SMFShop > Coding

Bonus points for Topic Starter

(1/2) > >>

Kalimas:
Hey everyone.

Just installed the shop mod, and everything works great, but I have a feature request. I don't believe it would be too difficult, but I know almost nothing about PHP.

I was wondering if there is any way I can have it so a topic starter gets x amounts of points for each reply in his topic. The value can be static, we'll use 3 points for the example.

So, essentially, "Bob" would get 10 points when he post a new topic, and he would also get an extra 3 points every time someone replies to that topic.

Like I said, I don't know anything of PHP, but from my research, it looks like I'd need to change something here:


--- Code: ---                    //For a new topic, you get...
                    if ($newTopic)
                        $result_shop = db_query("UPDATE {$db_prefix}members
                                                 SET money = money + {$modSettings['shopPointsPerTopic']}
                                                 WHERE ID_MEMBER = {$ID_MEMBER}
                                                 LIMIT 1", __FILE__, __LINE__);
                    else
                        $result_shop = db_query("UPDATE {$db_prefix}members
                                                 SET money = money + {$modSettings['shopPointsPerPost']}
                                                 WHERE ID_MEMBER = {$ID_MEMBER}
                                                 LIMIT 1", __FILE__, __LINE__);
                }
                //End Shop MOD
--- End code ---

Maybe something after the else?

Any help would be greatly appreciated

matkins70:
Yeah, I like that idea.  Though I was doing some financial forecasting for my shop today. At the moment, i have around $60,000 credits in my shop, and with an interest rate of 2% a day, i'm gonna have $110,000 in a months time, and then more worryingly, in 6 months, im gonna have around 2.1 Million.  This is at current cash flows, without the thousands I make from the random items i have made, like scratchcards that can give 8000 credits.
The worrying thing is that i have several keen users, who have around 10,000 to 20,000 in the bank, and its not gonna take them long to catch up.

Recently I've been trying to get rid of credits, mainly by doing competitions, and paying them out of my own pocket, but all this does is shift the bulk amount of credits to another user.

I think i may be taking my unit in economics a little too seriously, especially when you have created an excel cash predictor to show what sort of figures i could be at in the next few months, years etc...

chadk:
Well the problem is the bank calculates 2% DAILY not annual like a real bank. 

TechnoDragon:
it actually could be an easy thing to change (sort of)

Just decide on the annual interest you want and then calculate what that would translate into as a daily interest rate.

chinatown:
but the shop does not allow floating point interest right.. that's the problem

Navigation

[0] Message Index

[#] Next page

Go to full version