“Who ya gonna call?” “CODEBUSTERS”

No.

But the metaphor of Ghostbusters crossing the streams was inversely appropriate to a little bit of code action over the holidays (of which the actual action was nil).

But this was fun.

This nice tweet from John Johnston (who spawned the idea) reminded me of a WordPress plugin I had made

The WP Posted Today plugin is meant to offer a short code you can put on a site and it will list all previous posts on the current calendar day (this of course is useful if you actually still blog regularly) (cough) (cough).

Just for grins I checked the page where I use my own plugin. Yikes. Red Alert. It displayed all the ones for December 29 in years past, but the part where it should list how many there were was blank.

Red arrow points to missing number where the page output reads "There are posts previously published on December 29th"

I dug into my own code… and found myself a bit lost. Crossed. I was not even sure where I got the sprintf functions (John’s original code?) that were aimed to be compatible if anyone every wanted a language translation (maybe, or it’s just that thing when people code things differently).

Taking the path of least resistance, I took out the code where I think the problem was occurring and did it a more simple, but brute force way.

And it worked.

So I updated the version on GitHub and felt at peace with the world. In the off chance someone stumbled into my little corner of code, they would find something that works (or should work).

And then (here comes a stream crossing) Michael Hanscom @djwudi — someone I don’t think I’ve ever communicated with — tweets that he had seen pretty much the same bug and offered a fix.

https://twitter.com/djwudi/status/1212871226953101313

In looking at his post I saw the fix he made, and said– that’s better than mine! So I decided today to roll back my changes in place of Michael’s solution (but also keeping a modification I had made to remove extraneous calls when not needed for singular versus multiple results).

I noted the extra change he made in hos own version

Plus, I’ve made one other tweak to the plugin, so that it adds a link to the end of the excerpt to better handle “microblog” style entries that don’t have titles, so I still get to feel good about that part, as well. 🙂 My coding skills may be underdeveloped and rusty from lack of regular use, but they’re not entirely atrophied!

In this case, these microblog type entries (see Michael’s demo page) lack titles, so yes, a link is needed at the end of the post excerpt.

Yet I could see that regular posts (like on my site) did not need the extra link, and also, not everyone might want the arrow Michael likes.

I solved this cleverly by creating an additional shortcode parameter more which defaults to a blank string. In the shortcode function, we convert any attributes passed to variables with

extract(shortcode_atts( array( "month" => '', "day" => '', 'excerpt' => 1, 'more' => '' ), $atts ));

So on my site, where I just used the shortcode

