Deciding whether or not to show the number of or "hits" or "views" that an article has received is easy with Joomla: you toggle them globally, and on a per-article basis. So if you have an blog with relatively low traffic, but you have a popular article where you want to show how a hit counter, it's easy: disable the view count globally and enable it for the individual article.

After a while, this starts to get old, because you generally post an article without the hit counter showing and then if it gets a lot of traffic, you want to turn it on.

With this in mind I decided to write a quick custom script.

The original code looks something like this:

<?php if($this->item->params->get('itemHits')): ?>

 

 

The new code:

<?php 
// declare new "hit" variable
$c2hits=$this->item->hits;
?>

<?php if($this->item->params->get('itemHits') && $c2hits > 100): ?>