Thumb-in-Post Version 0.94
This is a very minor update to my Thumb-in-Post plugin. It corrects a problem that occurs with the Javascript popups in Microsoft Internet Explorer for Windows. Previously the javascript popups didn’t work properly in IE/Win. Otherwise the plugin is exactly the same as before.
The new version can be downloaded here.
The problem wasn’t actually a bug in the plugin but rather it was due to a rather strange behaviour of IE/Win.
In the original javascript code links which should be opened in a popup window were given an attribute rel="popup"
and the dimensions of the image (needed so that a popup of the appropriate size could be generated) were stored in a class
attribute, like so:
<a href="http://www.website.net/Content/picture.jpg" target="_new" rel="popup" class="320x240" >
The javascript routine retrieved the dimensions from the class
attribute using a getAttribute
call. Unfortunately, IE apparently sets the class attribute to null
immediately after it displays an object. Obviously this causes the script to crash.
The solution is to store the dimensions in the name
attribute, like so:
<a href="http://www.website.net/Content/picture.jpg" target="_new" rel="popup" name="320x240" >
In terms of semantic markup, this is probably an abuse of name
, but it does work.
Thanks for the update!
I’ve recently started using Version 0.7 and it seems to work fine but with this new version when I go to edit the thumb-in-post9.php file it’s corrupt. I’ve included a link to a screen shot of the text so you’ll see what I mean.
http://kpont.com/tmpimgs/094_text.jpg
I’m seeing in the zip file when I extract it a couple of __MACOSX files and I’m wondering if something is happening to the zip file causing corruption when I extract it on Windows XP.
Thanks for this handy plugin.
I think it’s not corrupt but that Windows is having difficulty interpreting the line end characters used on Macintosh.
If you put the plugin in the WordPress plugins directory and view it through the templates page does it still look odd?
I should have thought of that. Yes it works fine. Thanks.
I have created my own custom css and img folders under my wordpress
installation. Where would I need to place the .css and .gif files?
Thanks!
Basically, would I need to edit the code to look into my user created folders?
Hopefully, this isn’t a silly question. I just can’t find a README anywhere
to answer my own question. Thanks!
Amit, you can put the
css
andgif
files anywhere you like. You set the location that the plugin looks for them from thethumb-in-post.cfg
file. If you open the file up there are some instructions in there on what to do.You can also change the directory that the plugin looks for images in in that file as well.
Right now there is no README for this since it’s not at version 1.0 yet. If you’re looking for more information I’d suggest you read the entries for the 0.9x versions of the plugin and the associated comments.
Hey, thanks for the reply! I didn’t realize the .cfg file had the answers
to my questions. Keep up the good work, this looks like a really
cool plugin.
I’m getting the following error even after making all paths verbose:
Warning: file(http://www.marginalspace.com/wp-content/plugins/thumb-in-post.cfg): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in C:\Inetpub\amit\marginalspace\wp-content\plugins\thumb-in-post9.php on line 16
Warning: Invalid argument supplied for foreach() in C:\Inetpub\amit\marginalspace\wp-content\plugins\thumb-in-post9.php on line 21
Warning: Cannot modify header information – headers already sent by (output started at C:\Inetpub\amit\marginalspace\wp-content\plugins\thumb-in-post9.php:16) in C:\Inetpub\amit\marginalspace\wp-admin\options.php on line 231
Amit, did you put the
thumb-in-post.cfg
file in the plugins directory?Yes, I put both the php and cfg file in the plugins directory.
In that case I’m not sure why it won;t open it. I’m presuming that it may be something to do with permissions not being set to allow the file to be read.
Your might try making the changes described in comments 7, 8 and 9 on the post for version 0.91. See here.
hi!
I am having trouble getting the images to pop up eventhough I have this in my settings:
// If set to ‘true’, javascript popup windows will be used to showed the enlarged picture
JavascriptPopup == true
I also checked that the css is in the right place.
do I need to do anything with this
// determine what the target window shouold be: _new opens in a new window. Set to target=”_self” to open in the same window
// Set this to blank if you are using XHTML Strict.
Target == target=”_new”
for it to work????
thanks!
now I have no clue what happened, it was working before, but now, everytime I upload an image I get this error on my bog index page…
“Warning: Division by zero in /www/htdocs/v109938/blog/wp-content/plugins/thumb-in-post9.php on line 556
Warning: getimagesize() [function.getimagesize]: Read error! in /www/htdocs/v109938/blog/wp-content/plugins/thumb-in-post9.php on line 172
Warning: getimagesize() [function.getimagesize]: Read error! in /www/htdocs/v109938/blog/wp-content/plugins/thumb-in-post9.php on line 178
Warning: Division by zero in /www/htdocs/v109938/blog/wp-content/plugins/thumb-in-post9.php on line 556”
help??
Kathy, the errors in your second post look like they are probably being caused by the plugin being unable to locate the image directory. So you should probably check the settings for that first.
As far as the javascript popups go, as I’ve said previously, because there are so many different things that might conflict with the javascript code I can’t really provide any support for it. If it works great, go ahead and use it — but otherwise you’re on your own. Sorry.
I also experienced sudden errors but I figured it out and now fixed.
Problem was after upgraded from 0.7 to .94 some existing “thumb-Objects” no longer writable and able to read so all I did was went to the cpanel and changed it to 777. Strange process but it did fixed my problem.
Thank you for sharing this wonderful Plugin. I enjoyed it alot.
Thanks (Jazakallah) for the plugin, i’ll try it out…
I get this !!
Warning: getimagesize(/wp-inn/aquarius.jpg): failed to open stream: No such file or directory in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/thumb-in-post9.php on line 538
Warning: Division by zero in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/thumb-in-post9.php on line 557
Warning: getimagesize(/wp-inn/thumb-aquarius.jpg): failed to open stream: No such file or directory in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/thumb-in-post9.php on line 173
Warning: imagecreatetruecolor(): Invalid image dimensions in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/thumb-in-post9.php on line 506
Warning: imagesx(): supplied argument is not a valid Image resource in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/thumb-in-post9.php on line 509
Warning: imagesy(): supplied argument is not a valid Image resource in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/thumb-in-post9.php on line 509
Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/thumb-in-post9.php on line 509
Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/thumb-in-post9.php on line 515
Warning: getimagesize(/wp-inn/thumb-aquarius.jpg): failed to open stream: No such file or directory in /home/hosts/trollpack/www/trollpack.sverok.net/wp-content/plugins/thumb-in-post9.php on line 179
the thing is that everything is working fine !
(with the thumbnail and link to full size img)
But i get the above error message when i load a
page with the “thumb-in-post” code on.
Henrik, the errors are being produced because the plugin is unable to locate the image file. I’d suggest doeuble-checking that you have the directory set correctly and that the read and write permissions are set appropriately.
Let me know how you get on,
Ali
Hi again !
i have no luck with changing the file perm. (even to 777)
You can have a look for your self
http://trollpack.sverok.net/om-trollpack/styrelse-aktiviteter/
Password: 5002
my cfg file
http://trollpack.sverok.net/wp-inn/thumb-in-post.cfg.txt
im at loss ??
Hello, I was wondering whether thumb-in-post was compatible with WP 2.04? It spontaneously stopped working two days ago, and I get the following message:
Parse error: syntax error, unexpected ‘}’ in /home/platypus3333/public_html/platypus/wp-content/plugins/thumb-in-post9.php on line 28
Is this common?
Thanks a lot. Your plugin is excellent- that’s why I want it to work again so badly ^^