“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 9 posts previously published on May 30th

  • 2017
    • #NetNarr Contract Crafting My rand ambitions are some regular blogging about some behind the scenes things Mia Zamora and I did for the recently ended paused Networked Narratives class we taught. The cursed fog of time is descending. SLOW DOWN time, willya? Mia suggested the idea of doing contract grading ( prefer Miriam Posner’s writeup/example) with our students, […]
  • 2016
    • Tiny Wonders (one wonder being flickr explored) I saw this photo opportunity and almost hesitated. My foot was about to move me forward, but my inner voice said, “wait, there is something special in this light.” Or so that is how I imagine the voices working. This happened about 3/4 the way through one of the morning daily walks I do now […]
    • The Web of 2016… pops? POP! Like a zombie, email is declared dead on regular intervals. There are counter assertions, but the most significant sign to me, is the increasing frequency of web popovers that implore me to sign up for news by…. email. POP! I tried this month to screen cap all the ones I zapped; I definitely missed […]
    • To Be Certified and/or To Assert (A-cert?) Onself? One of the best aspects about my current project working on a Creative Commons Certification is that the timeline for the project extends to September 2017… in other places, I’d be in some fats track to build something or pick a technology, and I’d be in some frantic grasping at PersonalizedAPIBlockchainBedgeBots. Soon, very soon, I […]
  • 2015
    • Preclaiming A Web Site With Surge Those people on the east coast were tweeting early, before I even rolled open my eyes, but this caught my attention: My website in a Dropbox cc @twoodwar @timmmmyboy http://t.co/hZUrdB7PaE — Gardner Campbell (@GardnerCampbell) May 30, 2015 Dave Winer created this interesting PagePark thing, if I grok it correctly, it’s a bunch of standalone files […]
  • 2007
    • Spammers Are Like, So Dumb I’m going to get worried when email spammers finally develop good writing skills. Today, I earned another pile of money, a million pounds courtesy of Microsoft (hey they have gazillions to spare, believable, eh?) Dumb spamming, or How to Spam Like a Moronic Dummy: Use a forged emailed address that is from cox.net? dead giveaway. […]
    • Planning for Indy I leave in a few days for the 2007 NMC Summer Conference in Indianapolis. This is actually a minor test of blogging into the wind to see if Technorati picks up the conference tag of nmc2007 (I still am never 100% sure if it will pick up tagged blog posts). But yay! it looks like […]
  • 2006
    • In Search of Google Calendar Plugin I’m working on integrating a Google Calendar into a WP blog (not this one, an NMC project in development). The master plan is to allow a number of groups ti enter potential shared events into a common calendar, and syndicate to our blog site. I have a few events dumped into a Google Calendar for […]
  • 2005
    • A Blog and a Place For Everything The internet is seemingly infinite and I love gems that lie out there in the long tail of the long tail. From that obscure zone where a few people find vitality comes the blog “WordPerfect for DOS Updated”, so rock in in your special niche of DOS lovers, filling a void no big software support sites […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 9 posts previously published on May 30th

  • 2017
    • #NetNarr Contract Crafting My rand ambitions are some regular blogging about some behind the scenes things Mia Zamora and I did for the recently ended paused Networked Narratives class we taught. The cursed fog of time is descending. SLOW DOWN time, willya? Mia suggested the idea of doing contract grading ( prefer Miriam Posner’s writeup/example) with our students, […] &amp#x27A1;
  • 2016
    • Tiny Wonders (one wonder being flickr explored) I saw this photo opportunity and almost hesitated. My foot was about to move me forward, but my inner voice said, “wait, there is something special in this light.” Or so that is how I imagine the voices working. This happened about 3/4 the way through one of the morning daily walks I do now […] &amp#x27A1;
    • The Web of 2016… pops? POP! Like a zombie, email is declared dead on regular intervals. There are counter assertions, but the most significant sign to me, is the increasing frequency of web popovers that implore me to sign up for news by…. email. POP! I tried this month to screen cap all the ones I zapped; I definitely missed […] &amp#x27A1;
    • To Be Certified and/or To Assert (A-cert?) Onself? One of the best aspects about my current project working on a Creative Commons Certification is that the timeline for the project extends to September 2017… in other places, I’d be in some fats track to build something or pick a technology, and I’d be in some frantic grasping at PersonalizedAPIBlockchainBedgeBots. Soon, very soon, I […] &amp#x27A1;
  • 2015
    • Preclaiming A Web Site With Surge Those people on the east coast were tweeting early, before I even rolled open my eyes, but this caught my attention: My website in a Dropbox cc @twoodwar @timmmmyboy http://t.co/hZUrdB7PaE — Gardner Campbell (@GardnerCampbell) May 30, 2015 Dave Winer created this interesting PagePark thing, if I grok it correctly, it’s a bunch of standalone files […] &amp#x27A1;
  • 2007
    • Spammers Are Like, So Dumb I’m going to get worried when email spammers finally develop good writing skills. Today, I earned another pile of money, a million pounds courtesy of Microsoft (hey they have gazillions to spare, believable, eh?) Dumb spamming, or How to Spam Like a Moronic Dummy: Use a forged emailed address that is from cox.net? dead giveaway. […] &amp#x27A1;
    • Planning for Indy I leave in a few days for the 2007 NMC Summer Conference in Indianapolis. This is actually a minor test of blogging into the wind to see if Technorati picks up the conference tag of nmc2007 (I still am never 100% sure if it will pick up tagged blog posts). But yay! it looks like […] &amp#x27A1;
  • 2006
    • In Search of Google Calendar Plugin I’m working on integrating a Google Calendar into a WP blog (not this one, an NMC project in development). The master plan is to allow a number of groups ti enter potential shared events into a common calendar, and syndicate to our blog site. I have a few events dumped into a Google Calendar for […] &amp#x27A1;
  • 2005
    • A Blog and a Place For Everything The internet is seemingly infinite and I love gems that lie out there in the long tail of the long tail. From that obscure zone where a few people find vitality comes the blog “WordPerfect for DOS Updated”, so rock in in your special niche of DOS lovers, filling a void no big software support sites […] &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 *