Changeset 550689
- Timestamp:
- 05/30/2012 03:14:31 AM (12 years ago)
- Location:
- tdd-progress-bar/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
tdd-progress-bar/trunk/inc/admin.php
r549997 r550689 76 76 } 77 77 78 $tdd_pb_percentage = absint( get_post_meta( $post->ID, '_tdd_pb_percentage', true ) );78 $tdd_pb_percentage = ( get_post_meta( $post->ID, '_tdd_pb_percentage', true ) ); 79 79 $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 = tval( get_post_meta( $post->ID, '_tdd_pb_start', true ) ); 81 $tdd_pb_end = tval( get_post_meta( $post->ID, '_tdd_pb_end', true ) ); 82 82 83 83 if ( $percentage_display = get_post_meta( $post->ID, '_tdd_pb_percentage_display', true ) ){ … … 130 130 </td> 131 131 <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 ); ?>"> % </td> 133 133 </tr> 134 134 <tr valign="top"> … … 137 137 </td> 138 138 <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 ); ?>"> <?php _e( 'of', 'tdd_pb' ); ?> 140 <input name="tdd_pb_end" type="text" size="10" value="<?php echo ); ?>"><br /> 141 141 <span class="description"><?php _e( "Numbers only, don't include units", 'tdd_pb' ); ?></span> 142 142 </td> … … 186 186 187 187 if ( isset( $_POST['tdd_pb_percentage'] ) ) { 188 update_post_meta( $post_id, '_tdd_pb_percentage', abs int( $_POST['tdd_pb_percentage']) );188 update_post_meta( $post_id, '_tdd_pb_percentage', abs ) ); 189 189 } 190 190 191 191 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', tval( $_POST['tdd_pb_start'] ) ); 193 193 } 194 194 195 195 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', tval( $_POST['tdd_pb_end'] ) ); 197 197 } 198 198 -
tdd-progress-bar/trunk/inc/widget.php
r549997 r550689 70 70 </select><br> 71 71 <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 </small> 73 73 <!--<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> 74 74 -
tdd-progress-bar/trunk/readme.txt
r549997 r550689 5 5 Requires at least: 3.3 6 6 Tested up to: 3.3.1 7 Stable tag: 0.5 7 Stable tag: 0.5 8 8 9 9 Configure and display any number of percent-complete progress bars. … … 62 62 63 63 == Changelog == 64 65 66 67 64 68 65 69 = 0.5 = -
tdd-progress-bar/trunk/tdd-progress-bar.php
r549997 r550689 4 4 Plugin URI: http://github.com/tddewey/tdd-progress 5 5 Description: Manage and display progress bars 6 Version: 0.5 6 Version: 0.5 7 7 Author: Taylor D. Dewey 8 8 Author URI: http://websitesthatdontsuck.com 9 9 Licence: GPLv3 10 */11 12 /*13 global options:14 - animate (on/off) - default=on15 - use default CSS (on/off) - default=on16 - bar background-color - default=#333;17 - display percentage - default=true18 - percentage color - default=#ececec;19 20 shortcode options:21 - race height (if multiple ID's involved)22 - width23 24 bar specific options:25 - color/graphic26 - 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 page33 34 Page to add progress bars.35 - Name36 - Bar style37 - Perecentage / or API call.38 39 10 */ 40 11 … … 236 207 $bar_classes .= sanitize_html_class( $color_class ); 237 208 238 $bar_styles = 'width: ' . absint( $percentage ) . '%;';209 $bar_styles = 'width: ' . ( $percentage ) . '%;'; 239 210 if ( $custom_color ) 240 211 $bar_styles .= ' background-color: #' . tdd_pb_sanitize_color_hex_raw( $custom_color ) . ';'; 241 212 242 213 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="' . ) . '%">'; 244 215 245 216 //display percentage option is now a global control to show text on the bar (percentage or xofy). Name is for back compat … … 310 281 $tdd_pb_query->query(array( 311 282 'post_type' => 'tdd_pb', 312 'posts_per_page' => 20,283 'posts_per_page' => 0, 313 284 'post__in' => $idsarr, 314 285 'no_found_rows' => true, … … 333 304 //Get the calculated percentage 334 305 if ( $input_method == 'xofy' && $end > 0 ){ 335 $start = intval( $start );336 $end = intval( $end );306 $start = tval( $start ); 307 $end = tval( $end ); 337 308 $calcpercentage = round( $start/$end*100, 2 ); 338 309 } else { … … 349 320 $text_on_bar = ''; 350 321 if ( $percentage_display == 'on' || $percentage_display === '' ) 351 $text_on_bar .= absint( $calcpercentage) .'%';322 $text_on_bar .= ) .'%'; 352 323 353 324 if ( $xofy_display == 'on' ) … … 368 339 369 340 endwhile; 370 wp_reset_postdata();371 341 372 342 //Close the progress bar container, and return everything to screen.
Note: See TracChangeset
for help on using the changeset viewer.