...

View Full Version : Lots of coding....shoutcast, php, assign something to IP..



Crazydog
06-20-2005, 06:03 AM
Could someone tell me if this is possible? Thanks.
If someone could code this that'd be great....if not I can go and look it all up and figure it out. :-D
Or, if someone could tell me if this is possible.

I want to set up a "rewards" program for my shoutcast server...
What it is, is every hour they listen, they get half a point, and when they want to they can cash in their points.

What I would want it like:

Let's say they click the "rewards" link. They would see this.

(If first time viewing the page)
********
*welcome message*
Your IP is (javascript displaying IP)
Please assign a username to this IP address so we can track your points.
(Form)
Username:

[Submit]
********
It would then assign that username to that IP address. Then:
********
(2nd visit on)
Welcome *username assigned*!
You have XX Points!

[Cash Out]
********
What that would do, somehow, is read their IP and match it up with the username assigned earlier. Now, for the "XX Points" that would be somehow decided with shoutcast.

In the shoutcast log, it shows


[dest: 70.181.76.14] connection closed (24 seconds) (UID: 90)[L: 0]{Bytes: 635439}(P: 1)

Which shows i can track IPs and Time...what I would want is somehow to get it to add "0.5" every hour. Then when they go to the rewards page it shows the total points they have.

For the cash out button, I can code most of this, but I also want it to reset the number of points they have to 0.

So if this could be coded/told if possible I'd really appriciate that.

Thanks.

-crazydog

Crazydog
06-20-2005, 10:22 PM
Bump....could someone just tell me if this is possible?

marek_mar
06-20-2005, 11:21 PM
First of all IP's are unreliable if you want to track something for a long amount of time. Some (actually a lot) have dynamic IP's so you should assign points to a user whohas a session with that IP. I'd say it's doable but the "how" is a mystery for me.

raf
06-20-2005, 11:39 PM
you can't use IP's. You can't use sessions either (since the sesion can be destroyed by the garbage collection if the user waits to long or if there are a lott os sessions).

the most simple sollution is to just work with useraccounts and either
- require a login from the user on each visit
- automatically log the users in based on a cookie

you know, like the rest of the net does...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum