what i find interesting about blogging is how readily people put their personal lives out for anyone to read. not only is it a terrific end-run around the orwellian panopticon, but it also makes me wonder what effect on people might this culture of blogging be having?
on a recent plane flight, some people in seats near me were reading people magazine or us weekly. and it struck me in a way i didn’t expect, to see the pictures of vaguely familiar actors and models in semi-private settings flip by. how is it completely legal for someone to stalk a person, take a picture of them, and then publish it in a national magazine? what are the bounds? should there be a creative commons license for personal privacy/identity? (and wouldn’t it be great as a tattoo!?)
i had this thought while looking at a picture of matt damon and his girlfriend in a magazine laid open on the lap of the sleeping person next to me. it was a full page picture, and they were walking directly towards the photographer, looking pretty run of the mill. the caption said something about their having come back from a u2 concert. made me wonder what the world would be like if the photographer was legally obligated to ask the couple if he could take/publish their picture.
the thing i like about blogs is that i pretty much control the information i put out there. there are some things i blog about, and some i don’t, and i get to decide what, when, how much. but it doesn’t appear that matt damon is afforded the same luxury, walking down the street mid-conversation with his girlf. of course there are exceptions. friends and people i know can blog about me. someone i don’t know could blog about me. but what’s nice is that among bloggers, we’d be on somewhat even footing.
for instance, cory doctorow could tear into me on boingboing (i don’t know why he would do that), which is a much bigger stage than justinsomnia, but in so doing he’d probably link to me and my traffic would spike, wherein i would have a massive captive audience reading my rebuttal. but matt damon doesn’t have a forum comparable to people magazine to post pictures of the photographer in private moments (but it would be cool if he did). so the disincentive for the photographer (that exists for the blogger) is diminished.
anyway, it makes me wonder what percentage of people choosing to blog is borne out of our paparazzi culture? do i feel more comfortable posting photos of myself online because that’s what i see in so many magazines? am i subconsciously emulating people magazine? if not me, what about everyone else?
Inspiration
I got the following comment on a previous post:
I love your blog design a lot. I especially *LOVE* your MONTHCHUNKS archives. (It’s tiny, clean and stylish!) Is it possible to post a tutorial on how to achieve that sort of layout? I really really wish to add the same MONTHCHUNKS to my blog :D
Sure, no problem. Back when I used Blogger to publish my blog, I wrote some JavaScript to transform Blogger’s verbose archive link list into something a little more compact. But with WordPress, I was able to write a little PHP code to get the job done on the server. Thanks to Jackson for initially suggesting I turn my Monthchunks function into my first WordPress plugin.
Output
The Monthchunks plugin outputs the links to your archives as list items by year, with a link to each month by number:
When you’re viewing a monthly archive page, the number for that month will be bold and not linked. Like the default behavior of wp_get_archives()
, Monthchunks only outputs list items <li>...</li>
for each year. When you call the function, make sure that it’s wrapped in <ul>
or <ol>
tags.
Instructions
- Download Monthchunks v2.3 from the WordPress.org Plugin Directory (or from me here)
- Unzip the file and upload the folder
monthchunks
to your /wp-content/plugins
directory
- Activate the plugin
- Edit the theme template file sidebar.php in your theme’s directory:
/wp-content/themes/name-of-theme
- Look for this snippet of code:
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
and change it to this:
<ul>
<?php monthchunks(); ?>
</ul>
Options
The monthchunks()
function can take two optional parameters in between the parentheses.
<?php monthchunks(year_order, month_format); ?>
- year_order is a string (
"descending"
or "ascending"
) that determines whether the years are displayed in ascending (e.g. 2001, 2002, 2003…) or descending (e.g. 2003, 2002, 2001…) order. The default is descending.
- month_format is a string (
"numeric"
or "alpha"
) that determines whether the month links are printed out as numbers (e.g. 1 2 3 4…) or letters (J F M A…). The default is numeric.
If you wanted to sort the years in ascending order with letters for each month, you’d do this:
<ul>
<?php monthchunks("ascending", "alpha"); ?>
</ul>
Update: Monthchunks was included in the Japanese book, WordPress 標準ガイドブック (Standard Guidebook), and on its accompanying CD. Check it out!
Questions, comments, and suggestions are always welcome. If you’re interested in contributing to the code behind Monthchunks, it’s hosted on GitHub.
Update: This post is not intended for the faint of heart. It describes in some detail what it took for me to move my Blogger blog (circa March 2005) to WordPress 1.5. Much of it is obsolete, as WordPress 2.0 has a much simpler, more user-friendly process for importing posts and comments from Blogger. If you’re interested in moving your Haloscan comments to WordPress 2.x along with your Blogger blog, please see my “new and improved” version of this post, Importing Haloscan comments into WordPress from Blogger.
when i moved from blogger to wordpress 1.5 (a few weeks ago) the process proved to be a little less than painless. partly because the following two requirements of mine were somewhat outside the scope of the provided blogger import script.
- i wanted the existing blogger permalink post urls (based on the year, month, and post title) to be the same in wordpress (ignoring the .html difference which could be solved with mod_rewrite). Update: I’ve written a new post with information on maintaining your permalinks when moving from Blogger to WordPress. (17-Oct-2006)
- i wanted to import my haloscan comments. update: i’ve written a new post with information on importing haloscan comments into wordpress. (23-Jun-2005)
as a result, what you’re reading below is a partial simplification of the 3 tries it took before i was able to successfully import everything. knowing the following sql:
RENAME TABLE tbl_name TO new_tbl_name;
SHOW CREATE TABLE tbl_name;
was extremely useful when i needed to rename a table with munged data and then recreate it without reinstalling wordpress.
haloscan preparations
i had to make the following two changes to import-blogger.php (based on code written by ravingmadness) to ensure that the unique id blogger assigns to every post got included in the content of the blog post as an html comment. since haloscan uses this id to associate comments with each post, the number is crucial in maintaining that link when importing the comments later.
uncomment line 61:
$post_number = $postinfo[3];
change line 127 to this:
$post_content = addslashes("<!--" . $post_number . "-->" . $post_content);
it occurs to me now that it probably would have been easier to include the post id as a comment in the simplified blogger template below, rather than having to modify blogger-import.php. for an example of this, see my post importing haloscan comments into wordpress.
standard blogger import
after running the blogger import script (blogger-import.php) for the first time, it instructed me to replace the blogger template with the following:
<blogger><wordpresspost><$BlogItemDateTime$>|||<$BlogItemAuthorNickname$>|||<$BlogItemBody$>|||<$BlogItemNumber$>|||<$BlogItemSubject$></wordpresspost></blogger>
then change a few other settings in blogger, republish the whole blog to the root wordpress directory, and finally start the import process.
maintaining the post page filenames from blogger
Update: I’ve written an additional post entitled Maintain permalinks moving from Blogger to WordPress that enables you to automatically import your Blogger permalinks (aka the “post slug”) into WordPress 2.0 along with your posts and comments. (17-Oct-2006)
in order to maintain the permalink urls for each post created by blogger, i had to make sure the “post slug” (aka dirified post title) in wordpress matched the filename of the post page created by blogger. unfortunately, blogger’s dirify algorithm is different than wordpress’, leaving out articles (e.g. “a”, “the”) and truncating the title length.
first i fixed several imported posts that didn’t have titles at all (oops). blogger still dirified them (based on the first few words of the content), but wordpress did not. luckily there were only three, which i fixed by hand:
- ran the following query:
SELECT LEFT(post_content,80) FROM wp_posts WHERE post_title = '';
- based on the content, looked up the posts in blogger to figure out how it had dirified them
- updated the post slug and title in wordpress manually
next i had to get the actual permalink urls out of blogger and into a format that i could use to compare with the newly imported posts in wordpress. i created the following template, with a tab between the two tags to get a list of the titles and their dirified permalinks.
<blogger>
<$BlogItemTitle$> <$BlogItemPermalinkURL$>
</blogger>
i concatenated all the new monthly archive files blogger produced:
cat *_wordpress.php > blogger_post_titles.txt
then ran some regular expressions to clean up blank lines, removing .html on the ends of the permalinks, and the hostname/path from the beginning. at this point i had a nice clean tab-separated file of post titles and slugs to import into mysql.
i created a table in the wordpress database to store the (thankfully unique) post titles and slugs.
CREATE TABLE blogger_post_titles (post_title text, post_slug text)
i used the mysqlimport utility to import the tab-separated text file into the database table.
mysqlimport -p wp blogger_post_titles.txt
the following query updated the post slugs in wordpress to be equal to the filenames i’d extracted from blogger.
UPDATE wp_posts
LEFT JOIN blogger_post_titles ON wp_posts.post_title = blogger_post_titles.post_title
SET wp_posts.post_name = blogger_post_titles.post_slug
rewrite rule to match blogger urls with wordpress permalinks
now i had to write a rewrite rule that would catch requests for the old post page urls with .html extensions (e.g. /2004/02/hello-world.html
) and redirect them to urls without (e.g. /2004/02/hello-world/
). figuring this out took much longer than i expected, mostly because i was trying to accomplish it with an apache redirect directive. it turned out to interact badly with the rewrite rules created by wordpress. so i ended up writing a rewrite rule instead (outside the block of rules generated by wordpress).
RewriteRule ^([0-9]{4})/([0-9]{1,2})/([^/]+)\.html$ $1/$2/$3/ [QSA,R]
importing comments from haloscan
this was hard. haloscan allows comment exporting using the caif format, so i started by hacking up phil ringnalda’s caif2mt.php code. i got this almost all the way there when i discovered that haloscan was only exporting the raw text of the comments with none of the html tags. what a waste. i sent a support email in, and still haven’t heard back.
ravingmadness’ previously-cited post got the comment data by requesting each individual comment webpage from haloscan, scraping the page with some regular expressions, and then inserting the appropriate fields into the wordpress database. this is just what i had hoped to avoid by using caif.
unfortunately the code was a little hard to read and the regular expressions depended on a typical haloscan template layout—mine had been significantly modified. i wanted to make things a little easier on myself, so i added the raw haloscan data in an html comment beneath each actual comment, but before {HSCommentEnd}
. this allowed me to write and debug the import script without having to turn off the ability to leave comments.
<!--
<export>{HSCommentName}
|||{HSCommentUrl}
|||{HSCommentDate}
|||{HSCommentMessage}
</export>
-->
note: i’ve never collected commentor’s email addresses, so i didn’t bother to collect them here.
update: it occured to me that the ability to change the haloscan template requires that you’ve donated some amount of money to become a premium customer. since i imagine few people have taken that step, you may be better off using ravingmadness’ haloscan import script which uses regular expressions to extract the comment data based on the standard haloscan template.
update: ravingmadness’s haloscan import script is out of date and probably won’t work for you unless you’re comfortable hacking and debugging php. i hope to write a new and improved import-haloscan script for wordpress at some point in the future. (13-jun-2005)
update: i’ve written a script that imports haloscan comments directly from the exported CAIF files into wordpress. see importing haloscan comments into wordpress for more information. as a result you can safely disregard most of the information in this post about importing comments. (23-jun-2005)
then i wrote a script that loops through each imported wordpress post, gets the wordpress post ID and the old blogger post id from within the html comment in post_content. then it fetches the appropriate haloscan url using the unique blogger post id, parses the html for the commented out comment content, and inserts the comment fields into wp_comments. though i don’t recommend this script for public consumption it might help someone out there: import-haloscan.phps.
before using it, i’d recommend commenting out line 110 mysql_query($sql);
(which inserts the comment into the wordpress wp_comments table) to make sure the code is working for you.
Dissing blogging is like dissing communication. Making fun of blogs is like laughing at the masses and denying them their first amendment rights. Blogs are inherently an expression of free speech. They represent the use of technology to proliferate information, opinions, and ideas. A printing press in every home! To laugh at that expression from a position of authority and power is the epitome of the WORST kind of elitism.
How could an American Library Association President Elect Michael Gorman (even satirically) stoop to trample on that?
I think there should be a pot on whether he gets ousted.
if we see blogs in terms of conversations (a much overhyped metaphor as of late) what are the implications for journalism, now undergoing a transformation at the hands of bloggers?
not only does blogging enable subject matter experts to bypass a journalist middleman/woman, it also allows non-experts (i.e. the rest of us) to post what essentially amount to as requests for comment. usually they follow the form, “i think this, that, and the other” optionally followed by “anyone have any thoughts?”.
the blog’s readers (who may themselves be bloggers) then have an opportunity to respond, either by posting links to supporting or refuting sources or by furthering the discussion on other blogs in the form “blockquote, response”. this can go on ad infinitum, which certainly represents the bursty and asynchronous flow of information better than the daily new cycle.
the mainstream media derides non-expert bloggers but really they only represent the beginning of the process, the start of the conversation. other bloggers gather information, check facts and sources, question or explain the content. a certain few blogs and aggregators (boingboing, slashdot, blogdex, technorati, etc.) act as central information hubs, disseminating the latest and greatest and keeping people up-to-date.
the truth is that there isn’t only one type of blogger and no single blogger represents one and only one type. we are all writers, fact checkers, editors, reporters, paperboys/girls (connectors) to varying degrees with every post we post.
so while i’ve said bloggers should be asking themselves, “how can we be more like journalists?”, journalists should be asking, “how can the news be more like a conversation?”