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”

 
  • john carey, October 27, 2015 at 20:08

    Hi Henry
    I am doing a website for a charitable cause and I have problems with the plugin
    1) it doesn’t display a drop down for the currency , so I hard coded in €
    2) the € symbol stays after the amount and I want it to be on the left
    I un-ticked the box in settings and I also varied between “true” and “false” in the short code
    I have the short code with false

    I checked the source on the settings page and it is set to true
    :
    See:
    [thermometer raised=1523 target=5000 width=200 height=567 align=left currency=$ alt=off sep=. trailing=true].
    The size of the individual thermometer can be altered using height=200 (pixels), or width=20% (percentage of parent container). Set only width OR height so that the correct aspect ratio is maintained.
    The thousands separator can be set for an individual thermometer using the parameter sep=,, or set globally below.
    Currency symbols can be set to follow numeric values using trailing=true, or set globally below.
    The alt and title attributes of the image can also be modified, or toggled off. Use apostrophes to input a custom string, e.g. [thermometer alt='Raised £1523']
    I’d really appreciate your thoughts on it please
    best regards
    John

    • Henry, October 27, 2015 at 23:07

      Hi,

      Sorry about that, but think I can recreate your problem. For now, I think a quick fix is to replace line 586 of donation-thermometer.php in the plugin folder with this code:

      if(isset($options['trailing']) && $options['trailing'] == 1){

      Then delete all the png files in the folder to make sure the image gets remade. Under certain circumstances it seems the default ‘false’ value is not getting saved in the database. I’ll issue an update fixing this over coming days when I can look at it properly.

  • Diana, October 6, 2015 at 21:04

    Hi, if you visit my website you can see that I have this red text that I can’t get rid of. Can you help?

    • Henry, October 8, 2015 at 10:40

      I presume you’re using a different plugin now?

  • tmwnn, June 18, 2015 at 18:35

    Hi, for me, the plugin is creating and leaving thousands of identical images inside the plugin directory. They all have a name like “therm_99998_,36_7600_10000.png” with some of the numbers different in each. What could be responsible for that, and is there anything I can do about it? I am competent with php, but unfamiliar with generating images with gd.

    • tmwnn, February 8, 2016 at 18:28

      I finally couldn’t stand the 2 GB (!) of identical files in the plugin directory anymore, so I dug into the plugin and found that the filename for the created thermometer image includes the post ID, so that there is a separate image created for each post/page. I see how that makes sense for the use-case where you might have different donation drives running on different posts. But for my use-case (and I imagine for a lot of others), I’m just sticking the thermometer in a widget in the sidebar and it is a single global thermometer for the whole site.

      So I modified the plugin code to exclude the post ID from the filename and now it only produces and uses a single image. I am guessing that would be worthwhile for other people as well, so I am suggesting that you make something like that an admin option.

  • Jason, April 16, 2015 at 05:47

    I had to reinstall your plugin due to some server issues. However, when I now click on “Settings” on the plugin page, I get a “You do not have sufficient permissions to access this page” error. However, I’m the super admin, so I have access to everything. Am I missing something?

    • Henry, April 20, 2015 at 19:34

      Have you tried deactivating and reactivating the plugin too? Sounds like some database entries are missing for the plugin.

  • Ben, February 13, 2015 at 14:52

    Hello,

    I love your plugin, but I noticed today that anyone who loads my website in firefox only sees the shortcode and not the thermometer.

    Any ideas?

    • Henry, February 13, 2015 at 15:13

      Hi Ben,
      Many thanks. I have just tried viewing your ‘Download the bot’ page using the latest Firefox on OS X and Windows 7 and the thermometer displayed fine both times. Perhaps you can look on your server’s error log and let me know if anything went wrong when the plugin tried to create the thermometer image?

      Henry

  • Nic, January 14, 2015 at 17:20

    Hi, I’m trying to have just a space as thousand separator (for FR currency formatting). I tried a few things, including specifying “null” in the sep option, but that hasn’t worked. Any idea?
    Thanks

    • Henry, January 15, 2015 at 16:36

      Hi Nic,

      Try using the following in the shortcode: sep=' ', with the space defined by quotation marks.

  • Maren, November 17, 2014 at 18:16

    Hi – I can’t get my text to wrap around the thermometer. Any suggestions?

    Shortcode used: [thermometer raised=0 target=100000 width=150 align=right currency=$]

  • Ross Judd, November 14, 2014 at 23:39

    The Donation Thermometer plug-in doesn’t seem to be compatible with WordPress 4.0. Is a WordPress 4.0 version in the works, or is there a workaround, e.g., deleting and reloading the plugin?

    • Henry, November 15, 2014 at 10:22

      Ok, thanks for letting me now. I will look into it shortly.

    • Henry, November 15, 2014 at 18:08

      What specific problems are you having with it on WordPress 4.0? I haven’t found anything obviously wrong with the plugin on my test site.

  • Evelyne Mitchell, October 2, 2014 at 16:13

    Hi Gary,
    I am new to WordPress and I volunteered to do our homeowners website. I downloaded you thermometer to display the % of homeowners who paid their dues. I first tested it on a page to see if it works.
    I then deleted that page and keyed the following code into the text widget and changed the settings: [thermometer [therm_r] [therm_t] [thermometer align=center height=200px align=left currency=% alt='Thanks for paying your dues!' trailing=false]. I also keyed in the following at the bottom of your function.php file: add_filter(‘widget_text’, ‘do_shortcode’); When I run the website, I get both the Large Thermometer (that I tested on the page) and the small thermometer (the one I want) below it? What am I doing wrong? Thanks for your help!
    Evelyne

    • Henry, October 3, 2014 at 10:23

      You have mixed the shortcodes when trying to create the thermometer. If you want to use the raised and target values set on the Thermometer Settings page then you can write:

      [thermometer align=center height=200px align=left currency=% alt='Thanks for paying your dues!' trailing=true]

      Otherwise, see the examples at the top of this page.

      • Evelyne Mitchell, October 5, 2014 at 22:40

        Thank you sooooo much, that worked! However, the notify me by e-mail did not work? That is the reason I just saw your answer.
        Thanks again.

  • Megha, August 25, 2014 at 18:18

    The shortcode which I am using is:

    [thermometer raised=1762 target=2000]

    How can I edit this? Can I add currency= $ ?

    Thank you

    • Henry, August 25, 2014 at 18:40

      Yes…[thermometer raised=1762 target=2000 currency=$] (see my previous answer)

      You can also change the currency symbol from the ‘Thermometer’ options page.

      • Megha, August 26, 2014 at 20:50

        Thank you..

  • Megha, July 8, 2014 at 22:33

    I cannot change the pound symbol to dollar symbol.

    • Henry, July 13, 2014 at 14:28

      What shortcode are you using? Something like this should work:

      [thermometer raised=523 target=1000 currency=$]

      • Megha, July 14, 2014 at 15:11

        The short code which is used is:

        [thermometer raised=1762 target=2000]

        Can I change it to $?

  • neil, June 7, 2014 at 22:08

    Hello,
    Just downloaded version as of today on latest wordpress. I’m running windows 8 on xampp.

    The image fails to show. It’s being generated fine and matches exactly your demo image on this page, i.e.
    therm_2_,£_50_100.png

    However, the file being generated is adding an extra unicode character A with hat on top:
    therm_2_,£_50_100

    • Henry, July 13, 2014 at 14:29

      Try the latest update…it should fix your specific problem.

  • Zenman, May 14, 2014 at 15:20

    http://www.vriendenvandegeode.nl/euro-thermometer/

    shortcode used: [thermometer align=left currency="€" alt=off sep=.]
    in settings I have set the following:
    show target YES
    show raised YES
    target value 50000
    raised value 18500

    • Henry, July 13, 2014 at 14:30

      Does the latest update fix your issue?

      • Zenman, July 13, 2014 at 21:21

        Nope. Current version: 1.3.8 (automatic plugin update = ON so I always run the latest version).

  • Heather-Ann, April 14, 2014 at 19:58

    The thousands seperator is showing up as , (comma) with the word on my page. How can I change that?

    • Henry, April 15, 2014 at 10:42

      That is a bit strange in that I can’t replicate it, but for now you can fix it by including the sep=, parameter in the shortcode. I will release a permanent fix in the next update. Cheers

      • Heather-Ann, April 28, 2014 at 15:31

        Hi, I looked through all the code, but every time I found sep it was followed by =, so I don’t know what is wrong, but it is doing it in both the amount raised and the goal amount now. I turned them both off so that it isn’t displaying “$1,(comma)” which looks absurd. But I would like our donors to know what our goal is and how much we’ve raised, not just a percentage. Any ideas on how to fix this?

        • Henry, April 28, 2014 at 15:42

          Have you tried including ‘sep=.’ in the shortcode as mentioned above? e.g. [thermometer raised=523 target=1000 sep=.]. That should fix the individual thermometer.

          I can see what is causing the problem you are experiencing though, and will address it in the next update.

        • Henry, May 9, 2014 at 11:00

          See how you get on with the latest update to the plugin now…

          • David, May 14, 2014 at 11:34

            Hi,
            I was having a similar little mistake even with the latest update: the short-codes [therm_t] and [therm_r] were always showing , as thousands seperator (and not a . as i configured).
            My solution was to add the following line in function therm_target() and in function therm_raised():

            $sep = substr($options[‘thousands’],0,1);

            Don’t know if this ‘clean’, at least it’s working fine.

            • Henry, May 14, 2014 at 12:03

              Thanks for finding that..I’ve just included your fix in the latest update to 1.3.7.

  • Jakob Smith, March 16, 2014 at 19:52

    Two feature suggestions:

    1: The ability to choose which thousands separator to use. I’d like to use “.”

    2: The ability to choose if the currency should be shown before or after the amount.

    • Henry, March 17, 2014 at 08:22

      Good points, and fairly easy to implement too. Will include them in the next release. Cheers

  • Darren, March 3, 2014 at 14:16

    You’re 100% correct on that style. Can’t believe I overlooked that… thanks a bunch and I’ll work towards a better solution for that css override.

  • Coop, December 19, 2013 at 00:16

    Henry,

    First off, love the plugin. Simple to use and looks great. However, I just updated to v.1.3.3, and now neither the ‘height’ nor the ‘width’ attribute in the shortcode works. Any idea what might be causing the problem, or how I should go about fixing it? Thanks!

    • Henry, December 19, 2013 at 10:08

      Hi,

      It looks like you have managed to figure out the width issue on your donate page. FYI the shortcode does not recognise units for pixels, so width=98px would not work, whereas width=98 would. I will resolve this issue in the next update.

      • Darren, January 13, 2014 at 07:26

        I was having the same issue with the height and/or width attribute. I’m not able to get the image to resize automatically when I change the values. I was curious if you had any other reports like this or an update? For now, I’m just resizing the image that is created by hand and re-uploading it to my server.

        Thanks for the plug-in… just what I was looking for! Looking to donate soon!

    • Pascal, February 17, 2014 at 11:43

      Thanks Henry for the plugins. I have the same issue, since 1.3.3, the height or width attribute don’t work anymore. I have only a big size thermometer generated. Tried using % but it is not working neither.

      • Henry, March 2, 2014 at 14:58

        Hi Pascal,

        Try the new update for a fix. Otherwise send me a link to an example.

        • Darren, March 3, 2014 at 04:17

          Henry –

          I tried the updated plug-in code and looks to still have the same issue. I’ve created a test page you can visit to see an example:

          http://www.teammills.com/?page_id=172

          You’ll notice on the other pages of my site, I’ve manually modified the generated image to be the correct height. Thanks for any assistance you can provide.

          Darren

          • Henry, March 3, 2014 at 08:02

            Hi Darren,

            It looks like you have some conflicting CSS code within your wordpress theme, specifically lines 58-62 of the file style.css?ver=3.8.1. Try deleting these lines and I think the thermometer will start to behave as expected. Create a backup of the file first though before editing it.

            Thanks very much for the donation!

  • Lauren, December 11, 2013 at 20:45

    Hello – how would I add the thermometer to the home page php template for our website? What’s the code?

    Thanks,
    Lauren

    • Henry, December 11, 2013 at 22:13

      Try the answer to Simon below. Cheers

      • Lauren, December 11, 2013 at 23:56

        Thank you! Do you know if there’s a way to have it float left or right of the text using php? I used this code, which worked great:

        See http://www.chworks.org for how it looks now.

        Thank you for your help!

        • Henry, December 12, 2013 at 00:06

          The shortcode has an align parameter which will set the float position – set this to left and place the text after the shortcode. Cheers

          • Lauren, December 12, 2013 at 00:40

            Brilliant – thank you so much for your quick and helpful responses!! I really appreciate your help.

            Lauren

  • Simon, December 11, 2013 at 12:28

    Hi there

    Thank you very much for this plugin.

    Two things – the size does not want to change for me [thermometer raised=1523 target=150000 height=50px align=left currency=$ alt=off]

    Second – if I need to add to page tempkate – what would would the php code be?

    Thanks
    Simon

    • Simon, December 11, 2013 at 12:57

      Sorry – got sorted using perentages

      • Henry, December 11, 2013 at 22:14

        Otherwise remove ‘px’ from the shortcode. Cheers

    • Lauren, December 11, 2013 at 21:58

      Hi Simon – did you get an answer to your question about how to add to a page template with php code? I have the same question. Thanks!

      • Henry, December 11, 2013 at 22:08

        Try this:

        < ?php echo do_shortcode('[thermometer raised=1762 target=2000]'); ?>

  • Jason, May 9, 2013 at 20:41

    Nevermind. I see the you have already answered this.

  • Jason, May 9, 2013 at 20:39

    How difficult would it be to use an image other that a thermometer? For example, a tree for a park fund. Would just replacing the .png images with similar sized transparent images do the trick?

  • Michael Elphick, May 1, 2013 at 14:18

    I have been involved in managing a recent website at:

    http://slaleyroseandcrown.co.uk

    which uses your Donation Thermometer plugin, and as this is for a community effort to purchase our local pub, some have suggested that the image should display a “Yard of Ale” rather than a thermometer. See http://en.wikipedia.org/wiki/Yard_of_ale for a description of this traditional English glass.

    I have looked briefly at the code in donation_therm.php, and wonder how difficult it would be to modify the shape?

    • Henry, May 1, 2013 at 16:35

      It wouldn’t be a very simple task modifying the current code – the fill of the thermometer is coded to the image shape of the thermometer. Also, it would be a bit tricky making the raised value follow the curve of the glass.

      You could use the imagefill() function to fill a complex shape; something which I didn’t actually use and probably should change in the plugin to simplify things. If you draw the curve of the glass from the base using a known equation, then working out the x position for the raised pointer shouldn’t be too hard. Would take some time to writeup but would probably look quite good in the end.

  • Adam J. Blust, March 22, 2013 at 13:16

    Henry: When I add your shortcode to my page, it stops the page from displaying anything at all. Any idea why this could be happening, or a fix? Thanks.

    • Henry, March 22, 2013 at 13:40

      There might be a few things happening. Do you have the GD library installed on your server? You could also try changing the plugin folder permissions to 777 so that the thermometer image can be saved. See the FAQ above. If an image has been saved what is its filename?

      • Adam J. Blust, March 26, 2013 at 19:13

        Henry:

        1. I do have the GD library installed.
        2. If you mean the “donation-thermometer” folder in the plugins folder, that’s already set at 777.
        3. What image would be saved?

        I’m using the WooThemes Canvas theme, but I switched to the Twenty Twelve theme, and still no thermometer. I also tried de-activating all my plugins but yours. Still nothing. Any further ideas? I really like your plugin and want to use it.

        As I said, not only does the thermometer not display, but everything else but the page headline (sidebar, other text on the page) doesn’t display either. I’m stumped.

        • Henry, April 1, 2013 at 11:30

          Hi Adam, Sorry been away from a computer the last week.

          It does sound like there is a bug in the plugin. However, without any error messages to go from it’ll be hard to pinpoint. If you have access to your server cpanel (admin page) can you check the error log and check what functions are bringing up errors when you try and use a thermometer.

          There are also various debugging tools that might throw up php errors http://wordpress.org/extend/plugins/debug-bar/. The web console in Firefox might show something up as well. If you send me a test page on your site with the shortcode in use, I could have a look from my end.

          • Adam, April 1, 2013 at 12:57

            Henry: Thanks for your response. As it turns out, the web host was having some issues with their GD library; when they rebuilt it, the thermometer worked.

            I really appreciate your willingness to support your plugin. Thanks again.

  • Alistair, March 19, 2013 at 07:08

    Hi Henry,

    Just trying this out but I’m not getting an image generated when I apply a currency to it, creating a broken url link.

    Without – Fine
    http://teamjmc.jmc.it/wp-content/plugins/donation-thermometer/therm_2910_9616_8000_.png

    With Euros – doesnt display
    http://teamjmc.jmc.it/wp-content/plugins/donation-thermometer/therm_2910_9616_8000_%E2%82%AC.png

    On Rays Playhouse, on another comment the image url is in £ and url is totally different, Im getting an additional underscore?
    http://www.raysplayhouse.org/wp-playhouse/wp-content/plugins/donation-thermometer/therm_348_37000_48000_350.png

    Many thanks

    Alistair

    • Henry, March 19, 2013 at 18:39

      Thanks for bringing this to my attention – looks like there’s a issue with the character encoding not being recognised on your server, thus changing the filenames to something different than expected. I will look to change the way filenames are produced tomorrow and keep it simple. Ray’s Playhouse is using an older version of the plugin – you could install 1.2.2 if you need a thermometer on your site right away (the euro symbol will work in that version for sure), but it won’t be too long before I get it updated.

      • Zenman, July 29, 2013 at 08:33

        Same problem with Euro-sign here with v1.3.2. (WP 3.5.2) No image when using this shortcode [thermometer raised=17500 target=50000 width=200 align=left currency=€ alt=off], because the Euro-sign is automatically changed to a questionmark. In the settingspage there is no option to select the Euro-sign and the empty-option won’t stay in place after I save the settings.
        There are a few hacks, none are great but they work (kinda). For instance try:
        [thermometer raised=17500 target=50000 width=200 align=left currency=Euro alt=off] or [thermometer raised=17500 target=50000 width=200 align=left currency=Euro%20 alt=off] or [thermometer raised=17500 target=50000 width=200 align=left currency="Euro " alt=off]. Using the ASCII-codes won’t work either (like &0128; or €).

        • Zenman, May 14, 2014 at 13:10

          Hi there Henry, I see you are still active with the development of the thermometer-plugin. Great!

          Can you fix the Euro-sign problem for us because there is still no solution.

          • Henry, May 14, 2014 at 13:56

            Do you have an example page that I can see what happens if you use the € symbol? Also have you tried using currency=”€” instead?

  • Nick, February 20, 2013 at 10:35

    I made the four line changes to the donation_therm.php file but it’s still outputting the errors. Let me know if there is anything else I can try, thanks

    • Nick, February 20, 2013 at 10:37

      sorry just saw your other post, will go back a version! Thx

    • Henry, February 20, 2013 at 11:39

      That’s really strange – the getimagesize() function should be reading a local file and not be making a http request. When I reproduced your errors on my test setup the changes mentioned managed to fix the issue, so perhaps there’s something else going on here.

      It would be useful to see what errors still come up if you update to v1.3.1 (released yesterday with this fix in mind).

  • Nick, February 19, 2013 at 10:09

    Since the last update the thermometer has stopped formatting correctly – I removed it from the homepage and posted it here so you can see:
    http://www.raysplayhouse.org/supporting-the-playhouse/fundraising/

    The shortcode hasn’t changed: [thermometer raised=35000 target=48000 height=400 align=left] – it was working perfectly!

    • Henry, February 19, 2013 at 11:22

      Hi Nick,

      I’m pretty sure I know what’s happening here: on the last update I changed the way the thermometer was sized so that long raised values didn’t get chopped off on the right hand side. The formatting you can see might be because the width attribute is not getting calculated and therefore not written into the html code (looks fine in firefox to me).

      Looking at the error codes in your page source file, it looks like it’s because your server has set the allow_url_fopen and allow_url_include PHP directives to off. That’s fine, as it adds security. I will add in some alternative, more secure code in the next update that will hopefully resolve your issues. In the meantime I suggest rolling back to v1.2.2: http://henrypatton.org/wp-content/uploads/2012/04/donation-thermometer_v1.2.2.zip.

      Thanks for raising this issue, and will try to get a fix out soon. Sorry its messed things up for you.

    • Henry, February 19, 2013 at 12:13

      If you want a fix ASAP, then change the following lines in the plugin editor for the donation-thermometer.php file (changes are in bold):

      486: return thermhtml($atts[‘width’],$atts[‘height’],$raised,$target,$atts[‘align’],$align,$currency,$title,$urlpath,$custom_thermname);

      490: return thermhtml($atts[‘width’],$atts[‘height’],$raised,$target,$atts[‘align’],$align,$currency,$title,$urlpath,$custom_thermname);

      495: function thermhtml($code_w,$code_h,$code_r,$code_t,$code_a,$align,$currency,$urlpath,$custom_thermname){

      496: list($width,$height) = getimagesize(THERM_ABSPATH.$custom_thermname.’.png’);

      I managed to replicate the errors on a test site and these changes fix the issue for calculating width. It essentially gets the image size from the local file path rather than from a url path. Let me know if it works out.

  • Yinchen, February 14, 2013 at 22:11

    Ho can I change the size of the thermometer?

    Feature request. not sure if others would find this useful as well. It would be really helpful for us to have the option of another parameter… amount raised one color, amount pledged continuing above in another color. Previously we had someone who created the images in Photoshop for us to use.

    • Henry, February 17, 2013 at 19:59

      Hi Yinchen,

      The size of each thermometer can be adjusted using the width or height parameters in the shortcode. Units are pixels.

      I think that would be quite an easy option to incorporate. Look out for the next update 😉

  • Guido, February 9, 2013 at 22:40

    Hi,

    Thank you very much for creating this plugin and sharing it with the community.

    I would like to suggest an option to hide the alt text for the thermometer image. Or allow users to edit the output of the alt text.

    The option to hide the Target is great and the reason we chose this specific plugin, but it’s still shown in the alt text. In addition the alt text is in English, which isn’t ideal for websites in a different language. I can mess with the plugin files, but it seems the plugin is actively maintained. It’d be awesome if the alt text could be controlled to the same level the other elements of the plugin can be. 🙂

    I personally like the way the Genesis Simple Edits plugin allows you to edit things like the byline and footer by using shortcodes:

    “[post_date] by [post_author_posts_link] [post_comments] [post_edit]”

    You could delete the entire thing, just translate ‘by’ or take your pick and add text as desired. It’s a nifty way of allowing control over an element of a page. Maybe that’s only possible because it’s a framework, I don’t know. A tick box to opt out of having the alt text would be completely awesome on its own.

    Thanks again!

    • Henry, February 10, 2013 at 14:17

      You make a good point. Will implement something for the alt text in the next update.

      • Guido, February 10, 2013 at 21:50

        That’s awesome to hear. Many thanks in advance. And thanks again for sharing this plugin and actively maintaining it. Do you have a tip jar?

    • Henry, February 20, 2013 at 12:23

      Hi Guido,

      I have just released an update with some alt text control. Hopefully it’s what you’re after? Unfortunately the shortcode parser doesn’t accept square brackets within attributes so you can’t use the therm_r shortcode in the alt parameter for example (see last example on http://codex.wordpress.org/Shortcode_API).

      • Guido, February 20, 2013 at 12:42

        My client and I are absolutely chuffed with this update. Thanks so much! Their thermometer is steadily filling up. 😀

        I hope more people will donate towards your contributions to the community. And I hope to be able to send some more people interested in a donation plugin your site in the future.

        Thank you! <3

        • Henry, February 20, 2013 at 15:32

          Thanks very much for the contribution..you’re amazing! 😀 Much appreciated, and glad the plugin is what you’re after. Let me know if you think of any further improvements you want implementing.

  • Anna, February 7, 2013 at 18:45

    Hi, I really like the look of the plugin unfortunately I am getting the fatal error below when attempting to activate it:

    Fatal error: Cannot redeclare set_plugin_meta() (previously declared in /home3/meantime/public_html/mp/wp-content/plugins/wp-favicon/mode-admin/admin.php:41) in /home3/meantime/public_html/mp/wp-content/plugins/donation-thermometer/donation_therm.php on line 47

    Thank you for any help you can provide.

    • Henry, February 7, 2013 at 19:18

      Hi Anna, It looks like our two plugins are using the same function name to create a link to the settings page on the list of plugins. The only way to fix this will be to rename the function to something unique so that WordPress doesn’t get confused. If you open up the plugin editor from the wordpress menu, and open up the file donation-thermometer.php, replace the following in bold from line 47 with set_dt_plugin_meta

      function set_plugin_meta($links, $file) {
      $plugin = plugin_basename(__FILE__);
      // create link
      if ($file == $plugin) {
      return array_merge(
      $links,
      array( sprintf( ‘%s’, $plugin, __(‘Settings’) ) )
      );
      }
      return $links;
      }
      add_filter( ‘plugin_row_meta’, ‘set_plugin_meta‘, 10, 2 );

      then click ‘update file’. I’ve just tried it and it will resolve the conflict for you. Thanks for letting me know, and I will make sure this gets included in the next update. Cheers

      • Anna, February 7, 2013 at 20:40

        Thank you for such a quick response, your solution worked! Then I changed my mind and wanted to insert the Thermometer on the sidebar as a widget rather than on the page. I used the text box widget, and the shortcode showed up instead…so I came back here and as per your FAQ I added the additional line of code in the theme’s functions.php file and it worked! Thank you again for a nice plugin and really great support.

        • Henry, February 7, 2013 at 21:14

          Cheers, no worries 🙂 Hope the plugin is up to your needs.

  • Ronald, February 4, 2013 at 15:21

    Hi, thanks for your speedy answer!
    what i am looking for is a way to use a shortcode which relates back to the information i have put int the Admin section of your plugin; if there i have specified that my target is 10000 and we have already collected 650 i would like to be able to use these amounts throughout my site through a shortcode. In this particular site im working on, in the footer i want to put a note saying something like “Thanks to your generous contributions, we have already [amountraised] of our [amounttarget]. Remember to share our message to keep the momentum going!”

    • Henry, February 4, 2013 at 15:41

      Ok, I understand. Good idea, and yes it should be easily doable. Will implement it in the next update soon.

      • Ronald, February 4, 2013 at 15:43

        Great! Looking forward, in the mean time, if you wish for your plugin to be translated into spanish, let me know, i will probably have to do it anyhow for this site im working on. Cheers!

    • Henry, February 4, 2013 at 22:42

      Try the latest version 1.3 – hope it’s what you need (see the FAQ about shortcodes and text widgets). I probably will take you up on that offer of translation 🙂 Will contact you in due course. Cheers

      • Ronald, February 5, 2013 at 00:29

        Looks exactly like what i needed, thanks a lot for the speedy implementation, much appreciated.

  • Ronald, February 4, 2013 at 15:08

    Hi, great plugin, thanks a lot for it’s development.
    Wanted to ask whether there is any way i could access the total amount raised and target through a shortcode, this would avoid having to update it on several pages throughout my site, which would be error prone. Keep up the good work!

    • Henry, February 4, 2013 at 15:16

      What timing. I was just about to upload a new version when you commented! Do I understand right that you want the option of setting default ‘target’ and ‘raised’ values on the settings page?

  • Elizabeth, October 6, 2012 at 14:19

    First of all, many thanks for this plugin.

    We would like to put two thermometers on one post – one to help collect donations of airline points and one for travel funds. Is there a way using short code to have the $ sign on one thermometer and no symbol (or “points”) on the other thermometer?

    • Henry, October 6, 2012 at 14:40

      At the moment it’s not possible, but will see if can make the requested changes in the next release. Will be travelling from Tuesday so might not have time before then.

  • Alex, September 25, 2012 at 16:12

    Hello! I’m very new to wordpress. I have installed your plugin and setup a very basic page to show the thermometer. when I view that page I get the following error message:

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 3720 bytes) in /home/alexwhya/public_html/lyttonroad.co.za/wp-content/plugins/donation-thermometer/donation_therm.php on line 248

    can you advise some steps I could take to resolve?

    the shortcode I used is this:

    [thermometer raised=9000 target=22000]

    many thanks

    Alex

  • René, September 25, 2012 at 12:56

    Hi, getting the warning:

    Warning: Invalid argument supplied for foreach()

    for multiple lines, I don’t know if it’s because I installed it through WordPress or not, but I can’t seem to figure out how to fix it.

    • Henry, September 25, 2012 at 23:25

      Do the error messages give specific lines? When do the error messages appear? Will have a look soon – am fairly swamped at the moment.

    • Henry, February 7, 2013 at 21:16

      Hi, I think the issue is to do with read/write issues on your server. Try setting the plugin’s folder permissions to 777 and see if that fixes the problem.

  • Clifford Hill, June 29, 2012 at 01:18

    That seemed to work, but doesn’t seem to be working entirely. The thermometer image is there but aren’t there supposed to be numbers and other references to the total, percentage and current amounts of money raised? It’s just the thermometer.

    • Henry, June 29, 2012 at 10:29

      Ok, good. There is an options page under settings on your dashboard where you can choose to include those numbers.

      • Clifford Hill, June 29, 2012 at 19:59

        Ugh, right. I even saw that when I first installed. Seems to be working perfectly fine now. Thanks so much for your time and help!

      • Clifford Hill, June 29, 2012 at 20:52

        I hate to say this, but I just upgraded to the latest version (even deleted the old folder and downloaded the plugin manually and re-uploaded to ensure nothing got corrupted) and now the page stops loading right where the short code is placed in the main content entry of the template. All other pages load fine.

        • Henry, July 1, 2012 at 13:42

          Have sent you an email

  • Clifford Hill, June 28, 2012 at 16:16

    My install of your plugin shows a broken image. I notice that the image produced in the plugin directory has a different filename than the reference in the HTML. Example: the file in the directory is therm_11_1523_5000.png but the filename in the HTML is therm_11_1523_5000_350.png. So the HTML is referencing a file that doesn’t exist and shows up broken on the page. I tried the 777 perms on the plugin directory (though that seems insecure and unnecessary) and ensured that GD library is enabled. Any ideas? Thanks!

    • Henry, June 28, 2012 at 17:26

      Hi Clifford, I suspect you have found a shortcode combination that I haven’t accounted for..can you let me know what parameter values you’re putting in so can double check the code? You could try entering a width value (e.g. width=300) to see if it will correct (the shortcode used above is [thermometer target=2000 raised=1762 width=220 align=left]). I’ll be able to look into it more tomorrow.

      Also you should be able to return the permissions back from 777 seeing as images are being saved into the plugin folder.

      • Clifford Hill, June 28, 2012 at 17:33

        Thanks for the speedy reply! I tried the two defaults offered from the plugin settings:
        [thermometer raised=1523 target=5000]
        [thermometer raised=1523 target=5000 width=300 align=left]
        I also just tried the one you suggested. Same result as seen in the link.

    • Clifford Hill, June 28, 2012 at 17:35

      Also deactivated all plugins except Donation Therm without success.

      • Henry, June 28, 2012 at 17:55

        Ok, think I know what’s up. The function that resizes the thermometer is not being passed for some reason. Something’s wrong with the if loops. Off the top of my head, if you can edit the donation_therm.php file and insert:

        resizetherm($custom_thermname);

        above line 431 then it should load.

        I’ll need to check the code over though and release an update soon to fix it properly

  • 18 WordPress Plugins I Use, June 19, 2012 at 01:25

    […] Donation Thermometer – This is a nifty little plugin that I picked up to use for Project Happy. Unlike a lot of other fundraising plugins, the numbers on the thermometer are manually input. […]

  • Matt, June 14, 2012 at 14:51

    Thanks Henry – have a great day!

  • Matt, June 13, 2012 at 23:34

    Hi Henry – had two quick questions. do you know fi this plug in works on multi site installs? Also, is there a way to make the thermometer a widget so it’s on all pages?

    Thanks so much for this great plugin!

    Matt

    • Henry, June 14, 2012 at 14:14

      Thanks Matt. I haven’t included any capability for multi-site installs so it probably wouldn’t work. To make a thermometer appear on all pages, simply insert the shortcode into a text widget.

  • Amanda, June 13, 2012 at 21:21

    Hi,

    How can I wrap text around the thermometer widget?

    • Henry, June 14, 2012 at 14:06

      Defining the align parameter in the shortcode should work.

  • Ammar, June 1, 2012 at 15:49

    hi i am getting this error with the plugin please advise
    Warning: imagecreatefrompng() [function.imagecreatefrompng]: URL file-access is disabled in the server configuration in /home/content/w/h/i/whiteone/html/hero/wp-content/plugins/donation-thermometer/donation_therm.php on line 220

    Warning: imagecreatefrompng(/wp-content/plugins/donation-thermometer/images/thermometer_wide.png) [function.imagecreatefrompng]: failed to open stream: no suitable wrapper could be found in /home/content/w/h/i/whiteone/html/hero/wp-content/plugins/donation-thermometer/donation_therm.php on line 220
    Failed in call to imagecreate()
    thanx for any help in advance.

    • Henry, June 4, 2012 at 11:57

      Hi Ammar, will have a look in a few days when back from holiday. In the meantime you could try setting the plugin folder permissions to 777 and see if that solves it.

  • Sean, May 20, 2012 at 23:48

    love the thermometer, i have an issue though. My page has the thermometer in the sidebar using short code. I can’t get the thermometer centered, so the symmetry is all off. Can you show me the code for this?

    • Henry, May 21, 2012 at 11:53

      Thanks Sean. Ok, yeah, that’s a bit of a rookie mistake I’ve made with the coding – you can’t centre align img elements using the align attribute.

      If you’re happy to edit the plugin php file, all you need to do is replace a bit of code. On lines 409,413,418 & 421, replace “style=”border: 0pt none;” with “style=border: 0pt none; display: block; margin-left: auto; margin-right:auto;”. That will centre the image in the sidebar. Left and right align in the shortcode will still work too. I will incorporate these changes in the next release. Cheers.

      • Sean, May 21, 2012 at 17:39

        Hi Henry, tried to update like you said and received this error.. Parse error: syntax error, unexpected $end in (path) on line 472
        thoughts?

      • Henry, May 21, 2012 at 18:13

        Ah, i missed a quotation mark in the code above. After the align attribute the lines mentioned should end like:

        style=”border: 0pt none; display: block; margin-left: auto; margin-right: auto;”>’;

  • Lauren, May 16, 2012 at 22:35

    Love this concept. It almost meets my need. Any way of getting the Raised & Target amounts off the configuration page and inside the shortcode? We need to have several projects tracked on different posts.

    • Henry, May 16, 2012 at 23:26

      Thanks Lauren. Am looking into this at the moment – some people have already asked for the option of multiple thermometers. I think your idea of putting amounts in the shortcode is the best way forward. Will have to recode some stuff, and will hope to have something sorted by next week perhaps.

      • Kevin, May 16, 2012 at 23:38

        @Lauren – good Idea. Me too Please!

    • Henry, May 17, 2012 at 17:49

      Ok, while it was on my mind I’ve managed to get the changes done…multiple thermometers should work now when you next update. Let me know how it goes. Cheers.

  • Annika, May 16, 2012 at 13:04

    Thanks Henry! I’ll check it out 🙂

  • Annika, May 15, 2012 at 14:59

    Hey Henry,
    When i try to save my thermometer settings I get the following error Fatal error: Call to undefined function imagecreatefrompng….
    This also appears when I add the shortcode to my post.

    • Henry, May 15, 2012 at 16:16

      Hi Annika, It sounds like the GD library is not installed on your server. This unfortunately is required to produce the thermometer image. You can check to see if it is installed by creating a new phpinfo file. Look through to see what it says about a GD library. If it’s not there you may be able to get it installed via your hosting support – it’s a pretty standard tool really. Let me know how it works out. Cheers

  • Kevin, April 30, 2012 at 21:33

    Can I run multiple versions (4) of this plugin on the same site? We have four firms, each collecting donations towards a common goal.

    • Henry, May 1, 2012 at 00:22

      Not yet…but it is on the to-do list. If it helps, you can use the shortcode to display the same thermometer multiple times around your site.

      • Henry, May 17, 2012 at 17:51

        It will work now in the new version. Make sure to change the shortcodes. Cheers

  • Jason, April 26, 2012 at 23:14

    Thanks for the plugin – nice and simple!

    One question. How do I change the font color for the amount raised and target? Changing the % color doesn’t affect those two numbers.

    Thanks!

    • Henry, April 27, 2012 at 11:51

      Cheers Jason. Yeah I only thought to add the option for the ‘%’ text to avoid a potential clash with the background colour, but you’re right, I think it would be a useful addition. Will add it to the list of things to do.

      In the meantime, if you’re happy to edit the donation_therm.php file, all you need to do is add in this at line 277:

      $txt_color = imagecolorallocate($final_img,0,0,0);

      Change the numerical values to get any RGB colour you want…let me know if you have trouble.

  • Jane, April 19, 2012 at 07:00

    My server environment requires suExec to wrap scripts, this doesn’t seem to be compatible with the plug-in. I’m getting an error message that says there isn’t a script wrapping program at line 210. Is there anything I can do to fix this?

    • Henry, April 19, 2012 at 13:28

      Sorry, I’m not that familiar with suExec. I’m guessing here but you could try replacing lines 209 and 210 of the donation-thermometer.php file with:

      $image_1 = plugin_dir_path(__FILE__).’images/thermometer_wide.png’;

      $final_img = imagecreatefrompng($image_1) or die(“Failed in call to imagecreate()\n”);

      This will call the file path rather than the url, but otherwise the code looks fine to me. I presume you have the GD library installed too? If you send me the server error log I might be able to make a more educated guess…

  • Richard Moon, April 19, 2012 at 05:12

    I would like to have two independent thermometers on my WordPress site. Any suggestions how I might accomplish that.

    Thanks.

    Richard

    • Henry, April 19, 2012 at 13:17

      Hi Richard…it’s something I’ve thought about adding in before…will try and get it done for the next release.

    • Henry, May 17, 2012 at 17:52

      Update the plugin to 1.2 and you will have this functionality now. Cheers

  • Gary, April 17, 2012 at 18:07

    Hi Henry,

    I tried installing your donation thermometer, but an error keeps popping up saying ‘Sorry, Plugin requires PHP 5.0 or higher. Please deactivate Plugin.’ My server is running PHP version 5.2.17, any idea what is causing the problem?

    • Henry, April 17, 2012 at 19:45

      Hi Gary…it sounds like your server may still have PHP4 as the default handler even though PHP5 may be installed. Have you had similar error messages with other plugins?
      There may be some php settings on your cPanel that you could use to configure the .htaccess file, otherwise I would submit a ticket with your hosting provider. They should be able to give the best advice.

Reply