“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 16 posts previously published on September 15th
- 2024
- The Gift of Comments Before the rise of social media as the web’s public conversation space, where I felt it happened well, was across the comment space of blogs. As distributed as it was, it might have been a “distribuverse”- and was woven together by the use of hyperlinks and maybe trackback pings. Given the abuse of comment spammers […]
- 2019
- That Time I [mistakenly] Impersonated a Media Lab Funder In light of the scandal, the stench of pocketed dirty money at the MIT Media Lab, it’s time I confess an act of fakery of actually no consequence (or to be honest only a shred of relevance). I remember the incident well, but the timing eludes me as I found no flickr photos of the […]
- 2018
- Search, Serendipity, Semantically Silent I opened up WordPress to write something. As often it goes, I got curious about something, fell into rabbit hole, and find myself writing a different post. This is my oft repeated experience on the internet. I’m not stats obsessed, but I did glance at the JetPack plugin’s dashboard widget. It was not the numbers […]
- 2017
- Exit It’s really not that difficult. If you can rationalize being part of an enterprise that profits from the sale of hate ads… provides a space for external entities to promulgate recruitment programs aimed at undermining our culture… can take millions of dollars aimed at influencing a political election… can compel media producers to create click […]
- 2014
- Wondering about Wonder at UT Arlington I will be first to say today’s invited talk at the UT Arlington LINK Research Lab was my own trip through the Time Tunnel, with the year 1989 dialed in. An archive of the talk is available — here are el slides A bit of a mashup of some earlier ones on Enquire Within and […]
- 2012
- Installing Flickr CC Attribution Helper from Google Chrome Store Sadly, Google made it harder impossible to install the flickr creative commons attribution helper script directly from the Userscripts site. As alerted by George Couros, clicking that Install button in Chrome now gives you: Apparently in the name of “security” Google is taking a page from Apple: We’re constantly looking out for ways to make […]
- 2011
- Road Stats: Week 13 cc licensed ( BY ) flickr photo shared by cogdogblog Number of days on the road: 84 Miles Driven: 8788 Number of States/Provinces driven in: 15 Number of US/Canadian Border Crossings: 2 Money spent on gas: $2313.36 Photos posted: 1829 (that is an average of 21.7 per day) Number of nights in hotels/B&B: 9 Number […]
- 2010
- Coming Full Circle: Hello Flickr CC-BY cc licensed flickr photo shared by mag3737 If anything I might remain consistently inconsistent. After two previous switches, I have reverted my flickr photo creative commons license to the Occam Razor version- BY Attribution. Right back where I started from. It was a little over a week ago, I switched to BY-NC, influenced by the […]
- 2009
- Web Site Stratigraphy originally published over at NMC…. Me playing web paleontologist! As an appendix to the history of the NMC, I've been researching the evolution of its web site. With the aid of the invaluable Internet Archive Wayback Machine I've been able to identify, like in Geology, the major stratigraphic layers that marks this history. Join me […]
- Let’s Put an End to Stupid Forms cc licensed flickr photo shared by voss You would think in an advanced electronic era that has brought us tools to broadcast our breakfast dilemmas and make our rock and roll dreams come alive that we might perhaps… maybe… improve the collection of information via @$#%#ing paper forms. There is no excuse for wasting my […]
- 2005
- How Cool is
Panther Tiger Spelling? Regular CDB readers (or new ones) know I can hardly type one paragraph without creating at least 6 typos. I am sorry, I opted out of keyboarding class in high school (spending my adult years typing was not in my road map). I cannot type and thus my spelling goes out the window. Sure recent […] - Convince Curmudgeons with Comments? Hey, want to do me and the Maricopa Learning eXchange (MLX) a favor? Would you like to see something positive actually come out of comments? Read on. The set up might be long, but bear with me. I’d like to convince some of our faculty the worth of sharing their work, their efforts online, rather […]
- How Big Is That Thing On The Map? The add-ons for Google Maps seem as vast and wide as the places you can click and swoop through there, especially once you go past the First Google Map Thing (finding your own house). A nice example is the Google Areometer, which allows you to click to place points on a map, and once a […]
- 2004
- Survey Sez.,. Okay, 14 readers took the time to try the goofy, meaningless survey I posted as a quick demo of using phpQuestionnaire. The survey is open, and I have set this one up so the results are publicly viewable: http://zircon.mcli.dist.maricopa.edu/phpq/stats.php?sid=3. What was nice was that I could tweak it in midstream based on the early feedbacks […]
- 2003
- Under the Flash and Gee-Whiz of Online Learning– a student experience Thank Jeremy Hiebert for sharing via his blog Old-School Adminstration of Online Learning’ÄÝ . Jeremy is very favorable of his online learning experience at Memorial University, which is a miracle considering the administrative hurdles placed before him. It is amazing students manage to learn online despite that our institutions are still operating in the wrong […]
- OtherBlog MovableType Plugin Just came across the nifty MT Plugin: OtherBlog. This allows MovableTyple blogs to be able to include content on the same server. Plugin based way of including posts/info from other blogs on the same installation. I’ve yet to even try it, but I can already think about our BlogShop a way to provide a “super-blog” […]
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 September 15th
- 2024
- The Gift of Comments Before the rise of social media as the web’s public conversation space, where I felt it happened well, was across the comment space of blogs. As distributed as it was, it might have been a “distribuverse”- and was woven together by the use of hyperlinks and maybe trackback pings. Given the abuse of comment spammers […] ➡
- 2019
- That Time I [mistakenly] Impersonated a Media Lab Funder In light of the scandal, the stench of pocketed dirty money at the MIT Media Lab, it’s time I confess an act of fakery of actually no consequence (or to be honest only a shred of relevance). I remember the incident well, but the timing eludes me as I found no flickr photos of the […] ➡
- 2018
- Search, Serendipity, Semantically Silent I opened up WordPress to write something. As often it goes, I got curious about something, fell into rabbit hole, and find myself writing a different post. This is my oft repeated experience on the internet. I’m not stats obsessed, but I did glance at the JetPack plugin’s dashboard widget. It was not the numbers […] ➡
- 2017
- Exit It’s really not that difficult. If you can rationalize being part of an enterprise that profits from the sale of hate ads… provides a space for external entities to promulgate recruitment programs aimed at undermining our culture… can take millions of dollars aimed at influencing a political election… can compel media producers to create click […] ➡
- 2014
- Wondering about Wonder at UT Arlington I will be first to say today’s invited talk at the UT Arlington LINK Research Lab was my own trip through the Time Tunnel, with the year 1989 dialed in. An archive of the talk is available — here are el slides A bit of a mashup of some earlier ones on Enquire Within and […] ➡
- 2012
- Installing Flickr CC Attribution Helper from Google Chrome Store Sadly, Google made it harder impossible to install the flickr creative commons attribution helper script directly from the Userscripts site. As alerted by George Couros, clicking that Install button in Chrome now gives you: Apparently in the name of “security” Google is taking a page from Apple: We’re constantly looking out for ways to make […] ➡
- 2011
- Road Stats: Week 13 cc licensed ( BY ) flickr photo shared by cogdogblog Number of days on the road: 84 Miles Driven: 8788 Number of States/Provinces driven in: 15 Number of US/Canadian Border Crossings: 2 Money spent on gas: $2313.36 Photos posted: 1829 (that is an average of 21.7 per day) Number of nights in hotels/B&B: 9 Number […] ➡
- 2010
- Coming Full Circle: Hello Flickr CC-BY cc licensed flickr photo shared by mag3737 If anything I might remain consistently inconsistent. After two previous switches, I have reverted my flickr photo creative commons license to the Occam Razor version- BY Attribution. Right back where I started from. It was a little over a week ago, I switched to BY-NC, influenced by the […] ➡
- 2009
- Web Site Stratigraphy originally published over at NMC…. Me playing web paleontologist! As an appendix to the history of the NMC, I've been researching the evolution of its web site. With the aid of the invaluable Internet Archive Wayback Machine I've been able to identify, like in Geology, the major stratigraphic layers that marks this history. Join me […] ➡
- Let’s Put an End to Stupid Forms cc licensed flickr photo shared by voss You would think in an advanced electronic era that has brought us tools to broadcast our breakfast dilemmas and make our rock and roll dreams come alive that we might perhaps… maybe… improve the collection of information via @$#%#ing paper forms. There is no excuse for wasting my […] ➡
- 2005
- How Cool is
Panther Tiger Spelling? Regular CDB readers (or new ones) know I can hardly type one paragraph without creating at least 6 typos. I am sorry, I opted out of keyboarding class in high school (spending my adult years typing was not in my road map). I cannot type and thus my spelling goes out the window. Sure recent […] ➡ - Convince Curmudgeons with Comments? Hey, want to do me and the Maricopa Learning eXchange (MLX) a favor? Would you like to see something positive actually come out of comments? Read on. The set up might be long, but bear with me. I’d like to convince some of our faculty the worth of sharing their work, their efforts online, rather […] ➡
- How Big Is That Thing On The Map? The add-ons for Google Maps seem as vast and wide as the places you can click and swoop through there, especially once you go past the First Google Map Thing (finding your own house). A nice example is the Google Areometer, which allows you to click to place points on a map, and once a […] ➡
- 2004
- Survey Sez.,. Okay, 14 readers took the time to try the goofy, meaningless survey I posted as a quick demo of using phpQuestionnaire. The survey is open, and I have set this one up so the results are publicly viewable: http://zircon.mcli.dist.maricopa.edu/phpq/stats.php?sid=3. What was nice was that I could tweak it in midstream based on the early feedbacks […] ➡
- 2003
- Under the Flash and Gee-Whiz of Online Learning– a student experience Thank Jeremy Hiebert for sharing via his blog Old-School Adminstration of Online Learning’ÄÝ . Jeremy is very favorable of his online learning experience at Memorial University, which is a miracle considering the administrative hurdles placed before him. It is amazing students manage to learn online despite that our institutions are still operating in the wrong […] ➡
- OtherBlog MovableType Plugin Just came across the nifty MT Plugin: OtherBlog. This allows MovableTyple blogs to be able to include content on the same server. Plugin based way of including posts/info from other blogs on the same installation. I’ve yet to even try it, but I can already think about our BlogShop a way to provide a “super-blog” […] ➡
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.