September 1, 2009 Header
Smorgasborg - Random Objects

March 2010 Twenty-five posts

“I have been and always shall be your friend.”

“This is your thirty-fifth attempt to elicit an emotional response from me.”

“Is there a problem officer?”

Using tags: “Drawings”; How I use WordPress get_the_image()

If you’re like me, maybe you have a pile of posts in your WordPress database. I have 3426 posts in here. It’s a giant database of stuff. Good stuff, bad stuff, short stuff, long stuff. Slicing and dicing that content in a way that makes sense, or that allows you to find what you have written and posted before is tricky. Sure, you can use Google by adding “site:artlung.com” to your search query and get fairly good results. But for some things, wouldn’t it be great to be able to find things.

So in my effort to build a WordPress theme that suits me perfectly (I’m calling the theme “roanoke”), I’ve added a feature to provide thumbnail images for all my posts tagged with “drawings” — see https://artlung.com/blog/tag/drawings/.

Cool, no?

How do I do that? WordPress 2.9.2 can add Post Thumbnails:

Now, it’s a “dormant” feature. So your WordPress backend will not show that piece of the Posting interface if you have this line added to your current theme’s functions.php:

add_theme_support( 'post-thumbnails' );

I’m using a plugin called get_the_image, which can use the explicitly added “Post Thumbnail” feature if it’s there, OR use a few different other techniques. But mostly, it can analyze the currently referenced post and extract out the url of the first image being referenced. This is not perfect, as sometimes what it finds is a huge image, or maybe the first image is not the best image, but it still works pretty well. The plugin was originally written in 2008 (!) but works great for me.

So on my archive.php page, here is my code. This is not optimized or even particularly reusable, I include it here for reference for those of you looking for ideas:

// Need a way to pull these urls into the library.
	$args = array(
		'custom_key' => array( 'Thumbnail', 'thumbnail' ),
		'attachment' => true,
		'default_size' => 'thumbnail',
		'the_post_thumbnail' => true,
		'default_image' => false,
		'order_of_image' => 1,
		'link_to_post' => true,
		'image_class' => 'imageThumbNail',
		'image_scan' => true,
		'width' => 200,    
		// 'height' => 200,
		'echo' => false,
		'format' => 'array',
	);	

if ($tag == 'drawings' && function_exists('get_the_image')) {
	print '<div>';
	$item = get_the_image( $args ); 
	?><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" class="blogxPermalink"><?php
	$dir = "/blog/wp-content/uploads/get_the_image/";
	$filename = array_pop(explode('/',$item['url']));
	$filename = explode('.', $filename);
	$nil = array_pop($filename);
	$filename = implode('.', $filename) . '.jpg';
	$filename = str_replace('.400.', '.', $filename);
	$filename = str_replace('.225.', '.', $filename);
	print "<img src="{$dir}{$filename}" border='0' alt='' />";
	print "</a>";
	// print htmlentities(print_R($item, false));
	print "</div>nn";
} else {
	print "<!-- get_the_image not included or not drawing-->";
}

Now, you’ll notice that I hardcode the path to the image, and I’m not using the original image itself, but referencing a copy that I put into my ‘wp-content/uploads’ folder. For now, this works fine, though I really think something that automates grabbing the images, and automatically generates an appropriate thumbnail (I’m using 200 pixels wide) would be best.

So if I make a new post with the tag “drawings” now, I also have to do the legwork to make a new thumbnail. I also have to be mindful of filenames. This is not a problem for me since I am always extremely sensitive to prefixing filenames with dates, and flickr is too. Since these are my sources, it all works out pretty well.

Here’s a detail of how it looks:

New page for my "drawings" tag archive in wordpress -- DETAIL

Comments, ideas, and suggestions are welcome. See it for yourself!

Collaboration

Thank You Card, 2010-01-17 by Leahpeah and ArtLung

Back in January, Leah posted a scan of a thank you card we made together. That was really fun to make.

The day my twitter icon showed up on local TV

Okay, maybe not that exciting. See it on a local tv station WSLS: Jay Learns How To Tweet. A screenshot:

Awesome blog post about Stew fanhood.

color me passing strange on the BOX blog is worth a read for Stew, Negro Problem and Passing Strange fans. It aligns with many of my own experiences, particularly the Adams Avenue Music festival and Java Joe’s in Ocean Beach. It also links to some of the lyrics I have posted over the years.

Stew, The Negro Problem, Passing Strange. Awesome.

Which American Accent Do You Have?

Which American accent do you have? / Neutral / You're not Northern, Southern, or Western, you're just plain -American-. Your national identity is more important than your local identity, because you don't really have a local identity. You might be from the region in that map, which is defined by this kind of accent, but you could easily not be. Or maybe you just moved around a lot growing up.

