' freenerd '

berlin based nerd doing tech and music

wp-pulse-meter 0.2

14.01.09 – 23:03

During the redesign of the blog I have also refactored the wp-pulse Plugin I’m using in the sidebar for showing my blog activity. The changes I have done affect the way, the curve is drawn. The initial version I’m forking from is called wp-pulse and has been released by Skybly. I decided to release my version.

Download wp-pulse-meter.zip here

What it does:

wp-pulse-meter-02

Pulse meter is a WordPress Plugin, that shows you a graphical representation of your blogs activity (posts and comments) over time as a pulse graph image.

How to use it:

  • Download the Plugin here
  • Extract the wp-pulse-meter.php and put it into wp-content/plugins/
  • Create a directory (default: wp-images/wp-pulse-meter/) and make it writable
  • Call the function showPulseMeterImg() from where the image should show up. Attention: The function only returns the img-tag. Output it with echo or print.
  • Activate the Plugin

Example of Usage:

echo showPulseMeterImg($alwayscreatenew = true, $pulseScope = 30, $width = 200, $height = 50, $bgcolor = 'fDfDfD', $linecolor = 'CC7777');

Parameters:

showPulseMeterImg($alwaysCreateNew = 'false', $pulseScope = 30,
$width = 200, $height = 50, $bgcolor = 'FFFFFF', $linecolor = '000000', $paddingx = 5, $paddingy = 5, $fade = 1, $id = 'wppulsemeter', $path = 'wp-images/wp-pulse-meter/')

  • $alwaysCreateNew | If “true”, the image will be always redrawn with every call. Helpfull if you want to instantly see changes to the following parameters
  • $pulseScope | The number of days shown on the graph
  • $width $height | Dimension of the image
  • $bgcolor $linecolor | Color of background and graph
  • $paddingx / $paddingy | The number of pixel that the graph will always keep distance to the image border
  • $id | css id of the image
  • $path | Path to the directory the image is going to be saved in

How it works:

The function looks every day, if there is already a picture for the current day drawn. If not (there is no properly named picture in the directory) a new one is drawn. This will happen the first time the blog is accessed after midnight. Now, all posts and comments within the pulse scope are fetched. For every day in the scope, the posts and comments will be summed up and shown as a up-down peak on the graph. In the end, the graph image will be saved and the html img-tag will be returned. The graph is always scaled, so that the day with the highest peak uses the maximum height.

Changelog:
0.2:
- first release with new graph drawing

Todo:
– Enable widget functionallity for easy use in WordPress

  1. 2 Responses to “wp-pulse-meter 0.2”

  2. nice

    By andi on Jan 15, 2009

  1. 1 Trackback(s)

  2. Jan 15, 2009: Posts about WordPress Plugins as of January 15, 2009 | The Lessnau Lounge

Sorry, comments for this entry are closed at this time.