“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 17th

  • 2019
    • Net.Art Now.Web What does the quirky web art of the 1990s, an era before networked video was viable, palettes of 256 colors… have to do with the web of 2019? Maybe everything. Through my old tech ways of scouring the web (RSS Reader) today came another gem from Jay Hoffman’s History of the Web project. It’s not […]
  • 2018
    • Quick Peek at TWU Portfolios Project Since August I’ve been working on an up to now unblogged WordPress as portfolio project with Colin Madland at Trinity Western University. Let’s dash the “un”. I remember hearing of electronic portfolios from my very get go in instructional technology in the 1990s. I remember getting to know Dr Helen Barrett who even then billed […]
  • 2013
    • You Can Feel Crushed cc licensed ( BY SA ) flickr photo shared by Clay Junell First my body was physically demoralized by a brutal bike ride and yesterday it was my computer’s turn to beat me down. Without going into banal details no one cares about, I pretty much spent 4 hours Sunday night, and most of the […]
    • Fire on The Rim … Survivor I look a bit too satisfied and confident here crossing the finish line for the Fire on the Rim mountain bike race — this GIF made from two finish line photos they took This ride totally crushed me… Yes, I am glad to have finished, but man I was hurting. I went home, took a […]
  • 2010
    • Those PLENKing Diagrams cc licensed flickr photo shared by Lars Plougmann I’m ready. Once again, with the best intentions, I have signed up for a George and Stephen (and others more now) Massively Open Online Course, Personal Learning Environments, Networks, and Knowledge 2010 (PLENK2010). My track record is poor, I easily let this stuff slide off of the […]
  • 2008
    • One Face of a Billion Curious Beggar by cogdogblog posted 17 Sep ’08, 5.16pm MDT PST on flickr This little guy was curious about the gigapan I had set up to do this shot gigapan.org/viewGigapan.php?id=9189 I gestured to take a picture and he smiled, then he stuck his hand out for change. Now I was stuck, except the only thing […]
  • 2007
    • Battery Mysteries I dont think much about the battery in my laptop– til it craps out on me. I’ve known that the one on my 2006 MacBookPro might be getting creaky. During the last trip to Boston, it went form about a 30% reading immediately to 0 (and went black) a few times. I knew it was […]
  • 2004
    • CogDog(kiwi)Blog In preparation for some workshops during my November 2004 visit to some colleges in the Auckland, New Zealand area, I am launching an “inverted” version of the main CDB as the “CogDog(kiwi)Blog” (perhaps here after acronymed as CDkB?): http://ablog.unitecnology.ac.nz/blog/ Being on the opposite side of the globe, the new blog has the trendy blac kbackground, […]
    • Dog Off Grid In about 8 hours I will be pulling the Matrix plug out of the back of my neck, as I head north for a 3 day Grand Canyon adventure on the Hermit Trail — (e.g. no blogging, no barking, no ranting, just sweet silence on this blog site). It should be interesting- our streak of […]
    • No Excuse for Linkrot Linkrot is a preventable scourge- it is rampant despite the available of utterly simple solutions. What is Linkrot? Jakob coined it early, when web sites are “improved” or “redesigned”, often web urls are changed, or files are moved to a new directory, or just taken off the server. This is the case where a web […]
  • 2003
    • Mikey and Alec Comment Show Well there are spammers and then there are goofballs you have nothing better to do then send juvenile comments to my blog. This dog lifts a leg on Mike and Alec. Congratulations to “michael farrell” and “Alec” for their Oxford English command of the written word (congrats also for being added to the banned IPs […]
    • Hot off the Presses: MLX Special Collections This is the first glance at a new part of the Maricopa Learning eXchange (MLX), what we are calling MLX Special Collections: An MLX special collection is a set of packages associated with a specific project or program. We created this functionality to provide unique MLX URLs that would generate a listing as well as […]
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 17th

  • 2019
    • Net.Art Now.Web What does the quirky web art of the 1990s, an era before networked video was viable, palettes of 256 colors… have to do with the web of 2019? Maybe everything. Through my old tech ways of scouring the web (RSS Reader) today came another gem from Jay Hoffman’s History of the Web project. It’s not […] &amp#x27A1;
  • 2018
    • Quick Peek at TWU Portfolios Project Since August I’ve been working on an up to now unblogged WordPress as portfolio project with Colin Madland at Trinity Western University. Let’s dash the “un”. I remember hearing of electronic portfolios from my very get go in instructional technology in the 1990s. I remember getting to know Dr Helen Barrett who even then billed […] &amp#x27A1;
  • 2013
    • You Can Feel Crushed cc licensed ( BY SA ) flickr photo shared by Clay Junell First my body was physically demoralized by a brutal bike ride and yesterday it was my computer’s turn to beat me down. Without going into banal details no one cares about, I pretty much spent 4 hours Sunday night, and most of the […] &amp#x27A1;
    • Fire on The Rim … Survivor I look a bit too satisfied and confident here crossing the finish line for the Fire on the Rim mountain bike race — this GIF made from two finish line photos they took This ride totally crushed me… Yes, I am glad to have finished, but man I was hurting. I went home, took a […] &amp#x27A1;
  • 2010
    • Those PLENKing Diagrams cc licensed flickr photo shared by Lars Plougmann I’m ready. Once again, with the best intentions, I have signed up for a George and Stephen (and others more now) Massively Open Online Course, Personal Learning Environments, Networks, and Knowledge 2010 (PLENK2010). My track record is poor, I easily let this stuff slide off of the […] &amp#x27A1;
  • 2008
    • One Face of a Billion Curious Beggar by cogdogblog posted 17 Sep ’08, 5.16pm MDT PST on flickr This little guy was curious about the gigapan I had set up to do this shot gigapan.org/viewGigapan.php?id=9189 I gestured to take a picture and he smiled, then he stuck his hand out for change. Now I was stuck, except the only thing […] &amp#x27A1;
  • 2007
    • Battery Mysteries I dont think much about the battery in my laptop– til it craps out on me. I’ve known that the one on my 2006 MacBookPro might be getting creaky. During the last trip to Boston, it went form about a 30% reading immediately to 0 (and went black) a few times. I knew it was […] &amp#x27A1;
  • 2004
    • CogDog(kiwi)Blog In preparation for some workshops during my November 2004 visit to some colleges in the Auckland, New Zealand area, I am launching an “inverted” version of the main CDB as the “CogDog(kiwi)Blog” (perhaps here after acronymed as CDkB?): http://ablog.unitecnology.ac.nz/blog/ Being on the opposite side of the globe, the new blog has the trendy blac kbackground, […] &amp#x27A1;
    • Dog Off Grid In about 8 hours I will be pulling the Matrix plug out of the back of my neck, as I head north for a 3 day Grand Canyon adventure on the Hermit Trail — (e.g. no blogging, no barking, no ranting, just sweet silence on this blog site). It should be interesting- our streak of […] &amp#x27A1;
    • No Excuse for Linkrot Linkrot is a preventable scourge- it is rampant despite the available of utterly simple solutions. What is Linkrot? Jakob coined it early, when web sites are “improved” or “redesigned”, often web urls are changed, or files are moved to a new directory, or just taken off the server. This is the case where a web […] &amp#x27A1;
  • 2003
    • Mikey and Alec Comment Show Well there are spammers and then there are goofballs you have nothing better to do then send juvenile comments to my blog. This dog lifts a leg on Mike and Alec. Congratulations to “michael farrell” and “Alec” for their Oxford English command of the written word (congrats also for being added to the banned IPs […] &amp#x27A1;
    • Hot off the Presses: MLX Special Collections This is the first glance at a new part of the Maricopa Learning eXchange (MLX), what we are calling MLX Special Collections: An MLX special collection is a set of packages associated with a specific project or program. We created this functionality to provide unique MLX URLs that would generate a listing as well as […] &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 *