*

Recent

Author Topic: Tiles "Total Hits"  (Read 7106 times)

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Tiles "Total Hits"
« on: November 08, 2014, 05:14:46 PM »
stats.php

Total Hits: ';include ("$directorypath/includes/counter.php"); echo '<br />

Gives you this error:

include(\\INCLUDES

Remove:

$directorypath/

Total Hits: ';include ("includes/counter.php"); echo '<br />

In the demo "tiles" it doesn't have Total Hits. And one would be better off using SQL for hits.

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Tiles "Total Hits"
« Reply #1 on: November 08, 2014, 08:52:08 PM »
stats.php

Total Hits: ';include ("$directorypath/includes/counter.php"); echo '<br />

Gives you this error:

include(\\INCLUDES

Remove:

$directorypath/

Total Hits: ';include ("includes/counter.php"); echo '<br />

In the demo "tiles" it doesn't have Total Hits. And one would be better off using SQL for hits.

Ya iv never really understood the point of using a file for the counter i plan to move it to the database before next release.

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Tiles "Total Hits"
« Reply #2 on: November 09, 2014, 12:44:38 AM »
yeah! The robots play merry hell with that script, and that's what makes it useless. ;)

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
Re: Tiles "Total Hits"
« Reply #3 on: November 09, 2014, 09:28:14 AM »
I do not use this on my arcades but i left it in the script, Like Dillon said it will be upgraded in the next release.

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Tiles "Total Hits"
« Reply #4 on: November 12, 2014, 04:26:33 PM »
This might save you some time? ;)

Code: [Select]

PHP

//--
//-- Table structure for table `counter`
//--

mysql_query("CREATE TABLE IF NOT EXISTS `fas_counter` (
  `counter` int(20) NOT NULL,
  PRIMARY KEY (`counter`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;");

//--
//-- Dumping data for table `counter`
//--

mysql_query("INSERT INTO `fas_counter` (`counter`) VALUES
(0);");

#################################

SQL

CREATE TABLE IF NOT EXISTS `fas_counter` (
  `counter` int(20) NOT NULL,
  PRIMARY KEY (`counter`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `fas_counter` (`counter`) VALUES
(0);
################################

Stats page?


The Query.

//Adds one to the hit counter
mysql_query("UPDATE `fas_counter` SET counter = counter + 1");

//Retrieves the current count
$count = mysql_fetch_row(mysql_query("SELECT counter FROM `fas_counter`"));



Total Hits: '.$count[0].' <br />



am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
Re: Tiles "Total Hits"
« Reply #5 on: November 12, 2014, 05:08:51 PM »
I was going to add it to the fas_gamestats and alter the name but this is better .  8)
Thanks

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Tiles "Total Hits"
« Reply #6 on: November 12, 2014, 08:44:41 PM »
Yeah! Well if you want to start off with at least some hits - Like 1,578,209 - Just change the SQL (0); to (1578209);

HAHAHAHA!  ;D ;D ;D

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Tiles "Total Hits"
« Reply #7 on: November 12, 2014, 08:51:31 PM »
Wait why wouldnt we want all the stats to be in the same table?

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Tiles "Total Hits"
« Reply #8 on: November 12, 2014, 09:23:13 PM »
I agree with you Dillon, but probably make the var global and just add that to the "User Stats page"

You'll see with the Demo I sent - There's a lot of places/things where they could be functions to cut down on the duplicates.

I'll get around to it one day? Maybe!

am-fs

  • Owner
  • Developer
  • Full Member
  • ******
  • Posts: 228
  • Force: +1/-0
    • Great Flash Games
Re: Tiles "Total Hits"
« Reply #9 on: November 12, 2014, 10:29:19 PM »
Wait why wouldnt we want all the stats to be in the same table?

I was thinking about making a setting to enable or disable it, for users like me that do not care about the hits since i use Google Analytics on all my sites.

Frank

  • Sr. Member
  • ****
  • Posts: 257
  • Force: +4/-0
Re: Tiles "Total Hits"
« Reply #10 on: November 13, 2014, 05:09:01 AM »
Well, in that case I would use the fas counter table and add an "active" column to it to switch it on and of. ;)

Dillon

  • Developer
  • Sr. Member
  • ******
  • Posts: 340
  • Force: +3/-0
    • Arcade Freak
Re: Tiles "Total Hits"
« Reply #11 on: November 13, 2014, 11:39:37 AM »
We could also use it in the gamestats table and add an active field for every stat so you can turn off each one if youd like... However i also dont remember there being a gamestats table or i just forgot about it so i dont know how its setup to be sure that it would work like that