One of the my yearly goals is to run 700 miles in 2008. I have a Garmin Forerunner 301 to keep track of times, routes, distance of individual workouts, lap times, and thinks like that. I also built a Google Spreadsheet with a block for every day of the year that sums up my results. The export of that can be found here. I wanted something that would remind me every day that I need to go run. Since I hit the front page of my blog every morning to check stats and see if any of my 4 readers posted a comment (they never do), I figured putting it on the front page was the way to go.
My first method was just editing the template and putting the values in. P.I.T.A. to do every day. No fun.
The next step was to invest some time in a WordPress plugin. I am fairly adept at PHP and WP makes a pretty easy system to put new plugins into your site. I’m happy to say version 0.1 is complete. You can download it at my WordPress download page– yes, there is only one for now. Here is a happy screen shot from this morning:
How does it work? It is pretty simple. When you activate the plugin, it creates a table in the database and defaults it with zeroed out data. When you use the plugin admin page located under the Options tab you can update you goal and progress. The new data is saved in the database.
To display this data to your end users, you need to call a function from within your template. My theme has a left_sidebar.php that I wanted to locate the box in. I created the box and populated the data with this code:
<h3>2008 Running</h3>
<ul>
<center>
<?php running_record(); ?>
</center>
</ul>
That is it! Pretty simple huh?
This is still a version 0.1, so it has some quirks. The “Miles Remaining” area on the data entry page looks like a form, and even though it is not edit-able it does not auto update. There is no uninstall feature yet (the database does not get cleaned up if you de-activate the plugin). I’m not sure I like located the console under the Options section. Minor gripes for sure, but it works pretty darn well for what it was intended to do.
Want to use it? Feel free! Enjoy!
Let me know if you have any suggestions. I might spend some more time polishing the plugin. Once I get it pretty nice I might even submit it to the main WordPress plugin repository site.
Cool stuff…may be pretty easy to modify that for some type of poker related stat tracking…like total hands played, etc.?
Yeah, it would not be that hard to do. I was going to do a similar one for those of us trying to drop a few pounds with a weight tracker.
If you want to come up with the stats you want to track, I can see how quickly I can whip a poker track one up. Of course over time, that one will have to get more complicated (live vs online, some stats displayed others not, etc.)