[ABD] TUT Forum Page Hits 0.1.0

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [DEV] TUT Forum Page Hits

Post by TheUniqueTiger » Fri Dec 28, 2007 12:29 pm

I've added a screenshot to the first post... The ACP screen is too big for a screenshot so couldn't show that but its a simple large table.

Also different from that said in the first post, the pagehits are not updated to the db after 25 or 50 pagehits, but only once per day... thats on the first pagehit after midnight... So all your pagehits data for the day is present in the cache. But if you would like to purge the cache, it would first save the pagehits data to the db so that your pagehits are not lost.
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by TheUniqueTiger » Sat Dec 29, 2007 11:55 pm

Version 0.1.0 (beta 1) has been released. The first post has been updated accordingly.

Awaiting your feedback...!!! 8-)
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by RedTrinity » Sun Dec 30, 2007 1:02 am

Great, TUT! Doing a fantastic job :)

I have sadly had to build up my forum from scratch again (bar the database thankfully) due to a fatal error on our old one which killed it completely, so am gradually having to reinstall all of our MODs. But I have just downloaded this one and have it on my "to do" list :)

So will let you know how I go with it once it is installed!

Cheer :)

User avatar
simple12
Registered User
Posts: 84
Joined: Fri Jun 01, 2007 7:39 am
Location: Varanasi, India

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by simple12 » Sun Dec 30, 2007 7:22 am

Ok i installed this mod on localhost.

I think this mod need a module to be created in ACP. Instructions are missing.
Completed all the edits and try to add the module in ACP. Done.
On Accessing the module in ACP i get this error.

Code: Select all

General Error
SQL ERROR [ mysqli ]

Table 'seo-gold.pagehits_table' doesn't exist [1146]

SQL

SELECT * FROM PAGEHITS_TABLE WHERE date LIKE "2007-%"

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 143
CALL: dbal->sql_error()

FILE: includes/acp/acp_pagehits.php
LINE: 79
CALL: dbal_mysqli->sql_query()

FILE: includes/functions_module.php
LINE: 471
CALL: acp_pagehits->main()

FILE: adm/index.php
LINE: 74
CALL: p_master->load_active()
Also this debug error on the top of the module page head.

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/acp/acp_pagehits.php on line 77: Use of undefined constant PAGEHITS_TABLE - assumed 'PAGEHITS_TABLE'
i ran the sql and double checked my edits. If it is from my side? :?

User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by TheUniqueTiger » Sun Dec 30, 2007 7:36 am

Oops sorry for the mismanaged install file... Please download the new one...

(Instructions for includes/constants.php was not included)

Please download the new MOD package if you had downloaded 0.1.0 package before 30-Dec-07 0730 UTC.

Yes, you have to create an ACP module for which instructions are given in the install file.
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

User avatar
simple12
Registered User
Posts: 84
Joined: Fri Jun 01, 2007 7:39 am
Location: Varanasi, India

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by simple12 » Sun Dec 30, 2007 7:42 am

Ok downloading the new package. Will post back if found some errors in that.

RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by RedTrinity » Sun Dec 30, 2007 8:03 am

Am also installing atm so will let you know how I go too :D

RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by RedTrinity » Sun Dec 30, 2007 8:10 am

Ok got it all installed including the updated info, had no errors at all.

Only problem is that atm nothing is being logged? I have a few members online atm but the counter remains on 0 at both the foot of the forum as well as in the ACP (all of them are 0 in there) :S

Any ideas? Other than that it is looking great sofar!

saaiberke
Registered User
Posts: 1126
Joined: Wed Jul 20, 2005 8:13 am
Location: Gent/Belgium
Contact:

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by saaiberke » Sun Dec 30, 2007 10:10 am

I just installed the mod, works great :) Thank you TUT!
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.
Can you give me some info on this please? I have a selfmade page with links called forum/links.php that shows all my interesting links to the users. If I understand it correctly, I can have the page hits for this page also?

I saw that the info for december 2007 is the same as for december 2006, in which year there was no hits counting yet, shouldn't everything before today (when I installed the mod) need to be zero?

Greetz,

Nic

User avatar
simple12
Registered User
Posts: 84
Joined: Fri Jun 01, 2007 7:39 am
Location: Varanasi, India

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by simple12 » Sun Dec 30, 2007 10:33 am

