Insert ImageShack.us upload form on page in an iframe

by DavePreston

One of the ways I wanted to make life easier for my users was to try to make it easier for them to insert remotely-hosted images.

The first step was to create a simple action to insert an ImageShack upload form (see http://reg.imageshack.us/content.php?page=syndicate) on a wiki page thus...

<?php
    /**
    * imageshack.php
    * Insert ImageShack.us upload form on page in an iframe
    * for details, terms & conditions etc visit http://reg.imageshack.us/content.php?page=syndicate
    *
    * Usage {{imageshack txtcolor="224466" w="280" h="70"}}
    * (All parameters are optional)
    * (txtcolor takes an rgb colour without the # : default is ImageShack default)
    * (w is iframe width : default is ImageShack default)
    * (h is iframe height : default is ImageShack default)
    *
    * DavePreston (www.davepreston.me.uk)
    */


(!empty($vars['txtcolor'])) ? $txtcolor=$vars['txtcolor']: $txtcolor="111111";
(!empty($vars['w'])) ? $w=$vars['w']: $w="300";
(!empty($vars['h'])) ? $h=$vars['h']: $h="90";

echo "<iframe src=\"http://imageshack.us/iframe.php?txtcolor=$txtcolor&type=blank\" scrolling=\"no\" frameborder=\"0\" width=\"$w\" height=\"$h\"> You must have an iframe-compatable browser to view the ImageShack.us upload form.</iframe>";

?>


Then I created a page using this action to display the form and giving some help on using images hosted by ImageShack on wikka pages.


CategoryUserContributions
Comments
Comment by DaC
2007-01-09 07:40:19
The height "70" did not work for me. Had to use 90 to display the upload box properly. Using FireFox 1.5.0.9.
Comment by DavePreston
2007-01-21 14:36:56
Hmmm, you're right, DaC. Those are ImageShack's default dimensions, but don't seem to make the iframe big enough. I've increased the default dimensions to 300x90, which seems to have done the trick. Thanks for pointing that out.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki