ExZo & WordPress 2.1

PLEASE CLICK HERE FOR THE CURRENT VERSION OF THE EXZO PLUGIN

While ExZo itself should work flawlessly with the new WordPress version (2.1), there are some changes to be observed when it comes to the daily workflow. I used the edit the wordpress/wp-admin/inline-uploading.php file to suit my picture uploading needs. With the new uploader this file does not exist anymore. We’ll have a quick look at what changes are needed now, to integrate ExZo in the uploader web interface.

Step Zero

I’ll try to do this in a step-by-step mini-tutorial. First locate and backup this file:
wordpress/wp-admin/upload-js.php. That’s the file driving the all new JS-uploaders interface:
[exzo url=”TMB_PERM” title=”ExZo & WordPress 2.1″ id=”195″]exzoandwp21.jpg[/exzo]

Step One

It might be helpful if you have a text editor that numbers the lines of the file. Our first change will be in Line 46:
Look for this (without the line-break):
this.currentImage.src=
( 0 == id ? '' : $('attachment-url-' + id).value );

and add this line just after it (without line-breaks or spaces)
this.currentImage.ExZo_src=
this.currentImage.src.split('/')
[this.currentImage.src.split('/').length-1];

I might skip this and just use the complete path in the next release of ExZo, but for now we don’t need the whole image path this.currentImage.src (all we need is the filename).

Step Two

Next we’ll add the radio button for ExZo. Locate this entry in Line 113:
h += "</td></tr>";
and delete it. After the following bracket } paste these two lines:
h += "<br />
      <label for='exzo'>
      <input type='radio' name='display' id='exzo' value='exzo' />
      <?php echo attribute_escape(__('ExZo')); ?></label>";
h += "</td></tr>";

Step Three

This is our last step. All that’s left to do is modify the sendToEditor function. Find Line 237:
if ( 'none' != link )
and paste the following if/else-clause before it:
if( 'exzo' == display) {
h += '[exzo url="TMB_PERM" title="'
      + this.currentImage.title
      + '" id="'
      + this.currentImage.ID
      + '"]'
      + this.currentImage.ExZo_src
      + '[/exzo]';
}
else {

Finally close the else by adding a } just after Line 248
h += "</a>";

That’s it! If you are lazy or just curious "if you did it all right" have a look at my modded wordpress/wp-admin/upload-js.php file.

hope that helps,
-tmb