Sat 18 Apr |
|
This change will display the number of times each article has been read (hits) in the Joomla 1.5 Article layout. You can see how it looks on the article pages. Open file joomla_root/components/com_content/views/article/tmpl/default.php in any text editor and go to line 130. The table row were interested in looks like this - <?php if ( intval($this->article->modified) !=0 && $this->params->get('show_modify_date')) : ?> <tr> <td class="modifydate"> <?php echo JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->article->modified, JText::_('DATE_FORMAT_LC2'))); ?> </td> </tr> <?php endif; ?>You need to add the conditional clause to display the number of hits for the article. The <?php endif; ?> have been moved as well - <?php if ( intval($this->article->modified) !=0 && $this->params->get('show_modify_date')) : ?> <tr> <td class="modifydate"> <?php echo JText::sprintf('LAST_UPDATED2', JHTML::_('date', $this->article->modified, JText::_('DATE_FORMAT_LC2'))); ?> <?php endif; ?> <?php if ($this->params->get('show_hits')) : ?> <span style="float:right;"> Read : <?php echo $this->article->hits; ?> times </span> <?php endif; ?> </td> </tr>Now the number of times the article has been accessed (hits) is displayed. |
Last Updated on Saturday, 18 April 2009 14:07 |