Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // There seems to be a problem with the ratings extension in TYPO3
- // (http://typo3.org/extensions/repository/view/ratings/current/)
- //
- // The existing code tries to the DBAL-enabled method exec_UPDATEquery to update the table
- // but it would appear that this method does not like "column+1" values in the updateFields array.
- // Therefore I replaced a couple of lines in method updateRating():
- // line ~142-147:
- $GLOBALS['TYPO3_DB']->exec_UPDATEquery('tx_ratings_data', $dataWhere,
- array(
- 'vote_count' => 'vote_count+1',
- 'rating' => 'rating+' . intval($this->rating),
- 'tstamp' => time(),
- ), 'vote_count,rating');
- // replace with the following code:
- $updateSql = 'UPDATE tx_ratings_data SET vote_count = vote_count+1, rating=rating+' . $this->rating . ', tstamp =' .time() . " WHERE " . $dataWhere;
- $GLOBALS['TYPO3_DB']->sql_query($updateSql);
Advertisement
Add Comment
Please, Sign In to add comment