PHPImages

Summary: Generate on-the-fly graphics within a PmWiki page using a PHP script.
Version:
Prerequisites:
Status:
Maintainer: David Sovinski (Caspian)
Category: Images

Questions answered by this recipe

Generate on-the-fly graphics within a pmwiki page using a PHP script.

Description

(:Display PHP built graphics on the fly using PHP Image functions:)

Notes

One of the organizations I work with wanted to display a Thermometer / Goal Graph that would indicate the current status of our fundraiser graphically.

I found a PHP Thermometer / Goal Graph at http://www.arkie.net/~scripts/thermometer/ but didn't know how to call it from within pmWiki. So I posted to the pmwiki-users group and Wendell Brown answered. He let me know he was the writer of the program. He was also able show me how to implement it in pmwiki. Thanks Wendell!

From that page I copied everything between
-------- Script Starts Here -------
and
-------- Script Ends Here -------
and saved it to a file called thermometer.php.

I uploaded this file to the pmwiki/scripts directory and called it from within the body of a pmwiki page as follows:

http://www.mysitename.org/pmwiki/scripts/thermometer.php?Current=3000&Goal=10000&Width=80&Height=350&Font=1?format=.png

Using this style of programming we were able to instantly change the parameters of the Thermometer / Goal Graph from within the pmwiki page and display the new results.

You can look at http://pmwiki.org/wiki/PmWiki/Images to see how you can wrap text around images

Later, I modified Wendell's program to add a "blow off the top" feature so when the goal was reached or exceeded there would be a mini-explosion of the Thermometer / Goal Graph.

You can see the code to make these images here: thermometer.phpΔ

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

Comments

See Also

  • Goal Meter Based on this script, developed into standard recipe, for highly customisable goal thermometers

Contributors