Can pagestatistics only insert if page_type == blog_entry ?
Permalink
pagestatistics is sure busy table and bulk :)
thats why i want to minimal the insert record by filtering with blog_entry.
pagestatistics only insert record if page type is blog_entry.
i look into pagestatistics(page_statistics.php) class, but there is no insert query there.
i want just put this filter:
where should i put the code?
thats why i want to minimal the insert record by filtering with blog_entry.
pagestatistics only insert record if page type is blog_entry.
i look into pagestatistics(page_statistics.php) class, but there is no insert query there.
i want just put this filter:
if($c->ctHandle == blog_entry){
where should i put the code?
thanks penguins!
that's really help me to find the insert query,
so this not related with page_statistic.php and page.php.
i do this then
this way we can limited the bulk record insert to pagestatistic.
that's really help me to find the insert query,
so this not related with page_statistic.php and page.php.
i do this then
function recordView($c) { if($c->ctHandle == 'blog_entry'){ // only insert if it was content/blog_type $db = Loader::db(); $uID = ($this->uID > 0) ? $this->uID : 0; $cID = $c->getCollectionID(); $v = array($cID, $uID); $db->query("insert into PageStatistics (cID, uID, date) values (?, ?, NOW())", $v); } }
this way we can limited the bulk record insert to pagestatistic.
Yeah, page_statistic.php is used for statistics about a page/pages. More like total views, or views on a particular page. On the other hand page.php is used to have information about the page, like edit mode, is it checked out. The reason it is in user (i believe) is because it is needed to see who is visiting the page, this is called in /concrete/dispatcher.php (which is like the brains of concrete).
Hope this gives you more of an idea about what is going on. And thanks for the clean up, taught me something about variables in a collection variable with less db calls.
Hope this gives you more of an idea about what is going on. And thanks for the clean up, taught me something about variables in a collection variable with less db calls.
The best way would be to hook into concrete5 on_start event or something similar, have the site stats off and turn them on if the page_type event is ran, which means that a page type of blog_type was loaded and you care about the view.
Thanks scott for advice, so thats is how the mechanism pagestatistic running.
i will learn that on_start event first
#fast-cgi
i will learn that on_start event first
#fast-cgi
Let me know if you have any questions.
P.S. I created a cron to just remove all the jobs past a week old and save in a new table just by counts for pages.