Plugin Directory

Changeset 2967769


Ignore:
Timestamp:
09/16/2023 11:43:36 AM (3 years ago)
Author:
henryp
Message:

Changed #Gradient to #ThermGradient

Location:
donation-thermometer/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • donation-thermometer/trunk/donation_therm.php

    r2967764 r2967769  
    44Plugin URI: https://rhewlif.xyz/thermometer
    55Description: 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.2
     6Version: 2.2.3
    77Author: Henry Patton
    88Text Domain: donation-thermometer
  • donation-thermometer/trunk/includes/therm_svg.php

    r2967764 r2967769  
    9494    }
    9595    if($thermProperties['orientation'] == 'landscape') {
    96         $gradient = '<linearGradient id="Gradient" x1="0" x2="1" y1="0" y2="0">
     96        $gradient = '<linearGradient id="ThermGradient" x1="0" x2="1" y1="0" y2="0">
    9797          <stop style="stop-color: ' . esc_html(trim($colorListA[0])) . '" offset="0%" />
    9898          <stop style="stop-color: ' . $thermProperties['fill2'] . '" offset="100%" />
     
    100100    }
    101101    else{
    102         $gradient = '<linearGradient id="Gradient" x1="0" x2="0" y1="0" y2="1">
     102        $gradient = '<linearGradient id="ThermGradient" x1="0" x2="0" y1="0" y2="1">
    103103          <stop style="stop-color: ' . $thermProperties['fill2'] . '" offset="0%" />
    104104          <stop style="stop-color: ' . esc_html(trim($colorListA[0])) . '" offset="100%" />
     
    378378                if($raisedTotal > $targetTotal){
    379379                    #echo '<path d="M 280 41.5 C 280 51.5 275.5 59.5 269.5 59.5 L 54.5 59.5 C 50.5 64 43.5 66.5 37.5 66.5 C 23.5 66.5 12.5 55.5 12.5 41.5 C 12.5 27.5 23.5 16.5 37.5 16.5 C 43.5 16.5 50.5 19.5 54.5 23.5 L 269.5 23.5 C 275.5 23.5 280 31.5 280 41.5" style="stroke-width: 0;" fill="'.esc_html(trim($colorListA[$i])).'"/>';
    380                     echo '<path d="M 280 41.5 C 280 51.5 275.5 59.5 269.5 59.5 L 54.5 59.5 C 50.5 64 43.5 66.5 37.5 66.5 C 23.5 66.5 12.5 55.5 12.5 41.5 C 12.5 27.5 23.5 16.5 37.5 16.5 C 43.5 16.5 50.5 19.5 54.5 23.5 L 269.5 23.5 C 275.5 23.5 280 31.5 280 41.5" style="stroke-width: 0;" fill="url(#Gradient)"/>';
     380                    echo '<path d="M 280 41.5 C 280 51.5 275.5 59.5 269.5 59.5 L 54.5 59.5 C 50.5 64 43.5 66.5 37.5 66.5 C 23.5 66.5 12.5 55.5 12.5 41.5 C 12.5 27.5 23.5 16.5 37.5 16.5 C 43.5 16.5 50.5 19.5 54.5 23.5 L 269.5 23.5 C 275.5 23.5 280 31.5 280 41.5" style="stroke-width: 0;" fill="url(#ThermGradient)"/>';
    381381                }
    382382                else{
    383383                    #echo '<path d="M '.$newThermLevel.' '.$rightM.' L 54.5 '.$rightM.' C 50.5 64 43.5 66.5 37.5 66.5 C 23.5 66.5 12.5 55.5 12.5 41.5 C 12.5 27.5 23.5 16.5 37.5 16.5 C 43.5 16.5 50.5 19.5 54.5 '.$leftM.' L '.$newThermLevel.' '.$leftM.' L '.$newThermLevel.' '.$rightM.'" style="stroke-width: 0;" fill="'.esc_html(trim($colorListA[$i])).'"/>';
    384                     echo '<path d="M '.$newThermLevel.' '.$rightM.' L 54.5 '.$rightM.' C 50.5 64 43.5 66.5 37.5 66.5 C 23.5 66.5 12.5 55.5 12.5 41.5 C 12.5 27.5 23.5 16.5 37.5 16.5 C 43.5 16.5 50.5 19.5 54.5 '.$leftM.' L '.$newThermLevel.' '.$leftM.' L '.$newThermLevel.' '.$rightM.'" style="stroke-width: 0;" fill="url(#Gradient)"/>';
     384                    echo '<path d="M '.$newThermLevel.' '.$rightM.' L 54.5 '.$rightM.' C 50.5 64 43.5 66.5 37.5 66.5 C 23.5 66.5 12.5 55.5 12.5 41.5 C 12.5 27.5 23.5 16.5 37.5 16.5 C 43.5 16.5 50.5 19.5 54.5 '.$leftM.' L '.$newThermLevel.' '.$leftM.' L '.$newThermLevel.' '.$rightM.'" style="stroke-width: 0;" fill="url(#ThermGradient)"/>';
    385385                }
    386386
     
    391391            else{
    392392                ##$fill = ($i > count($colorListA)-1) ? $thermProperties['fill'] : trim($colorListA[$i]); // if not enough colours in list -> transparent
    393                 $fill = ($i > count($colorListA)-1) ? 'url(#Gradient)' : trim($colorListA[$i]); // if not enough colours in list -> transparent
     393                $fill = ($i > count($colorListA)-1) ? 'url(#ThermGradient)' : trim($colorListA[$i]); // if not enough colours in list -> transparent
    394394                $newThermLevel = ($raisedTotal > $targetTotal) ? $oldThermLevel - (($minH - $maxH) * ($r/$raisedTotal)) : $oldThermLevel - (($minH - $maxH) * ($r/$targetTotal));
    395395                if ($raisedTotal > $targetTotal & $i == $raisedN){
     
    424424                if($raisedTotal > $targetTotal){
    425425                    #echo '<path d="M'.$leftM.' '.$newThermLevel.' L '.$leftM.' 251 C 15.5 255, 13 262, 13 268 C 13 282, 24 293, 38 293 C 52 293, 63 282, 63 268 C 63 262, 60 255, '.$rightM.' 251 L '.$rightM.' '.$newThermLevel.' C '.$rightM.' 30, 48 25.5, 38 25.5 C 28 25.5, 20 30, '.$leftM.' '.$newThermLevel.'" style="stroke-width: 0;" fill="'.esc_html(trim($colorListA[$i])).'"/>';
    426                     echo '<path d="M'.$leftM.' '.$newThermLevel.' L '.$leftM.' 251 C 15.5 255, 13 262, 13 268 C 13 282, 24 293, 38 293 C 52 293, 63 282, 63 268 C 63 262, 60 255, '.$rightM.' 251 L '.$rightM.' '.$newThermLevel.' C '.$rightM.' 30, 48 25.5, 38 25.5 C 28 25.5, 20 30, '.$leftM.' '.$newThermLevel.'" style="stroke-width: 0;" fill="url(#Gradient)"/>';
     426                    echo '<path d="M'.$leftM.' '.$newThermLevel.' L '.$leftM.' 251 C 15.5 255, 13 262, 13 268 C 13 282, 24 293, 38 293 C 52 293, 63 282, 63 268 C 63 262, 60 255, '.$rightM.' 251 L '.$rightM.' '.$newThermLevel.' C '.$rightM.' 30, 48 25.5, 38 25.5 C 28 25.5, 20 30, '.$leftM.' '.$newThermLevel.'" style="stroke-width: 0;" fill="url(#ThermGradient)"/>';
    427427                }
    428428                else{
    429429                    #echo '<path d="M'.$leftM.' '.$newThermLevel.' L '.$leftM.' 251 C 15.5 255, 13 262, 13 268 C 13 282, 24 293, 38 293 C 52 293, 63 282, 63  268 C 63 262, 60 255, '.$rightM.' 251 L '.$rightM.' '.$newThermLevel.' L '.$leftM.' '.$newThermLevel.'" style="stroke-width: 0;" fill="'.esc_html(trim($colorListA[$i])).'"/>';
    430                     echo '<path d="M'.$leftM.' '.$newThermLevel.' L '.$leftM.' 251 C 15.5 255, 13 262, 13 268 C 13 282, 24 293, 38 293 C 52 293, 63 282, 63  268 C 63 262, 60 255, '.$rightM.' 251 L '.$rightM.' '.$newThermLevel.' L '.$leftM.' '.$newThermLevel.'" style="stroke-width: 0;" fill="url(#Gradient)"/>';
     430                    echo '<path d="M'.$leftM.' '.$newThermLevel.' L '.$leftM.' 251 C 15.5 255, 13 262, 13 268 C 13 282, 24 293, 38 293 C 52 293, 63 282, 63  268 C 63 262, 60 255, '.$rightM.' 251 L '.$rightM.' '.$newThermLevel.' L '.$leftM.' '.$newThermLevel.'" style="stroke-width: 0;" fill="url(#ThermGradient)"/>';
    431431                }
    432432
     
    437437            else{
    438438                ##$fill = ($i > count($colorListA)-1) ? $thermProperties['fill'] : trim($colorListA[$i]); // if not enough colours in list -> transparent
    439                 $fill = ($i > count($colorListA)-1) ? 'url(#Gradient)' : trim($colorListA[$i]); // if not enough colours in list -> transparent
     439                $fill = ($i > count($colorListA)-1) ? 'url(#ThermGradient)' : trim($colorListA[$i]); // if not enough colours in list -> transparent
    440440                $newThermLevel = ($raisedTotal > $targetTotal) ? $oldThermLevel - (($minH - $maxH) * ($r/$raisedTotal)) : $oldThermLevel - (($minH - $maxH) * ($r/$targetTotal));
    441441                if ($raisedTotal > $targetTotal & $i == $raisedN){
  • donation-thermometer/trunk/readme.txt

    r2967764 r2967769  
    55Requires at least: 4.6
    66Tested up to: 6.3.1
    7 Stable tag: 2.2.2
     7Stable tag: 2.2.3
    88Requires PHP: 5.2
    99License: GPL3
     
    8080
    8181== Changelog ==
     82
     83= 2.2.3 =
     84* Fixed potential bug with using the gradient option.
    8285
    8386= 2.2.2 =
Note: See TracChangeset for help on using the changeset viewer.