“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 July 29th

  • 2016
    • A Case for a Creative Commons Stack Exchange A Creative Commons Stack Exchange Community would serve as a place for people seeking Creative Commons Certifications can demonstrate their proficiency by practicing asking, answering, rating, and commenting on relevant questions. Furthermore it could provide a public resource for the organization in conjunction with the current available avenues of FAQs, email, and IRC as ways […]
    • Your Name Was “Strale” Next week will mark 4 months since I have adopted you, Felix. Is life now good for you? It is for me. Do you remember last weekend when we went to Flagstaff, and saw all those dogs at the Rescue Roundup? That lady I talked to for a while at the end recognized you; that […]
  • 2015
    • Pin the Discipline on the www._________.com Domain Pure silliness. I plopped one of the major scientific academic disciplines in front of “.com” and ended up on a dating site. It’s legit. Domain names are the wild west (I am hoping to pick up a special vanity domain soon). But this turned into a funny 30 minutes of diversion as I saw where […]
    • A Peek at the Web Machinery for the UDG Agora Project Purring like a finely tuned machine… To followup on the first phase the blogging about the UdG Agora Project, here I will dive into some details of the web site(s) which I am responsible/to blame for. This post covers the overall set up, some stats, and info on the main site. Subsequent posts will/should detail […]
    • The CogDog.It Irregular Annual Report (well the first one) About two weeks from now marks three years since my last salary paycheck from my last full time position, meaning I have managed to keep myself housed, fed, and otherwise amused by earning my own kibbles. I’m inspired by friend and fellow self-employed edtech dude, Bryan Alexander, to do some regular summaries for their “business” […]
  • 2013
    • Endorse is the New Like I’ve already barked about how cheap it is to like stuff on Facebook (my campaign to have everyone like everything failed). If you can just click something in 0.2 seconds does it really carry any value? But now, of the ease of which I can endorse someone’s skills in LinkedIn, means alot if one gets […]
    • ds106 Daily Create Challenge (29): Frustration Today’s ds106 daily create challenge is writing a Haiku– thats pretty easy, cram something into a 3 line poem, of 7-5-7 format. The prompt is: Write a nonpolitical haiku about your nation’s head of state. So how can you do this? You can play with the idea of who is the head of state, or […]
    • What Am I Doing? cc licensed ( BY ND ) flickr photo shared by Andrew Morrell Depending on intonation, emphasis, and perhaps insertion of a TF, that question can go down a number of paths… I still get questions about The Horizon Report- I’ve not worked for NMC since March 2011, and it’s been so long I may not […]
  • 2012
    • A Car Named Bob I will let the video do the talking here- meet my Strawberry Arizona friend and neighbor Jim, a man full of stories from his years in aviation industry. He recently decided to pass on his pride, a bright blue 1973 Volkswagen Beetle named “Bob”. Today I visited to take some photos and record hom telling […]
  • 2010
    • London Dog Calling I’m really excited to be making my first trip ever to London next month (too late to meet up with Scott or Brian) for a few days of NMC meetings. I have set aside a few extra days to be a tour dog. But I am a total n00b in my London knowledge– so I […]
  • 2009
    • d yfd found one awesome data tool I’ve been mumbling in twitter (like anyone notices) about a very interesting data gathering/visualizing tool that rides the back coat tails of twitter in a clever way. I’ll spill the beans first, but stick around for the story and the after blog coffee, okay? Your Flowing Data (YFD) is described by its creator, Nathan, as […]
  • 2008
    • More GraphJamming I can’t stop going back for more GraphJams. I am wearing my GraphJammies eating peanut butter and GraphJam sandwiches. But I am waiting for my own submission to be portrayed, based on a recent blog post of my own. But for now, cue up that CD track that starts with scratchy vinyl sounds and get […]
  • 2006
    • Anti-Midas Touch Resumes I am ready to dump all of this technology stuff and go to work raking leaves or painting houses. It was just last week my MacBookPro came back from its two week vacation to replace its fan and logic board. And now today, its screen is dimmed to about 2% of its brightness, so much […]
  • 2004
    • Raising the White Flag on our Course Management System Data Collection As far as course management systems, the Maricopa system has quite the diversity for course management systems- 2 colleges using WebCT (moving Fall 2004 to a shared Enterprise server), 6 using Blackboard, 1 using MIDAS, a derivative of the Anlon product, and 1 developing a brand new LMS/CMS to pilot this fall. We saw this […]
  • 2003
    • Creating RSS (bottle opener optional) Stephen Downes outlines How to Create an RSS Feed With Notepad, a Web Server, and a Beer, essentially a 9 step process for (ugh) writing RSS Feeds by hand. An RSS (Rich Site Summary) feed is an XML file used to describe the contents of your website. As your website content changes, your RSS feed […]
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 July 29th

  • 2016
    • A Case for a Creative Commons Stack Exchange A Creative Commons Stack Exchange Community would serve as a place for people seeking Creative Commons Certifications can demonstrate their proficiency by practicing asking, answering, rating, and commenting on relevant questions. Furthermore it could provide a public resource for the organization in conjunction with the current available avenues of FAQs, email, and IRC as ways […] &amp#x27A1;
    • Your Name Was “Strale” Next week will mark 4 months since I have adopted you, Felix. Is life now good for you? It is for me. Do you remember last weekend when we went to Flagstaff, and saw all those dogs at the Rescue Roundup? That lady I talked to for a while at the end recognized you; that […] &amp#x27A1;
  • 2015
    • Pin the Discipline on the www._________.com Domain Pure silliness. I plopped one of the major scientific academic disciplines in front of “.com” and ended up on a dating site. It’s legit. Domain names are the wild west (I am hoping to pick up a special vanity domain soon). But this turned into a funny 30 minutes of diversion as I saw where […] &amp#x27A1;
    • A Peek at the Web Machinery for the UDG Agora Project Purring like a finely tuned machine… To followup on the first phase the blogging about the UdG Agora Project, here I will dive into some details of the web site(s) which I am responsible/to blame for. This post covers the overall set up, some stats, and info on the main site. Subsequent posts will/should detail […] &amp#x27A1;
    • The CogDog.It Irregular Annual Report (well the first one) About two weeks from now marks three years since my last salary paycheck from my last full time position, meaning I have managed to keep myself housed, fed, and otherwise amused by earning my own kibbles. I’m inspired by friend and fellow self-employed edtech dude, Bryan Alexander, to do some regular summaries for their “business” […] &amp#x27A1;
  • 2013
    • Endorse is the New Like I’ve already barked about how cheap it is to like stuff on Facebook (my campaign to have everyone like everything failed). If you can just click something in 0.2 seconds does it really carry any value? But now, of the ease of which I can endorse someone’s skills in LinkedIn, means alot if one gets […] &amp#x27A1;
    • ds106 Daily Create Challenge (29): Frustration Today’s ds106 daily create challenge is writing a Haiku– thats pretty easy, cram something into a 3 line poem, of 7-5-7 format. The prompt is: Write a nonpolitical haiku about your nation’s head of state. So how can you do this? You can play with the idea of who is the head of state, or […] &amp#x27A1;
    • What Am I Doing? cc licensed ( BY ND ) flickr photo shared by Andrew Morrell Depending on intonation, emphasis, and perhaps insertion of a TF, that question can go down a number of paths… I still get questions about The Horizon Report- I’ve not worked for NMC since March 2011, and it’s been so long I may not […] &amp#x27A1;
  • 2012
    • A Car Named Bob I will let the video do the talking here- meet my Strawberry Arizona friend and neighbor Jim, a man full of stories from his years in aviation industry. He recently decided to pass on his pride, a bright blue 1973 Volkswagen Beetle named “Bob”. Today I visited to take some photos and record hom telling […] &amp#x27A1;
  • 2010
    • London Dog Calling I’m really excited to be making my first trip ever to London next month (too late to meet up with Scott or Brian) for a few days of NMC meetings. I have set aside a few extra days to be a tour dog. But I am a total n00b in my London knowledge– so I […] &amp#x27A1;
  • 2009
    • d yfd found one awesome data tool I’ve been mumbling in twitter (like anyone notices) about a very interesting data gathering/visualizing tool that rides the back coat tails of twitter in a clever way. I’ll spill the beans first, but stick around for the story and the after blog coffee, okay? Your Flowing Data (YFD) is described by its creator, Nathan, as […] &amp#x27A1;
  • 2008
    • More GraphJamming I can’t stop going back for more GraphJams. I am wearing my GraphJammies eating peanut butter and GraphJam sandwiches. But I am waiting for my own submission to be portrayed, based on a recent blog post of my own. But for now, cue up that CD track that starts with scratchy vinyl sounds and get […] &amp#x27A1;
  • 2006
    • Anti-Midas Touch Resumes I am ready to dump all of this technology stuff and go to work raking leaves or painting houses. It was just last week my MacBookPro came back from its two week vacation to replace its fan and logic board. And now today, its screen is dimmed to about 2% of its brightness, so much […] &amp#x27A1;
  • 2004
    • Raising the White Flag on our Course Management System Data Collection As far as course management systems, the Maricopa system has quite the diversity for course management systems- 2 colleges using WebCT (moving Fall 2004 to a shared Enterprise server), 6 using Blackboard, 1 using MIDAS, a derivative of the Anlon product, and 1 developing a brand new LMS/CMS to pilot this fall. We saw this […] &amp#x27A1;
  • 2003
    • Creating RSS (bottle opener optional) Stephen Downes outlines How to Create an RSS Feed With Notepad, a Web Server, and a Beer, essentially a 9 step process for (ugh) writing RSS Feeds by hand. An RSS (Rich Site Summary) feed is an XML file used to describe the contents of your website. As your website content changes, your RSS feed […] &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 *