One Year Ago Widget

June 04, 2007 By: erik Category: Geeky, Wordpress 1,896 views

Rate this post:
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

This blog, in its present form, turned one year old this past weekend. It was a solemn single-candle ceremony.

To look back over the previous trip around the sun, I’ve added a new feature to the sidebar called “One Year Ago”, which displays three posts from one year ago. It’s kind of a hacked up version of the One Year Ago WordPress Plugin using my famous Widgetize Anything plugin.

The code used inside the body of the widget is as follows:

$dateago = (date('Y') - 1) . date('-m-d');
global $wpdb;
$entries = $wpdb->get_results("SELECT *
    FROM $wpdb->posts
    WHERE post_status = 'publish' and post_date >= '$dateago'
    ORDER BY post_date asc limit 3");
if ($entries)
{
  echo '<ul id="oneYearAgo">';
  foreach ($entries as $entry)
  {
    $post_date = date('F j, Y', strtotime($entry->post_date));
    echo "<li><a href=\"" . get_permalink($entry->ID) .
        "\" title=\"Posted on $post_date\"" .
        " class=\"tooltipped\">$entry->post_title</a></li>";
  }
  echo '</ul>';
}

You are now free to reminisce to your heart’s content.

 
  • http://rainypamplona.blogspot.com/ Theresa

    Happy Blogoversary, or watever you call it. My computer’s been down so I haven’t been doing much blogging for the last few days. I checked out your pics of Vitoria, looks like you’ve got a nice bunch of future in-laws there. So, has your future family-in-law started you on your Spanish Culture Master yet? It includes things like being able to: say who Marisol, Chiquito de la Calzada, and Tip y Col were, identify the song “Mi Carro” and know who sings it, give the ingredients for Pisto Manchego. This is just a sample of the many things you need to know to become part of a Spanish family. I’ll be coming back to check on your progress soon, so start studying.

  • http://www.erik-rasmussen.com/ erik

    Of the things listed, I do actually know Mi Carro, and can at least sing along to the often repeated ¿Dónde estará mi carro? chorus lines. I downloaded the Escobar discography for my future mother-in-law last year.

    I also know what pisto is and could name the ingredients. I’ve never heard it called Pisto Manchego, but a google search seems to confirm that it’s the same thing.

    As for the other items, well… I’ve been told a lot of things that I haven’t retained. Every time I see them, I’m told, ¡Todavía te quedan muchas cosas para aprender! This is usually followed by some trick about how to keep a burro cool in the summer sun using only three figs, some rope, and a shovel.

    And the truth is that I’m just not that interested in Rocío Jurado or Isabel Pantoja and all that Marbella saga. But then Marga has never seen Star Wars and doesn’t know who Van Morrison or Led Zeppelin is, so I get off the hook for not being completely drenched in Spanish culture.

    At least I know how to make lengua.

  • http://rainypamplona.blogspot.com/ Theresa

    Marga hasn’t seen Star Wars? How old is she? So how do you keep a burro cool in the summer sun with three figs, some rope, and a shovel? That could be highly useful, you never know when you’ll find yourself out with an overheated burro. Lengua, hmmm, that’s not one of my favorite dishes – Give me a good “Cocido” any day.

  • http://www.erik-rasmussen.com/ erik

    She’s 30, but just never been interested in sci-fi movies. No Trek either.

  • Betsy

    What is Cocido? When I plugged it into my handy-dandy translator it told me it means “cooked”.

    Are you going to tell us about the burro, figs and rope? or was that just a hypothetical jokester attempt to mess with your Spanish?

  • http://www.erik-rasmussen.com/ erik

    Yes, it literally means “cooked”. But it also means “stew”. One of the more common usages of cocido with that meaning is a cocido montañés, which is a common dish from Cantabria with beans and meat. If you’d searched my blog, you’d have found pictures of it here.

    I was being the hypothetical jokester on that one. I meant that the things that they claim I need to learn are very often some rural farm trick that their grandfather taught them 50 years ago when children went to school for 5 years and then began working on the farm (and therefore useless and often uninteresting to me).

    The other day I learned that Marga’s grandfather didn’t learn to read until he was in the military. Pretty different from my two PhD grandfathers.

  • Marc

    Are you going to upgrade that plugin to WP 2.5? Or is it already running?

    I really need this plugin!

  • http://www.erik-rasmussen.com/ Erik R.

    Yes, Marc, it seems to work.

  • Thomas

    $a is never used, is it?

    • http://www.erik-rasmussen.com/ Erik R.

      You are absolutely correct, Thomas. I’ve removed it. Thanks.