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 Read : 7178 times |





























Hint: if you change and nothing happens, check if your layout already has a com_content override at /template/layout_name/html/com_content/article/default.php
Try making the link go to a page that has the pdf to download.
Then use my plugin http://www.gjcwebdesign.com/page-views-in-content.html to report the hits..
(Title)WMC Annual Report Download ### times
Description: sdfjalsdfjoweuraslkdjfoqwejlaskhgfoqwjsadf
asfhasodfjwoeiufaskljdglkajdsfjasdklf
In this case, can you help me. (for joomla)
or just like your below
You could add a similar code to the com_content/views/frontpage/tmpl/default_item.php and have the number of hits per article.
Haven't tried it but it would be something like item->hits; ?>
C:\Program Files\xampp\htdocs\Joomla\components\com_content\views\frontpage\tmpl\default_item.php
on line 96. It works fine for the Last Update showing but hit counter does not work. Will you help me in this issue?