Posts Tagged ‘WordPress’

Enabling skype: and sip: URLs in WordPress MU 1.5.1

Wednesday, June 11th, 2008

Last week when I put up my request for readers to dial into some sample voice applications, I received the feedback (ironically via Twitter) that my “skype:” and “sip:” URLs weren’t working. They appeared in the text correctly:

skype:+990009369996076704
sip:9996076704@sip.voxeo.net

but they weren’t “clickable”. Instead of launching your Skype or SIP client, they went instead to:

http://blogs.voxeo.com/voiplab/2008/06/03/got-a-minute-to-make-a-couple-of-phone-calls-to-generate-some-traffic-for-screencasts/+990009369996076704

http://blogs.voxeo.com/voiplab/2008/06/03/got-a-minute-to-make-a-couple-of-phone-calls-to-generate-some-traffic-for-screencasts/9996076704@sip.voxeo.ne

Neither of which worked, of course, so people got the good old 404 screen. (Some of you may know where this is going…) A quick look at the code showed the problem:

<a href=”+990009369996076704″>skype:+990009369996076704&t;/a> or <a href=”sip:9996076704@sip.voxeo.net”>9996076704@sip.voxeo.net</a>

The “skype:” and “sip:” URL prefixes were being helpfully stripped out when the post was being published! The links were then relative URLs which were of course bogus.

The solution turned out to be similar to what I could do to solve my embedding XML problem… modify the kses.php file. There at line 338 was this:

