In version 2.0, if an image is to large you are redirected back to the post preview page and a red border arround the image that is too large is displayed.
Mod Name / Version: Restrict Images 2.0
Description: The mod checks the images contained within the image tags in a post for width, height, filesize and image count.
The admin can specify the maximum amount of images per post, the maximum image width, height and size.
Info/Instructions: Instructions within the checkimages.php file.
In order for the getimagesizes() function to work on remote files, the PHP version has to be > 4.0.5 .
Disclaimer: Please backup every file that you intend to modify. If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Thx! This one was also on my list. A suggestion that might be more comfortable for the users: If an image is to large, redirect to the post preview page and display a red border arround the image that is too large. This way they don't have to go back and they can see which one is too large.
I have a question, Anno. I am having my site redone, and I am going to use this mod so that the new layout, which includes graphics on the right side of the page, doesn't get stretched. The maximum allowable width would be about 740 pixels.
My question is, what if I have a user puts two, let's say 500 pixel-wide, images in a post without using a linebreak in between. Will this mod split them up, putting them on different lines, so that they don't break up the layout?
[]Anno said: The images are put in the next line automatically by the browser. The following images are all placed in one line. [/]
Is that a function of this mod, or the browser? Because the last thing I want is images stetching and breaking my new layout? However it is the case, this mod will be a nice addition for my board when 6.5.1 goes final
I am helping a forum resolve an issue with your mod, maybe you can help. This is the error recieved when the image is to large
Warning: getimagesize(http://test.haastylcalls.com/images/test.jpg) [function.getimagesize]: failed to open stream: HTTP request failed! ÔÜþ¿ì[ÜÜþ¿t»W1 in /home/.sites/28/site1/web/ubbthreads/checkimages.php on line 88
It also take a very long time for the post to appear, if at all when the image is under or at the required size. It seems to just hang. I think they are using 2.0 but not 100% sure.
They are not sure, I gave them a utility php file that will tell them, and or they will contact the host if they are unable to execute the file.
I figured it would have somthing to do with the version due to the code being unable to compile on line 88. I looked at the code and it stalls on this line of code $imagehw = getimagesize($imageUrl); So I would bet that the php version does not support getimagesize.
Ya I know, but from what I understand they do not have access to the server in a manner at wich they can upload stuff and not sure they trust me yet, this is the first thing I have helped them with and don't blame them, but we will get there. That's exactly what I sent them
also keep in mind getimagesize() is part of the image module of php and is NOT loaded by default on alot of systems. BUT you said you can run small images and it works so its probably loaded....
What is happening now is it just takes a very long time to have the post happen when an image is involved. It hangs and then never really does anything. No errors now just no image checking and posts
Nope they are on version 5.0 of PHP and it does not work. They are running UBB 6.5 and I fixed (seemed to fix) the berror, but it does not function properly. It hangs forever and then does not ever bring you back to the red square part or say anything about posting an image that is not within the settings.
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.