“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 12 posts previously published on March 15th
- 2017
- Domains: The Bumper It was almost a request… Anyone got some good ideas for a @DomainsConf radio bumper? Going live on #ds106radio Wednesday for a chat with @mburtis about her keynote.— Jim Groom (@jimgroom) March 13, 2017 Though this may not be the bumper they were looking forward to, but the sound of the JJ Cale original lept […]
- 2016
- IAILTIT? (If Alan Is Late to IFTTT Then?) I’ve known for a while of the features of IFTTT (If This Than That) and maybe had one or two recipes set up in an account I forgot making there, but never really got in to make one for myself. Being late for this party is no big deal- but it’s quite an elegant concept, […]
- 2014
- Three Years on the Lam cc licensed ( BY ) flickr photo shared by Andy Wright My calendar has a reminder for my own life event; three years ago in 2011 was my last day of employment at NMC, the day after I set out into the Great Wide Open. Like most people, I have the decisions I deeply regret. […]
- Making of Mariana’s New Landing Page I’m behind on sharing this wee bit of CogDog webcrapcraft — Mariana Funes asked me to redesign her online presence page. This is the kind fo stuff I do know to make a few kibbles and bits. Her previous one (which sadly I did not save a screen shot for the “before” photo) was a […]
- 2013
- Two Years Later cc licensed ( BY SA ) flickr photo shared by cogdogblog Twas two years ago today I set myself out into The Great Wide Open. Perhaps fitting that the path would be an an odyssey extending today to a day of wandering ancient temples in Singapore as well as meeting for the first time a […]
- 2011
- Rooms Full of Scribes I had an enjoyable day attending the MEC 2011 Conference at Arizona State University (an ed tech conference that is in its 31st year). Part of the thrill was returning to the campus I spent 1987-1991 as a graduate student. Much has changed, but many things are the same. I was glad to track down […]
- 2007
- What Would I Do with 1017 Friends? Compared to this guy, in twitter-chips, I am a hermit in the woods. Does John Edwards keep up with his small group of friends? Does he have a designated staff twitter-er? More idle banter, while I have little meaningful to blog these days. But the twitter buzz train is rolling. I get a handful of […]
- 2005
- The Perl King I had 5 minutes of technical glory today, where I felt like I mastered the machine. The rest of the day I may have been under its thumb, where I belong. Readers may note that a few weeks back I was dealing with some strange web server activity every Saturday morning that managed to take […]
- No Chumps at Chumpsoft I’ve been very happy with our purchase of phpQuestionnaire, a PHP + mySQL set of scripts that have allowed us to easily create, admin, and export dat for online surveys. It’s been a champ, not a chump. Today I was doing a CSV (comma separated value) export for a recent survey, somthing I had yet […]
- Five More Skyperviews Added Whew, this is fun! Without much effort, I have added another 5 interviews, each under 5 minutes, for my upcoming article on digital net audio, You can find all 11 and (more as I add ’em) on the mcli Forum Spring 2005 Podcast. Joining the crowd, and rounding out some of the gender gap thanks […]
- Seb Sets the Gold Standard For Conference Blogging Sébastien Paquet is blogging the Information Architecture Summit in Montreal and is somehow (speed typist, total recall, good tunes??) blogging out extraordinarily detailed notes– see just a sampling from March 7 Thanks Seb! Share this barking on social media
- 2004
- MLX Has Dublin Core Metadata, Now What? I’ve made some noise here and there about the value of meta-data, not that I do not believe it in it nor do I think it does not exist, but mainly, I have yet to see the applied use beyond searching. Out of last week’s NMC Spring 2004 Online Conference, someone asked me, “Well doesn’t […]
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 March 15th
- 2017
- Domains: The Bumper It was almost a request… Anyone got some good ideas for a @DomainsConf radio bumper? Going live on #ds106radio Wednesday for a chat with @mburtis about her keynote. — Jim Groom (@jimgroom) March 13, 2017 Though this may not be the bumper they were looking forward to, but the sound of the JJ Cale original […] ➡
- 2016
- IAILTIT? (If Alan Is Late to IFTTT Then?) I’ve known for a while of the features of IFTTT (If This Than That) and maybe had one or two recipes set up in an account I forgot making there, but never really got in to make one for myself. Being late for this party is no big deal- but it’s quite an elegant concept, […] ➡
- 2014
- Three Years on the Lam cc licensed ( BY ) flickr photo shared by Andy Wright My calendar has a reminder for my own life event; three years ago in 2011 was my last day of employment at NMC, the day after I set out into the Great Wide Open. Like most people, I have the decisions I deeply regret. […] ➡
- Making of Mariana’s New Landing Page I’m behind on sharing this wee bit of CogDog webcrapcraft — Mariana Funes asked me to redesign her online presence page. This is the kind fo stuff I do know to make a few kibbles and bits. Her previous one (which sadly I did not save a screen shot for the “before” photo) was a […] ➡
- 2013
- Two Years Later cc licensed ( BY SA ) flickr photo shared by cogdogblog Twas two years ago today I set myself out into The Great Wide Open. Perhaps fitting that the path would be an an odyssey extending today to a day of wandering ancient temples in Singapore as well as meeting for the first time a […] ➡
- 2011
- Rooms Full of Scribes I had an enjoyable day attending the MEC 2011 Conference at Arizona State University (an ed tech conference that is in its 31st year). Part of the thrill was returning to the campus I spent 1987-1991 as a graduate student. Much has changed, but many things are the same. I was glad to track down […] ➡
- 2007
- What Would I Do with 1017 Friends? Compared to this guy, in twitter-chips, I am a hermit in the woods. Does John Edwards keep up with his small group of friends? Does he have a designated staff twitter-er? More idle banter, while I have little meaningful to blog these days. But the twitter buzz train is rolling. I get a handful of […] ➡
- 2005
- The Perl King I had 5 minutes of technical glory today, where I felt like I mastered the machine. The rest of the day I may have been under its thumb, where I belong. Readers may note that a few weeks back I was dealing with some strange web server activity every Saturday morning that managed to take […] ➡
- No Chumps at Chumpsoft I’ve been very happy with our purchase of phpQuestionnaire, a PHP + mySQL set of scripts that have allowed us to easily create, admin, and export dat for online surveys. It’s been a champ, not a chump. Today I was doing a CSV (comma separated value) export for a recent survey, somthing I had yet […] ➡
- Five More Skyperviews Added Whew, this is fun! Without much effort, I have added another 5 interviews, each under 5 minutes, for my upcoming article on digital net audio, You can find all 11 and (more as I add ’em) on the mcli Forum Spring 2005 Podcast. Joining the crowd, and rounding out some of the gender gap thanks […] ➡
- Seb Sets the Gold Standard For Conference Blogging Sébastien Paquet is blogging the Information Architecture Summit in Montreal and is somehow (speed typist, total recall, good tunes??) blogging out extraordinarily detailed notes– see just a sampling from March 7 Thanks Seb! Share this barking on social media ➡
- 2004
- MLX Has Dublin Core Metadata, Now What? I’ve made some noise here and there about the value of meta-data, not that I do not believe it in it nor do I think it does not exist, but mainly, I have yet to see the applied use beyond searching. Out of last week’s NMC Spring 2004 Online Conference, someone asked me, “Well doesn’t […] ➡
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.