english/components/com_content/models/article.php
/**
	 * Increment the hit counter for the article.
	 *
	 * @param	int		Optional primary key of the article to increment.
	 *
	 * @return	boolean	True if successful; false otherwise and internal error set.
	 */
Increment the hit counter for the article.
@param       int             Optional primary key of the article to increment.

@return      boolean True if successful; false otherwise and internal error set.
Increment the hit counter for the article . @param int Optional primary key of the article to increment . @return boolean True if successful ; false otherwise and internal error set .
public function hit($pk = 0)
	{
            $hitcount = JRequest::getInt('hitcount', 1);
            if ($hitcount)
            {
                $pk = (!empty($pk)) ? $pk : (int) $this->getState('article.id');
                $db = $this->getDbo();
                $db->setQuery(
                        'UPDATE #__content' .
                        ' SET hits = hits + 1' .
                        ' WHERE id = '.(int) $pk
                );
                if (!$db->query()) {
                        $this->setError($db->getErrorMsg());
                        return false;
                }
            }
            return true;
	}
public function hit ( $ pk = 0 ) { $ hitcount = JRequest :: getInt ( 'hitcount' , 1 ) ; if ( $ hitcount ) { $ pk = ( ! empty ( $ pk ) ) ? $ pk : ( int ) $ this -> getState ( 'article.id' ) ; $ db = $ this -> getDbo ( ) ; $ db -> setQuery ( 'UPDATE #__content' . ' SET hits = hits + 1' . ' WHERE id = ' . ( int ) $ pk ) ; if ( ! $ db -> query ( ) ) { $ this -> setError ( $ db -> getErrorMsg ( ) ) ; return false ; } } return true ; }
Increment the hit counter for the article.
Increment the hit counter for the article .
// Initialise variables.