TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 18, 2024, 03:03:17 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,164
  • Total Topics: 21,219
  • Online today: 190
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 162
  • Total: 162

# People Visited This Page..

Started by Bounda, July 20, 2006, 05:42:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bounda

if(file_exists("hits.txt"))
{
$exist_file = fopen("hits.txt", "r+");
$new_count = fread($exist_file, filesize("hits.txt"));
$new_count++;
fclose($exist_file);
print("$new_count people have visited this page, starting at 11:34 PM Central Time on July 19th.");
$exist_count = fopen("hits.txt", "w");
fputs($exist_count, $new_count);
fclose($exist_count);
}
else
{
$new_file = fopen("hits.txt", "w");
fputs($new_file, "1");
fclose($new_file);
}


Saw it at some php scripting site, thought it would be cool. Use it in a block, but change "people have visited this page, starting at 11:34 PM Central Time on July 19th." To whatever fits you.

Bounda


akulion

Added to Block code Index under "P" as "People visited this Page Block"

rebelrose

That is a nice little script, thanks for posting it.

Crip

What Type of Block? -- phpbox -- doesn't work?
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



rebelrose

#5
Quote from: crip on August 06, 2006, 01:03:22 AM
What Type of Block? -- phpbox -- doesn't work?

I just put it in a php block and it works except if you have the front page turned on it counts that as well as when you go into the forum, not sure if it counts when you view a post I didn't check that yet.

So I turned it off, because it is not giving a true count, unless someone knows how to fix that.

Crip

doesn't work at all for me, not-in-any-type-of-block /
I have become comfortably numb!

Cripzone | Crip's Free 2.0.2 Themes



Bounda

its for each member that views a page with the bar its on enabled, i think.

Assistance


hanzboer

For the same purpose, I used the one in this thread:
http://www.tinyportal.net/smf/index.php?topic=3125.0
it works quite well.