Elxis CMS Forum

Community => Elxis Community => Topic started by: nikos65 on June 11, 2009, 21:05:17

Title: [Solved]Number of hits
Post by: nikos65 on June 11, 2009, 21:05:17
How i can add the hits number in a content item ?
Title: Re: Number of hits
Post by: nikos65 on June 12, 2009, 18:06:52
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  ;))
Title: Re: Number of hits
Post by: Ivan Trebješanin on June 12, 2009, 18:14:59
But, I still don't understand the question... You can set to "show" number of hits for content items in global configuration.
Title: Re: Number of hits
Post by: nikos65 on June 12, 2009, 18:20:10
The set is on and nothing display , i have check also the menu item and i didnt find anything !!
Title: Re: Number of hits
Post by: ks-net on June 12, 2009, 18:52:17
you can see number of hits only in lists .... category-table
Title: Re: Number of hits
Post by: nikos65 on June 12, 2009, 18:56:19
Thank you ks-net for your reply, inside the content  ? Maybe an extra bot needed ?
Title: [Solved] Number of hits
Post by: nikos65 on June 12, 2009, 21:01:22
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

Quote
echo '<div class="item_hits"'.$rtl.'>'._E_HITS.': '.$row->hits.'</div>'._LEND;

This is before :
Quote
   /*****************************************/
   /* 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
Quote
   /*****************************************/
   /* 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