Category Archives: programming

Jumped Personal Site from MT 3.2 to WordPress 2.0.2

I have used WP for over two years and even coded plugins for it but never had time to convert my personal site to using WordPress. I have finally marked this task off my to-do list.

It was actually easier then I thought it would be and I plan to outline the steps I took to preserve my MT permalink structure in WordPress. What I had to do isn’t outlined anywhere on the web. I had to improvise with a variation of a couple different methods. WordPress 2.x imports differently then past versions so that was the real trick…..outline coming in the next week. 

WordPress DraftControl Plugin – New Version Soon

I am working on a new version of my DraftControl plugin for WordPress. This version will support WP 2.0 and also batch publishing. I have a full feature list but I need to get this out because a lot of people are moving to the latest version of WP. The next release will be DC 1.2 with version 1.5 to follow very soon after. I need beta testers so if you are interested contact me at ken[at]kenvillines[dot]com.

Quicktime Scripting & playing Fullscreen

Sometimes building QuickTime Scripting Controls into your web pages can be tricky. The differences between Windows Media Player and the Quicktime Player are very significant. The first problem is that they have different scripting APIs. When you are a video profressional trying to post your work to the web this can be tasking.

One of the Javascript function calls for the Windows Media Player allows fullscreen playback on the client desktop. The quicktime API doesn’t support this feature from within the plugin. The video producer will have to force the plugin to send the video to the QuickTime Player. The media, being either a .qtl or a .smil file, is basically a reference or pointer to the real Quicktime video or audio file. The Quicktime Plugin reads the directives or properties within the file and follows the commands. That includes telling the plugin to play a video at fullscreen and sending it to the player to accomplish the task.

The files are both XML formatted but with different tagging structures. I am going to cover the easier of the two – QTL. I will save the SMIL lecture for another post.

Quicktime media Link or QTL for short allows you to create a text link on a web page that opens a movie in QuickTime player. For this to work, your web server must be configured to associate the .qtl file extension with the correct MIME type. The MIME type can be handled by placing a .htaccess file into the movies directory. Type the following info into the .htaccess file:

AddType application/x-quicktimeplayer qtl

The XML within the .qtl file will look something like this:

<?xml version="1.0"?>
<?quicktime type="application/x-quicktime-media-link"?>

Save this XML as “qtfullscreen.qtl” and into the same folder as your .htaccess file or vise versa. Now you can make a link from within a web page that calls your .qtl file. You now have a control to play your movie Fullscreen!!

Other important Commands for your XML file:

autoplay = “true” or “false”
controller=”true” or “false”
fullscreen=”normal” or “double” or “half” or “current” or “full”
loop=”true” or “false” or “palindrome”
playeveryframe=”true” or “false”

quitwhendone=”true” or “false”

Play Sample Movie Now!!

BTW: You can always open an HREF to your .qtl file using a javascript call.

Getting Started with Photoshop CS2 Scripting

I am finally getting back to revisiting Photoshop Scripting. I beta tested with Photoshop CS and wrote tons of scripts. Things have changed in CS2 but for the better :)

New features in CS2 scripting:

  • File Includes
  • Self Contained Scriptlet (New File extension)
  • Script Events

It is a one liner to include files in your CS2 script.

//Global contants or variables can be defined in another file.
//This line should go before any code that will execute methods.
// @include "YourFileToInclude.jsx"

The self contained scriptlet is also a one liner.

// This enables double clicking on the Mac OS or on Windows
// This line of code should be first if you want your script
// to be a self contained scriptlet
#target photoshop

The Scripting Events feature is not so much about coding but more about executing scripts when a given event happens within Photoshop CS2. Let’s say I always want a specific size of document, specific font selection, specific ruler units, and specific font color selected whenever I create a new document. I can write a script that will execute on CS2′s New Document Event. (That is another how to).

New Comment Template

I am happy to say my new comment template is finished. It took me all day yesterday…argh! I kept running into CSS issues, but then again I was trying to watch sports all day too. I will post something a little more meaningful later but for now click and make a comment :)

BTW: I have only tested the new templates in safari, firefox, Mozilla, and camino on Mac OS X. I fully expect to be making CSS tweaks later.

Using InnerHTML correctly within IE and Firefox

I have put this sample together so other programmers don’t run into the pitfalls I have.

IE supports innerHTML for table cells and FireFox doesn’t.

You have to embed a div within the table cell and perform all innerHTML calls on that. IE and FireFox both support this method.

Sample code below:

<script language="JavaScript">
/* This works for both IE and Firefox */
function toggleValue()
if(document.getElementById("currentItem").innerHTML != "1")
document.getElementById("currentItem").innerHTML = "1";
document.getElementById("currentItem").innerHTML = "2";


<table width =" 200" border="0">
<td colspan=2><br><center>
<a href="javascript:toggleValue()">Toggle Value</a>

<div id="currentItem">1</div>


FireFox or IE Gotcha:
FireFox does not support table tags when changing the value of a div using innerHTML()- when the div is within a table cell. Form tags along with most other tags are supported

*IE does support table tags when changing the value of a div using innerHTML() when the div is within a table cell.

I am not really sure who is right and who is wrong with the Gotcha…

QuickTime Scripting – Object.SetRate()

I have seen several forum posts where users say SetRate() doesn’t work. What has worked for me is this:


function playFwd(anObj, rate)
anObj.Play(); //Have to call play first



<a href="javascript:playFwd(document.quicktimemov, 0.03)">
<image src="images/fps_button.jpg" border="0">

When dealing with rtsp this will only cause the video to slow (The audio plays at full speed – bug reported to Apple). When using this code with a progressive download QT file it works great.

If you take your streaming file and run it through the http protocol everything works great!! But then you don’t get the features of the QTSS. Another topic…

The bottomline: Play() has to be called before using SetRate().

Still not working: Check in other browsers and how you are passing the javascript object. Make sure the object is not NULL. Different browser DOMs can cause you to think it isn’t working.