t l R r
^

Donation Thermometer

#ef1c1a Raised £1 762 towards the £2 000 target. Description

Does your WordPress site need fundraising thermometers? Then look no further…

Simple to configure, and can be placed on any page or post with the simple shortcode [thermometer raised=1762 target=2000].

Multiple thermometers with different targets/sizes/amounts raised/currency symbols/alt text can be placed on the same page.

Optional parameters

The plugin shortcode has 6 optional parameters: width/height, align, alt, trailing, fill, and currency:

[thermometer raised=523 target=1000 width=300 height=567 align=left currency=$ alt='Raised £523' trailing=false fill=#D318D6].

Width and height values are interpreted as pixels. The alt text can be toggled off by using ‘alt=off’. Currency can proceed the raised and target values by toggling ‘trailing’ to true or false. Unique thermometer fill colours can be assigned using hex values in the fill parameter.

Shortcodes

The plugin also supports the use of shortcodes to display text values of the amount raised and target value. Simply use [therm_r] or [therm_t] on any post or page. See the FAQ for instructions on how to use in text widgets.

 

Multiple thermometers

screenshot-1

 

Download v1.3.14 >>> extract and upload to your wordpress plugins folder.

Leave a comment below for questions or suggestions. I will be happy to try and implement any requests in future releases.

If you have found this plugin useful, then please do consider leaving a tip. Just follow the Paypal button and enter the amount (GBP) you wish to pledge. Many thanks!

 

Change log

1.3.14 (22 Dec '16)* Fill colours can now be assigned for individual thermometers using the new shortcode parameter ‘fill=‘
1.3.13 (5 Feb '16)* Fixed minor bug regarding centre alignment of the thermometer.
1.3.12* Fixed minor bug with default values when updating from < version 1.3.
1.3.11* Error in database changes on upgrade in 1.3.10.
1.3.10* Various backend improvements of the code and handling of errors.
* Added more options for the thousands separator.
* Confirmed compatibility up to Wordpress 4.3.*
1.3.9 (21 July '14)* Move width and height parameters into CSS code.
* ‘px’ units can now be defined in the shortcode, instead of having to just use a number value.
1.3.8 (13 July '14)* Fixed encoding for currency symbols in the filename.
1.3.7 (14 May '14)* Further fix to the therm_r and therm_t shortcodes.
1.3.6 (9 May '14)* Fixed an issue with the default display of the thousands separator.
1.3.5 (19 Mar '14)* Added an option to modify the thousands separator in the thermometer shortcode. E.g. sep=,
* Added an option to move the position of the currency symbol to follow the target/raised value using the thermometer shortcode. E.g. trailing=true
* Added global currency settings to the plugin options page.
1.3.4 (2 Mar '14)* Fixed a bug that was preventing absolute values of the width/height parameter working.
1.3.3 (10 Dec '13)* Added the option to use the width or height parameter value as a percentage (useful for displaying thermometers consistently across various screen sizes).
1.3.2 (14 July '13)* Bug fixed where thermometer settings were overwritten with defaults every time the plugin was reactivated/updated.
* More efficient code used for filling the thermometer.
* When percentage raised is greater than 100% the thermometer now fills completely.
* Thousand's separator added to the thermometer alt and title captions.
1.3.1 (19 Feb '13)* New 'alt' parameter for the thermometer shortcode: toggle the thermometer's alt & title off, or use custom text.
* Added option for different raised/target value text colours.
* Fix for servers with allow_url_fopen directive set to off.
* Added a 'donate' link for the developer 😉
1.3 (4 Feb '13)* New shortcodes for 'raised' and 'target' values ([therm_r] and [therm_t]).
* Addressed memory issues concerning the generation of images.
* A new parameter in the thermometer shortcode now allows for custom currency symbols.
* Image width now dynamically adjusts depending on the total raised.
* Target and percentage values change font size depending on string length.
* Horizontal and vertical margins added to the thermometer image.
1.2.2 (29 June '12)* Improved the fail-safe that makes sure thermometers exist before page load.
1.2.1 (6 June '12)* Solve align issues (centre)
* Input missing image title text
* Consistent referencing to file paths
1.2 (17 May '12)* New Feature: Multiple thermometers with varying targets/amounts raised now possible.
* Target/amount raised values now moved from the settings page to the shortcode parameters.
* Included a cache feature which clears thermometer images on the server after 1 week.
1.1.2 (9 May '12)* Fixed bug that may have prevented thermometer displaying in IE.
* Alleviated a re-sampling issue present in some browsers.
1.1.1 (3 May '12)* Option added to change the text colour of the raised/target amount.
* Some code tidying, including in the colours.js file.
* Added style.css file for the colour boxes.

FAQ

  • I am able to save the thermometer settings but the image does not appear on my page or post.

First check you have typed the shortcode correctly. If it is still not working, try changing the permissions of the plugin folder to 777 (no need to recurse into subdirectories) then update the thermometer once more from the settings page.

  • I get an error message “Fatal error: Call to undefined function imagecreatefrompng…”

It is likely the GD library (required to create images) is not installed on your server – check by creating a phpinfo file and contact your hosting support.

  • The shortcodes don’t work in text widgets!

WordPress only enables shortcodes in posts and pages by default.Edit the donations_therm.php file in the plugin folder, and add the following lines: if (!is_admin()) add_filter('widget_text', 'do_shortcode', 11); (Src:http://hackadelic.com/the-right-way-to-shortcodize-wordpress-widgets).

  • The [therm_r] and [therm_t] shortcodes show different values to the thermometers.

Values for these shortcodes are set on the Thermometer settings page. If you want your thermometers to display the same values, remove the ‘raised’ and ‘target’ parameters from the [thermometer] shortcode, e.g. [thermometer width=300 align=right].

  • Can I display the thermometer as a percentage of a parent container?

Yes – just add the percentage symbol to the shortcode value. For example, width=30%. As before, values can be set for Width OR height only. To display the thermometer using an absolute value, set width=320, NOT width=320px.

  • How do I use the title & alt attributes?

This alt parameter option will change the title and alt text attributes of the thermometer image. To toggle off, type alt=off. To enter custom text, type alt=’your custom text’ (include apostrophes). If the option is left out the default text ‘Raised £xxxx towards the £xxxx target.’ will appear.

  • Can I remove the currency symbol?

Yes! Select the empty option on the settings page dropdown menu, or enter currency=null in the thermometer shortcode, e.g. [thermometer currency=null].

161 comments to “Donation Thermometer”

 
  • Wouter, January 30, 2017 at 20:17

    Hi,

    is it possible to build an admin widget to set the Raised value option?

    Tnx

  • Walter, October 11, 2016 at 18:29

    Can the thermometer be set to show matching donations? For example, if a major donor has promised matching funds, and someone gives $100, can the thermometer automatically go up $200?

    • Henry, October 12, 2016 at 15:24

      No, there isn’t this function, but I will consider it for the next update.

  • Dennis Heffernan, September 6, 2016 at 23:16

    Looking for the ability to have segemented thermometer sections, such as first 10% was from Committee, next 15% was from Locals, next 8% was from New Members, etc.

    Can your thermomether be made to do this or do you know of one that will ? Appreciate any insights.

    dennis

  • Rob Wickham, April 29, 2016 at 16:46

    Henry, can you recommend a way that I can use a form or csv file to update 110 thermometers? I have a fund raising website for 110 different parishes. We have one person currently editing 110 widgets with the thermometer code. I would like to make it easier. Thanks. – Rob

  • Frank, March 8, 2016 at 17:05

    Hi Henry,
    Any thanks for the quick response.
    1. Removing one of the parameters fixed the error, thank.
    2. I’m running Version 1.3.13, and yes I have both values saved correctly. So, I don’t know what the problem is.
    Frank

    • Henry, March 10, 2016 at 19:19

      No problem. Can you try deactivating and reactivating the plugin, then save a random/empty ‘Target value’ and ‘Raised value’ value on the plugin options page again. This should ensure that values are being saved in the database ok. The only way typing therm_r would produce a 0 on the webpage, as far as i can see, is if that value is saved in the database already.

  • Frank, March 7, 2016 at 17:43

    1. I keep getting the following error above the plugin; “Use only width OR height parameter values.”
    2. I tried to use the [therm_r] and [therm_t] values, but on the [therm_r] it only shows “0”.

    Thanks for your help,
    Frank

    • Henry, March 7, 2016 at 18:11

      Hi there,

      1. What shortcode are you using to produce the thermometer? If you have both height and width parameters in there then you will need to remove one. Otherwise there might be a bug.

      2. Have you saved correct values on the thermometer settings page? Presumably you’re using the latest version of the plugin?

  • germaine, February 12, 2016 at 10:06

    Hi, I really do like the plugin but is there a chance you could add a row of numbers between

    0-100 as example so it will show
    —100
    —90
    —80
    —70
    —…
    —0

    so you can toggle it off or that you can edit the values yourself so that you got as example
    —100
    —50
    —30
    —0

Reply