Elxis CMS Forum
Community => Elxis Community => Topic started by: nikos65 on June 11, 2009, 21:05:17
-
How i can add the hits number in a content item ?
-
I want to display inside the content the number of own hits !! Is that possible ? There is a counter inside can we display this one using bot?
(Was the same question in a different way ;))
-
But, I still don't understand the question... You can set to "show" number of hits for content items in global configuration.
-
The set is on and nothing display , i have check also the menu item and i didnt find anything !!
-
you can see number of hits only in lists .... category-table
-
Thank you ks-net for your reply, inside the content ? Maybe an extra bot needed ?
-
Thanks to Ivan Trebješanin the solution works fine to Elxis 2008.x and 2009
Via ftp find the /www/components/com_content/content.html.php
you have to open it and go to line 630 for elxis2008 or 639 for elxis 2009 and add this line
echo '<div class="item_hits"'.$rtl.'>'._E_HITS.': '.$row->hits.'</div>'._LEND;
This is before :
/*****************************************/
/* DISPLAY ITEM'S LAST MODIFICATION DATE */
/*****************************************/
static function ModifiedDate( $row, $params ) {
if ( $params->get( 'modifydate' ) ) {
if ((intval( $row->modified ) > 0) && ($row->modified != '1979-12-19 00:00:00')) {
$mod_date = mosFormatDate( $row->modified );
echo '<div class="item_modifydate">'._LAST_UPDATED.' '.$mod_date.'</div>'._LEND;
}
}
}
and this is after
/*****************************************/
/* DISPLAY ITEM'S LAST MODIFICATION DATE */
/*****************************************/
static function ModifiedDate( $row, $params ) {
if ( $params->get( 'modifydate' ) ) {
if ((intval( $row->modified ) > 0) && ($row->modified != '1979-12-19 00:00:00')) {
$mod_date = mosFormatDate( $row->modified );
echo '<div class="item_modifydate">'._LAST_UPDATED.' '.$mod_date.'</div>'._LEND;
}
}
echo '<div class="item_hits"'.$rtl.'>'._E_HITS.': '.$row->hits.'</div>'._LEND;
}
Go to the global configuration and enable the hits to "Show"
Thank you Ivan :D :D