Click to See Complete Forum and Search --> : Setting up a 'points' system for users


charlesdavison
08-28-2004, 04:50 PM
Hi,

I maintain a website for a charity cause and would like to set up a system for promotional purposes.

You may have seen this before:
The user (visitor A) registers and is given a username. He/she invites a friend (visitor B) to the website with an email which is generated (this has already been set up). The email points B to the registration page where he/she enters A's username as the referrer. A is then credited with a certain number of 'points', and B can then do the same, and so on.

The points add up for different users recruited (and for other things done) and a league table is kept so the winner gets a prize. Each username would have access to a generated page telling them details like points earned, etc.

As I do this in my free time for free, I don't have the time to learn how to create this from scratch, so I was wondering if there are any scripts of any kind that do this or something similar so they can be modified for the purpose? If not how could I most easily go about doing this?

Any help on this topic would be greatly appreciated!
:)

Nedals
08-28-2004, 10:08 PM
I don't know of any scripts that will do this, but it does not sound like this would be very difficult. But it does depend on how much already exists, what language you plan to use, and what is your experience level.

For instance:
* Does the registration page already exist and how is the user info saved.?
* That email (already set up): Can it be modified?
* How much of the work do you plan to do?

charlesdavison
08-29-2004, 07:51 AM
Thanks for the quick reply. In response to your questions, -

The email at the moment is a basic form to email program which I can modify (to,from,subject and message fields. I can also change message content depending on what the user enters on the form). I was thinking of changing to a more advanced script that allows sending out messages to about 5 people at a time rather than just one.

I'm doing the work myself to minimise costs as it is a charitable fundraising venture. I may be able to get some money to pay for programming if I can't do it myself very easily. However, if as you say it is not going to be terribly complicated I may give it a go. My experience with Perl (and other server side languages) is beginner really, I don't know how to program from scratch but I have worked with some scripts that I could modify slightly (nothing at all complicated though).

The registration page hasn't been set up - I wanted to put it up when the points system was set up. I was thinking maybe I could get a 'user management' script to set up the registration process and then modify that to add one variable stored that keeps track of the points. Do you think this would be a good option?

The server supports Perl and PHP, although I am more familiar with Perl (i.e. I have had 0 experience with PHP!). In terms of databases, mySQL is supported. Would I need to buy a copy of MySQL in order to maintain the database or is it entirely server side?

Nedals
08-29-2004, 09:57 AM
Here's what I have in mind.
*Registration Page ( with fields for the following )
UserA: Real name, username, email; ## to be saved to mySQL database
UserB: Real name, email; ## used to create email (not saved)

*Email (sent to UserB) with link to 'registration.cgi?id=##'
The id=## will used to add a point to UserA when UserB goes to the registration page. (AND registers; stops repeated visits adding to the score.)

The above is BASIC. Any frills and more-than-simple security issues will be beyond the scope of this thread. Agreed? :)

The Basic Registration Script. - to be written in PERL
-Connect to the database;
-Display the registration page;
-On submit
-check this username. ## Allow a user to send to other userB's
-if(new user) {
-save this user's data;
-if (id) add point to that id; ## id, for userA, comes from email
}
-send email to 'userB'; ## if entered

Will this do what you want?

If ok, you need to create the registration page in HTML (no perl yet), post it to YOUR website, and provide a link. When that's done, I will help you build the script.
If you want to have crack at the script, post what you get done.
No need to buy mySQL (it's server-side) but you might want to buy a book :)


!! If anyone knows of an existing script, please chime in !!

CyCo
08-29-2004, 10:35 AM
...maybe something like this?

Refer The World Version 1.0

http://www.mydesktophelp.com/perl.htm?refer1

charlesdavison
08-29-2004, 09:58 PM
Thanks for your help Nedals and Cyco, I'll look into that script, loks like it might be pretty good... But I'll set up the HTML anyway and let you know where it is.