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