Search Results - Searched for: Hits counter when using Jotcache

27 Nov 2014 13:51
Krikor

Hits counter 3 weeks 1 day ago

Hello,

Joomla! caches the hit count. That is why you are seeing an offset between these values.

This post will help you get past this. www.joomlaworks.net/forum/k2-en/36313-hits-counter-when-using-jotcache
24 Nov 2014 17:55
Andi Setyaji
Thanks for your reply Mr. Krikor. Sorry, I still do not understand. I use K2 v.2.6.8, joomla v 2.5.27. Where the line, code is inserted?

My regards,
Andi
24 Nov 2014 14:42
Krikor
In the item.php.
More information on overrides can be found here: getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
24 Nov 2014 14:10
Andi Setyaji
Sorry, I am new in K2 and Joomla. I also had the same problem.
May I ask, where the code is entered?
02 Jun 2014 12:17
Lefteris
You also need to set "Parse PHP code" to "yes".
31 May 2014 00:02
Petar
BIG BIG Thnx Lefteris Kavadas
I try with K2 tools custum code. Put this code in module, set module to desidered position, excluded this position from caching, but no result. Hit are not increased by +1
Is code good. I have latest K2 and latest joomla 3.3
Big Thnx
30 May 2014 12:54
Lefteris
@Petar Grgurev

I cannot know why this does not work. I was just asked to provide some code. I don't even know how Jotcache works. K2 includes also a module for custom code. Try to use that.
30 May 2014 00:31
Petar
What module use for php code
I try Blank module and Flexi custum code, put code you write above, exclude position in Jotcache, But does not work
Please help
24 May 2014 03:51
Marcos
Hello! Would you be so kind as to share the module that has developed? Because my great ignorance did not allow me to implement it myself.
Thank you!
23 May 2014 18:18
Lefteris
You are welcome.
23 May 2014 16:17
dennisb
Thank you verry much!!!!

This worked for me!


I installed a custom code module.
insert this code and exclude this module position from being cached.

Now every time the k2 item page is recached, the new hits are displayed correct.
23 May 2014 12:02
Lefteris
According to the link you provided the code should be:
<?php
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

if (isset($_GET['view']) && strtolower($_GET['view']) == 'item') {
 $articleId = (int) $_GET['id'];
 
 $db = JFactory::getDBO();
 $db->setQuery(
                        'UPDATE #__k2_items' .
                        ' SET hits = hits + 1' .
                        ' WHERE id = '.(int) $articleId
                );
 $db->query();
}

?>
22 May 2014 13:52
dennisb
Ok, I will try to figure out how to modify the query for K2 items.

Yes I know that the amount of hits is to provide a general image of the item popularity, but it looks strange when a webpage has serveral thousands hits, a main article only showed up 62 hits.

I think there are more people with this problem, and looking for a solution.
22 May 2014 13:00
Lefteris
Hi. Yes if it works for Joomla! articles it can also work for K2 items. You just need to modify the query so it updates the K2 items table. In general, hits are there to provide a general image of the item popularity, not to provide accurate statistics. For such usage you are suggested to use a tool like Google Analytics.
21 May 2014 22:31
dennisb

Hits counter when using Jotcache 6 months 4 weeks ago

Hi,

I'm looking for a solution to use full page caching (jotcache), but still counting and display the total hits.

When I activate the jotcache full page caching, the number of hits will only count up once in a while when the page cache is expired and have to be recached.

for normal Joomla! articles, I found a good solution, described in the topic below:

Joomla forum hits counter with full page cache

Is there a way to implement this solution for K2 items?
Displaying 1 - 15 out of 15 results.

Who Is Online

Total users online: 12 Members and 8600 Guests Online
CFI Services GmbH Chui So Chill Gary Grant Ivan Varela Jan Chambers Jxfive Web Desin Mr_Anonymous Pamela Stoesser Sprendimu Metas Tristan Cowley alfredo joe.brown
Legend ::   Site Administrator Global Moderator Moderator Banned User Guest
  • Total Messages: 135262 | Total Subjects: 36883
  • Total Sections: 4 | Total Categories: 26
  • Today Open: 0 | Yesterday Open: 8
  • Today Total Answer: 1 | Yesterday Total Answer: 9
Powered by Kunena Forum