POD CMS sort codes
-
Guy can you help me out with my codes?the current codes sort thing alphabetically.I want it to be sorted by the highest score to the lowest heres the code
<?php $scores = new Pod("song_scores"); $whichsong = pods_url_variable('last'); $params = array(); $params['select'] = 't.name,t.score, t.date_played'; $params['where'] = 't.song_url LIKE "%'.$whichsong.'%"'; $params['limit'] = 10; $scores->findRecords($params); $total_scores = $scores->getTotalRows(); ?> <?php if($whichsong == "" || (strlen($whichsong)<3)){ echo '<div id="top-score">'; echo "This tab displays scores only in the individual songs page."; echo '<br />Please click <a href="'; $permalink = the_permalink(); echo '">here</a> to view the scores.'; echo '</div>'; } else{ if($total_scores>0){ echo '<div id="top-score">'; echo '<div id="top-score-header"><div class="top-score-name">Name</div><div class="top-score-score">Score</div><div class="top-score-date">Date Played</div></div>'; echo '<ol>'; while ( $scores->fetchRecord() ) { echo '<li><div class="top-score-name"><a href="/members/'. $scores->get_field("name") .'/profile/">' . $scores->get_field("name") . '</a></div><div class="top-score-score">' . $scores->get_field("score") . '</div><div class="top-score-date">' . $scores->get_field("date_played") . '</div>'; } echo "</ol>"; echo "</div>"; } else{ echo "No scores for this song has been uploaded yet."; } } ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘POD CMS sort codes’ is closed to new replies.