Changeset 227

Show
Ignore:
Timestamp:
02/09/07 00:37:32 (2 years ago)
Author:
mdawaffe
Message:

bb-ratings 0.8

Files:

Legend:

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

    r225 r227  
    66Author: Michael D Adams 
    77Author URI: http://blogwaffe.com/ 
    8 Version: 0.7.2 
     8Version: 0.8 
    99*/ 
    1010 
     
    1818} 
    1919 
    20 function bb_rating_count( $topic_id = 0 ) { 
     20function bb_rating_count( $topic_id = 0, $show_zero = false ) { 
    2121        global $topic; 
    2222        if ( $topic_id ) 
    2323                $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 : '' )
    2525} 
    2626 
     
    4141                <div class="star star-rating select" style="width: <?php echo ( 85 * $rating / 5 ); ?>px"></div> 
    4242<?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; ?> 
    4544        </div> 
    4645<?php 
     
    103102        global $topic, $bb_current_user; 
    104103 
    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') ); 
    106105 
    107106        if ( !isset($_GET['rate']) ) 
     
    178177                <div class="star star-rating<?php if ( $current_user ) echo ' select'; ?>" style="width: <?php echo ( 85 * $rating / 5 ); ?>px"></div> 
    179178<?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> 
    181180<?php endfor; ?> 
    182181        </div> 
     
    185184 
    186185function 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"; 
    188187} 
    189188 
  • bb-ratings/trunk/readme.txt

    r28 r227  
    22Tags: rating, rate, vote 
    33Contributors: mdawaffe 
    4 Requires at least: 0.74 
    5 Tested up to: 0.74 
    6 Stable Tag: 0.7.2 
     4Requires at least: 0.8 
     5Tested up to: 0.8 
     6Stable Tag: 0.8 
    77 
    88Allows users to rate topics on a simple 1-5 star scale. 
     
    4646 
    4747The 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). 
    4949 
    5050To change the size, find all the places in `bb-ratings.css` that say "`16px`" and change it to the size you want.