“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 November 21st

  • 2024
    • Federated/Fragmentated  Composed while offline 14 hours on a trans pacific flight… While I playfully gasta-cated at OER24 for folks to put on the Get Federated t-shirt, I knew then and more now that it’s not going to be for everyone.  “It’s too complicated reigns”. Where to Go? Hence the ongoing gnashing of “where to be”? The […]
  • 2022
    • I Choose a Meeting with a talking Alpaca over Twitter Drama Any Day of the Week For re-refreshing change from the ever increasing Twitter fallout drama and the rising wave of AI euphoria, I was granted a reprieve last week where I got to catchup with an old friend, yes, that Blabberize talking alpaca. Alas, we could not help but slip into the musky drama of the Now. Our connection traces […]
  • 2020
    • What Can You Do About Digital Surveillance? At least make [#ds106] art I don’t need to spend paragraphs explaining the state of digital surveillance most of us have become resigned to here in 2020. I turn that over to the twitter stream of Chris Gilliard (where you do get the occasional reprieve of a pupdate). A thing that gives me some small solace is making digital art, […]
  • 2013
    • Airtime and ds106 Radio Intersecting at Mozfest What feels like a month later, I’m still back blogging some of my experience at Mozfest in London. My ears perked up when someone mentioned something about SourceFabric being at Mozfest. @grantpotter I was told the folks from Airtime are sponsoring the #Mozfest beer tonight, hope to find em to talk about #ds106radio — Alan […]
  • 2012
    • A New Under Construction Man Remember this little busy guy? You’ve seen much of him since the late 1990s? I thought I spotted him today in Canada: cc licensed ( BY ) flickr photo shared by cogdogblog But he just would not move. No more digging. No matter how many times I clicked. It just took a little convincing (and […]
    • Dogs and Cows Talking ’bout Cheese ‘n GIFs I listen, and read, and listen, and try to make sense of what they are talking ’bout. But those cows just go on and on and on about their MOOcing and making cheese. On and on they go. And go. “…placental, emergent, alienating, enveloping, sometimes thriving, sometimes dead, sometimes reborn…” Whatever. Yawn. Anyone want to […]
    • Reaping the Dead ds106 Links cc licensed ( BY ND ) flickr photo shared by ind{yeah} A rather annoying grain of sand in the ds106 machine of syndication is the loss of web sites when students give up their domains, or just obliterate their blogs after class. It’s a common theme of the distributed web, the stench of link rot […]
    • CHEESE is not a Thing: Emergence, Disruption, and Dairy Products cc licensed ( BY ) flickr photo shared by foxypar4 On December 14, 2012, Clara-Belle, Daisy, Elsie, Moonbeam, Bessie, and a small group of bovine thought leaders will gather in Des Moines to discuss the future of CHEESEs in online dairy production. The approach of this one-day intensive summit brings Elsie and Moonbeam back to […]
  • 2011
    • Michael Branson Smith: The Horror How are mere mortals going to motivate themselves to produce videos given the epic quality of the ones by Michael Branson Smith? Must we shave heads and show dark ominous videos in the dark? The Horror! If you have no idea, check out his latest masterpiece, the ds106 Confessional I for one plan to flush […]
    • My ds106 Addiction I admit it. I have a problem. I can stop at any time, but why would I want to? Yes, I am addicted to ds106 since my first exposure. All the things i could say about it- the energy, the group of people i have become deeply connected to, the power of the radio community, […]
  • 2008
    • Google Life Photo Archive: Fantastic Images / Fuzzy Info on Usage I can agree with all the positive acclaim for the archive of Life photographs Google is hosting. It is a vast archive of important historical moments. What is striking me odd that is not strictly mentioned on this site is any statement on usage of the images. I looked high and low, and I am […]
  • 2007
    • I’m In Wikipedia! I’m somebody now! Millions of people look at this web site everyday! This is the kind of spontaneous publicity – your name in a wiki – that makes people. I’m in Wikipedia! Things are going to start happening to me now. apologies to Steve Martin… Don’t ask why, well I was bored, and looked for […]
  • 2005
    • iForum Sneak Peek I’m under my own gun for getting all of our articles ready for the December 5, 2005 planned release of our MCLI iForum– as alluded to earlier, this is going to be a 100% online publication replacing the print/web publication we’d been doing since 2001 (and an earlier version back to 1993). To do this, […]
  • 2003
    • PHP the Drug Menace Wow, it’s been a while since I clicked over to BBspot. This story is a bit dated (June 14), but is important if you are concerned about today’s youth. BBspot – Student Suspended Over Suspected Use of PHP Topeka, KS – High school sophomore Brett Tyson was suspended today after teachers learned he may be […]
    • Business BlogShop (or how I slept through that day in profiteering class) I musta been sleepin’ that day they covered bizness models. Here them smart folks in the Windy city offer Business Blog / Weblog Workshop by BloggingWorks One day workshop on how your business can harness the power of weblogs to improve efficiency and communication. a smokin deal at $395 per suit, err head. At what […]
    • You Know Where You Are.. but can your web visitors tell? I am guilty of this as much as the next person– in working on a web design project, or any project for that matter, you can get so close to the details and the content that you easily miss minor but important details. Huh?  Share this barking on social media
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 November 21st

  • 2024
    • Federated/Fragmentated  Composed while offline 14 hours on a trans pacific flight… While I playfully gasta-cated at OER24 for folks to put on the Get Federated t-shirt, I knew then and more now that it’s not going to be for everyone.  “It’s too complicated reigns”. Where to Go? Hence the ongoing gnashing of “where to be”? The […] &amp#x27A1;
  • 2022
  • 2020
  • 2013
    • Airtime and ds106 Radio Intersecting at Mozfest What feels like a month later, I’m still back blogging some of my experience at Mozfest in London. My ears perked up when someone mentioned something about SourceFabric being at Mozfest. @grantpotter I was told the folks from Airtime are sponsoring the #Mozfest beer tonight, hope to find em to talk about #ds106radio — Alan […] &amp#x27A1;
  • 2012
    • A New Under Construction Man Remember this little busy guy? You’ve seen much of him since the late 1990s? I thought I spotted him today in Canada: cc licensed ( BY ) flickr photo shared by cogdogblog But he just would not move. No more digging. No matter how many times I clicked. It just took a little convincing (and […] &amp#x27A1;
    • Dogs and Cows Talking ’bout Cheese ‘n GIFs I listen, and read, and listen, and try to make sense of what they are talking ’bout. But those cows just go on and on and on about their MOOcing and making cheese. On and on they go. And go. “…placental, emergent, alienating, enveloping, sometimes thriving, sometimes dead, sometimes reborn…” Whatever. Yawn. Anyone want to […] &amp#x27A1;
    • Reaping the Dead ds106 Links cc licensed ( BY ND ) flickr photo shared by ind{yeah} A rather annoying grain of sand in the ds106 machine of syndication is the loss of web sites when students give up their domains, or just obliterate their blogs after class. It’s a common theme of the distributed web, the stench of link rot […] &amp#x27A1;
    • CHEESE is not a Thing: Emergence, Disruption, and Dairy Products cc licensed ( BY ) flickr photo shared by foxypar4 On December 14, 2012, Clara-Belle, Daisy, Elsie, Moonbeam, Bessie, and a small group of bovine thought leaders will gather in Des Moines to discuss the future of CHEESEs in online dairy production. The approach of this one-day intensive summit brings Elsie and Moonbeam back to […] &amp#x27A1;
  • 2011
    • Michael Branson Smith: The Horror How are mere mortals going to motivate themselves to produce videos given the epic quality of the ones by Michael Branson Smith? Must we shave heads and show dark ominous videos in the dark? The Horror! If you have no idea, check out his latest masterpiece, the ds106 Confessional I for one plan to flush […] &amp#x27A1;
    • My ds106 Addiction I admit it. I have a problem. I can stop at any time, but why would I want to? Yes, I am addicted to ds106 since my first exposure. All the things i could say about it- the energy, the group of people i have become deeply connected to, the power of the radio community, […] &amp#x27A1;
  • 2008
  • 2007
    • I’m In Wikipedia! I’m somebody now! Millions of people look at this web site everyday! This is the kind of spontaneous publicity – your name in a wiki – that makes people. I’m in Wikipedia! Things are going to start happening to me now. apologies to Steve Martin… Don’t ask why, well I was bored, and looked for […] &amp#x27A1;
  • 2005
    • iForum Sneak Peek I’m under my own gun for getting all of our articles ready for the December 5, 2005 planned release of our MCLI iForum– as alluded to earlier, this is going to be a 100% online publication replacing the print/web publication we’d been doing since 2001 (and an earlier version back to 1993). To do this, […] &amp#x27A1;
  • 2003
    • PHP the Drug Menace Wow, it’s been a while since I clicked over to BBspot. This story is a bit dated (June 14), but is important if you are concerned about today’s youth. BBspot – Student Suspended Over Suspected Use of PHP Topeka, KS – High school sophomore Brett Tyson was suspended today after teachers learned he may be […] &amp#x27A1;
    • Business BlogShop (or how I slept through that day in profiteering class) I musta been sleepin’ that day they covered bizness models. Here them smart folks in the Windy city offer Business Blog / Weblog Workshop by BloggingWorks One day workshop on how your business can harness the power of weblogs to improve efficiency and communication. a smokin deal at $395 per suit, err head. At what […] &amp#x27A1;
    • You Know Where You Are.. but can your web visitors tell? I am guilty of this as much as the next person– in working on a web design project, or any project for that matter, you can get so close to the details and the content that you easily miss minor but important details. Huh?  Share this barking on social media &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 *