“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.
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.
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 11 posts previously published on August 23rd
- 2022
- On Three Months Running #DS106 Daily Creates in Parallel with #MYFest22 You know, like “two great tastes that go together great” (uh oh repeat metaphor alert) the end of August is the end of 3 month run of DS106 Daily Creates that were also set up as an activity for MYFest22. The latter was a 3 month series of “recharge and renewal experiences” coordinated by Equity […]
- 2018
- My 15 Year Old Web Tool Still Works (and was just updated) It’s become a regular internet FOL (Fact of Life) that web sites, both information ones and web tools, seem to have a shorter and shorter shelf life. There was some good go arounds recently on those things that people wrote their own thoughts on before just tossing threads into twitter… I think they were called […]
- 2015
- New Image Display for Pechaflickr Just to demonstrate how glamorous my social life is, I spent a few hours Saturday night redesigning how my pechaflickr site displays its images. As far as I am concerned, it was an ideal evening. Okay, pechaflickr is a thing I made a number of years ago to provide a place to practice improvisation. It’s […]
- #ds106 Good Spellin’ on a Sunday Afternoon I got a message request from Mariana Funes Want to do new bumper for 106 spell starting Sept 6 can you record “Under the #106spell on a sunny Sunday on #ds106radio” for us when you have a moment? with a link to the song by The Kinks. She is referring to the DS106 Good Spell, […]
- 2014
- Blogging about Blogging Like a Connected Courses Champion Just a quick post here to reference what I posted on the Connected Courses site as part of the “pre-course” unit September 2 to 14 I am co-doing with Jim Groom and Howard Rheingold. This is the equivalent of what we used to do in ds106 as “Boot Camp” (probably a metaphor not useful worldwide) […]
- Wired for Character creative commons licensed ( BY-NC-SA ) flickr photo shared by Johnson Cameraface What happens when ds106 takes on a theme and subject of the TV series The Wire? That unfolds next week when the class starts at UMW. Do you feel me? (that’s a line from the show, ok?) Jim and Paul have been ripping […]
- 2013
- Headless Headlines It’s not sure what this portends for next week, these headless courses appearing. Keep your eye and web browser open to http://ds106.us/category/the-site/fall-2013-headless/ where on Monday, at one minute past midnight, the first week’s worth of content will appear for the Headless ds106 Course. The person not teaching this class, a.k.a. I. Crane, has texted us […]
- 2012
- That Ole Blue WordPress Woah, retro! I was contacted by someone with an innocent WordPress question, and in the confusion of email (“I don’t have that option”) it became apparent this person was running a older version of WordPress. I quickly thought migrating it would not be all that complex… Till I started. Her site is in WordPress 2.6, […]
- Notes from the Road: Thoughts to Chop By cc licensed ( BY ) flickr photo shared by cogdogblog On this new leg of my wayward life, I’m trying to pay attention to those gems of small conversations that happen when I get curious. I call ’em “Notes from the Road” While tucked away today at the Virginia Tech campus, I wandered over to […]
- 2010
- Found in London – RAG app cc licensed flickr photo shared by cogdogblog It’s been about 24 hours I’ve been back from my week in London (and it took another 24 hours to do all the travel stops to do that). I have a dog blog back load of stuff to post, but I seem to be having trouble with the […]
- 2007
- Uncanny Dog Valley Uncanny Dog Valley posted 23 Aug ’07, 6.17pm MDT PST on flickr The book, Lives of Monster Dogs was recommend to me last week by someone (sorry, forgot who) at the NMC Symposium on Creativity in Second Life. And 2008 is nigh for the arrival of the Dogs: "A postmodern Mary Shelley, taking the parable […]
and the default value, the link at the end is invisible.
On Michael’s site he might use There are 11 posts previously published on August 23rd
- 2022
- 2018
- My 15 Year Old Web Tool Still Works (and was just updated) It’s become a regular internet FOL (Fact of Life) that web sites, both information ones and web tools, seem to have a shorter and shorter shelf life. There was some good go arounds recently on those things that people wrote their own thoughts on before just tossing threads into twitter… I think they were called […] ➡
- 2015
- New Image Display for Pechaflickr Just to demonstrate how glamorous my social life is, I spent a few hours Saturday night redesigning how my pechaflickr site displays its images. As far as I am concerned, it was an ideal evening. Okay, pechaflickr is a thing I made a number of years ago to provide a place to practice improvisation. It’s […] ➡
- #ds106 Good Spellin’ on a Sunday Afternoon I got a message request from Mariana Funes Want to do new bumper for 106 spell starting Sept 6 can you record “Under the #106spell on a sunny Sunday on #ds106radio” for us when you have a moment? with a link to the song by The Kinks. She is referring to the DS106 Good Spell, […] ➡
- 2014
- Blogging about Blogging Like a Connected Courses Champion Just a quick post here to reference what I posted on the Connected Courses site as part of the “pre-course” unit September 2 to 14 I am co-doing with Jim Groom and Howard Rheingold. This is the equivalent of what we used to do in ds106 as “Boot Camp” (probably a metaphor not useful worldwide) […] ➡
- Wired for Character creative commons licensed ( BY-NC-SA ) flickr photo shared by Johnson Cameraface What happens when ds106 takes on a theme and subject of the TV series The Wire? That unfolds next week when the class starts at UMW. Do you feel me? (that’s a line from the show, ok?) Jim and Paul have been ripping […] ➡
- 2013
- Headless Headlines It’s not sure what this portends for next week, these headless courses appearing. Keep your eye and web browser open to http://ds106.us/category/the-site/fall-2013-headless/ where on Monday, at one minute past midnight, the first week’s worth of content will appear for the Headless ds106 Course. The person not teaching this class, a.k.a. I. Crane, has texted us […] ➡
- 2012
- That Ole Blue WordPress Woah, retro! I was contacted by someone with an innocent WordPress question, and in the confusion of email (“I don’t have that option”) it became apparent this person was running a older version of WordPress. I quickly thought migrating it would not be all that complex… Till I started. Her site is in WordPress 2.6, […] ➡
- Notes from the Road: Thoughts to Chop By cc licensed ( BY ) flickr photo shared by cogdogblog On this new leg of my wayward life, I’m trying to pay attention to those gems of small conversations that happen when I get curious. I call ’em “Notes from the Road” While tucked away today at the Virginia Tech campus, I wandered over to […] ➡
- 2010
- Found in London – RAG app cc licensed flickr photo shared by cogdogblog It’s been about 24 hours I’ve been back from my week in London (and it took another 24 hours to do all the travel stops to do that). I have a dog blog back load of stuff to post, but I seem to be having trouble with the […] ➡
- 2007
- Uncanny Dog Valley Uncanny Dog Valley posted 23 Aug ’07, 6.17pm MDT PST on flickr The book, Lives of Monster Dogs was recommend to me last week by someone (sorry, forgot who) at the NMC Symposium on Creativity in Second Life. And 2008 is nigh for the arrival of the Dogs: "A postmodern Mary Shelley, taking the parable […] ➡
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.
Share this barking on social media