How to create a hit counter module in joomla 2.5? - joomla

How to create a hit counter module in joomla 2.5

Use this extension to create hit counter
Module Hit Counter

In production Joomla will have cache enabled, and this makes it necessary to handle the hit counting with javascript.
Since we accept this limitation, maybe it's best to use a dedicated server such as piwik, that beyond counting hits will also allow you to study trends, analyse referrals, navigation paths, time on site etc.

Related

WP Super Cache conflicts Contact Form 7

2 popular Wordpress plugins, Super Cache and Contact Form 7 - there are still some issues expected around _nonce AJAX calls.. How it is possible to make them work together smoothly? Definitely, there are some situations you want to keep ALL your posts (pages) super-cached, and not to be served dinamically without caching while preserving and providing contact form functionality.
When not checking the "Cache rebuild" in the settings, Super Cache will function:
standard pages will NOT enforce a new cache file to be generated (e.g. it REALLY serves an (if) existing supercache file whithout triggering a new cache file to be generated
pages with a wpcf7-form included WILL enforce/trigger the re-generation of supercache file while serving the initial on the request. I think that is the point when things go wrong.
Question: How to stop unwanted re-generation of pages with a wpcf7-form included? Based on wpcf7 plugin homepage Docs by the author, my expectation is that the wpcf7 form has evolved and been developing to meet this ajax-call requirements such _nonce calls. Any idea how to resolve this?
to be hard-coded (e.g. exclude _nonce call and/or URL parameter..) within wpcf7 form (this is against WP standards) or
settings in Super cache?
any other idea, solution or alternatives?
In this thread wpcf7 author says:
Contact Form 7 uses WP nonce as secret key. As nonce life is 24 hours by default, if cache clears less than 24 hours, the two plugins should work without problem, even if the page is cached.

Drupal 6 caching and blocks

I've read all over the place and I'm trying to figure out if I am understanding the way caching happens in Drupal 6. We have a site that has a real time stock ticker in it. We have Drupal caching enabled so the stock price ends up getting cached and frozen at a specific spot. I figured a way I could handle it would be to put the ticker in a block I make in a custom module and set BLOCK_NO_CACHE, but if I'm understanding this correctly, if you have site caching enabled, then the ENTIRE page gets cached including any and all blocks on it regardless of their individual cache settings. Is this correct? So am I unable to take advantage of site caching then if I have certain spots that should not cache? Does anyone know of another solution I might be able to use to have the best of both worlds? To be able to have site caching, but also have a real time stock ticker? By the way, the stock ticker is making a JSON request to the Yahoo finance API to get the quote.
You are correct, the directive BLOCK_NO_CACHE is only applicable to block level. However when page caching is enabled then Drupal will cache the entire page (which includes the block as well). But this is only applicable to anonymous users. Drupal's philosophy is that the content for anonymous users is always the same so they get served the cached page. But this is not applicable to authenticated users. Since different users might have different access to certain parts of the page (e.g. the links block will look different for an admin than a regular user).
You might want to have a look at this discussion: BLOCK_NO_CACHE not working for anonymous users
And there is a solution, which you'll stumble upon this discussion. It's this module: Ajax Blocks. Extract from the module description:
Permits to load some blocks by additional AJAX request after loading
the whole cached page when the page is viewed by anonymous user. It is
suitable for sites which are mostly static, and the page caching for
anonymous users is a great benefit, but there are some pieces of
information that have to be dynamic.

Article hit counter and Joomla 2.5.x cache?

There was a comment on Adding in a hit counter to Joomla that the cache impacts the stock hit counter. Do you have any idea how I can fix that bug in Joomla or where I can start to look in the code?
I see it's submitted in the bug tracker but nobody is assigned to it. I believe the hits must be increased before the cache is served, and at the moment the function that generates the content is actually the one that calls the hit increasing function, so that's why the hits only increase upon a fresh article render.
Joomla counts and update the article hits when the page is built, but if the caching plugin is enabled and the page has been cached to disk, the page is loaded directly from the cache directory, without updating the number of views. You can try this joomla hack here:
Joomla Hit Counter Updater
Even though it's not free, it might help you.

cakephp website confusing load times

I have a website that uses CakePHP 1.3.10. This CakePHP app it's pretty big, not in the amount of models or controllers (like 5 of each), but in the amount of plugins. I use the plugins as places of the website where users can access (or can't access) depending on if they have logged in already or not (well there's more reasons, but it's not important now, it's how it works). I also use a global Auth component in the app_controller.php
My issue is the following: I've noticed that the website is getting really slow when trying to access any of the pages of a plugin (when accessing the "home" page - which is not in a plugin - all is good).
The thing is that I was going to run some performance tests to figure out what's going on. I decided to create another website, exactly like the one I described, with the only difference that I removed all the plugins with the exception of one.
Amazingly (for me), when I access one of the pages of this plugin that I didn't delete, it goes super fast, like it should normally go.
So my question is: does the number of plugins really have a direct impact on the loading times of a page inside those plugins? Is there any way to "fix" this? Or is it just a coincidence and something else is going on that I missed?
Thanks so much in advance for any advise!
Reducing the amount of files and folders of my application has increased significantly the load times. I don't know what is the relation between amount of files/folders and loading speed in CakePHP, but it's a fact, at least in my website.
I've changed my cake installation to an advanced installation (as it explains in the cakephp boo) to have my files more spread out in different sub-apps, instead of having one huge app, and this has helped a lot!

JIT-Compiled Resources in Razor Views

We are currently reworking a WebForms based application to a MVC3/Razor system, and have hit a minor issue.
In our current solution, we have a large number of resources held within an external CMS that are compiled into our .aspx pages via a GlobalResource handler; this means that the hit on the CMS is low, and that the resources are only ever needed to be collected once for each individual page.
We can't seem to find any mechanism within Razor/MVC3 that would allow us to do the same thing - any pointers?
I'm not 100% sure I understand your question, but it sounds like you are using an HttpHandler to serve up a bundle of resources. There's no reason that code can't continue to work in MVC3 as-is. If you're doing something else, I'll need a little more clarification :). What's the underlying goal? To reduce the number of Http Requests per page?

Resources