Current version: 0.1
Released on: 31 May 2005
License: GPL
Live demo: Kris's powerlifting PR matrix
Download: tsampaprtable01.zip (5.7K)


tsampaPRtable is a PHP script to render a personal record matrix out of a plain textfile. It was written after I got bloody tired of having to mess around with <td> tags in my html pr matrix every month (and getting it wrong). It was written with powerlifting in mind, but could just as well be used for tracking personal bests in any sport or even to manage non-PR oriented tables, such as the numbers of sushi rolls eaten every month (it's easy to ditch the PR column to list non-PR data).

The virgin version is not the most beautiful code I've written (the word spaghetti springs to mind), but it does what it is supposed to do at a reasonable speed. That said, you might want to run tsampaPRtable manually or as a cron job to render a plain html file out of it to lessen server load.

The script ships as a standalone solution with the code, html and css in a single file: basically you only need to plug in your own pr file and you're golden. Of course, if you know basic PHP, it is trivial to cut out the function and use it as you see fit. There's also several variables you can tweak at the beginning of the script to customize such things as language and column widths. Also note that the script supports listing only PRs falling within a certain timeframe making it easy to maintain yearly PR matrixes while still using a single PR file.

Feature history

  • list subset of pr file between any dates or up to the current year/month
  • darken out all months prior to first recorded PR on all exercises <td class="inactive">
  • transparent image used to force the width of the cells to counter those browsers that try to squeeze the table into the width of the screen without regard for the <td width="xx"> tags.
  • can list the timeline (months) every X lines to make it easier to follow
  • besides the chronological listing, the script optionally also adds a PR column to make it easy to see all current PRs side-by-side.
  • optional remarks field where meta information such as injuries and routine changes can be noted to put some context around the PRs.
  • spits out valid XHTML 1.1 (checked with the The W3C Markup Validation Service).