function wp_kses($string, $allowed_html, $allowed_protocols = array (’http’, ‘https’, ‘ftp’, ‘ftps’, ‘mailto’, ‘news’, ‘irc’, ‘gopher’, ‘nntp’, ‘feed’, ‘telnet’)) {

And so a simple change of adding ’skype’ and ’sip’ to the end of the list like this:

function wp_kses($string, $allowed_html, $allowed_protocols = array (’http’, ‘https’, ‘ftp’, ‘ftps’, ‘mailto’, ‘news’, ‘irc’, ‘gopher’, ‘nntp’, ‘feed’, ‘telnet’, ’skype’, ’sip’)) {

seems to have fixed the problem. I had to re-enter the URL prefixes on the original post, but now the “skype:” and “sip:” URLs do work in the edited post.

Fun, fun, fun…

Technorati Tags:
, , , ,

Adding video comments to WPMU using Seesmic’s new plugin

Thursday, April 24th, 2008

seesmiclogo.jpgIf you look down in the comments area of this - or any other blog post - you’ll now see a link that says you can add a video comment:
seesmicvideocomment.jpg

What’s going on? Well, I’ve added a new video plugin for Wordpress from the folks at Seesmic. Here’s brief video intro from me:

The plugin was announced yesterday on Techcrunch and also on (Seesmic founder) Loic LeMeur’s blog. The folks at Seesmic even nicely created a little YouTube tutorial about the plugin:

Adding the plugin to WordPress MU was very straightforward. I downloaded the code, unzipped it and copied the directory into the “plugins” directory (NOT mu-plugins). I then went into Site Administration -> Plugin Commander and clicked on the “Allow” link to allow individual blogs to have this capability. Next I went into the admin dashboard for this blog and enabled the plugin for this blog. Ta da… video comments and embeds into posts are now enabled.

Why didn’t I just enable it across all blogs? Well, I like the granularity of being able to enable or disable it on a per-blog basis. The reality is that I’ll probably enable it for all the blogs on this site that I primarily run. But we may have other blogs here that others run (as Chris does with the Voxeo Labs blog) where they don’t want to use video.

One note I should make. In the Seesmic plugin configuration (for each blog), I have opted to allow “anonymous” video comments, meaning that someone does not need to have a Seesmic account in order to leave a video comment. There’s a checkbox there that enables that kind of posting:
seesmicanonymouscheckbox.jpg

Now, the one down-side I’ve already discovered is that in order to use it to embed a video in a post like this, I have to use the WordPress web editor to write my post. However, I almost never use this web editor because I’ve gotten very addicted to doing all my blogging offline using MarsEdit. However, I think odds are that when I want to embed a video, I probably won’t want to write as much text, so I probably won’t need all the shortcuts that I’ve gotten used to in MarsEdit. (I may also be able to go into the web editor, record and embed the video, save it as a draft, and then pull it down into MarsEdit and do further editing there - I’ll have to try it.)

Outside of that, it seems like a cool way to add video into the blogging platform. Let me know what you think. Hey… if you have a webcam, you can leave me a video comment!

Technorati Tags:
, , , , ,

WordPress 2.5 is out… now to see when WPMU will update

Wednesday, April 2nd, 2008

wordpress.jpgWith WordPress 2.5 now out, we’ll be watching to see when WordPress MU gets updated. Of the long list of WP 2.5 features, the one that is honestly of most interest to me as the one running a blog site is of all things the improved editor:

Friendlier visual post editor — I’m not sure how to articulate this improvement except to say “it doesn’t mess with your code anymore.” We’re now using version 3.0 of TinyMCE, which means better compatibility with Safari, and we’ve paid particular attention this release to its integration and interaction with complex HTML. It also now has a “no-distractions” mode which is like Writeroom for your browser.

I don’t use the visual post editor myself - I do all my posting through the MarsEdit offline blog editor - but as I’ve been helping others post to this site, I’ve seen the existing editor as one of the things that sometimes causes challenges. So I’m looking forward to the new editor.

All the other features look good, too, so it should be an interesting release to get into place. Per a thread on the WordPress MU forums, though, it may be a little bit before WPMU comes out with a new release in sync with WP 2.5. As noted in that thread, WordPress.com needs to be updated first. We’ll see. This will be the first WordPress MU upgrade we’ll have done to this site, so it will be an interesting learning experience for us. Will the “upgrade” features of WPMU work as well as we would hope they will? :-)

Technorati Tags:
, ,

The challenge of embedding XML into a WordPress MU blog entry

Monday, March 31st, 2008

Given that we work with XML, we naturally want to include XML inside of our blog posts. However, that turns out to be a bit of a major headache. Over on our Voxeo Developer’s Corner blog, you can see what we are trying to do with posts like this one. We want to include snippets of XML code, complete with angle brackets, etc.

Obviously this can be done through good, old “HTML character entity substitution. In order to get:

<prompt>

we simply enter it into WordPress MU as:

&lt;prompt&gt;

We can do that - and certainly any number of text editors make it now easy to go through and swap all symbols over to their corresponding HTML character entities. But this is rather a pain in the neck. You have to bring the code into one of those editors, select the entire text, and then execute whatever script you use to to the character conversion. It takes a little bit of time and when you are trying to get folks like our busy support team to also contribute blog entries, you want to reduce anything that adds time to the posting process.

What I was ideally trying to do for our authors was make it so that they could do something like this:

<code>
… XML code…
</code>

With something like this, they could simply copy/paste their XML code directly into the WPMU editor and… ta da… publish the post. In trying to make this ideal a reality, I worked my way through installing a number of different “code markup” plugins for WordPress:

I also looked at Code Viewer but really did not want to store the XML code in separate files.

I installed each of these (in some cases multiple times), read and re-read the instructions, added the appropriate markup (usually <code>) around the block of code, published the entries and…

Nothing.

All the posts looked horrible and didn’t display any of my XML code. This was all incredibly frustrating and after spending a sizable chunk of my time trying to make this work, I finally posted my problem on the WPMU Forum and soon received my answer.

It turns out that WordPress has a file called “kses.php” which lists all of the tags that are allowed inside my post. Any tags not in the allowed list get stripped out! This obviously occurs before the code markup plugins step in and do whatever conversion they do of the code into HTML character entities. So… all my XML code appears to WPMU as regular tags, which, because they aren’t listed in kses.php get stripped out.

Oops.

The end result is that it appears that I have two options:

1. Enter all the relevant VoiceXML, CCXML and CallXML tags into kses.php so that they are allowed; or
2. Keep on doing it the text editor massive replace route.

Given everything else on my plate, we’re going to reluctantly have to stick with #2 and just keep on replacing the symbols with HTML character entities before copying/pasting into WordPress’ editor. It’s a pain - but I don’t see an option until either I find another solution or get the time myself to update kses.php.

If anyone reading this knows of another option, I’d love to hear it.

Technorati Tags:
, , , , ,