“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 June 11th
- 2023
- Strap on that Jetpack, Fly Over the Dead Bird in the Road I was trolling the olde blog settings for the WordPress Jetpack plugin and spotted something that confirmed I had aleady learned– the nuking of Twitter’s API meant the Social module could no longer tweet new posts. Old news. But what I did see was a new option to connect my WordPress blog to publish new […]
- 2013
- Call in The Dog: ds106zone LoDown 024 cc licensed ( BY SA ) flickr photo shared by Bruce McKay When the clams and worcestershire get Scottlo too low to do his daily show, well, they can call in the Dog, that is CogDog, to lend a paw (it’s tricky fitting a pencil behind the ears). This is my first run at doing […]
- 2012
- Scientists Identify Source of Martian Landslides Another slide guy attempt and damn, Martha got to Timmmmy in space first. Oh well…. NASA SCIENTISTS IDENTIFY SOURCE OF MARTIAN LANDSLIDES In a press announcement today, NASA scientist Marvin M. Artian released startling photographic evidence of the cause of the mysterious recent landslide deposits spotted in the Burns Hill region of the Endurance crater. […]
- Dude, Where’s My Barrel? How can we resist Martha’s new assignment, Slide Guy aka Make a Timmmmmy Meme: Slide Guy loves to slide down things! Find a photo of something to slide down and make your own Slide Guy! (You can find Slide Guy! to download and use at http://dl.dropbox.com/u/22064153/SlideGuy.png) At first I was looking for the perfect picture […]
- ds106ing Creative Commons Posters Martha and I are adding a new element to the ds106 syllabus area on design, we want students to get practice understanding creative commons by seeking licensed media and then doing a design assignment using it- make a creative commons poster Use creative commons licensed images to design a poster about how groovy Creative Commons […]
- 2006
- Other Side of Conference I’m on a sardine can packed flight back home to Phoenix from Cleveland (judging from the airport, the local population must be down 80% in numbers), and thinking already about the backload of blogging that may just get pushed aside. Working for the organization running a conference, is 180 degrees (or 540) from the experience […]
- A Tale of Three Taggings I feel moderately good about our experiment of “tagging” the NMC Summer Conference this year. We put it in the printed program that we were asking participants to tag blog posts, flickr photos, and del.icio.us bookmarks with an “official” tag of nmc2006. I used a local copy of Feed2JS and flickr’s Javascript badge to bring […]
- U-R-O-K I am astounded people take my blog as marginally credible, or more so that they read it, so it takes me back when people attach some importance or meaning to what is really my own meandering streams of thoughts and complaints (or more properly termed as my Kiwi friends say, “whinges“). So yes, back in […]
- There is a Metaphor I have a gripe (surprised?) about nearly every hotel. It’s coffee and packaging. Every hotel I have been to has in room coffee maker (which I love). But daily they only give me one regular coffee (which is about 20-20% of my daily consumption). Usually the housekeeping staff has no problem keeping me stocked. But […]
- 2004
- Why Not Let the Machines Read to Us? James Farmer has shared an interesting idea of building a collection of audio “readings” of articles, and Stephen Downes has taken the idea and ran it as an online audio jukebox. I’m not much of an avid reader of academic articles, so I let is slide into the “neat idea but no time to bother” […]
- Holy Blog! What a Wiki! Together Holy _____! Over at Open Artifact, Randy Brown has neatly sewn together a neat package: phpWiki inside and integrated with his new WordPress blog, so it more or less operates as a cohesive site and sharing the WP database. It addresses some of the issues of trying to tie into wikis which typically have their […]
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 June 11th
- 2023
- Strap on that Jetpack, Fly Over the Dead Bird in the Road I was trolling the olde blog settings for the WordPress Jetpack plugin and spotted something that confirmed I had aleady learned– the nuking of Twitter’s API meant the Social module could no longer tweet new posts. Old news. But what I did see was a new option to connect my WordPress blog to publish new […] ➡
- 2013
- Call in The Dog: ds106zone LoDown 024 cc licensed ( BY SA ) flickr photo shared by Bruce McKay When the clams and worcestershire get Scottlo too low to do his daily show, well, they can call in the Dog, that is CogDog, to lend a paw (it’s tricky fitting a pencil behind the ears). This is my first run at doing […] ➡
- 2012
- Scientists Identify Source of Martian Landslides Another slide guy attempt and damn, Martha got to Timmmmy in space first. Oh well…. NASA SCIENTISTS IDENTIFY SOURCE OF MARTIAN LANDSLIDES In a press announcement today, NASA scientist Marvin M. Artian released startling photographic evidence of the cause of the mysterious recent landslide deposits spotted in the Burns Hill region of the Endurance crater. […] ➡
- Dude, Where’s My Barrel? How can we resist Martha’s new assignment, Slide Guy aka Make a Timmmmmy Meme: Slide Guy loves to slide down things! Find a photo of something to slide down and make your own Slide Guy! (You can find Slide Guy! to download and use at http://dl.dropbox.com/u/22064153/SlideGuy.png) At first I was looking for the perfect picture […] ➡
- ds106ing Creative Commons Posters Martha and I are adding a new element to the ds106 syllabus area on design, we want students to get practice understanding creative commons by seeking licensed media and then doing a design assignment using it- make a creative commons poster Use creative commons licensed images to design a poster about how groovy Creative Commons […] ➡
- 2006
- Other Side of Conference I’m on a sardine can packed flight back home to Phoenix from Cleveland (judging from the airport, the local population must be down 80% in numbers), and thinking already about the backload of blogging that may just get pushed aside. Working for the organization running a conference, is 180 degrees (or 540) from the experience […] ➡
- A Tale of Three Taggings I feel moderately good about our experiment of “tagging” the NMC Summer Conference this year. We put it in the printed program that we were asking participants to tag blog posts, flickr photos, and del.icio.us bookmarks with an “official” tag of nmc2006. I used a local copy of Feed2JS and flickr’s Javascript badge to bring […] ➡
- U-R-O-K I am astounded people take my blog as marginally credible, or more so that they read it, so it takes me back when people attach some importance or meaning to what is really my own meandering streams of thoughts and complaints (or more properly termed as my Kiwi friends say, “whinges“). So yes, back in […] ➡
- There is a Metaphor I have a gripe (surprised?) about nearly every hotel. It’s coffee and packaging. Every hotel I have been to has in room coffee maker (which I love). But daily they only give me one regular coffee (which is about 20-20% of my daily consumption). Usually the housekeeping staff has no problem keeping me stocked. But […] ➡
- 2004
- Why Not Let the Machines Read to Us? James Farmer has shared an interesting idea of building a collection of audio “readings” of articles, and Stephen Downes has taken the idea and ran it as an online audio jukebox. I’m not much of an avid reader of academic articles, so I let is slide into the “neat idea but no time to bother” […] ➡
- Holy Blog! What a Wiki! Together Holy _____! Over at Open Artifact, Randy Brown has neatly sewn together a neat package: phpWiki inside and integrated with his new WordPress blog, so it more or less operates as a cohesive site and sharing the WP database. It addresses some of the issues of trying to tie into wikis which typically have their […] ➡
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.