Free icons Wordpress Blogroll Timestamp/Time Since plugin

Current version: 1.1
Difficulty level: Medium-Easy Golden starGolden starGolden starGray starGray star

This is a plugin that allows you to put on your blogroll a "Last updated" timestamp that measures how long ago the links were updated from the present moment. So for example, you would see on my present blogroll that the links were updated ~hours/~days/ago.

I cannot guarantee that this will work for all versions of WordPress, but it worked for mine (2.1.2, 2.2.1, 2.3.1) and I see no reason why it shouldn't work on all later versions as well.

What you'll need:

Note: if you have WordPress 2.1.2 or later, you have to open the wp_links table with phpMyAdmin and change the "links_updated" Type from DATETIME to TIMESTAMP and the Default from 0000 00-00 00:00 to the checkbox CURRENT_TIMESTAMP. If you know of any way I can update this dynamically from a php call to the MySql database please let me know so that I can implement it.


What I assume:

That you are displaying your links using the get_links call of the following form:

<?php get_links('-1', '<p>', '</p>', ' '
, FALSE, '_id', TRUE, TRUE, 7, TRUE); ?>

Deprecated, I know, but WordPress still has backwards compatibility.


More information about the template tag can be retrieved from the Codex Remember, the last value should be set to TRUE. The 7 is just there as an example.


What to do:

1. Download and open blogrolltimesince.php and edit the line $timeoffset to the offset your blog is currently set at. (If you're on the East Coast, that would be -4). This value must be in sync with the value that is defined in your admin section, under "Options >> General >> Times in the weblog should differ by".

2. Upload blogrolltimesince.php to your /wp-content/plugins directory and activate it through your blog interface.

3. Go to your http://www.myblog.com/wp-admin/options.php page and find the links_updated_date_format box. Change whatever's inside to

Uwhich is shorthand for the Unix Epoch. This allows you to subtract the current time from a base time to calculate how long ago your blogroll was updated.

4. Open index.php and add the following to wherever you want to timestamp to appear.

<?php print_time(); ?>

5. I don't suppose you'll need an "Updated ~weeks ago" but if you do, I assume you can do the math and fix the above to suit your needs.