Well the mod is really nice. :)

What is to be done to get this....
Whenever a guest or user or bot visit some page and returns back to index.php it shows the most current statstics of page hits each time. :idea:

RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by RedTrinity » Sun Dec 30, 2007 11:10 am

Just went through and double checked my edits, everything is in place. So I am at a loss as to why its still sitting on 0 hits after a couple of hours :S Have had heaps of members/visitors on during this time.

User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by TheUniqueTiger » Sun Dec 30, 2007 2:10 pm

Looking into these issues... However they shouldn't be happening this way, since I was sitting testing it from Thursday...

@saaiberke,
it seems you have got this MOD to work for you... Can you please tell the others how you did it so... I simply can't think why the others have not been able to get this to work... I hope all of you have downloaded the new package. And looking into the bug reported by you...

Yes you can add your own pages to be tracked too... I'll give you the details in the next post.

I'll be back in some time... after checking everything. Don't worry its not a big error.
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

saaiberke
Registered User
Posts: 1126
Joined: Wed Jul 20, 2005 8:13 am
Location: Gent/Belgium
Contact:

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by saaiberke » Sun Dec 30, 2007 4:27 pm

Aheum, I just installed it following the instructions, I don't know what is going wrong with the other installations.

What exactly is the problem then?

Grtz,

Nic

User avatar
TheUniqueTiger
Registered User
Posts: 303
Joined: Wed Sep 05, 2007 7:57 pm
Location: India
Contact:

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by TheUniqueTiger » Sun Dec 30, 2007 6:42 pm

As saaiberke has said that he followed the install instructions and successfully has it working, I don't think there is any errors in the install instructions...

It is recommended to do the following edit as it fixes the wrong number of pagehits in ACP for any year.
(It was actually adding today's pagehits even though you were viewing last year's pagehits!)

Open includes/acp/acp_pagehits.php

find

Code: Select all

				$pagehits = $cache->obtain_pagehits();
				//now pagehits will contain todays data, so we can safely use $current_date['mon']
				foreach ($pagehits as $todays_date => $data)
				{
					foreach ($data as $page_name => $counts)
					{						
						$current_page_id = $pages_ary[$page_name];						
						$pagehits_data[$current_date['mon']][$current_page_id]['guest_hits'] += $counts['guest_hits'];
						$pagehits_data[$current_date['mon']][$current_page_id]['member_hits'] += $counts['member_hits'];
						$pagehits_data[$current_date['mon']][$current_page_id]['bot_hits'] += $counts['bot_hits'];
					}
				}
				unset($pagehits);
replace with

Code: Select all

				if ($period == $current_date['year'])
				{
					$pagehits = $cache->obtain_pagehits();
					//now pagehits will contain todays data, so we can safely use $current_date['mon']
					foreach ($pagehits as $todays_date => $data)
					{
						foreach ($data as $page_name => $counts)
						{						
							$current_page_id = $pages_ary[$page_name];						
							$pagehits_data[$current_date['mon']][$current_page_id]['guest_hits'] += $counts['guest_hits'];
							$pagehits_data[$current_date['mon']][$current_page_id]['member_hits'] += $counts['member_hits'];
							$pagehits_data[$current_date['mon']][$current_page_id]['bot_hits'] += $counts['bot_hits'];
						}
					}
					unset($pagehits);
				}
The next version will contain update instructions for upgrading from this version... including this above edit...

@saaiberke...
You wanted the edit for adding your own additional pages to be tracked... Suppose you want to add abc.php... (Make sure you keep on incrementing the number to the right, for each new page.)

open common.php

find

Code: Select all

	'viewonline'		=> 10,
	'viewtopic'			=> 11,
after-add

Code: Select all

	'abc'				=> 12,
If you remove an existing page in the list then it may cause error when viewing pagehits in ACP. This will be fixed in next version.
You have only One Life... So before you are History, make sure you make it to the History books! - TheUniqueTiger

saaiberke
Registered User
Posts: 1126
Joined: Wed Jul 20, 2005 8:13 am
Location: Gent/Belgium
Contact:

Re: [BETA] TUT Forum Page Hits 0.1.0

Post by saaiberke » Sun Dec 30, 2007 9:04 pm

Thank you Tiger, works great.

Grtz,

Nic

Locked

Return to “[3.0.x] Abandoned MODs”