“Or maybe you just moved around a lot growing up.”

That sounds right.

In Islands in the Net I think Sterling refers to the homogenization of American accents as the result of the flattening aspects of “the net.” Net English, I think it how he describes it. Consuming a lot of media–television–I’m sure has had that effect on me. I wonder what my new exposure to more Mid-Atlantic to Southern accents here in Roanoke, Virginia will do to me. Maybe nothing, perhaps my accent is set for life. Can accent change later in life? I don’t know how that works.

The differences in accent and idiom are fascinating everywhere. Some favorites at random and off the top of my head. There are many more that I find interesting than the ones on this list:

  • The usage of “dude” in California
  • Spanglish (Spanish and English interspersed)
  • Tanglish (Tagalog interspersed with English)
  • The clipped pronunciation and precise diction of some Filipino nurses
  • UK english idioms in film, tv, music (“take a decision” vs. “make a decision,” usage of “Cheers” as a greeting)
  • The faux cockney (I think) of people like Lily Allen and Kate Nash–as I understand it they have been criticized for sounding cockney when they’re actually middle or upper-class.

I remember that my father, when we lived in New Orleans 30 years ago, would slip into something like a faux Southern accent sometimes when doing business with someone who’s working class. My dad was a Navy brat, like me. For kids who move around, going to new settings, I think language can be part of what can help you blend in. There’s a bit of “chameleon,” I think, to kids like that. I wonder if or how much I used it that way.

(Oh, and I found the quiz via Meg)

Very frank talk on Conservative Media from a conservative

Frank talk about the interests of governance vs. conservative media in David Frum: Waterloo:

I’ve been on a soapbox for months now about the harm that our overheated talk is doing to us. Yes it mobilizes supporters – but by mobilizing them with hysterical accusations and pseudo-information, overheated talk has made it impossible for representatives to represent and elected leaders to lead. The real leaders are on TV and radio, and they have very different imperatives from people in government. Talk radio thrives on confrontation and recrimination. When Rush Limbaugh said that he wanted President Obama to fail, he was intelligently explaining his own interests. What he omitted to say – but what is equally true – is that he also wants Republicans to fail. If Republicans succeed – if they govern successfully in office and negotiate attractive compromises out of office – Rush’s listeners get less angry. And if they are less angry, they listen to the radio less, and hear fewer ads for Sleepnumber beds.

So today’s defeat for free-market economics and Republican values is a huge win for the conservative entertainment industry. Their listeners and viewers will now be even more enraged, even more frustrated, even more disappointed in everybody except the responsibility-free talkers on television and radio. For them, it’s mission accomplished. For the cause they purport to represent, it’s Waterloo all right: ours.

The article has some real smart realpolitik. It’s too bad the rest of the party couldn’t muster the will to execute on compromises to get something out of a popular idea–healthcare in the USA needs fixing. It’s time to start fixing it.

Regarding the tone and method of the conversation–the Great Republic of the United States of America is better served by better, smarter, more tolerant discourse.

It turns out extremism in the defense of liberty can be a vice, sometimes. (apologies to Barry Goldwater) (and actually, I quite like the full quote better than just the first part. The full quote from Goldwater is apparently:

I would remind you that extremism in the defense of liberty is no vice! And let me remind you also that moderation in the pursuit of justice is no virtue!

Chatroulette: Merton, Ben Folds

The wonder serendipity that was part of the net I remember now gets YouTubed and shared back with the world.

I wrote about Chatroulette last month, here’s some wonderful video that is internet + piano + video + flash-enabled randomized connected chat. It’s a wonderful selection.

Note: there are swear words.

I still like Ben Folds. His interview on The Sound of Young America was quite good. The earliest mention of him I can find of him here on the blog is 2002.

I still have not hat the gumption / guts / foolhardiness to actually try Chatroulette though. But I look forward to more interesting improvisation and performance to come out of it. Artistic agenda + random audience = interesting YouTube. Well, or a trainwreck or offensiveness of the worst kind.

via waxy

I am 40.

40

I’m not sure why exactly they call it “The Big Four Oh.” It is startlingly common to hear it called that. My mom, my mother-in-law. Maybe everyone calls it that. I don’t remember 30 being called “The Big Three Oh” though.

I’m not sure what I think about turning 40 yet. I feel pretty good. Imperfect, moving forward me. Yo holmes, onward.

Previous birthdays mentioned on the blog: 31, 32, 33 (wherein I was recovering from dental surgery and leah was taking wonderful care of me, a habit she has continued!), 34 (it was National Corndog Day. And it is again.). In 2005 I didn’t have a birthday. 36, 37, 38, 39.

Faithful readers, thanks for stopping by. Thanks for being my neighbor!

Won't You Be My Neighbor

Sabotage Video a la Galactica

←February 2010April 2010→