Page 1 of 5

[ABD] TUT Forum Page Hits 0.1.0

Posted: Mon Dec 24, 2007 4:15 pm
by TheUniqueTiger
MOD Name : TUT Forum Page Hits
MOD Description : This MOD will keep track of the total forum page hits, as well as the individual pages data... (excluding the redirection and confirmation pages).
MOD Author : TheUniqueTiger
MOD Version : 0.1.0 (beta 1)
Compatible with : 3.0.0
Supported styles : Prosilver, Subsilver2

Features :
  • Keep track of the total page hits, as well as individual pages (excluding of course, the redirection and confirmation pages).
  • Keep track of the page hits by guests, members and bots.
  • Also keep track of daily page hits for individual pages.
  • Total page hits displayed in statistics on index page.
  • Detailed individual page hits viewable in ACP.
  • All the pagehits data for the current day is cached and written to the db only if date changes or if the cache was purged.
Additional notes:
***
You can add additional pages to be tracked too... For example if you install a MOD that adds a basic page to phpBB3 in the root folder, then you can add it to be tracked too... Just requires one line edit.
***
As phpBB3 doesn't have pagehits tracking by default, your pagehits before the date you install the MOD will all be zero... so be sure to change a variable...
***
For the above two edits, I can give you the edit in a subsequent post.
***
Don't worry about the number of update queries since it executes only two queries only on the first page after midnight... If the cache was purged, then a few more queries one-time.
***
The detailed pagehits in the ACP was a bit challenging... I'll welcome anyone to point out any improvements in terms of speed and memory efficiency in includes/acp/acp_pagehits.php file.
***
This MOD creates a db table to store all the data in addition to adding a config variable for total pagehits.

Screenshots:
1. Total page hits on index page
Image

Demo: Not required... Please look at the above screenshot.

MOD Download: Download link
(Please download this new file if you had downloaded 0.1.0 file before 30-Dec-07 0730 UTC.)

Awaiting your feedback about the MOD and suggestions for any more features... 8-)
Check back this topic for updates as the development continues...!

Re: [DEV] TUT Forum Page Hits

Posted: Tue Dec 25, 2007 8:43 am
by TheUniqueTiger
Isn't anyone interested in this MOD? Doesn't anyone want to keep track of the page hits that your forum gets, that too categorised into guests and members and the various pages?

Re: [DEV] TUT Forum Page Hits

Posted: Tue Dec 25, 2007 9:02 am
by RedTrinity
I'm interested :D

Re: [DEV] TUT Forum Page Hits

Posted: Tue Dec 25, 2007 12:52 pm
by simple12
Me interested too. Seems like another great mod is being prepared to launch.

Re: [DEV] TUT Forum Page Hits

Posted: Tue Dec 25, 2007 8:53 pm
by saaiberke
Me too I'm interested :)

Nic

Re: [DEV] TUT Forum Page Hits

Posted: Tue Dec 25, 2007 10:54 pm
by TheUniqueTiger
Just completed doing all the coding for general pages (ACP is modifications are yet to be coded)...

Some details about the working of this MOD...
There are 11 basic pages in phpBB3 like index.php, viewtopic.php ... etc... Each page will take 13 bytes per day for db storage... so thats max just 4433 bytes (4.4 KB) per month.

Everything in this MOD is cached... so you need not worry about the db queries...
When a day changes, like one accesses the first forum page after midnight or after purging cache, it will do two queries if cache was purged (to get existing data, and write the new values) or one query (for writing the values for the past day using multi-insert). If the forum has no visitors for an entire day, no data will be recorded for that day.

Later tomorrow or after that, I'll be working on the ACP module to show the page hits.

(Once this is completed, my next version of Statistics MOD will contain addon based on this too showing just the total pagehits and today's total pagehits on the basic stats page!)

@saaiberke, did you implement the FTRT MOD for each viewed page? How is it going? I hope its working fine.

Re: [DEV] TUT Forum Page Hits

Posted: Wed Dec 26, 2007 9:20 am
by saaiberke
TheUniqueTiger wrote:@saaiberke, did you implement the FTRT MOD for each viewed page? How is it going? I hope its working fine.
Yes I tried but it gave me MSQL errors:

Code: Select all

General Error
SQL ERROR [ mysql4 ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 [1064]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.
And when I am at the login page I see the word "cron" in the left bottom corner. So I reversed to the original file changes and it works, I can live with it the way it is now ;)

Grtz,

Nic

Re: [DEV] TUT Forum Page Hits

Posted: Wed Dec 26, 2007 5:14 pm
by simple12
I have a feature request for this mod.

Overall hits to the forum can be shown on the index page and the hits number used should use beautiful gifs. And this should be configurable in ACP.

Thanks

Re: [DEV] TUT Forum Page Hits

Posted: Wed Dec 26, 2007 6:36 pm
by TheUniqueTiger
simple12 wrote:I have a feature request for this mod.

Overall hits to the forum can be shown on the index page and the hits number used should use beautiful gifs. And this should be configurable in ACP.

Thanks
I couldn't understand... Please explain.

Re: [DEV] TUT Forum Page Hits

Posted: Thu Dec 27, 2007 5:18 am
by simple12
i want this on the index page.

Visitor Number: xxxxxx
Or
Page Hits: xxxxxx

These xxxxxx are the number of hits or unique visit to the forum.


For the latest post mod.
Please visit this url and fix a typo for the latest post.
http://www.phpbb-seo.com/boards/phpbb3- ... t1936.html

Re: [DEV] TUT Forum Page Hits

Posted: Thu Dec 27, 2007 10:43 am
by TheUniqueTiger
Yes I see, thanks for pointing out the typo.

This MOD doesn't store the number of visitors. It only keeps count of the pagehits to the various pages in phpBB3. Yes, it surely shows the total pagehits in the statistics section of the index page (like this...)

Code: Select all

Statistics
Total posts 40, Total topics 20, Total members 5, Our newest member ABC, Total page hits 12345

Re: [DEV] TUT Forum Page Hits

Posted: Thu Dec 27, 2007 10:50 am
by simple12
Ok, It was a request to add this feature.

Is it possible to Get these no. In good gif images?
Total page hits 12345

Re: [DEV] TUT Forum Page Hits

Posted: Thu Dec 27, 2007 4:41 pm
by TheUniqueTiger
simple12 wrote:Ok, It was a request to add this feature.

Is it possible to Get these no. In good gif images?
Total page hits 12345
Do you want gif images for the numbers? I won't agree for this since it wouldn't look uniform with the other stats (like total posts, total topics, total users etc) next to it.

Re: [DEV] TUT Forum Page Hits

Posted: Thu Dec 27, 2007 11:02 pm
by TheUniqueTiger
Well it was a real brain teaser coding the ACP module for showing the pagehits for various pages... (You'll know when you'll see the code for that page!)

The entire coding for the first version is complete... The 1st beta will be released on Sunday...

@simple12,
if you were asking for using gifs instead of numbers, then I disagree at this moment.

Re: [DEV] TUT Forum Page Hits

Posted: Fri Dec 28, 2007 5:08 am
by simple12
TheUniqueTiger wrote:@simple12,if you were asking for using gifs instead of numbers, then I disagree at this moment.
Well No problem. I can live without that images also. :)