Plugin does not work:

class plgContentCounter extends JPlugin { public function onContentAfterDisplay($context, &$article, &$params, $limitstart) { if ($context == 'com_content.article' && JFactory::getUser()->id == $article->created_by && $params->get('intro_only')) { $database = JFactory::getDBO(); $query = 'UPDATE #__content SET hits = hits - 1 WHERE id = ' . $article->id; $database->setQuery($query); $database->query(); } return ''; } } 

XML: <extension version="2.5" type="plugin" group="content" method="upgrade">

The plugin should block the hits counter (hits) if the material is viewed by its author. It is installed normally, but does not want to work.

    1 answer 1

    The problem was in the class name - it must exactly match the name of the plugin php file.