I fixed a bug I uncovered earlier this week where articles were sorted wrong when displaying their tag. I thought Id set the sorting up correctly, but found that I didnt change the compare option. Perl is a bit picky when using <=>
vs. cmp
. One is for numbers, one is for text, and I used the wrong one. Fixed!
Today, I added in a couple of statistics to my race tracking page that Id been looking to add. Specifically, Ive added in the a total race count, along with the personal records (bests) and counts for the top race types. Note that these are for races in the pastfuture races wont count yet.
I actually have stats for the any race type entered, but chose to limit it to keep the list manageable. I probably should add filters to exclude races, although an easy way to do that is to add a letter to the time. The counts and PRs must be parsable times in hours:minutes:seconds.fractions, or some portion of that. Adding any letters, or leaving the time blank, will not increment that races count.
Two changes for tonight. I fixed the sort when displaying the articles written. This took a bit longer due to the way the code has to search for the author.
The other change is to display a badge for races that need timesassuming you are logged in and have created races. Id forgotten to update a race earlier this week, so it seemed fitting to have a reminder. Plus, I already had the code open from yesterdays change.
As a side note, all these changes are just screaming at me to optimize the code. If the task wasnt so large, and the fun Im having adding features, I would have already made progress.
Okay, Im on a roll today. I wanted a way to highlight when changes were made, so I reused the badge code for IMs to display changes within the last 7 days. Given that I dont track if you view a change, the hard cutoff was easiest. I might increase the number later if I find the changes are rolling off too quickly.
Finished updating the site to use published date instead of the article ID as the sort. The top news and previous next buttons are working. Im sure I need to fix some other items, but the major stuff is working.
To my surprise, I didnt need to edit the RSS creator as it already uses published date. Win!
As a bonus, I was able to add a previous button to the main news page. In fact, it was a pretty easy fix. I just had to add one to the max news variable, saving an extra article. When I print the news, I check if that extra article exists and, if it does, displays it as a button instead.