There are 17 posts previously published on January 9th

  • 2023
    • Yes! Post by email lives (and finding hidden Jetpack modules) I am forgetting who’s blog post I read recently asking about doing blog posts by email… ah yes, thank for Inoreader, it was JR Dingwal who mentioned this in a new post about revitalizing blogging. Part of me was tempted to respond to JR and say Try Posterous! (old timer internet joke) Posterous was a […]
  • 2022
    • The Irony of Out (according to old reruns) I was never a full on fan of the Seinfeld show, and likely saw more of the later than the earlier ones. Just for something different, and avoid the plague of Netflix scrolling, Cori and I decided the other night to try a few episodes. We both were surprised at how much we laughed. But […]
  • 2019
    • Digging into an obscure WordPress Error; not quite Brain Surgery You are working on some project and just decide to look at an older WordPress site that should be just sitting there humming along, and see this… Fatal is not pretty. My hunch is that since it is a reference to “undefined function mysql_connect()” that it’s related to the changes in PHP 7 – I […]
  • 2017
    • CC Flickr Attribution Helper Now Helps Writers on Medium (while it lasts) Note: I posted this first on medium.com intended as a demo for this blog post. But it took a day to get around to this, so it might look like I am writing my stuff there. Not. This blog always comes first. Sort of. I often feel lonely fighting for attribution for photos openly shared […]
  • 2016
    • An Unexpected Affirmation for Why I Teach Serendipity would have no magic if it did not sneak up on you and lovingly whack you on the side of your normality. On a beautiful Saturday when I ought to be outside playing in the fresh snow, I am instead pounding away at this #%$*@ keyboard working on web sites. Finally, after getting a […]
  • 2015
    • DS106 in the MLA China Shop List crossing. Attending (and presented) yesterday at the Modern Language Association Conference here in Vancouver. I mingled with more rhetoricians then I usually do. I got to meet Sean Michael Morris and Jesse Strommel of Hybrid Pedagogy fame. My session yesterday was part of a panel on Visionary Pedagogies for the Twenty-First Century: Teaching the […]
  • 2013
    • Getting Your Own Meta Data in Your Own Photos You may not be aware of it, but your digital photos have more in them than colored pixels, modern cameras, mobile phones attach extra information that travels with the photo. This came up with discovery because a commenter on my site about returning a found camera asked about finding her own lost camera. I came […]
  • 2012
    • Lassie’s Trans-Species Truth on TED Stage Ben Rimes has coined a clever new ds106 assignment that plays with visual mashups – in Fantasy TED Talks you are given free reign to: Create a scene from a TED Talk being given by a fictional character. Obscure or well known, feel free to have your fictional character pontificating on their story, and their […]
    • Wrong End of Credentialing Stick cc licensed ( BY ND ) flickr photo shared by Tambako the Jaguar I am riding on a train, watching the archive of Higher-Ed Live interview with Audrey Waters. She and host Seth Odell are bantering about the possibilities of the hither to change everything MITx, the Stanford AI course and Open Badges as well […]
  • 2011
    • Even a Cat can Animate a GIF Almost as much as grey page backgrounds, under construction barricades, and nested HTML tables, few things define the web of the 1990s as the animated GIF. It’s been rewarding and nostalgic to see the wave of resurgence in the lead up to the ds106 open course that should lift off this week. It’s been fun […]
    • Turn it up to 2011 by  Kaptain Kobold  I sit in the Vino Volo wine bar at the Oakland airport milking the last minutes from a vacation tacked onto the holiday break…. Who would want this to end? I am buying another ticket to Denial Land. Where did I miss the line to stand in for the life of idle […]
  • 2008
    • I Give You These 15… 10 Twitter Commandments I leave it to Phillie Casablanca to issue the Twitter Commandments now available in pretty flickr form– to jump into parody mode, “I Give You These 15…. 10 Twitter Commandments”: I too think “commandment” is a bit strong, but the metaphor is not the point. And again, if you believe there are absolute “right” and […]
    • Meeting Cole Finally Get to Meet Cole posted 9 Jan ’08, 8.52pm MST PST on flickr I’ve "known" Cole Camplese for a number of years, though we had yet to meet… He came to speak at Maricopa last May, and wouldn’t you know it, the same week i was at University of Mary Washington. So our "knowing" […]
  • 2007
    • Blog Clog Not writing much this week. Looking for nouns. Must find noun…. Just kidding (not that the world would wobble off its axis if I focused on work rather than badly typing about it). January is ramping up with project intensity, still working with our drupal developers on getting the NMC Web site’s 2.0 version ready […]
    • Multiple Browsers = Impact of Web 2.0 flickr foto Multiple Browsers = Impact of Web 2.0available on flickr For reasons likely harder to write, I now have numerous iterations of myself at multiple web application sites, including 3 Google accounts (mail, reader, docs, calendar), 2 del.icio.us accounts, 3 flickr accounts. I hate having to log in and log out to do tasks, […]
  • 2005
    • Hero’s Journey Project Desperately Needs Web Programming/Design Update Help! I am in search of someone, some benevolent group, maybe a web design/development class project, willing to do an overhaul of a writing site that very much needs an update. Is this a lot to ask for? I just lack the time and resources to do it myself, and despite some flakiness, some 20,000 […]
    • Thrice Warned: Piracy Shy? Who reads the fine print any more? From the Stamp Out And Abolish Redundancy Department (apologies to Mad Magazine) comes the fine print on the back on an audio CD: Like the famous multiblade razors, the first warning (1) gets your attention. FBI Anti Piracy Warning: unauthorized copying is punishable under federal law. Then, in […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 17 posts previously published on January 9th

  • 2023
    • Yes! Post by email lives (and finding hidden Jetpack modules) I am forgetting who’s blog post I read recently asking about doing blog posts by email… ah yes, thank for Inoreader, it was JR Dingwal who mentioned this in a new post about revitalizing blogging. Part of me was tempted to respond to JR and say Try Posterous! (old timer internet joke) Posterous was a […] &amp#x27A1;
  • 2022
    • The Irony of Out (according to old reruns) I was never a full on fan of the Seinfeld show, and likely saw more of the later than the earlier ones. Just for something different, and avoid the plague of Netflix scrolling, Cori and I decided the other night to try a few episodes. We both were surprised at how much we laughed. But […] &amp#x27A1;
  • 2019
    • Digging into an obscure WordPress Error; not quite Brain Surgery You are working on some project and just decide to look at an older WordPress site that should be just sitting there humming along, and see this… Fatal is not pretty. My hunch is that since it is a reference to “undefined function mysql_connect()” that it’s related to the changes in PHP 7 – I […] &amp#x27A1;
  • 2017
  • 2016
    • An Unexpected Affirmation for Why I Teach Serendipity would have no magic if it did not sneak up on you and lovingly whack you on the side of your normality. On a beautiful Saturday when I ought to be outside playing in the fresh snow, I am instead pounding away at this #%$*@ keyboard working on web sites. Finally, after getting a […] &amp#x27A1;
  • 2015
    • DS106 in the MLA China Shop List crossing. Attending (and presented) yesterday at the Modern Language Association Conference here in Vancouver. I mingled with more rhetoricians then I usually do. I got to meet Sean Michael Morris and Jesse Strommel of Hybrid Pedagogy fame. My session yesterday was part of a panel on Visionary Pedagogies for the Twenty-First Century: Teaching the […] &amp#x27A1;
  • 2013
    • Getting Your Own Meta Data in Your Own Photos You may not be aware of it, but your digital photos have more in them than colored pixels, modern cameras, mobile phones attach extra information that travels with the photo. This came up with discovery because a commenter on my site about returning a found camera asked about finding her own lost camera. I came […] &amp#x27A1;
  • 2012
    • Lassie’s Trans-Species Truth on TED Stage Ben Rimes has coined a clever new ds106 assignment that plays with visual mashups – in Fantasy TED Talks you are given free reign to: Create a scene from a TED Talk being given by a fictional character. Obscure or well known, feel free to have your fictional character pontificating on their story, and their […] &amp#x27A1;
    • Wrong End of Credentialing Stick cc licensed ( BY ND ) flickr photo shared by Tambako the Jaguar I am riding on a train, watching the archive of Higher-Ed Live interview with Audrey Waters. She and host Seth Odell are bantering about the possibilities of the hither to change everything MITx, the Stanford AI course and Open Badges as well […] &amp#x27A1;
  • 2011
    • Even a Cat can Animate a GIF Almost as much as grey page backgrounds, under construction barricades, and nested HTML tables, few things define the web of the 1990s as the animated GIF. It’s been rewarding and nostalgic to see the wave of resurgence in the lead up to the ds106 open course that should lift off this week. It’s been fun […] &amp#x27A1;
    • Turn it up to 2011 by  Kaptain Kobold  I sit in the Vino Volo wine bar at the Oakland airport milking the last minutes from a vacation tacked onto the holiday break…. Who would want this to end? I am buying another ticket to Denial Land. Where did I miss the line to stand in for the life of idle […] &amp#x27A1;
  • 2008
    • I Give You These 15… 10 Twitter Commandments I leave it to Phillie Casablanca to issue the Twitter Commandments now available in pretty flickr form– to jump into parody mode, “I Give You These 15…. 10 Twitter Commandments”: I too think “commandment” is a bit strong, but the metaphor is not the point. And again, if you believe there are absolute “right” and […] &amp#x27A1;
    • Meeting Cole Finally Get to Meet Cole posted 9 Jan ’08, 8.52pm MST PST on flickr I’ve "known" Cole Camplese for a number of years, though we had yet to meet… He came to speak at Maricopa last May, and wouldn’t you know it, the same week i was at University of Mary Washington. So our "knowing" […] &amp#x27A1;
  • 2007
    • Blog Clog Not writing much this week. Looking for nouns. Must find noun…. Just kidding (not that the world would wobble off its axis if I focused on work rather than badly typing about it). January is ramping up with project intensity, still working with our drupal developers on getting the NMC Web site’s 2.0 version ready […] &amp#x27A1;
    • Multiple Browsers = Impact of Web 2.0 flickr foto Multiple Browsers = Impact of Web 2.0available on flickr For reasons likely harder to write, I now have numerous iterations of myself at multiple web application sites, including 3 Google accounts (mail, reader, docs, calendar), 2 del.icio.us accounts, 3 flickr accounts. I hate having to log in and log out to do tasks, […] &amp#x27A1;
  • 2005
    • Hero’s Journey Project Desperately Needs Web Programming/Design Update Help! I am in search of someone, some benevolent group, maybe a web design/development class project, willing to do an overhaul of a writing site that very much needs an update. Is this a lot to ask for? I just lack the time and resources to do it myself, and despite some flakiness, some 20,000 […] &amp#x27A1;
    • Thrice Warned: Piracy Shy? Who reads the fine print any more? From the Stamp Out And Abolish Redundancy Department (apologies to Mad Magazine) comes the fine print on the back on an audio CD: Like the famous multiblade razors, the first warning (1) gets your attention. FBI Anti Piracy Warning: unauthorized copying is punishable under federal law. Then, in […] &amp#x27A1;
to get the arrow codes he likes. This works because output for each found post looks like

// output post and link
			
$output .= '
  • ' . get_the_title() . ''; // display excerpt if we want it if ( $excerpt ) $output .= ' ' . get_the_excerpt(); // for microblog output where there might not be titles so add a link at end // h/t https://www.michaelhanscom.com/eclecticism/2020/01/02/rss-feed-weirdness-and-php-debugging/ $output .= ' ' . $more . '
  • ';

    So how is that for the odds of streams crossing on the same obscure bit of code? That’s the old fashioned kind of net serendipity that still happens.

    Thanks Michael! Check out his 20 year old blog, he’s an “Enthusiastically Ambiverted Hopepunk” quite the tag line.


    Featured Image: Edit of the Ghostbusters Cross Streams scene found in the Ghostbusters Fandom Wiki site which states “Community content is available under CC-BY-SA unless otherwise noted.” I replaced part of the background with a screenshot of the WP Posted Today PHP code.

    If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
    Become a patron at Patreon!
    Profile Picture for CogDog The Blog
    An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca

    Leave a Reply

    Your email address will not be published. Required fields are marked *