{todayayearago}

Another Blogsome user was wanting to use {todayayearago} to get posts from a week ago, which reminded me I do it with a month ago. Looking through the source to see if a weekly one exists (it doesn’t, as yet), I came across this little nugget:

1    function todayayearago( $when, $wpblog, $spacer ='<br /' )

Now, ignoring the apparent typo (I think there should in fact be a closing tag to that there BR tag…), what do you see that is notable? That’s right, you can choose a different blog. So I tried this with my test blog:

 1    {todayayearago when='month' wpblog='schinckel'}
 2    {if $todayayearago != ''}
 3        <h2>A Month Ago</h2>
 4            <ul>
 5                {foreach from=$todayayearago key=id item=details}
 6                    <li>
 7                        <a href="{get_permalink id=$id}" title="{$details.content|truncate:25:"..."}">
 8                            {$details.title|truncate:20:"..."}
 9                        </a>
10                    </li>
11                {/foreach}
12            </ul>
13    {/if}

Now, this gives some very interesting results. Firstly, it works, except for the part that tries to get the permalink:

href="{get_permalink id=$id}"

This fails, because it (naturally) tries to grab the permalink from the current blog, not the other one. My next step was to see if {get_permalink} can handle an argument like wp_blog. The sad news is it can’t. So, the next question is: does the URL get returned in the data structure along with the content and title. I suspect so, but need to see how. Looking through the source of wp-db.php doesn’t throw much light on the topic, so it’s time for trial and error. That’s what a test blog is for, after all! Aha! You can see most of what happens from the todayayearago file itself:

1    foreach( $reqhistory as $row )
2    {
3     $todayayearago[ $row->ID ] = array( "title" => strip_tags( stripslashes($row->post_title) ),
4      "content" => strip_tags( stripslashes( $row->post_content ) ) );
5    }

Which clearly shows that only the title and content are ‘grabbed’. So, until I rewrite this function (so it includes the URL, and perhaps even so it allows for other intervals), it’s use is still limited to posts within your own blog, from either a year or a month ago. Unless I can find a way to get post data from another blog’s database…

Schickel

One of my students today told me she had seen a poster for a band named after me. I did a little research (they played at Flinders Uni last Friday), and came up with this poster:

As you can see, it’s pretty close. You can read about this band over on Music SA’s Schickel page, or the Official Schickel Website, and even listen to a track. It’s not too bad, actually.

BeeDogs - If..Else Log

BeeDogs - If..Else Log

Beedogs.com is the premier online repository for pictures of dogs in bee costumes.

Sort of implies there are several repositories, doesn’t it?