“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 21 posts previously published on August 29th

  • 2019
    • A SPLOT Fork in the Road Can you believe this is yet another blog post about SPLOTs? Has anyone stuck a fork in them yet? Not me. I’m considering a rather major change which ultimately make them less complex to set up. This is all about the need for them to use a secret authoring account that the user never sees. […]
  • 2017
    • My DML Workshop Prep Begins With the Movie Poster I’m still got in my brain the hoofbeat sounds of Western 106… Those sounds are louder as I prepare for the DML 2017 pre-conference workshop I’m doing with Kim Jaxon, long trail titled “Staking Your Claim: How the Open Web is Won for Teaching & Learning”: How do educators support students as they navigate an […]
  • 2016
    • Sometimes An Odd Tool Does the Job I’m on R&R time visiting my good friend Mike in Durango. We both share a background in Geology but careers in technology, so we do tend to talk about geekery. When I showed up he gently teased that he had a project for me, and as it turns out, it was just the right size […]
  • 2015
    • It Takes A Stuffed Animal To Explain the Call for Stories I did not know my wails of despair were heard by by co-habitant. I started my campaign a month ago asking for stories of connection, and a few did come in. I saw more tweets and retweets than stories, and even enlisted Bugs Bunny to the cause. Well I do have 13, peeking way down […]
  • 2013
    • Here’s a New Trick I started this blog in 2012 for the first ds106 class I taught at the University of Mary Washington– mainly to be using the same web hosting (then on Cast Iron Coding) my students were using. It has hoisted some class materials for that semester, but mostly since then has idled as a place to […]
    • Withering Domains This morning, I spend about an hour in the lower levels of the ds106 web site, doing some cleanup in the Feed WordPress area. The system was reporting a moderate amount of dead or decaying blog feeds; I did not count, but cleared out maybe 100 feeds that were dead. cc licensed ( BY NC […]
  • 2012
    • Talking About Keys- An Opener My keychain is not much different from the last time I did this assignment for the Daily Create The Daily Create for August 28, 2012 told us to make a video: Show us your keychain and tell us a story about the keys or things you have on it. Yes, i still have the scuffed […]
    • Dear Flickr Dear flickr, We have been friends for so long, like since March 2004. I have shared with you over 27,000 photos, and stood up for you when other people were saying you were a has been. I still love you. But you are getting weird o senile and I am getting confused. Our ds106 students […]
    • Shortcodes, Widgets, ‘n Duct Tape Even cats know that duct tape is useful cc licensed ( BY NC SD ) flickr photo shared by Rev. Xanatos Satanicos Bombasticos (ClintJCL) It comes in handy for PHP work on WordPress sites as well. You should know that the main internal organ that makes the magic of the ds106 site do what it […]
    • They Should Call it Barrier not Banner When I hear the word “Banner” I think of a colorful warm welcome cc licensed ( BY ) flickr photo shared by woodleywonderworks My experience with student information systems is negligible, and now my connotation os shifting more to cc licensed ( BY NC ND ) flickr photo shared by Ani-Bee In fact its so […]
    • startup.me() Sigh. This is attempt to write after my bog host hiccuped yesterday. But that’s part of the playing field. I have signed up for maybe another MOOC I Signup for and Never Show Up (MOOC-SNSU), edstartup, which David Wiley is part commandeer, and is running in a less than your averag money MOOC format and […]
  • 2011
    • Cookielady’s Last Batch cc licensed ( BY ) flickr photo shared by cogdogblog One day after talking to my Mom on the day marking 10 years since my Dad passed away, I got that call you never want to receive. A friend found Mom dead on her kitchen floor. My quasi plan trip now includes a sooner-than-charted dash […]
  • 2010
    • Open as the Western Sky cc licensed flickr photo shared by cobalt123 The sky was as full of motion and change as the desert beneath it was monotonous and still, “” and there was so much sky, more than at sea, more than anywhere else in the world. The plain was there, under one’s feet, but what one saw when […]
    • London Called cc licensed flickr photo shared by Larry Johnson It’s been a week since I got back from my London Calling trip– I was wondering what sort of prophetic paragraphs I could write, or somehow to try and distill all the senses and sounds of such a place into words. I #fail. So down below I […]
    • In Time With Dad A tin full of stuff. Scout knife. Cuff links. Engraved bracelet. Puzzle game. A tin full of my Dad’s stuff. It’s just stuff. But it was my Dad’s stuff. Friday marked the day nine years ago Morris Levine left this earth. You don’t forget your loved ones, but their presence ebbs and flows without much […]
  • 2009
    • Who Is That Guy? from original by cogdogblog After a long break, I’ve started running again (that’s another yet blogged bit, but not the point today), and am doing so listening on the iPOd to Chris Anderson’s book Free on audiobook (the one I packaged from his free mp3 recordings) So there’s a section where he’s talking about Moore’s […]
  • 2007
    • Land Ho I am now owner of a plot of land in Second Life, 4096 sq meters on a new sim called “Sciences”, one of the NMC Educational Communities (land that is parceled and rented to educational organizations). As of tonight I have spent extensive amount of time walking the green carpet and tossing out objects. Actually […]
    • Zing! is in the Search Results Pshaw to bloggers who cut off or dont harvest their comments! I got rich today! Thanks to Matt M who commented on my “Anyone Remember Podcasting” post, he pointed my to EveryZing– as search services that does keyword searches among audio and video content — and returns results that are linked directly to the segment […]
  • 2006
    • Best Blog Subtitle It takes a creative mind to think of a catchy clog subtitle, you know, a pithy phrase that can run underneath the blog’s name. Leave it to Guy Kawasaki’s Signum sine tinnitu: or skipping passed the image squinting: Blogger. n. Someone with nothing to say writing for someone with nothing to do. Perfect. And just […]
    • MacBookPro Gets Home First My mis-behaving MacBookPro started its vacation a day before mine, but alas, it’s time away from home is shorter than mine… it was shipped to Apple from my doorstep Thursday afternoon, the 24th, while I left town Friday morning. The MBP was at Apple’s Spa for Weary Laptops on Friday, and turned around the next […]
  • 2005
    • More OSX Cat Quirks To add to my list of burps in the Panther-Tiger upgrade: I seem unable to print any web page from Firefox... its infinite beach ball spin, and forced quit to escape. I can print fine in other applications. I rarely print web content, but its not too much to ask for. Finder sidebar disappearing icons… […]
and the default value, the link at the end is invisible.

On Michael’s site he might use

There are 21 posts previously published on August 29th

  • 2019
    • A SPLOT Fork in the Road Can you believe this is yet another blog post about SPLOTs? Has anyone stuck a fork in them yet? Not me. I’m considering a rather major change which ultimately make them less complex to set up. This is all about the need for them to use a secret authoring account that the user never sees. […] &amp#x27A1;
  • 2017
    • My DML Workshop Prep Begins With the Movie Poster I’m still got in my brain the hoofbeat sounds of Western 106… Those sounds are louder as I prepare for the DML 2017 pre-conference workshop I’m doing with Kim Jaxon, long trail titled “Staking Your Claim: How the Open Web is Won for Teaching & Learning”: How do educators support students as they navigate an […] &amp#x27A1;
  • 2016
    • Sometimes An Odd Tool Does the Job I’m on R&R time visiting my good friend Mike in Durango. We both share a background in Geology but careers in technology, so we do tend to talk about geekery. When I showed up he gently teased that he had a project for me, and as it turns out, it was just the right size […] &amp#x27A1;
  • 2015
    • It Takes A Stuffed Animal To Explain the Call for Stories I did not know my wails of despair were heard by by co-habitant. I started my campaign a month ago asking for stories of connection, and a few did come in. I saw more tweets and retweets than stories, and even enlisted Bugs Bunny to the cause. Well I do have 13, peeking way down […] &amp#x27A1;
  • 2013
    • Here’s a New Trick I started this blog in 2012 for the first ds106 class I taught at the University of Mary Washington– mainly to be using the same web hosting (then on Cast Iron Coding) my students were using. It has hoisted some class materials for that semester, but mostly since then has idled as a place to […] &amp#x27A1;
    • Withering Domains This morning, I spend about an hour in the lower levels of the ds106 web site, doing some cleanup in the Feed WordPress area. The system was reporting a moderate amount of dead or decaying blog feeds; I did not count, but cleared out maybe 100 feeds that were dead. cc licensed ( BY NC […] &amp#x27A1;
  • 2012
    • Talking About Keys- An Opener My keychain is not much different from the last time I did this assignment for the Daily Create The Daily Create for August 28, 2012 told us to make a video: Show us your keychain and tell us a story about the keys or things you have on it. Yes, i still have the scuffed […] &amp#x27A1;
    • Dear Flickr Dear flickr, We have been friends for so long, like since March 2004. I have shared with you over 27,000 photos, and stood up for you when other people were saying you were a has been. I still love you. But you are getting weird o senile and I am getting confused. Our ds106 students […] &amp#x27A1;
    • Shortcodes, Widgets, ‘n Duct Tape Even cats know that duct tape is useful cc licensed ( BY NC SD ) flickr photo shared by Rev. Xanatos Satanicos Bombasticos (ClintJCL) It comes in handy for PHP work on WordPress sites as well. You should know that the main internal organ that makes the magic of the ds106 site do what it […] &amp#x27A1;
    • They Should Call it Barrier not Banner When I hear the word “Banner” I think of a colorful warm welcome cc licensed ( BY ) flickr photo shared by woodleywonderworks My experience with student information systems is negligible, and now my connotation os shifting more to cc licensed ( BY NC ND ) flickr photo shared by Ani-Bee In fact its so […] &amp#x27A1;
    • startup.me() Sigh. This is attempt to write after my bog host hiccuped yesterday. But that’s part of the playing field. I have signed up for maybe another MOOC I Signup for and Never Show Up (MOOC-SNSU), edstartup, which David Wiley is part commandeer, and is running in a less than your averag money MOOC format and […] &amp#x27A1;
  • 2011
    • Cookielady’s Last Batch cc licensed ( BY ) flickr photo shared by cogdogblog One day after talking to my Mom on the day marking 10 years since my Dad passed away, I got that call you never want to receive. A friend found Mom dead on her kitchen floor. My quasi plan trip now includes a sooner-than-charted dash […] &amp#x27A1;
  • 2010
    • Open as the Western Sky cc licensed flickr photo shared by cobalt123 The sky was as full of motion and change as the desert beneath it was monotonous and still, “” and there was so much sky, more than at sea, more than anywhere else in the world. The plain was there, under one’s feet, but what one saw when […] &amp#x27A1;
    • London Called cc licensed flickr photo shared by Larry Johnson It’s been a week since I got back from my London Calling trip– I was wondering what sort of prophetic paragraphs I could write, or somehow to try and distill all the senses and sounds of such a place into words. I #fail. So down below I […] &amp#x27A1;
    • In Time With Dad A tin full of stuff. Scout knife. Cuff links. Engraved bracelet. Puzzle game. A tin full of my Dad’s stuff. It’s just stuff. But it was my Dad’s stuff. Friday marked the day nine years ago Morris Levine left this earth. You don’t forget your loved ones, but their presence ebbs and flows without much […] &amp#x27A1;
  • 2009
    • Who Is That Guy? from original by cogdogblog After a long break, I’ve started running again (that’s another yet blogged bit, but not the point today), and am doing so listening on the iPOd to Chris Anderson’s book Free on audiobook (the one I packaged from his free mp3 recordings) So there’s a section where he’s talking about Moore’s […] &amp#x27A1;
  • 2007
    • Land Ho I am now owner of a plot of land in Second Life, 4096 sq meters on a new sim called “Sciences”, one of the NMC Educational Communities (land that is parceled and rented to educational organizations). As of tonight I have spent extensive amount of time walking the green carpet and tossing out objects. Actually […] &amp#x27A1;
    • Zing! is in the Search Results Pshaw to bloggers who cut off or dont harvest their comments! I got rich today! Thanks to Matt M who commented on my “Anyone Remember Podcasting” post, he pointed my to EveryZing– as search services that does keyword searches among audio and video content — and returns results that are linked directly to the segment […] &amp#x27A1;
  • 2006
    • Best Blog Subtitle It takes a creative mind to think of a catchy clog subtitle, you know, a pithy phrase that can run underneath the blog’s name. Leave it to Guy Kawasaki’s Signum sine tinnitu: or skipping passed the image squinting: Blogger. n. Someone with nothing to say writing for someone with nothing to do. Perfect. And just […] &amp#x27A1;
    • MacBookPro Gets Home First My mis-behaving MacBookPro started its vacation a day before mine, but alas, it’s time away from home is shorter than mine… it was shipped to Apple from my doorstep Thursday afternoon, the 24th, while I left town Friday morning. The MBP was at Apple’s Spa for Weary Laptops on Friday, and turned around the next […] &amp#x27A1;
  • 2005
    • More OSX Cat Quirks To add to my list of burps in the Panther-Tiger upgrade: I seem unable to print any web page from Firefox... its infinite beach ball spin, and forced quit to escape. I can print fine in other applications. I rarely print web content, but its not too much to ask for. Finder sidebar disappearing icons… […] &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 *