[pmwiki-users] A fundraising thermometer (PHP script to draw an image) within pmwiki

Wendell Brown wbrown at arkie.net
Wed Nov 30 13:39:39 CST 2005


>
> This fundraising thermometer has definately impressed some people at 
> our sight. Thanks! We are almost at 75% of our fundraising goal.and it 
> is fun watching it grow.

I don't suppose you would be willing to share the URL of your site so it 
can be seen in action?

> Two questions
> 1) Would it be appropriate to add this script to pm-wiki site with 
> notes on how to get this type of PHP script working? I would like to 
> do that for part of my contribution to pm-wiki in general and this 
> script in particular. If it should be put on the site with 
> instructions where should I put it? It's a pretty short script so I'd 
> probable include the code in the text.

I think it would be fine.  As to where to put it, I don't really know - 
it's not really a cookbook (well maybe).  I would prefer that the source 
not be copied here (a link to my site would make sure that people would 
always get the most current version).

> 2) Would anyone know how to add a couple of lines of code to make it 
> look like the thermometer is bursting out the top whenever the 
> "Current" excedes the "Goal"?
> the code, currently, is at     http://www.arkie.net/~scripts/thermometer/

This can certainly be done.  I can think of  a couple of ways to code it....

1)  Use GD commands from PHP to draw the "burst".  This is probably the 
cleanest, but I'm not sure that it's ever going to knock your socks off 
(or if it does, it's going to take a BUNCH of code).

2)  Merge a predesigned burst with the generated thermometer.  This 
could be a cool solution, but it has a couple of down sides - first, if 
you want to keep the script generic it will have to scale (not easy) and 
second I don't think it's going to be easy to make the burst move (come 
on, you know you had already thought of it) - the graphic that is being 
generated is a PNG image and there isn't a standard animated PNG 
format.  I guess you could change the format to GIF (you would need to 
see if GIF support is available in your version of GD - 
http://php.net/gd) but....




More information about the pmwiki-users mailing list