Timestamp and counter integration. *Request*

Everything related to MBoard - PHP message board
Locked
Debikul
Posts: 4
Joined: Tue Feb 07, 2006 8:54 pm

Timestamp and counter integration. *Request*

Post by Debikul »

Script URL:
Version of script:
Version of PHP:
Hosting company:
Have you searched THIS FORUM for your problem:
(if not please do before posting)
If so, what terms did you try:

Write your message below:

Hello,

I was wondering if there was a way to integrate a hit counter per topic on the board, along with a timestamp to include the time in addition to the date. If anyone could help me with this I would greatly appreciate it.
Debikul
Posts: 4
Joined: Tue Feb 07, 2006 8:54 pm

Post by Debikul »

Ok, I figured out how to add the time posted but I have no idea who to go about showing how many times a post has been viewed. Can anyone help me out here?

Anyway, to add the time beside the date of a post look for the following code in the mbaord.php file:

Code: Select all

$date=date ("d/M/Y");
and replace with:

Code: Select all

$date=date ("d/M/Y g:i a");
I'm sure someone will be able to find this useful if they are new to php and are just learning.

Anyway, does anyone have any idea how to add a "message viewed 'x' amount of times" to the forum script?
Klemen
Site Admin
Posts: 10114
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi,

Glad to hear you got the first one going, all it takes is a little effort and I always prefer helping people who show effort :wink:

As for the second one, you should use some hit counter, like the one at
http://www.phpjunkyard.com/php-text-hit-counter.php

Then edit mboard.php - line 338 should be empty, you can simply paste something like this there:

Code: Select all

$content.='<p align="center">Message viewed <script language="Javascript"
src="http://www.yourdomain.com/path_to_counter/counter.php?page='.$count.'"></script> times</p>';
Of course replace the URL of counter.php with your own. You could also use any other counter script similarly.

Just a note - this will add the counter to new posts, but not existing ones.

Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Debikul
Posts: 4
Joined: Tue Feb 07, 2006 8:54 pm

Post by Debikul »

That sounds excellent! Thank you a million times!

I seriously had no idea how to integrate something like that and failed trying to do it. But many thanks again!

Oh, sorry about the edit.

I was wondering how it would be possible to put the "message viewed" out beside the date and time portion of the forum to show how many clicks it has. I did see where it showed how many clicks it has once you clicked on the subject, but I was wondering if I could put it on the frontpage beside the topic listing with the time, date, etc?
Klemen
Site Admin
Posts: 10114
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

That's more work and would require quite some editing and coding and probably also complications (it's easy to do such things with MySQL database, but text databases have their limits).

Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
zr
Posts: 6
Joined: Sat May 06, 2006 10:40 pm

Post by zr »

I created an add on that I think meets your criteria.

Go to viewtopic.php?t=822

Hope this helps! :D
Locked