Quote from: rthrash at Aug 04, 2006, 10:43 AM
Sounds good to me Raymond. Is the location above the appropriate location for the events, though?
I still am definitely in favor of a simple pagehit counter ... or a dedicated hits counter table.
What will happen here is that the system will raise the OnLogPageView event so that Page counters, Stats, etc can then decide what they should do with the system. They could either insert some javascript/html code inside output document (as in the case of google and others) or they could write the information to the database.
The OnLogPageView event will be located in a section of the code that wll honor the Log Page Hits option when it’s enabled.
Quote from: rthrash at Aug 04, 2006, 11:33 AM
Quote from: xwisdom at Aug 04, 2006, 11:25 AMThe OnLogPageView event will be located in a section of the code that wll honor the Log Page Hits option when it’s enabled.
In my code example above taken directly from the trunk, is this the appropriate location to register the events, replacing the previous session checks (before) and logging call (after)?
I totally agree with you on the decision to put even a page counter as a module, not as part of the core.
Yes, that’s the location. Sorry I did not see that post
-
MODX Staff
- 12,272 Posts
Check out commit 1231 for the above referenced changes.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Quote from: rthrash at Aug 04, 2006, 10:43 AM...I still am definitely in favor of a simple pagehit counter ... or a dedicated hits counter table.
Question-
Is it better to have a separate table with fields: pageId and count - or to simply add a count field to the content table? Seems like one less join to me but might decrease modularity...
Standard Disclaimer
I could be totally wrong.
-
MODX Staff
- 12,272 Posts
Susan has a working pagehit counter module now as well.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me