Created
October 1, 2012 17:27
-
-
Save Viktorminator/3813182 to your computer and use it in GitHub Desktop.
MODX Revolution Star Rating top star elements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$snippetPath = $modx->getOption('core_path').'components/star_rating/'; | |
$modx->addPackage('star_rating',$snippetPath.'model/'); | |
$c = $modx->newQuery('starRating'); | |
$c->sortby('vote_total','DESC'); | |
$c->sortby('vote_count','DESC'); | |
$c->limit('100'); | |
$c->prepare(); | |
$c->stmt->execute(); | |
$res = $c->stmt->fetchAll(PDO::FETCH_ASSOC); | |
foreach ($res as $v) { | |
$output.= $v['starRating_id'].","; | |
}; | |
$output = substr($output,0,-1); | |
return $output; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment