Changeset 227
- Timestamp:
- 02/09/07 00:37:32 (2 years ago)
- Files:
-
- bb-ratings/trunk/bb-ratings.php (modified) (6 diffs)
- bb-ratings/trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-ratings/trunk/bb-ratings.php
r225 r227 6 6 Author: Michael D Adams 7 7 Author URI: http://blogwaffe.com/ 8 Version: 0. 7.28 Version: 0.8 9 9 */ 10 10 … … 18 18 } 19 19 20 function bb_rating_count( $topic_id = 0 ) {20 function bb_rating_count( $topic_id = 0, $show_zero = false ) { 21 21 global $topic; 22 22 if ( $topic_id ) 23 23 $topic = get_topic( $topic_id ); 24 echo is_array($topic->rating) ? count($topic->rating) : 0;24 echo is_array($topic->rating) ? count($topic->rating) : ( $show_zero ? 0 : '' ); 25 25 } 26 26 … … 41 41 <div class="star star-rating select" style="width: <?php echo ( 85 * $rating / 5 ); ?>px"></div> 42 42 <?php for ( $r = 5; $r > 0; $r-- ) : ?> 43 <div class="star star<?php echo $r; ?> select"><a href="<?php echo bb_nonce_url( add_query_arg( 'rate', $r ), 'rate-topic_' . $topic->topic_id ); ?>" title="<?php echo $title_array[$r]; ?>"><img src="<?php bb_option( 'uri' ); echo BBPLUGINDIR; ?>/star.gif" /></a></div> 44 <?php endfor; ?> 43 <div class="star star<?php echo $r; ?> select"><a href="<?php echo bb_nonce_url( add_query_arg( 'rate', $r ), 'rate-topic_' . $topic->topic_id ); ?>" title="<?php echo $title_array[$r]; ?>"><img src="<?php echo bb_path_to_url( dirname(__FILE__) . '/star.gif'); ?>" /></a></div> <?php endfor; ?> 45 44 </div> 46 45 <?php … … 103 102 global $topic, $bb_current_user; 104 103 105 bb_enqueue_script( 'bb_rating', bb_ get_option( 'uri' ) . BBPLUGINDIR . '/bb-ratings.js', array('wp-ajax') );104 bb_enqueue_script( 'bb_rating', bb_path_to_url( dirname(__FILE__) . '/bb-ratings.js' ), array('wp-ajax') ); 106 105 107 106 if ( !isset($_GET['rate']) ) … … 178 177 <div class="star star-rating<?php if ( $current_user ) echo ' select'; ?>" style="width: <?php echo ( 85 * $rating / 5 ); ?>px"></div> 179 178 <?php for ( $r = 5; $r > 0; $r-- ) : ?> 180 <div class="star star<?php echo $r; ?>"><img src="<?php bb_option( 'uri' ); echo BBPLUGINDIR; ?>/star.gif" /></div>179 <div class="star star<?php echo $r; ?>"><img src="<?php echo bb_path_to_url( dirname(__FILE__) . '/star.gif' ); ?>" /></div> 181 180 <?php endfor; ?> 182 181 </div> … … 185 184 186 185 function bb_rating_stylesheet() { 187 echo "<link rel='stylesheet' href='" . bb_ get_option( 'uri' ) . BBPLUGINDIR . "/bb-ratings.css' type='text/css' />\n";186 echo "<link rel='stylesheet' href='" . bb_path_to_url( dirname(__FILE__) . '/bb-ratings.css' ) . "' type='text/css' />\n"; 188 187 } 189 188 bb-ratings/trunk/readme.txt
r28 r227 2 2 Tags: rating, rate, vote 3 3 Contributors: mdawaffe 4 Requires at least: 0. 745 Tested up to: 0. 746 Stable Tag: 0. 7.24 Requires at least: 0.8 5 Tested up to: 0.8 6 Stable Tag: 0.8 7 7 8 8 Allows users to rate topics on a simple 1-5 star scale. … … 46 46 47 47 The size of the `star.gif` image file is 17px by 17px. It is displayed at 16px by 16px to help round off the sharp edges 48 (an old Web 1.0 trick ).48 (an old Web 1.0 trick - that doesn't play nice with internet explorer, it seems). 49 49 50 50 To change the size, find all the places in `bb-ratings.css` that say "`16px`" and change it to the size you want.
