Changeset 22

Show
Ignore:
Timestamp:
11/07/06 06:44:28 (2 years ago)
Author:
mdawaffe
Message:

bb-ratings 0.7.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bb-ratings/trunk/bb-ratings.php

    r19 r22  
    66Author: Michael D Adams 
    77Author URI: http://blogwaffe.com/ 
    8 Version: 0.7 
     8Version: 0.7.1 
    99*/ 
    1010 
     
    7373 
    7474        $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)"); 
    7676        return bb_append_meta( $topics, 'topic' ); 
    7777} 
     
    148148                $topic->rating = array($user_id => $rating); 
    149149 
    150         $avg = (int) round(array_sum($topic->rating) / count($topic->rating)); 
     150        $avg = number_format(array_sum($topic->rating) / count($topic->rating), 2); 
    151151        bb_update_topicmeta( $topic_id, 'rating', $topic->rating ); 
    152152        bb_update_topicmeta( $topic_id, 'avg_rating', $avg ); 
     
    185185 
    186186function bb_rating_stylesheet() { 
    187         if ( !is_topic() ) 
    188                 return; 
    189187        echo "<link rel='stylesheet' href='" . bb_get_option( 'uri' ) . BBPLUGINDIR . "/bb-ratings.css' type='text/css' />\n"; 
    190188} 
  • bb-ratings/trunk/readme.txt

    r19 r22  
    44Requires at least: 0.74 
    55Tested up to: 0.74 
    6 Stable Tag: 0.7 
     6Stable Tag: 0.7.1 
    77 
    88Allows users to rate topics on a simple 1-5 star scale.