Changeset 3018257
- Timestamp:
- 01/06/2024 06:20:03 PM (2 years ago)
- Location:
- donation-thermometer/trunk
- Files:
-
- 3 edited
-
donation_therm.php (modified) (2 diffs)
-
includes/therm_svg.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
donation-thermometer/trunk/donation_therm.php
r2967794 r3018257 4 4 Plugin URI: https://rhewlif.xyz/thermometer 5 5 Description: Displays customisable thermometers for tracking donations using the shortcode <code>[thermometer raised=?? target=??]</code>. Shortcodes for raised/target/percentage text values are also available for posts/pages/text widgets: <code>[therm_r]</code> / <code>[therm_t]</code> / <code>[therm_%]</code>. 6 Version: 2.2. 46 Version: 2.2.5 7 7 Author: Henry Patton 8 8 Text Domain: donation-thermometer … … 10 10 License: GPL3 11 11 12 Copyright 20 18Henry Patton (email : hp@rhewlif.xyz)12 Copyright 2024 Henry Patton (email : hp@rhewlif.xyz) 13 13 14 14 This program is free software: you can redistribute it and/or modify -
donation-thermometer/trunk/includes/therm_svg.php
r2967794 r3018257 78 78 $raisedValue = ($thermProperties['trailing'] == 'true') ? number_format($raisedTotal,$decimals,$thermProperties['decsep'],$thermProperties['sep']).$currency : $currency.number_format($raisedTotal,$decimals,$thermProperties['decsep'],$thermProperties['sep']); 79 79 $targetValue = ($thermProperties['trailing'] == 'true') ? number_format($targetTotal,$decimals,$thermProperties['decsep'],$thermProperties['sep']).$currency : $currency.number_format($targetTotal,$decimals,$thermProperties['decsep'],$thermProperties['sep']); 80 $tValue = ($thermProperties['swapValues'] == 1) ? $raisedValue : $targetValue; 80 81 end($targetA); // move pointer to end of array 81 82 if ($showSubTargets == 1){ … … 150 151 } 151 152 153 $targetLen = mb_strlen($tValue); 152 154 if (!empty($tickM) && $tickM == $rightM){ // left or right ticks 153 $viewboxX1 = 0; 155 if($thermProperties['orientation'] != 'landscape'){ 156 $viewboxX1 = ($targetLen > 7) ? ($targetLen * -2.5) + 7 : 0; 157 } 158 else{ 159 $viewboxX1 = -4; 160 } 154 161 $majorTickL = $rightM - 13; 155 162 $minorTickL = $rightM - 6; … … 180 187 if (count($targetA) > 1){ 181 188 $viewboxX2 = 76 + mb_strlen($subTargetValue)*8; // expand right 189 $viewboxX2 = ($targetLen > 7) ? $viewboxX2 + ($targetLen * 2.5) - 9 : $viewboxX2; 182 190 } 183 191 elseif (!empty($raisedValue)){ 184 192 $viewboxX2 = 76 + mb_strlen($raisedValue)*8; // expand right 193 $viewboxX2 = ($targetLen > 7) ? $viewboxX2 + ($targetLen * 2.5) - 9: $viewboxX2; 185 194 } 186 195 } … … 318 327 // target 319 328 if ($showTarget == 1){ 320 $tValue = ($thermProperties['swapValues'] == 1) ? $raisedValue : $targetValue;321 329 if($thermProperties['orientation'] == 'landscape'){ 322 330 echo '<text x="'.$targetAnchorPoint.'" y="'.$subTargetMargin.'" class="therm_target" fill="'.esc_html($targetColor).'" dominant-baseline="central" style="text-anchor:'.$targetAnchor.'!important">'.esc_html($tValue).'</text>'; -
donation-thermometer/trunk/readme.txt
r2967794 r3018257 4 4 Tags: donate, donation, thermometer, progress, tracker, fundraising, funds, gift, aid, money, charity, non-profit, counter, meter, goal, custom 5 5 Requires at least: 4.6 6 Tested up to: 6. 3.17 Stable tag: 2.2. 46 Tested up to: 6.4.2 7 Stable tag: 2.2.5 8 8 Requires PHP: 5.2 9 9 License: GPL3 … … 80 80 81 81 == Changelog == 82 83 = 2.2.5 = 84 * Fixed a bug where very large target values would get cut off in the SVG with the default font-size. 82 85 83 86 = 2.2.4 =
Note: See TracChangeset
for help on using the changeset viewer.