Flu Pandemic Level


Flu Pandemic Level is a WordPress plugin that will fetch the current WHO (World Health Organisation) phase of pandemic alert.

Download

Download Flu Pandemic Level (v1.3, 21/07/2010)

Changelog

Version 1.0

  • Initial release

Version 1.1

  • Tidied up code
  • Re-tested to ensure that level extraction still works

Version 1.2

  • Flu level is now cached – by default for 24 hours
  • New cache tag added so that default cache time can be changed
  • Added new inline tag that can be used within posts and pages to display the flu level
  • New function added to output error messages

Version 1.3

  • Wording on WHO site had changed so this plugin has stopped working – corrected

Installation

  1. Upload the entire flu-pandemic-level folder to your wp-content/plugins/ directory.
  2. Ensure the cache folder within the plugins folder is fully writable – ie. change its permissions to 777.
  3. Activate the plugin through the ‘Plugins’ menu in WordPress.
  4. There is no options screen.

Configuration

From version 1.2 a cache system is used -  please read the installation notes for ensuring that the new caching facility correctly works

This plugin reads the WHO (World Health Organisation) website and fetch the current phase of pandemic alert. You can also find full descriptions for the phases on this site. The phase is a number between 1 and 6.

The phase is not displayed, but is returned by the plugin. So, to display the phase you might code…

<php echo flu_pandemic_level(); ?>

Alternatively, you can simply use the plugin to return the phase for use in some further code.

The following is an example of how it could be used, with a function_exists check so that it doesn’t cause problems if the plugin is not active…

<?php if (function_exists('flu_pandemic_level')) : ?>
<?php echo flu_pandemic_level(); ?>
<?php endif; ?>

From version 1.2, you can (optionally) pass a parameter of cache= followed by a number. This represents the number of hours that a cache should be retained. If this is set to “NO” then caching will be turned off. For example…

<?php echo flu_pandemic_level('cache=6'); ?>

Also from version 1.2 onwards, you can request the pandemic level to be listed “inline”, from within your post/page. Simply place the tag 3 within your post/page and it will be replaced by the current flu level number.

Problems/Queries

Please report any problems, or suggestions for enhancements, to me either via my contact form or by commenting on the appropriate entries on my blog.

Updates

Updates to this and any other of my WordPress plugins will be published on this blog.

Subscribe to my WordPress category feed.


Share this on del.icio.us Digg this! Email this Share this on Facebook Share this on LinkedIn Send this page to Print Friendly Share this on Reddit Share it on StumbleUpon Tweet This!

3 Comments


  1. Hey great plugin its very usefull but the line “The current WHO phase of pandemic alert is” was changed to “The current WHO phase of pandemic alert for avian influenza is”
    and need to be updated on the code or you get an error =)


  2. Thanks for letting me know – I’ll get the plugin updated today.


  3. The WHO site change again the text to “The current WHO phase of pandemic alert for avian influenza H5N1 is ” but i change the quoted line and got this “Flu Pandemic Level: The WHO page is not in the expected format.”

1 Pingback/Trackback

No Tweetbacks


  1. Hey great plugin its very usefull but the line “The current WHO phase of pandemic alert is” was changed to “The current WHO phase of pandemic alert for avian influenza is”
    and need to be updated on the code or you get an error =)


  2. Thanks for letting me know – I’ll get the plugin updated today.


  3. The WHO site change again the text to “The current WHO phase of pandemic alert for avian influenza H5N1 is ” but i change the quoted line and got this “Flu Pandemic Level: The WHO page is not in the expected format.”

Leave a Comment

All comments are authorised before appearing - you should receive an email once this has been done.

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

49 queries in 0.895 seconds.