WordPress.org

Plugin Directory

Changeset 550689


Ignore:
Timestamp:
05/30/12 03:14:31 (23 months ago)
Author:
taylorde
Message:

Tagging release 0.5.1

Location:
tdd-progress-bar/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • tdd-progress-bar/trunk/inc/admin.php

    r549997 r550689  
    7676    } 
    7777 
    78     $tdd_pb_percentage = absint( get_post_meta( $post->ID, '_tdd_pb_percentage', true ) ); 
     78    $tdd_pb_percentage = floatval( get_post_meta( $post->ID, '_tdd_pb_percentage', true ) ); 
    7979    $tdd_pb_custom_color = tdd_pb_sanitize_color_hex_raw( get_post_meta( $post->ID, '_tdd_pb_custom_color', true ) ); 
    80     $tdd_pb_start = intval( get_post_meta( $post->ID, '_tdd_pb_start', true ) ); 
    81     $tdd_pb_end = intval( get_post_meta( $post->ID, '_tdd_pb_end', true ) ); 
     80    $tdd_pb_start = floatval( get_post_meta( $post->ID, '_tdd_pb_start', true ) ); 
     81    $tdd_pb_end = floatval( get_post_meta( $post->ID, '_tdd_pb_end', true ) ); 
    8282 
    8383    if ( $percentage_display = get_post_meta( $post->ID, '_tdd_pb_percentage_display', true ) ){ 
     
    130130                            </td> 
    131131                            <td> 
    132                                 <input name="tdd_pb_percentage" type="text" size="2" value="<?php echo esc_attr( $tdd_pb_percentage ); ?>"> %                           </td> 
     132                                <input name="tdd_pb_percentage" type="text" size="2" value="<?php echo round( floatval( $tdd_pb_percentage ), 2 ); ?>"> %                           </td> 
    133133                        </tr> 
    134134                        <tr valign="top"> 
     
    137137                            </td> 
    138138                            <td> 
    139                                 <input name="tdd_pb_start" type="text" size="10" value="<?php echo esc_attr( $tdd_pb_start ); ?>"> <?php _e( 'of', 'tdd_pb' ); ?> 
    140                                 <input name="tdd_pb_end" type="text" size="10" value="<?php echo esc_attr( $tdd_pb_end ); ?>"><br /> 
     139                                <input name="tdd_pb_start" type="text" size="10" value="<?php echo round( floatval( $tdd_pb_start ), 2 ); ?>"> <?php _e( 'of', 'tdd_pb' ); ?> 
     140                                <input name="tdd_pb_end" type="text" size="10" value="<?php echo round( floatval( $tdd_pb_end ), 2 ); ?>"><br /> 
    141141                                <span class="description"><?php _e( "Numbers only, don't include units", 'tdd_pb' ); ?></span> 
    142142                            </td> 
     
    186186 
    187187    if ( isset( $_POST['tdd_pb_percentage'] ) ) { 
    188         update_post_meta( $post_id, '_tdd_pb_percentage', absint( $_POST['tdd_pb_percentage'] ) ); 
     188        update_post_meta( $post_id, '_tdd_pb_percentage', abs( floatval( $_POST['tdd_pb_percentage'] ) ) ); 
    189189    } 
    190190 
    191191    if ( isset( $_POST['tdd_pb_start'] ) ) { 
    192         update_post_meta( $post_id, '_tdd_pb_start', intval( $_POST['tdd_pb_start'] ) ); 
     192        update_post_meta( $post_id, '_tdd_pb_start', floatval( $_POST['tdd_pb_start'] ) ); 
    193193    } 
    194194 
    195195    if ( isset( $_POST['tdd_pb_end'] ) ) { 
    196         update_post_meta( $post_id, '_tdd_pb_end', intval( $_POST['tdd_pb_end'] ) ); 
     196        update_post_meta( $post_id, '_tdd_pb_end', floatval( $_POST['tdd_pb_end'] ) ); 
    197197    } 
    198198 
  • tdd-progress-bar/trunk/inc/widget.php

    r549997 r550689  
    7070            </select><br> 
    7171            <script>jQuery(".chzn-select").chosen();</script> <?php /* This entire form is ajax refreshed, putting the call here makes it stay bound on-save */ ?> 
    72             <small>Maximum of 20 will be shown in one block</small> 
     72            <small>Maximum of 100, but that's a crazy-large amount, don't you think?</small> 
    7373            <!--<input class="widefat" id="<?php echo $this->get_field_id( 'ids' ); ?>" name="<?php echo $this->get_field_name( 'ids' ); ?>" type="text" value="<?php echo esc_attr( $ids ); ?>" /><br><small>Comma separated</small>--></p> 
    7474 
  • tdd-progress-bar/trunk/readme.txt

    r549997 r550689  
    55Requires at least: 3.3 
    66Tested up to: 3.3.1 
    7 Stable tag: 0.5 
     7Stable tag: 0.5.1 
    88 
    99Configure and display any number of percent-complete progress bars. 
     
    6262 
    6363== Changelog == 
     64 
     65= 0.5.1 = 
     66* Fixed an issue where all the shortcodes in the Progress Bar Administration Panel were displaying the same. 
     67* Now allows for two digit precision floating numbers on percentages inputed, calculated, and the start/end values. 
    6468 
    6569= 0.5 = 
  • tdd-progress-bar/trunk/tdd-progress-bar.php

    r549997 r550689  
    44Plugin URI: http://github.com/tddewey/tdd-progress 
    55Description: Manage and display progress bars 
    6 Version: 0.5 
     6Version: 0.5.1 
    77Author: Taylor D. Dewey 
    88Author URI: http://websitesthatdontsuck.com 
    99Licence: GPLv3 
    10 */ 
    11  
    12 /* 
    13         global options: 
    14             - animate (on/off) - default=on 
    15             - use default CSS (on/off) - default=on 
    16             - bar background-color - default=#333; 
    17             - display percentage - default=true 
    18             - percentage color - default=#ececec; 
    19  
    20         shortcode options: 
    21             - race height (if multiple ID's involved) 
    22             - width 
    23  
    24         bar specific options: 
    25             - color/graphic 
    26             - percentage (or API call) 
    27  
    28  
    29         @todo: 
    30             make a variety of the colored bars. Assemble into a sprite and work-in above. Only need the width to be long enough to feel random. Blend the seam. 
    31  
    32             Global options page 
    33  
    34             Page to add progress bars. 
    35                 - Name 
    36                 - Bar style 
    37                 - Perecentage / or API call. 
    38  
    3910*/ 
    4011 
     
    236207    $bar_classes .= sanitize_html_class( $color_class ); 
    237208 
    238     $bar_styles = 'width: ' . absint( $percentage ) . '%;'; 
     209    $bar_styles = 'width: ' . floatval( $percentage ) . '%;'; 
    239210    if ( $custom_color ) 
    240211        $bar_styles .= ' background-color: #' . tdd_pb_sanitize_color_hex_raw( $custom_color ) . ';'; 
    241212 
    242213 
    243     $return = '<div class="' . $container_classes . '" style="' . $container_styles . '" aria-valuemax="100" aria-valuemin="0" aria-valuenow="' . absint( $percentage ) . '" role="progressbar" title="' . esc_attr( $title ) . ': ' . absint( $percentage ) . '%">'; 
     214    $return = '<div class="' . $container_classes . '" style="' . $container_styles . '" aria-valuemax="100" aria-valuemin="0" aria-valuenow="' . round( floatval( $percentage ), 2 ) . '" role="progressbar" title="' . esc_attr( $title ) . ': ' . round( floatval( $percentage ), 2 ) . '%">'; 
    244215 
    245216    //display percentage option is now a global control to show text on the bar (percentage or xofy). Name is for back compat 
     
    310281    $tdd_pb_query->query(array( 
    311282        'post_type' => 'tdd_pb', 
    312         'posts_per_page' => 20, 
     283        'posts_per_page' => 100, 
    313284        'post__in' => $idsarr, 
    314285        'no_found_rows' => true, 
     
    333304        //Get the calculated percentage 
    334305        if ( $input_method == 'xofy' && $end > 0 ){ 
    335             $start = intval( $start ); 
    336             $end = intval( $end ); 
     306            $start = floatval( $start ); 
     307            $end = floatval( $end ); 
    337308            $calcpercentage = round( $start/$end*100, 2 ); 
    338309        } else { 
     
    349320        $text_on_bar = ''; 
    350321        if ( $percentage_display == 'on' || $percentage_display === '' ) 
    351             $text_on_bar .= absint( $calcpercentage ) .'%'; 
     322            $text_on_bar .= round( floatval( $calcpercentage ), 2 ) .'%'; 
    352323 
    353324        if ( $xofy_display == 'on' ) 
     
    368339 
    369340    endwhile; 
    370     wp_reset_postdata(); 
    371341 
    372342    //Close the progress bar container, and return everything to screen. 
Note: See TracChangeset for help on using the changeset viewer.