Posts tagged ‘WordPress’

iPhone 4 as a blogging platform

The iPhone is a powerful handheld computer. (Yes, it can also make a phone call but who does that anymore?) So the logical test for me was blogging with it. Here is my workflow …

My blog posts are nearly always accompanied by a photo, image, or graphic. The layout is mostly standard with the image on the right near the top and the text flowing around it.

My blog is running WordPress software. I’ve installed the Postie plugin which adds extensive “blog by email” support. I’ve configured WordPress’s “media” settings to create small, medium, and large thumbnails. I have configured Postie to use the medium sized thumbnail and to add the necessary markup to position the image and to link to the original.

What was left was to find a solution to “decorate” the images. On my desktop computer, I use Windows Live Writer. It has build-in features to add drop shadow, borders, etc. I also have GIMP for more extensive editing. On the iPhone I’ve installed a few different apps. The most technical of these is PerfectPhoto which gives me most of the color/light editing functions of GIMP. For taking pictures and handling some predefined edits, I like Camera+. (Before you ask, I did snag Camera+ before Apple pulled it from the app store – Google for the controversy.) The ColorSplash app is for that “colored b&w” effect and Photo Finish is for adding borders and edges (I don’t like the look of a plain photo for my blog). I wish Photo Finish supported native resolution but it always rescales to match its fixed frames. (It looks like a 1.0 release and the developer has moved on.) For blogging “on the go”, I can live with it.

To blog, I just compose an email. It’s a bit backwards actually. The iPhone does not let you add a photo to an email. Rather, you email a photo – from the camera roll – and add text to it.

This post is an example of the above process and tools. Oh. Before you send you email to get posted, make sure to delete your ‘sig’ at the bottom. There’s probably no need to post you contact info

WordPress + WPTouch + WP-HashCash (update)

UPDATE: In a prior post I mentioned this blog uses WordPress with the WPTouch plugin for great mobile device support (iPhone & Touch, Blackberry, Android, etc.) and the WP-Hashcash anti-spam plugin.

Things were not as "plug-and-play" as I would like. Well, with the 1.9.7.7 update to WPTouch, life is much happier.

Now, if you simply turn off AJAX comments in WPTouch, everything plays well together. No code changes required !

Thanks BraveNewCode ! … look for a little something in your beer fund :-)

Using WordPress with WPTouch and WP-HashCash

If you use WordPress you should definitely install the WPTouch plugin and give your readers a great experience for their mobile device (iPhone, Blackberry, Android, etc.) Additionally, I am fond of the WP-Hashcash anti-spam plugin since it works well and does not require posters to read one of those CAPTHA images.

Unfortunately, out of the box, things do not play well together. The symptom is that comments that come through the WPTouch experience, will be flagged by WP-Hashcash as potential spam because it did not get a value generated key. There are a lot of background that is not important. There are two ways to make things play well. One has minimal changes but does not support AJAX comments. The other is more invasive but retains all the functions of both plugins.

 

Minimalist Solution:

WP_Hashcash requires two things in the theme – some JavaScript to be inserted in the header and a hidden field inserted into the comment form. The plugin uses hooks for each of these so the theme only needs to conform to the following.

WP Hashcash relies on the presence of two hooks in your theme, wp_head and comment_form. If your theme doesn’t include these actions, you will need to add them immediately before the </head> and </form> tags respectively.

source: Elliot Back, author of WP-Hashcash

Things are a bit spread out. If you have already enabled your normal theme for WP-Hashcash, then the wp_head() change is already done since WPTouch adds to your normal header. However, WPTouch provides its own comments page so you will need to edit that. It’s location is:

  /public_html/blog/wp-content/plugins/wptouch/themes/default/comments.php 

Just add the following before the closing </form> tag:

  <?php do_action('comment_form', $post->ID); ?> 

There is one more thing. In the plugin settings page for WPTouch, you will need to turn off AJAX comments.

 

Full Function Solution:

You make the changes described above but you do not need to turn off AJAX comments. You then need to make some code changes to both WPTouch and WP-Hashcash.

Back in the same directory as WPTouch’s "comments.php" there is the partner file called "comments-ajax.php". Edit this file in two places – adding one line (seen below in bold green) and appending to another (seen below in bold blue).

  $comment_author = trim($_GET['author']); 
  $comment_author_email = trim($_GET['email']);  
  $comment_author_url = trim($_GET['url']); 
  $comment_content = trim($_GET['comment']); 
  $wphc_value = trim($_GET['wphc_value']); 
  ... 
  $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID', 'wphc_value'); 

Now edit the "wp-hashcash.php" file which should be in the root of your plugins directory. Near the very bottom of the file, there is a comment, "Check the wphc values against the last five keys". There are actually two instances of this comment and you will make changes for the one in the "wphc_check_hidden_tag()" function. The code only looks for the "wphc_value" field in the _POSTS data. If you are using WPTouch AJAX comments, the changes above have added this field to the compacted "comment data". Now you need to check both locations as follows:</P?

  $hash_value = $_POST["wphc_value"]; 
  if (!$hash_value) 
    $hash_value = $comment['wphc_value']; 
  $spam = !in_array($hash_value, $options['key']); 
   
  if($options['logging'] && $spam) 
    $comment['comment_content'] .= "\n\n[WORDPRESS HASHCASH] The poster sent us '".($hash_value)."' which is not a hashcash value."; 

Mobile-fy the web

IMG_0161

I’ve become one of those "smoker bigots" – you know the kind … they quit smoking and *THEN* start preaching all the bad things that smoking does. My conversion was not that I was a smoker; it was the "mobile browser".

I am blogger and user of the web but until about 6 months ago I was mostly on my computer. I now read blogs, feeds, news, and more using my iPod and/or my Blackberry. I use if for Facebook, the weather, Twitter (a little), and most of my personal email. I realized my blog was not as friendly to these mobile devices as it could / should / and eventually would be.

So, I set about to add support for mobile devices and mobile users. It was easy for my blog since it uses WordPress and there is the WPTouch plug-in that makes it nearly automatic. It added support for the devcies I use most often and I even added support for the Androids of the world. (If you have a mobile device and it is not working with my blog, add a comment and I’ll do my best).

So, now I grumble whenever I hit a website that *does not* have special support for mobile devices. I realize I am being zealous but that has not stopped me from small internal unseen spurts of frustration. Oh well. I guess I could seek counseling.

How many times will you do the same thing ?

wordpress-facebook Blogging, tweets, Facebook walls …. it can all be too much. For me it can all be too redundant. Like Ramírez said, "in the end, there can be only one".

I’ve been running a bit of a social experiment on myself over the past few weeks. anyone who reads this blog has noticed I have not been as prolific as I usually strive to be. It is partly because I’ve been in an experiment on Facebook. All that is wrapping up now. I have decided I can’t be master/mistress to two slaves …. wait, strike that and reverse it.

My preferred outlet is blogging. I like the longer for it promotes and I like the combining of words and pictures. However, blogging as more of a "broadcast" and Facebook allows me to listen to others. So, I have gathered so twine, bailing wire, and glue. I will blog for most of my content and "listen" and comment over on Facebook. I hope this keeps most of my efforts singular. time will tell.

… and for the record, I once again spent way too much time creating the artwork for this post.