Changeset 22
- Timestamp:
- 11/07/06 06:44:28 (2 years ago)
- Files:
-
- bb-ratings/trunk/bb-ratings.php (modified) (4 diffs)
- bb-ratings/trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-ratings/trunk/bb-ratings.php
r19 r22 6 6 Author: Michael D Adams 7 7 Author URI: http://blogwaffe.com/ 8 Version: 0.7 8 Version: 0.7.1 9 9 */ 10 10 … … 73 73 74 74 $top = join(',', $top); 75 $topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE topic_id IN ($top) AND topic_status = 0 ");75 $topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE topic_id IN ($top) AND topic_status = 0 ORDER BY FIELD(topic_id, $top)"); 76 76 return bb_append_meta( $topics, 'topic' ); 77 77 } … … 148 148 $topic->rating = array($user_id => $rating); 149 149 150 $avg = (int) round(array_sum($topic->rating) / count($topic->rating));150 $avg = number_format(array_sum($topic->rating) / count($topic->rating), 2); 151 151 bb_update_topicmeta( $topic_id, 'rating', $topic->rating ); 152 152 bb_update_topicmeta( $topic_id, 'avg_rating', $avg ); … … 185 185 186 186 function bb_rating_stylesheet() { 187 if ( !is_topic() )188 return;189 187 echo "<link rel='stylesheet' href='" . bb_get_option( 'uri' ) . BBPLUGINDIR . "/bb-ratings.css' type='text/css' />\n"; 190 188 } bb-ratings/trunk/readme.txt
r19 r22 4 4 Requires at least: 0.74 5 5 Tested up to: 0.74 6 Stable Tag: 0.7 6 Stable Tag: 0.7.1 7 7 8 8 Allows users to rate topics on a simple 1-5 star scale.
