Hello,
I am developing a community site in PHP with lots of customized features and mods. Everything that i have coded i have had previous knowledge of so it has not been that difficult, but i am thinking about adding a new mod to my site that i have never attempted before.
My site currently has a points system, users can earn points which they can then spend on various things. I would like to add a feature whereby users can buy other users aswell. This would mean a link on each users profile, probably a radio button with a submit button, which would then update the mysql database table which contains each users points by deducting the user who has bought the other user the correct amount of points. The cost of each user would be determined by however many other users they own, values which i would set myself, the default amount being 50.
Once a user has bought another user and has been deducted the correct amount of points, they then start to earn a percentage of points off the recently bought user's activity.
A user who is 'owned' by another user has the oppurtunity to 'buy themselves back' at any point using their points.
A users will have a part on their profile that says something like: 'owned by: user1' and 'owns: user2, user4' etc.
This type of system can be found on profilenation.com except it is written in ASP and not PHP.
Could anyone point me in the right direction as to what codes i would need to impliment to get this feature working on my site.
ANY help whatsoever would be greatly appreciated.
Thanks,
Lee
Help with developing new code
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
The only thing i dont know how to do is how to split the points & buy out the user that owns you.
For instance, when user1 buys user2, user1 gets half of the points user2 earns from then on.
so say user2 earned 20 points in a week, user1 would receive 10 of them, and user2 would only get 10 aswell, and if another user owned user1, user1's 10 points would be split between user1 and user1's owner (5 points each), and so on.
I was thinking about making a buy back system depending on how many other users they own, for instance, a user who owns 20 users will cost alot more than a user who owns 5. But i thought if i could put a simple system in to start, then i could make it more advanced.
For instance, when user1 buys user2, user1 gets half of the points user2 earns from then on.
so say user2 earned 20 points in a week, user1 would receive 10 of them, and user2 would only get 10 aswell, and if another user owned user1, user1's 10 points would be split between user1 and user1's owner (5 points each), and so on.
I was thinking about making a buy back system depending on how many other users they own, for instance, a user who owns 20 users will cost alot more than a user who owns 5. But i thought if i could put a simple system in to start, then i could make it more advanced.