english/components/com_content/controllers/article.php
/**
	 * Method to save a vote.
	 *
	 * @return	void
	 * @since	1.6.1
	 */
Method to save a vote.
Method to save a vote .
function vote()
	{
		JRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
		$user_rating = JRequest::getInt('user_rating', -1);
		if ( $user_rating > -1 ) {
			$url = JRequest::getString('url', '');
			$id = JRequest::getInt('id', 0);
			$viewName = JRequest::getString('view', $this->default_view);
			$model = $this->getModel($viewName);
			if ($model->storeVote($id, $user_rating)) {
				$this->setRedirect($url, JText::_('COM_CONTENT_ARTICLE_VOTE_SUCCESS'));
			} else {
				$this->setRedirect($url, JText::_('COM_CONTENT_ARTICLE_VOTE_FAILURE'));
			}
		}
	}
function vote ( ) { JRequest :: checkToken ( ) or jexit ( JText :: _ ( 'JINVALID_TOKEN' ) ) ; $ user_rating = JRequest :: getInt ( 'user_rating' , - 1 ) ; if ( $ user_rating > - 1 ) { $ url = JRequest :: getString ( 'url' , '' ) ; $ id = JRequest :: getInt ( 'id' , 0 ) ; $ viewName = JRequest :: getString ( 'view' , $ this -> default_view ) ; $ model = $ this -> getModel ( $ viewName ) ; if ( $ model -> storeVote ( $ id , $ user_rating ) ) { $ this -> setRedirect ( $ url , JText :: _ ( 'COM_CONTENT_ARTICLE_VOTE_SUCCESS' ) ) ; } else { $ this -> setRedirect ( $ url , JText :: _ ( 'COM_CONTENT_ARTICLE_VOTE_FAILURE' ) ) ; } } }
Method to save a vote.
Method to save a vote .
// Check for request forgeries.