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

  • 2017
    • Traveling Around Samerica I’m home yesterday from an almost month-long road trip sojourn up and down a bunch of western states, covering some 3600+ miles in the mighty Red Dog truck, with Felix my co-pilot. By far, driving is my favorite mode of travel, especially when I can drive non-interstate roads and camp along the way. Even in […]
  • 2016
    • Turn up the Monsoon to 11 (Inside the Photo) This photo got picked today for Flickr explore rather mind boggling for an iPhone pic sitting among so many stunning photos. The magic of explore is you cannot expect it, I thought maybe something was up when it showed 20 favorites this morning from people I do not know. And then shortly after I got […]
  • 2015
    • Dalmatia – 22 Upon arriving home today I found the photo above on a postcard from my sister- on the back it reads “Couldn’t resist!” She’s referring to my first dog, Dominoe, who traveled with me out to Arizona in 1987. With some sad irony, yesterday marked the day she passed on to Rainbow Bridge. I have to […]
  • 2014
    • 21 Years Beyond Dominoe creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog Here we are in 1987, me a 24 year old mullet head know-not-much and my side kick, Dominoe. In May of that year we did a practice camping trip in western Maryland’ it might very well have been the Catoctin Mountain area where the […]
  • 2009
    • Dominoe’s Other Story cc licensed flickr photo shared by cogdogblog In honor of Dominoe, who left this world July 24, 1993. Yesterday’s addictive diversion was flipping through my old analog photo albums pulling photos to scan for Remembering Dominoe. But I missed another major back story part of the story. It was in 1986 when my room-mate Kevin […]
  • 2008
    • EduPunk Goes Bollywood For no other reason that it was fun to play with, using the cutting web 2.X tools of BombayTV, we have the latest in the tales of edupunk. Grapheine : Webdesigners, illustrateurs, graphistes, agence de com, Paris Lyon A linktribution goes to the Adventures of Bollywood Blackboardwala by Randy Thornton for yielding this site that […]
    • Creative Commons- They Don’t Have to Ask, But When They Do, It Tells If there was a Most Valuable Player award for advancing open content, I would certainly give it to Creative Commons. Remove CC from history, say it never happened, and I wonder if we’d have the awareness of enabling sharing content. I dont want to argue that point, it is a long winded way of saying […]
  • 2007
    • Unexpected Time Diversion My $0.00 Under the Desk Organizer posted 25 Jul ’07, 3.37pm MDT PST on flickr Always in the spirit of being (acting?) organized, I decided to move some things off the top fo my desktop to underneath like the DSL modem (which needs rare attention) and my USB / Firewire external drives. As much as […]
  • 2005
    • Spam Karma 2 Is Da Boss Wow, wow, and wow… I am very tempted to ponying up some paypal dough for Spam Karma 2, the powerful plugin for Word Press 2. It assigns incoming comments and trackbacks a karma value, based on your moderation habits, content in the comment, remote blacklists, and more. There is a raft of options for you […]
    • Postcards from the Flickr Edge I really need to stop finding cool stuff and get some work done! But I could not pass on the Flickr Postcard Browser which takes any flickr tags and presents a view like a collection of photos laid out on the table, e.g. hitting some of my own on the tags “strawberry flower” for flower […]
    • Tag Spam / Tag Mud — Way Down Here in the Long Tail of Social Software Tagging is in. You’re It! From tagging web sites to bookmarks, to photos it is changing the way we look at and organize large globs of information. It is spreading to other content, like news, music, movies, heck, maybe even learning content… Yes, folksonomy is hip and happening, eveolving and causing disruption. However, it thrives […]
    • Feed2JS Mirrors Are Active Out of some idle curiosity, I checked up on the mirror sites of our Feed2JS site that allows folks to embed RSS content into their own pages. Currently there are 7 mirror sites and it looks like we may open up a few more. Checking up on these by going to the examples page– it […]
    • Email Like This Makes Me Forget About the Pile of Spam From the inbox, a reference to our Writing HTML tutorial which is still active after being on the web for 11 years (and sadly in need of a re-write). Hello, Alan, I haven’t bent your ear for awhile. I check the links on the “Volcano” pages occasionally, and it appears that the “Pliny the Elder” […]
    • Podcasts – All or Nothin’ Podcasting has been an interesting phenomena to observe. It really did not exist a year ago, and has been riding like a bullet up the technology charts, most recently fueled by inclusion of its features in Apple’s iTunes. It’s all good. I’ve been trying to sample more from a variety of sources, mostly on my […]
  • 2004
    • When Blogs Soar (Like a Pb Balloon?) I fervently believe in the power of potential of weblogs, for students, teachers, and people in general, as a powerful, expressive platform, and have been beating the drum for the last year and a half. At the same time, I also wonder, with a Keith Moon accent, whether they will fly with the speed and […]
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 25th

  • 2017
    • Traveling Around Samerica I’m home yesterday from an almost month-long road trip sojourn up and down a bunch of western states, covering some 3600+ miles in the mighty Red Dog truck, with Felix my co-pilot. By far, driving is my favorite mode of travel, especially when I can drive non-interstate roads and camp along the way. Even in […] &amp#x27A1;
  • 2016
    • Turn up the Monsoon to 11 (Inside the Photo) This photo got picked today for Flickr explore rather mind boggling for an iPhone pic sitting among so many stunning photos. The magic of explore is you cannot expect it, I thought maybe something was up when it showed 20 favorites this morning from people I do not know. And then shortly after I got […] &amp#x27A1;
  • 2015
    • Dalmatia – 22 Upon arriving home today I found the photo above on a postcard from my sister- on the back it reads “Couldn’t resist!” She’s referring to my first dog, Dominoe, who traveled with me out to Arizona in 1987. With some sad irony, yesterday marked the day she passed on to Rainbow Bridge. I have to […] &amp#x27A1;
  • 2014
    • 21 Years Beyond Dominoe creative commons licensed ( BY-SA ) flickr photo shared by cogdogblog Here we are in 1987, me a 24 year old mullet head know-not-much and my side kick, Dominoe. In May of that year we did a practice camping trip in western Maryland’ it might very well have been the Catoctin Mountain area where the […] &amp#x27A1;
  • 2009
    • Dominoe’s Other Story cc licensed flickr photo shared by cogdogblog In honor of Dominoe, who left this world July 24, 1993. Yesterday’s addictive diversion was flipping through my old analog photo albums pulling photos to scan for Remembering Dominoe. But I missed another major back story part of the story. It was in 1986 when my room-mate Kevin […] &amp#x27A1;
  • 2008
    • EduPunk Goes Bollywood For no other reason that it was fun to play with, using the cutting web 2.X tools of BombayTV, we have the latest in the tales of edupunk. Grapheine : Webdesigners, illustrateurs, graphistes, agence de com, Paris Lyon A linktribution goes to the Adventures of Bollywood Blackboardwala by Randy Thornton for yielding this site that […] &amp#x27A1;
    • Creative Commons- They Don’t Have to Ask, But When They Do, It Tells If there was a Most Valuable Player award for advancing open content, I would certainly give it to Creative Commons. Remove CC from history, say it never happened, and I wonder if we’d have the awareness of enabling sharing content. I dont want to argue that point, it is a long winded way of saying […] &amp#x27A1;
  • 2007
    • Unexpected Time Diversion My $0.00 Under the Desk Organizer posted 25 Jul ’07, 3.37pm MDT PST on flickr Always in the spirit of being (acting?) organized, I decided to move some things off the top fo my desktop to underneath like the DSL modem (which needs rare attention) and my USB / Firewire external drives. As much as […] &amp#x27A1;
  • 2005
    • Spam Karma 2 Is Da Boss Wow, wow, and wow… I am very tempted to ponying up some paypal dough for Spam Karma 2, the powerful plugin for Word Press 2. It assigns incoming comments and trackbacks a karma value, based on your moderation habits, content in the comment, remote blacklists, and more. There is a raft of options for you […] &amp#x27A1;
    • Postcards from the Flickr Edge I really need to stop finding cool stuff and get some work done! But I could not pass on the Flickr Postcard Browser which takes any flickr tags and presents a view like a collection of photos laid out on the table, e.g. hitting some of my own on the tags “strawberry flower” for flower […] &amp#x27A1;
    • Tag Spam / Tag Mud — Way Down Here in the Long Tail of Social Software Tagging is in. You’re It! From tagging web sites to bookmarks, to photos it is changing the way we look at and organize large globs of information. It is spreading to other content, like news, music, movies, heck, maybe even learning content… Yes, folksonomy is hip and happening, eveolving and causing disruption. However, it thrives […] &amp#x27A1;
    • Feed2JS Mirrors Are Active Out of some idle curiosity, I checked up on the mirror sites of our Feed2JS site that allows folks to embed RSS content into their own pages. Currently there are 7 mirror sites and it looks like we may open up a few more. Checking up on these by going to the examples page– it […] &amp#x27A1;
    • Email Like This Makes Me Forget About the Pile of Spam From the inbox, a reference to our Writing HTML tutorial which is still active after being on the web for 11 years (and sadly in need of a re-write). Hello, Alan, I haven’t bent your ear for awhile. I check the links on the “Volcano” pages occasionally, and it appears that the “Pliny the Elder” […] &amp#x27A1;
    • Podcasts – All or Nothin’ Podcasting has been an interesting phenomena to observe. It really did not exist a year ago, and has been riding like a bullet up the technology charts, most recently fueled by inclusion of its features in Apple’s iTunes. It’s all good. I’ve been trying to sample more from a variety of sources, mostly on my […] &amp#x27A1;
  • 2004
    • When Blogs Soar (Like a Pb Balloon?) I fervently believe in the power of potential of weblogs, for students, teachers, and people in general, as a powerful, expressive platform, and have been beating the drum for the last year and a half. At the same time, I also wonder, with a Keith Moon accent, whether they will fly with the speed and […] &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 *