[REQ] Counters

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
Im building an flash game site now. I need this types of counters:

On every game:
Times played counter - 40 credits / sponsorlink - 30
Playtime - 100 credits / sponsorlink - 90

On main page:
Total gameplays all games together - 200 credits / sponsorlink - 180
Total playtime on all games together - 400 credits / sponsorlink - 370

Sponsorlink means I add your link permanently under "sponsored link" at the main menu.

The page http://jagf.pcriot.com/flash/

I know the background are a bit weird but I should fix that after the counters.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
I want 4 counters. On the gamepage where the game is, there should be 2 counters. 1 counting numbers of hits/plays the other1 how much time the game has been played. Then on the main page (home page) there should be an counter that counts every hit/play on every game and 1 that counts all playtime together.

Example:

Game 1
plays 10
play time 3 min

Game 2
Plays 150
Play time 100 min

Home page
Total game plays : 160
Total time spended playing games: 103 min
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Hits is ridiculously easy.

Game time however is another story :) Unless the flash file provides that kind of feedback, its almost impossible to get an accurate time played.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
The flashfile hasn't since I embeed it from miniclips webmaster games but it doesen't need to be accurate.
 

Splatzone

New Member
Messages
85
Reaction score
0
Points
0
Would the play time consist of how long the person was on the game page or how long he was actually playing the game? (from pressing the start button)
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
No one wants the credits?
Edit:
Would the play time consist of how long the person was on the game page or how long he was actually playing the game? (from pressing the start button)
It should be too hard and illegal to hack those miniclip games so how long the person was on the gamepage.
 
Last edited:

Splatzone

New Member
Messages
85
Reaction score
0
Points
0
Ha, yeah.

I would give it a go but my php "Mad Skillz" are yet to be... found ;).

I can do basic stuff, but not anything like that, sorry.
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Which means they are the ones hosting the file, so again, how are you gonna edit something hosted remotely (that you have no control over)?

If they do have some feedback like a highscore or something that you can use on YOUR site, you may have a chance though :)
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
But look, I don't gonna edit thoose games because that would breake both miniclips and x10s TOS. I just want some script that counts the time a person are on that page and add it together and show time played under the game. But actually it counts the persons time on that page. And then just an hit counter. And then 2 "total" counters at the main page that show total played games and total time. An example: http://www.casualcollective.com/ . To the left in the statistic they have a total games played. I want that on the main page. Then under every game they have some more statistic like total time.
 
Last edited:

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Like I said, its not possible UNLESS the game gives some kind of feedback to your site -.-
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
But the hit counter is possible. It counts the page hits. Therefore a page hit counter. Then on the main page all counters would be added together into one.
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
I know how to do that but how to add the hit counters together like counter1 + counter2 + counter3 = counter4?
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
How are you storing the hits? In a database or in flat files?
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
I haven't created the counter right because I have no idea how to make 1 myself. I usually search google. But I don't care. Which are best?
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
Could you not have something cookie related.

As the user presses the button to play the game(would have to be outside of the game itself) it sets the cookie to "started @ time", when they finish they must click another link to get somewhere else (maybe start again or check thier score). This could then collect the cookie data and dellete the cookie, do a simple equation to deduct the start time from the current time and you got a reasonably good idea as to time played. This can then be added to a counter.
 

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Could you not have something cookie related.

As the user presses the button to play the game(would have to be outside of the game itself) it sets the cookie to "started @ time", when they finish they must click another link to get somewhere else (maybe start again or check thier score). This could then collect the cookie data and dellete the cookie, do a simple equation to deduct the start time from the current time and you got a reasonably good idea as to time played. This can then be added to a counter.


That'd only work IF they actually click the link to go somewhere else. Otherwise you'd just have a LOT of open ended statements that have a start time but no end time :p
Edit:
I know how to do that but how to add the hit counters together like counter1 + counter2 + counter3 = counter4?

Use MySQL then. Assuming they are all stored in a the same table and the hits field is called hits, it would be a simple as

Code:
Select sum(hits) from some_table;
 
Last edited:
Top