“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 15 posts previously published on March 31st

  • 2016
    • I’m Immortalized in Google Street View! Late last May I was driving north from home when I saw a car coming down the hill with a prominent tower atop its roof; I was pretty sure it was a Google Streetview vehicle, but could no get my phone out of lock mode to take a photo, but I did the next best […]
  • 2014
    • Behind a Cowbird My being inspired to write a story on cowbird is a likely correlation with spending last week visiting Barbara Ganley. Because I urge my students to share the story behind a story, the one I wrote last night A Stranger Rummaged Through My Suitcase came from my unpacking experience. It was hardly the first time […]
  • 2013
    • Automating Song Info to Ladiocast cc licensed ( BY NC SA ) flickr photo shared by volperic Late night fiddling, don’t ask why– I was doing my photo editing and saw nothing on #ds106 radio, so set out to play somethimg from iTunes. For some reason, Nicecast no longer allows me to select an application as a source (Maybe because […]
  • 2011
    • New! Improved! Code! Five Card Flickr Stories I was way overdue in rolling some updates into the source code (available on google code) for my Five Card Flickr Stories site. Before my departure from NMC, I moved the site from their servers to my own, so the new main site is at http://5card.cogdogblog.com/ (I left a URL redirect on the NMC site, […]
  • 2010
    • Honey, I Shrunk the Bava! Nothing is more fun on the internet then playing smack down with Jim Groom. He is relentless, but like a good tussle with that rubber stretch toy, I wont give in easily. Over the last few days, though, poor bava boy Jim was been shrinking in stature. It started out when his endless twitter stream […]
    • Deciphering the Wired/iPad Tea Leaves I was thumbing through the current issue of Wired Magazine (yes, my analog, arrived in snail mail, maybe delivered by Pony Express version). In very small print on the table of contents, under “New Media” was an interesting note. We’ve collaborated with Adobe to develop the Wired Reader, which will run on pretty much any […]
  • 2008
    • Thanks to Twitter, I Have a Tweet Cloud Thanks to Twitter, I Have a Tweet Cloud by cogdogblog posted 31 Mar ’08, 10.03pm MDT PST on flickr I was intrigued when the Good Doctor Bryan Alexander blogged his discovery of a twitter cloud tool. Tweetclouds generates this once granted your tiwtter user name. I wanted one! Bryan has one! But when I tried […]
    • Upping WP WordPress 2.5 has been out a few days, what am I waiting for? Actually for my Dreamhost hosted sites, the upgrade is a brainless click with its One Click install/upgrades. I am done. Well not completely, the whole admin interface is different! It has that new car WordPress.com smell, the old blue is gone, we […]
  • 2006
    • Feed2JS Changes / Roadmap Next week brings a lot of changes for Feed2JS— just posted to our Updates are a number of things that affect users of our site: The first week of April 2006 brings a number of changes in Feed2JS, all to make it bigger and better. First of all, anyone using the primary “jade” server at […]
    • YAW2L Yet Another Web 2.0 List. All Things Web 2.0 – “THE LIST”: Although I continue to be repulsed by the term Web 2.0, I still thought I was keeping pretty current until I took a look at Bob’s list. While there are alot of Me2Web2 projects on the list, there’s a lot that aren’t. Browsing […]
    • From Shanghai To Scottsdale It was March 27 ordered and on its way March 30 and due to arrive April 4. From China to Scottsdale in 6 days. I knew the thing was fast, but zowie!  Share this barking on social media
    • Bye Bye Bike Locker A week from tomorrow is my last day at Maricopa. I’ll turn in my badge and key and leave the building. Today, I cleaned out another place I’ve occupied for a long while — my cubby in the downstairs locker room. For the last 10? 11? years, I have occupied locker #1 here (top right […]
  • 2005
    • Skyperviews Up to 21 I keep recording the audio “skyperview” and “iRiverView” interviews I am doing for the upcoming article I am not yet writing, and have 21 now in the collection: http://www.mcli.dist.maricopa.edu/forum/spr05/podcast.html Most of these were colleagues I cornered with my mp3 recorder, as well as a few more audio devices So added to the list: * Eric […]
    • Carbon Copy Cloner: Cloning (hard-dives) is Not A Dream Carbon Copy Cloner is worth 12 stars out of 10 for a Mac OS X application. After a rebuild of the OS on our XServe (that powers this blog and Feed2JS), our temporary solution was to build the OS on an external Firewire drive loaned by a helpful Apple engineer who trouble shooted our server […]
  • 2004
    • MLX Great Package Race: The Sprint to the Finish Line Months of pleading, cajoling, nagging our folks to contribute to the Maricopa Learning eXchange produced a fair stream of new items, but the 2 days prior to the close of our “Great Package Race” is when most of the action takes place. This is where we tabulate for a 6 month period how many MLX […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 15 posts previously published on March 31st

  • 2016
    • I’m Immortalized in Google Street View! Late last May I was driving north from home when I saw a car coming down the hill with a prominent tower atop its roof; I was pretty sure it was a Google Streetview vehicle, but could no get my phone out of lock mode to take a photo, but I did the next best […] &amp#x27A1;
  • 2014
    • Behind a Cowbird My being inspired to write a story on cowbird is a likely correlation with spending last week visiting Barbara Ganley. Because I urge my students to share the story behind a story, the one I wrote last night A Stranger Rummaged Through My Suitcase came from my unpacking experience. It was hardly the first time […] &amp#x27A1;
  • 2013
    • Automating Song Info to Ladiocast cc licensed ( BY NC SA ) flickr photo shared by volperic Late night fiddling, don’t ask why– I was doing my photo editing and saw nothing on #ds106 radio, so set out to play somethimg from iTunes. For some reason, Nicecast no longer allows me to select an application as a source (Maybe because […] &amp#x27A1;
  • 2011
    • New! Improved! Code! Five Card Flickr Stories I was way overdue in rolling some updates into the source code (available on google code) for my Five Card Flickr Stories site. Before my departure from NMC, I moved the site from their servers to my own, so the new main site is at http://5card.cogdogblog.com/ (I left a URL redirect on the NMC site, […] &amp#x27A1;
  • 2010
    • Honey, I Shrunk the Bava! Nothing is more fun on the internet then playing smack down with Jim Groom. He is relentless, but like a good tussle with that rubber stretch toy, I wont give in easily. Over the last few days, though, poor bava boy Jim was been shrinking in stature. It started out when his endless twitter stream […] &amp#x27A1;
    • Deciphering the Wired/iPad Tea Leaves I was thumbing through the current issue of Wired Magazine (yes, my analog, arrived in snail mail, maybe delivered by Pony Express version). In very small print on the table of contents, under “New Media” was an interesting note. We’ve collaborated with Adobe to develop the Wired Reader, which will run on pretty much any […] &amp#x27A1;
  • 2008
    • Thanks to Twitter, I Have a Tweet Cloud Thanks to Twitter, I Have a Tweet Cloud by cogdogblog posted 31 Mar ’08, 10.03pm MDT PST on flickr I was intrigued when the Good Doctor Bryan Alexander blogged his discovery of a twitter cloud tool. Tweetclouds generates this once granted your tiwtter user name. I wanted one! Bryan has one! But when I tried […] &amp#x27A1;
    • Upping WP WordPress 2.5 has been out a few days, what am I waiting for? Actually for my Dreamhost hosted sites, the upgrade is a brainless click with its One Click install/upgrades. I am done. Well not completely, the whole admin interface is different! It has that new car WordPress.com smell, the old blue is gone, we […] &amp#x27A1;
  • 2006
    • Feed2JS Changes / Roadmap Next week brings a lot of changes for Feed2JS— just posted to our Updates are a number of things that affect users of our site: The first week of April 2006 brings a number of changes in Feed2JS, all to make it bigger and better. First of all, anyone using the primary “jade” server at […] &amp#x27A1;
    • YAW2L Yet Another Web 2.0 List. All Things Web 2.0 – “THE LIST”: Although I continue to be repulsed by the term Web 2.0, I still thought I was keeping pretty current until I took a look at Bob’s list. While there are alot of Me2Web2 projects on the list, there’s a lot that aren’t. Browsing […] &amp#x27A1;
    • From Shanghai To Scottsdale It was March 27 ordered and on its way March 30 and due to arrive April 4. From China to Scottsdale in 6 days. I knew the thing was fast, but zowie!  Share this barking on social media &amp#x27A1;
    • Bye Bye Bike Locker A week from tomorrow is my last day at Maricopa. I’ll turn in my badge and key and leave the building. Today, I cleaned out another place I’ve occupied for a long while — my cubby in the downstairs locker room. For the last 10? 11? years, I have occupied locker #1 here (top right […] &amp#x27A1;
  • 2005
    • Skyperviews Up to 21 I keep recording the audio “skyperview” and “iRiverView” interviews I am doing for the upcoming article I am not yet writing, and have 21 now in the collection: http://www.mcli.dist.maricopa.edu/forum/spr05/podcast.html Most of these were colleagues I cornered with my mp3 recorder, as well as a few more audio devices So added to the list: * Eric […] &amp#x27A1;
    • Carbon Copy Cloner: Cloning (hard-dives) is Not A Dream Carbon Copy Cloner is worth 12 stars out of 10 for a Mac OS X application. After a rebuild of the OS on our XServe (that powers this blog and Feed2JS), our temporary solution was to build the OS on an external Firewire drive loaned by a helpful Apple engineer who trouble shooted our server […] &amp#x27A1;
  • 2004
    • MLX Great Package Race: The Sprint to the Finish Line Months of pleading, cajoling, nagging our folks to contribute to the Maricopa Learning eXchange produced a fair stream of new items, but the 2 days prior to the close of our “Great Package Race” is when most of the action takes place. This is where we tabulate for a 6 month period how many MLX […] &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 *