“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 12 posts previously published on September 29th

  • 2020
    • The Ring Drone Zone As soon as Chris Gilliard shared the flying Ring drone my mind went to free association. It went back to the Twilight Zone episode “The Invaders” just for those scenes of Agnes Moorehead whacking at the flying invaders in her cabin. This episode is brilliant on so many levels, especially for the lack of dialogue. […]
  • 2019
    • Lacktribution: Be Like Everyone Else Go ahead, be a copycat. Down at number 111 of the 2019 Top Tool for learning is a site I use often myself for finding images available for reuse, pixabay. The rank is anything I care about. Among the comments: “Free images, you do not have to attribute, good selection.” Instructional Designer, USA “As with […]
  • 2009
    • Intel Sponsored Me into Tomorrow In my late night fiddling with my stream of Weird S*** Web sites, I stumbled into “Sponsors of Tomorrow”, which takes an uploaded photo of you, and melds it into a hideous video of some dorko Tom Cruis-ish type character. The photo used was my mugshot-like passport photo. I warned you of the weirdness: How […]
  • 2008
    • Ixy in Your Pocket? Can You Say Ixy? by cogdogblog posted 29 Sep ’08, 8.20am MDT PST on flickr Japanese electronics stores carry many new camera models before they hit the states. This new pocket digital camera form Canon, the IXY series, can take images in 14.7 MegaPixels and 3200 ISO. Wow! 14.7 MegaPixels in a pocket camera! That […]
  • 2007
    • Three Amigos Kerpoofing It Three Amigos Kerpoofing It posted 29 Sep ’07, 12.51pm MDT PST on flickr Working on our "teaser" for the K12 Online conference… Played a little with this fun tool for creating cartoon graphics, www.kerpoof.com – harder to figure out how to embed or create linked stories. Last Flickr blog post (for now). Must run out […]
    • Picnik Let’s Us Really Play With Photos Picnik Let’s Us Really Play With Photos posted 25 Sep ’07, 9.18pm MDT PST on flickr Fresa and Kasha are rather excited about the new features in picnik, the free online photo editor that lets you modify images from flickr, facebook, photobucket, your desktop, and then save back to these sites. The new tools allow […]
    • ICanHazAirlineTickets ICanHasAirlineTickets posted 29 Sep ’07, 2.38pm MDT PST on flickr If you have not caught the I CAN HAS CHEEZBURGER craze, you are about 1 meme behind. It is a subset of the broader genre of LOL CATS. I created my oen with the ICanHazCheezBurger Factory, a site where you can browse a vast set […]
    • I CN HZ TWEETS I CN HZ TWEETS posted 29 Sep ’07, 2.06pm MDT PST on flickr Twitter is cheezing my tweets again. Am ready to coin the term "Cheez Tweetos" – sort of eCheese Its lacking the orange crud on your fingers (though blue bird feathers works fine for debris) Copy your tweets to your clipboard before “updating” […]
  • 2006
    • Second Prize in a Virtual Photo Contest flickr foto It’s not everydayavailable on flickr …that yours truly comes second in a beauty contest. This happened a few months back, but was reminded when iw as organizing some directories on my laptop. I’ve been spending some time recently in Second Life, drumming up events and activities for the NMC Campus — it is […]
  • 2005
    • Lies, Damn Lies, and Blog Statistics Over on the Learning Circuits Blog, David Lee just posted Blogging by The Numbers about attempts to draw some meaningful data out of this Blogger hosted blog (since Blogger provides no data, he is using the add-ons from SiteMeter and Bravenet. He then asks: * Are there metrics you see as key when looking at […]
  • 2004
    • MLX Says, “Thanks for All the Spam”! The fight goes on. Spammers keep trying to thrust their links to pharmaceutical and gambling and whatever crap.com sites via the Maricopa Learning eXchange comments. Today, some hours were spent making sure all new comments were not made visible, so after submitting the form, they should see that nothing has been added. Don’t you think […]
    • Mickey Has Left The House Please excuse our regularly scheduled blogging for a sad announcement. Today we had to put down my labrador retriever, Mickey, normally the dog on the banner image for this blog. As warm and affectionate he was with humans, this dog had a strange aggressive streak towards other dogs. Last Spring, he bolted through a tiny […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 12 posts previously published on September 29th

  • 2020
    • The Ring Drone Zone As soon as Chris Gilliard shared the flying Ring drone my mind went to free association. It went back to the Twilight Zone episode “The Invaders” just for those scenes of Agnes Moorehead whacking at the flying invaders in her cabin. This episode is brilliant on so many levels, especially for the lack of dialogue. […] &amp#x27A1;
  • 2019
    • Lacktribution: Be Like Everyone Else Go ahead, be a copycat. Down at number 111 of the 2019 Top Tool for learning is a site I use often myself for finding images available for reuse, pixabay. The rank is anything I care about. Among the comments: “Free images, you do not have to attribute, good selection.” Instructional Designer, USA “As with […] &amp#x27A1;
  • 2009
    • Intel Sponsored Me into Tomorrow In my late night fiddling with my stream of Weird S*** Web sites, I stumbled into “Sponsors of Tomorrow”, which takes an uploaded photo of you, and melds it into a hideous video of some dorko Tom Cruis-ish type character. The photo used was my mugshot-like passport photo. I warned you of the weirdness: How […] &amp#x27A1;
  • 2008
    • Ixy in Your Pocket? Can You Say Ixy? by cogdogblog posted 29 Sep ’08, 8.20am MDT PST on flickr Japanese electronics stores carry many new camera models before they hit the states. This new pocket digital camera form Canon, the IXY series, can take images in 14.7 MegaPixels and 3200 ISO. Wow! 14.7 MegaPixels in a pocket camera! That […] &amp#x27A1;
  • 2007
    • Three Amigos Kerpoofing It Three Amigos Kerpoofing It posted 29 Sep ’07, 12.51pm MDT PST on flickr Working on our "teaser" for the K12 Online conference… Played a little with this fun tool for creating cartoon graphics, www.kerpoof.com – harder to figure out how to embed or create linked stories. Last Flickr blog post (for now). Must run out […] &amp#x27A1;
    • Picnik Let’s Us Really Play With Photos Picnik Let’s Us Really Play With Photos posted 25 Sep ’07, 9.18pm MDT PST on flickr Fresa and Kasha are rather excited about the new features in picnik, the free online photo editor that lets you modify images from flickr, facebook, photobucket, your desktop, and then save back to these sites. The new tools allow […] &amp#x27A1;
    • ICanHazAirlineTickets ICanHasAirlineTickets posted 29 Sep ’07, 2.38pm MDT PST on flickr If you have not caught the I CAN HAS CHEEZBURGER craze, you are about 1 meme behind. It is a subset of the broader genre of LOL CATS. I created my oen with the ICanHazCheezBurger Factory, a site where you can browse a vast set […] &amp#x27A1;
    • I CN HZ TWEETS I CN HZ TWEETS posted 29 Sep ’07, 2.06pm MDT PST on flickr Twitter is cheezing my tweets again. Am ready to coin the term "Cheez Tweetos" – sort of eCheese Its lacking the orange crud on your fingers (though blue bird feathers works fine for debris) Copy your tweets to your clipboard before “updating” […] &amp#x27A1;
  • 2006
    • Second Prize in a Virtual Photo Contest flickr foto It’s not everydayavailable on flickr …that yours truly comes second in a beauty contest. This happened a few months back, but was reminded when iw as organizing some directories on my laptop. I’ve been spending some time recently in Second Life, drumming up events and activities for the NMC Campus — it is […] &amp#x27A1;
  • 2005
    • Lies, Damn Lies, and Blog Statistics Over on the Learning Circuits Blog, David Lee just posted Blogging by The Numbers about attempts to draw some meaningful data out of this Blogger hosted blog (since Blogger provides no data, he is using the add-ons from SiteMeter and Bravenet. He then asks: * Are there metrics you see as key when looking at […] &amp#x27A1;
  • 2004
    • MLX Says, “Thanks for All the Spam”! The fight goes on. Spammers keep trying to thrust their links to pharmaceutical and gambling and whatever crap.com sites via the Maricopa Learning eXchange comments. Today, some hours were spent making sure all new comments were not made visible, so after submitting the form, they should see that nothing has been added. Don’t you think […] &amp#x27A1;
    • Mickey Has Left The House Please excuse our regularly scheduled blogging for a sad announcement. Today we had to put down my labrador retriever, Mickey, normally the dog on the banner image for this blog. As warm and affectionate he was with humans, this dog had a strange aggressive streak towards other dogs. Last Spring, he bolted through a tiny […] &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.

    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 *