View Full Version : Minimum Picture Size
Marco van Herwaarden
11-24-2005, 10:00 PM
<font size="4">Minimum Picture Size - Version 1.00</font>
Hack: Minimum Picture Size
Version: v1.00
Author: MarcoH64
Description
With this modification installed you can set minimum dimensions (width & height) for image attachments.
There are some file edits needed to make this work.
Some of the edits are optional, read the Install.txt
Notes
Copyright ©2005 MarcoH64
This Modification may not be redistributed in whole or significant part or changed without prior agreement of author.
Please don't forget to click Install.
If you like this work and would like to support the author, donations are always welcome at Paypal: Marcoh64 AT gmail.com
michaelbenson
11-25-2005, 09:58 PM
Erm, i think perhaps there is a typo in the topic thread title.
Good addition though.
dcpaq2xx
11-26-2005, 04:12 AM
Ill give it a try and post feedback soon.
Thanks for taking the time to create this.
Doug
Marco van Herwaarden
11-26-2005, 06:06 AM
Erm, i think perhaps there is a typo in the topic thread title.
Lol, thanks, updated.
Snake
11-26-2005, 10:36 AM
Thanks for the hack. All installed!
Marco van Herwaarden
11-26-2005, 11:35 AM
And working how expected?
PS Then please also click on Install :D
dcpaq2xx
12-07-2005, 04:20 AM
Marco,
I have install this and I must say from what I have seen on the initial preview and testing right after the install I am very impressed with your work. An excellent job, please keep up the great work.
As soon as the holidays are over with donations are coming your way.
Also if it is possible and your willing to tackel this, would it be possible to do this mod/hack as a plug in requiring NO CODE modifications?
Again thank you for your efforts, we really appreciate it.
Doug
Marco van Herwaarden
12-07-2005, 06:35 AM
Also if it is possible and your willing to tackel this, would it be possible to do this mod/hack as a plug in requiring NO CODE modifications?Sorry but this is not possible without code edits, although some are optional, see the install.txt.
Maybe some new hooks are added in 3.5.2 that will allow less edits, but i doubt it. Will have a look as soon as i have time.
dcpaq2xx
12-31-2005, 05:34 AM
I must say my main concern is having to add or fix things after doing an upgrade of VB how it overwrites or restores files back to default.
I've delt with this enough with phpbb I dont want to go that route ever again if i can help it.
So if i have to modify anything i try make sure that an update or upgrade isn't going to crash my forums or break a feature or function.
Thats why im always pushing for plugins and such.
Doug
Marco van Herwaarden
12-31-2005, 06:14 AM
Yes, and i am sure (most) coders are fully aware of that, and will do whatever is possible/practical to write modifications that don't require file editing. Sometimes however there is just no other solution.
Just to asure you, even if you overwrite the files, it will not make your baord crash, it will just stop checking for minimum sizes.
dcpaq2xx
12-31-2005, 06:25 AM
Yes, and i am sure (most) coders are fully aware of that, and will do whatever is possible/practical to write modifications that don't require file editing. Sometimes however there is just no other solution.
Just to asure you, even if you overwrite the files, it will not make your baord crash, it will just stop checking for minimum sizes.
Marco,
I do know that, I really didn't need to be told that.
I was just trying to explain why I like plugins over hacks. Thats all.
A reply to this really wasn't needed.
Also if it stops checking for minimum sizes then it's done exactly what I DON'T want it to do, which was what I was trying to tell you as to why I like plugins versus modifying code.
Anyway I guess I shouldnt have said anything.
Doug
dcpaq2xx
01-05-2006, 07:05 AM
Marco,
I noticed some text in the error message that Id like to change to my own wording.
One is in the error message for the minimum image size.
What phrase or template would I change this in?
Copy of DSC05823.JPG:
The Minimum Dimension limits for this filetype are 640 x 480. We were unable to resize your file so you will need to do so manually and upload it again. Your file is currently 320 x 200.
Thanks
Doug
dcpaq2xx
01-14-2006, 04:00 AM
Marco,
I noticed some text in the error message that Id like to change to my own wording.
One is in the error message for the minimum image size.
What phrase or template would I change this in?
Copy of DSC05823.JPG:
The Minimum Dimension limits for this filetype are 640 x 480. We were unable to resize your file so you will need to do so manually and upload it again. Your file is currently 320 x 200.
Thanks
Doug
Can anyone help me with this question?
Doug
Marco van Herwaarden
01-19-2006, 06:28 PM
Can anyone help me with this question?
Doug
I am not a PC where i have my files right now. But search Phrases for 'mh_' in the variable name.
dcpaq2xx
06-07-2006, 06:03 PM
Marco,
Its been awhile now and havent heard anything new on this...
Where or how can I edit the text within the error message?
Thanks
Doug
dcpaq2xx
06-21-2006, 10:00 AM
When I did my last upgrade of Vbulletin it appears to have wiped out all my code changes and I am now going around trying to figure out what got wiped out, as the hack no longer works because of this.
I noticed a change that VB made in the admincp/attachment.php file, line one is not there anymore. And if I put that line one back in as indicated in the "replace by" will this effect anything? Im not sure what changes have been made between the two versions regarding this line.
Oh how I like plugins, so much easier. :)
Doug
------------------------------------------------------------------------
Find:
1.) $types = $vbulletin->db->query("
2.) SELECT extension, size, height, width, enabled, thumbnail, newwindow
3.) FROM " . TABLE_PREFIX . "attachmenttype
4.) ORDER BY extension");
.................................................. .................................................. ...
REPLACE BY:
// Hack: Minimum Picture Size (MarcoH64)
// $types = $vbulletin->db->query("
// SELECT extension, size, height, width, enabled, thumbnail, newwindow
// FROM " . TABLE_PREFIX . "attachmenttype
// ORDER BY extension
// ");
$types = $vbulletin->db->query("
SELECT extension, size, height, width, enabled, thumbnail, newwindow, mh_mps_minwidth, mh_mps_minheight
FROM " . TABLE_PREFIX . "attachmenttype
ORDER BY extension
");
// / Hack: Minimum Picture Size (MarcoH64)
dcpaq2xx
06-21-2006, 10:48 AM
Update...
From what I can see it appears that the "newattachment.php" file at root, and the "attachment.php" file in the admincp folder were the main files that got replaced by Vbulletin during an upgrade; or possibly another hack install?
The theme style templates "new attachment" and "new attachment key bits" were not effected at all.
Also it appears that having $types = $vbulletin->db->query(" put back in doesnt seem to have any effect on Vbulletin or the hack from what I can see.
Doug
aLReeMi
06-21-2006, 01:33 PM
thanks alot
dcpaq2xx
06-21-2006, 01:37 PM
thanks alot
Huh? Thanks alot for what aLReeM ?
Doug
Marco van Herwaarden
06-21-2006, 03:59 PM
When I did my last upgrade of Vbulletin it appears to have wiped out all my code changes and I am now going around trying to figure out what got wiped out, as the hack no longer works because of this.
I noticed a change that VB made in the admincp/attachment.php file, line one is not there anymore. And if I put that line one back in as indicated in the "replace by" will this effect anything? Im not sure what changes have been made between the two versions regarding this line.
Oh how I like plugins, so much easier. :)
Doug
------------------------------------------------------------------------
Find:
1.) $types = $vbulletin->db->query("
2.) SELECT extension, size, height, width, enabled, thumbnail, newwindow
3.) FROM " . TABLE_PREFIX . "attachmenttype
4.) ORDER BY extension");
.................................................. .................................................. ...
REPLACE BY:
// Hack: Minimum Picture Size (MarcoH64)
// $types = $vbulletin->db->query("
// SELECT extension, size, height, width, enabled, thumbnail, newwindow
// FROM " . TABLE_PREFIX . "attachmenttype
// ORDER BY extension
// ");
$types = $vbulletin->db->query("
SELECT extension, size, height, width, enabled, thumbnail, newwindow, mh_mps_minwidth, mh_mps_minheight
FROM " . TABLE_PREFIX . "attachmenttype
ORDER BY extension
");
// / Hack: Minimum Picture Size (MarcoH64)It would be very helpfull if you stated the vB version you are trying to install it on.
PS Since this is a code edit hack, chances are always there that it will not work on a new version, or only modified.
dcpaq2xx
06-21-2006, 04:33 PM
Sorry about that Marco my bad... :)
I am currently at version 3.5.4.
Is it possible for the "right amount" of money that this hack could be put into a plugin where I wouldnt have to worry about upgrades changing things on me like this? Because if it can be done I probably would make it worth your while in doing that for me.
Doug
Marco van Herwaarden
06-21-2006, 04:38 PM
If i have time left one of htese days, i can see if i can make instructions for 3.5.4.
And no, this couldn't be done with a plugin, or i already would have done so (lol you think it is fun to write instructions to edit code ;)). No money can change that. But maybe in a future vB version ther are hooks on teh places needed, maybe even in 3.5.4, but i doubt it.
dcpaq2xx
06-21-2006, 04:43 PM
If i have time left one of htese days, i can see if i can make instructions for 3.5.4..
That would be excellent Marco, thank you for considering.
(lol you think it is fun to write instructions to edit code ;))
Im not sure why your replying back to me with the rudeness as I never said it was fun or enjoyable coding this stuff. I just asked as sometimes coders wont go too far out of their way if they arent getting paid for their time or work. I figured that "maybe" that was how you work.
Sorry to have offended you...
Doug
dcpaq2xx
08-18-2006, 09:08 PM
MarcoH64,
Any plans to update this to 3.6?
Doug
dcpaq2xx
08-28-2006, 09:09 AM
I upgraded to VB 3.6 and it wiped out my code alterations and quit working. I went in to restore the code modifications and I see missing code in the 3.6 templates, So I have removed this hack until it can be revised to work with 3.6. Hopefully Marco will update this soon, I really like this hack.
Thanks
Doug
dcpaq2xx
02-03-2007, 11:10 PM
MarcoH64,
Have you given up on this hack?
Doug
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.