How to post photos from a palm to word press

From Ian's Wiki

Jump to: navigation, search

Contents

[edit] On the wordpress

Wordpress for reasons that escape me sanitizes the file names before uploading. This makes it really hard to guess what the final file name is. So I disabled the most annoying checks. I removed the tolower statement that converts all the uppercase characters to lower case, and removed conversion of '_' to '-'

changed wp-includes/formatting.php

function sanitize_file_name( $name ) { // Like sanitize_title, but with periods
        $name = strtolower( $name );
        $name = preg_replace('/&.+?;/', '', $name); // kill entities
        $name = str_replace( '_', '-', $name );
        $name = preg_replace('/[^A-Za-z0-9\s-_.]/', '', $name);
        $name = preg_replace('/\s+/', '-', $name);
        $name = preg_replace('|-+|', '-', $name);
        $name = trim($name, '-');
        return $name;
}

to

function sanitize_file_name( $name ) { // Like sanitize_title, but with periods
        //$name = strtolower( $name );
        $name = preg_replace('/&.+?;/', '', $name); // kill entities
        //$name = str_replace( '_', '-', $name );
        $name = preg_replace('/[^A-Za-z0-9\s-_.]/', '', $name);
        $name = preg_replace('/\s+/', '-', $name);
        $name = preg_replace('|-+|', '-', $name);
        $name = trim($name, '-');
        return $name;
}

[edit] On the Palm MO:BLOG

I am using MO:BLOG, which you can download a working trail version

[edit] Install

  • Create a new blog (menu->New Blog)
  • Enter the Blog Name
  • Type: metaWeblogs
  • User ID: this should match your wordpress user
  • Password: This should match your wordpress password
  • URI: http://yourwebsite/xmlrpc.php
  • Blog ID: Hit refresh and if everything is working you should see your blog
  • Hit Save


  • hit the button to to create a new post
  • Menu -> Tools -> Manage snippets
  • Name: image
  • code: <img src=/wp-content/uploads/%a height="255">
  • hit save
  • hit back


[edit] To Post

  • T: enter the title
  • hit the attach icon in the bottom left
  • Choose your photo
  • Chose ok
  • hit the snippets button (the one next to the attach)
  • Select image
  • You should now have the image tag plus the name of the attachment in your post
  • You can repeat this for each image you want to post, the snippets button will always use the last image you attached
  • Choose the save ion
  • Choose the Left arrow icon
  • Choose the publish icon (left bottom)
  • The post will be published and will no longer show up on the list

[edit] On the Palm U*BLOG

[edit] Install

  • top right hand corner click dropdown and choose Edit Blog
  • Choose New
  • Name: "name of your blog"
  • Type: metaWeblog
  • username:
  • password:
  • host:www.imacdonald.co.uk
  • XML-RPC Path: xmlrpc.php
  • click find, if everything works then it should should you full blog name
  • click more, remove all the text for Image Archive path
  • Ok
  • OK
  • press menu button
  • choose settings
  • Change image path to /DCIM/PALM/
  • click ok
  • click new post
  • click the tag icon (the one that looks like a paper tag)
  • choose "edit Tags"
  • click new
  • name: image
  • for the content enter: <img src=/wp-content/uploads/%f>

[edit] To Post

  • Title: Name of the post
  • click the paper clip icon
  • click the paper clip icon again
  • choose your photo
  • click select
  • click return icon (orange arrow)
  • click in the body of the post
  • click the tag icon
  • choose image
  • click post icon (paper with arrow pointing up)
Personal tools