“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 16 posts previously published on July 5th

  • 2021
    • SPLOTbox Extended to Support Kaltura and oEmbed More The SPLOTting has not stopped here. I’m happy to have added a whole new avenue for support of services for SPLOTbox I previously thought impossible. You can see it (and try it) in action right now at http://splot.ca/box. As proof of concept, you can add simply via URL, video from Kaltura media servers from BCcampus, […]
  • 2018
  • 2016
    • Young Me Now Me When I followed the link from this tweet from Alec Corous Dr. Alec Couros “Young me, now me” from @zefrank https://t.co/RMemkHgJvW #ETFOAQInnovate — Dr. Alec Couros (@courosa) April 15, 2016 I knew I had to make it into a DS106 Daily Create. Sure it was from 2008, and I am not sure if Ze Frank […]
  • 2013
    • ds106 Daily Create Challenge (5): Silver Beets cc licensed ( BY NC ND ) flickr photo shared by ss saa rrra hhh bb bbb… U-G-L-Y! The fifth of the #ds106 Daily Create Summer challenges was — challenging. Today’s was a writing assignment: Write about something ugly “” war, fear, hate, cruelty “” but find the beauty (silver lining) in it. I planted […]
  • 2012
    • The New Plastics cc licensed ( BY ) flickr photo shared by cogdogblog My response for today’s Daily Create… Your assignment for today: Make a photograph of a plastic object that you’ve used today. http://t.co/kZwOydTI — The Daily Create (@DS106TDC) July 5, 2012 which naturally led me to think of this classic cinema moment which led me to […]
    • Learn 13 Kinds of Practical Jokes at Camp Crystal Lake Here is a new ds106 video assignment based on the notion of going to Camp Magic Macguffin for summer camp, Send a Camp Movie to Camp: Take one of the movies on the list of movies with camp themes, find a trailer for it, and re-edit the audio to completely change the plot- e.g. make […]
  • 2011
    • StoryBox Wants YOU cc licensed ( BY NC ND ) flickr photo shared by SpreadTheMagic C’mon folks, I have been politely asking, nudging, nagging, and frankly, INTERNET YOU ARE LETTING ME DOWN on participating in my StoryBox Project. The imperial gloves are coming off, cause the excuses are poop. I’m out here on the road, going town to […]
  • 2010
    • The Internet Was Built for Me cc licensed flickr photo shared by bobtravis That’s me, second from the right. As a kid, I heard a lot of things cast my way (even from my folks) about being a “Smart Aleck” cause I had a snappy, saracastic answer to anything They never defined it, there was no google, so I just had […]
    • Depositing Checks- There’s an App for That! Harrumph to people who gave up on RSS readers and really are deluded that they can get all their news via twitter; its now my secret weapon of discovery. It was there I found in my techie feeds a story that my bank (Chase) has added the capability to their iPhone app to deposit checks. […]
    • First Diptic cc licensed flickr photo shared by cogdogblog First image made with the iPhone app Diptic (http://www.dipticapp.com/) to create multipane images from phone photos. I grabbed two of my own photos from flickr and upped them to my phone. The side images are from the same photo, just displaced to make for a framing effect Originals […]
    • Adopt My Code, Please? modified from cc licensed flickr photo shared by Lord Jim I’m looking for someone, some group to take over the development for Feed2JS; I’ve taken it as far as I can possibly can. It gets used a lot, more than I think I want to know. The server empties its cache nightly, but I just […]
    • The Gaping M Shaped Void for DIY Education Notes from the blog crypt.. This post has been lingering in the drafts area for a while; it reminds me of one of those mystery containers of Unidentified Food Substances in the back of me fridge. I keep thinking I had thrown it out, and every time I rummage around, I look at it and […]
    • Social Media Recap from NMC 2010 cc licensed flickr photo shared by cogdogblog It’s a few weeks gone by in the rear view mirror, but like last year I wanted to post some notes from the social media aspects we wove into the 2010 NMC Summer Conference. Our host this year was USC, but we had the conference in Anaheim at […]
  • 2009
    • Where The Comment Things Are from TheVine It seems pretty simple. If I post an image on flickr, I go there (or get an RSS feed) to see what comments have been added. If I want to see what people said in response to my blog posts, I go here (or again, read my own feed). Same for YouTube. Any […]
  • 2007
    • Easy Peasy Rich Media – VoiceThreads There’s no shortage at all of cool new tools to create and express yourself on the web. I came across Voicethread via a link from Tim Lauer (linktribution!). From its site: A VoiceThread is an online media album that allows people to make comments, either audio or text, and share them with anyone they wish. […]
  • 2006
    • Rain, Finally flickr foto Rain, Finallyavailable on flickr I hear in other parts of the world they have this word for when "water falls from the sky"…. Here in the Arizona desert, the first rare bits of summer rain are quite magical, and well worth stopping doing whatever you think is important, and go outside and just […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 16 posts previously published on July 5th

  • 2021
    • SPLOTbox Extended to Support Kaltura and oEmbed More The SPLOTting has not stopped here. I’m happy to have added a whole new avenue for support of services for SPLOTbox I previously thought impossible. You can see it (and try it) in action right now at http://splot.ca/box. As proof of concept, you can add simply via URL, video from Kaltura media servers from BCcampus, […] &amp#x27A1;
  • 2018
  • 2016
    • Young Me Now Me When I followed the link from this tweet from Alec Corous Dr. Alec Couros “Young me, now me” from @zefrank https://t.co/RMemkHgJvW #ETFOAQInnovate — Dr. Alec Couros (@courosa) April 15, 2016 I knew I had to make it into a DS106 Daily Create. Sure it was from 2008, and I am not sure if Ze Frank […] &amp#x27A1;
  • 2013
    • ds106 Daily Create Challenge (5): Silver Beets cc licensed ( BY NC ND ) flickr photo shared by ss saa rrra hhh bb bbb… U-G-L-Y! The fifth of the #ds106 Daily Create Summer challenges was — challenging. Today’s was a writing assignment: Write about something ugly “” war, fear, hate, cruelty “” but find the beauty (silver lining) in it. I planted […] &amp#x27A1;
  • 2012
    • The New Plastics cc licensed ( BY ) flickr photo shared by cogdogblog My response for today’s Daily Create… Your assignment for today: Make a photograph of a plastic object that you’ve used today. http://t.co/kZwOydTI — The Daily Create (@DS106TDC) July 5, 2012 which naturally led me to think of this classic cinema moment which led me to […] &amp#x27A1;
    • Learn 13 Kinds of Practical Jokes at Camp Crystal Lake Here is a new ds106 video assignment based on the notion of going to Camp Magic Macguffin for summer camp, Send a Camp Movie to Camp: Take one of the movies on the list of movies with camp themes, find a trailer for it, and re-edit the audio to completely change the plot- e.g. make […] &amp#x27A1;
  • 2011
    • StoryBox Wants YOU cc licensed ( BY NC ND ) flickr photo shared by SpreadTheMagic C’mon folks, I have been politely asking, nudging, nagging, and frankly, INTERNET YOU ARE LETTING ME DOWN on participating in my StoryBox Project. The imperial gloves are coming off, cause the excuses are poop. I’m out here on the road, going town to […] &amp#x27A1;
  • 2010
    • The Internet Was Built for Me cc licensed flickr photo shared by bobtravis That’s me, second from the right. As a kid, I heard a lot of things cast my way (even from my folks) about being a “Smart Aleck” cause I had a snappy, saracastic answer to anything They never defined it, there was no google, so I just had […] &amp#x27A1;
    • Depositing Checks- There’s an App for That! Harrumph to people who gave up on RSS readers and really are deluded that they can get all their news via twitter; its now my secret weapon of discovery. It was there I found in my techie feeds a story that my bank (Chase) has added the capability to their iPhone app to deposit checks. […] &amp#x27A1;
    • First Diptic cc licensed flickr photo shared by cogdogblog First image made with the iPhone app Diptic (http://www.dipticapp.com/) to create multipane images from phone photos. I grabbed two of my own photos from flickr and upped them to my phone. The side images are from the same photo, just displaced to make for a framing effect Originals […] &amp#x27A1;
    • Adopt My Code, Please? modified from cc licensed flickr photo shared by Lord Jim I’m looking for someone, some group to take over the development for Feed2JS; I’ve taken it as far as I can possibly can. It gets used a lot, more than I think I want to know. The server empties its cache nightly, but I just […] &amp#x27A1;
    • The Gaping M Shaped Void for DIY Education Notes from the blog crypt.. This post has been lingering in the drafts area for a while; it reminds me of one of those mystery containers of Unidentified Food Substances in the back of me fridge. I keep thinking I had thrown it out, and every time I rummage around, I look at it and […] &amp#x27A1;
    • Social Media Recap from NMC 2010 cc licensed flickr photo shared by cogdogblog It’s a few weeks gone by in the rear view mirror, but like last year I wanted to post some notes from the social media aspects we wove into the 2010 NMC Summer Conference. Our host this year was USC, but we had the conference in Anaheim at […] &amp#x27A1;
  • 2009
    • Where The Comment Things Are from TheVine It seems pretty simple. If I post an image on flickr, I go there (or get an RSS feed) to see what comments have been added. If I want to see what people said in response to my blog posts, I go here (or again, read my own feed). Same for YouTube. Any […] &amp#x27A1;
  • 2007
    • Easy Peasy Rich Media – VoiceThreads There’s no shortage at all of cool new tools to create and express yourself on the web. I came across Voicethread via a link from Tim Lauer (linktribution!). From its site: A VoiceThread is an online media album that allows people to make comments, either audio or text, and share them with anyone they wish. […] &amp#x27A1;
  • 2006
    • Rain, Finally flickr foto Rain, Finallyavailable on flickr I hear in other parts of the world they have this word for when "water falls from the sky"…. Here in the Arizona desert, the first rare bits of summer rain are quite magical, and well worth stopping doing whatever you think is important, and go outside and just […] &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 *