PDA

View Full Version : Miscellaneous Hacks - HS - External Signature Image Size Limiter


StrifeX
01-20-2007, 10:00 PM
This add-on had been produced and distributed by Hybrid-Soft.

Don't forget to click INSTALL (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=137167)!

Name:
External Signature Image Size Limiter

Description:
Unlike vBulletin does, this hack limits the size of external images in signatures depending on the dimensions you choose.

Features:
- On/Off Switch
- Set max image width.
- Set max image height.

Installation Instructions:
1. Unzip the folder.
2. Upload 'product-hs_sigimgsize.xml' to the Product Manager in the vBulletin AdminCP.
3. Manage Settings via AdminCP => vBulletin Options => vBulletin Options => HS - External Signature Image Size Limiter

Credits:
Chris M (https://vborg.vbsupport.ru/member.php?u=4197) for the base code.

Information:
Plugins: 1
Phrases: 2

Installation Difficulty: Very Easy
Installation Duration: 10- seconds.

Important: In order to update you must uninstall the old product and upload the new one.

Before installing, check your php.ini file for this setting:
allow_url_fopen = on

If it's off, turn it on. Otherwise this won't work.


To make this hack delete all signatures so users must put there signatures in again: In the Admin CP, go to > Update Counters > Empty Signature Cache.

This mod can be improved, so with all of your help, by suggesting new ideas and reporting bugs, I can modify and play around with this product to improve it.

Enjoy, and don't forget to click install if you use! :)

StrifeX
01-21-2007, 09:47 PM
v1.2 - July 9th, 2007
- Section in vBulletin options for convenience of entering options containing the following:
- On/Off Switch
- Set max image width.
- Set max image height.
---------------------------------------
v1.0: Initial Release - Jan 21st, 2007
---------------------------------------

Future Updates:
- Restrict filesize.
- Usergroup specification.

More updates will be posted here when suggested.

beduino
01-21-2007, 09:52 PM
Tks!
a useful hack :)
Beduino

Endurer
01-22-2007, 02:49 AM
Thank you.. I definitely need this one.

Installed!

Hornstar
01-22-2007, 04:29 AM
sounds like one of those hacks that vb should have as default. nice work.

StrifeX
01-22-2007, 05:44 AM
I'm glad you all like it, thanks for the positive feedback.

Please click the install button if you used the hack though.

Terminatoronly
01-22-2007, 06:00 AM
nice mate this is a great hack because members use a big images which will make the site much slower and mostly the sections that they reply on it so this hack will limit it ;) thanks (Installed)

smoknz28
01-22-2007, 06:32 AM
This hack will not adjust those sig images already set by members prior to installing?

Thanks

Snake
01-22-2007, 08:57 AM
Wow I have been waiting for this. Thanks! :)

tobybird
01-22-2007, 01:57 PM
Question/Clarification: Is the size restriction set for the total signature area, not just one image? For example, typical signatures on my board would consist of one larger image along with 5 to 8 smaller images. How would this hack work with multiple images? And this is not for the default vB "Signature Picture" option, correct?

StrifeX
01-22-2007, 06:22 PM
This is for individual external images, there is options for amount of images according to usergroups and plenty of options to limit uploaded signature size.

There is other hacks to limit the total size and lines of signature though, I remember seeing one made by Scr although I don't recall if it worked correctly.

tobybird
01-23-2007, 04:03 AM
Thanks for the response StrifeX. I did see another hack (https://vborg.vbsupport.ru/showthread.php?t=110401) and while it does work, it unfortunately only works when restricting height so I was hoping this one would do the trick. :)

StrifeX
01-23-2007, 05:54 AM
This one certainly does what you want, you're welcome and good luck bro. :)

Zia
01-23-2007, 05:09 PM
does it work for user group base?

each user group have diff. size limit?

AzzidReign
01-23-2007, 06:32 PM
sounds like one of those hacks that vb should have as default. nice work.
Definitely! I've suggested it to them for the past 2 versions now...and they said that they are working on it...

does it work for user group base?

each user group have diff. size limit?
This would be a great feature!! Hope to see it in the near future if it is at all possible.

StrifeX
01-23-2007, 06:33 PM
No, the installation instructions state what you have to do and it only applies it to every member.

I'll attempt to setup usergroup specification in the future, thanks for the suggestion. :)

teedizz
01-28-2007, 11:05 PM
This hack will not adjust those sig images already set by members prior to installing?

Thanks



Good question, what about members who already exceeded this size before installing this hack? Is there a piop-up message to those users stating they now have a sig that is over the sig limit?

teedizz
01-28-2007, 11:17 PM
BTW...what is Maximum Lines in Signature? I have users that add 2-4 pics that are left to right & it streches my forum and makes threads look terrible, how can I prevent this?

StrifeX
01-30-2007, 06:19 AM
You can add an overflow xhtml code into the postbit or postbit_legacy template to make it scroll when the image is too big. If you can't do this by yourself, just tell me, i will be happy to provide you with the code.

d8tabyte
01-31-2007, 01:44 AM
hmm I thought this would affect users that already have sigs. This is upsetting. I wonder what the best way would be to nag them to update it, as I really dont want to manually edit all of my members.

anywares
02-02-2007, 06:31 PM
Installed ;)

StrifeX
02-03-2007, 01:12 AM
hmm I thought this would affect users that already have sigs. This is upsetting. I wonder what the best way would be to nag them to update it, as I really dont want to manually edit all of my members.I believe there is an options somewhere to update tables so this hack will work for already entered signatures.

Click install if you use people!

Miles_Binck
02-06-2007, 02:16 PM
hmm I thought this would affect users that already have sigs. This is upsetting. I wonder what the best way would be to nag them to update it, as I really dont want to manually edit all of my members.

I used the Empty Signature Cache option in Update Counters, seems to have done the trick :)

mamashid
02-06-2007, 02:29 PM
*installed*

SkyCatcher
02-06-2007, 11:31 PM
Awesome, thank you :)

ogameclub
02-07-2007, 07:57 PM
Super. Thnx

StrifeX
02-08-2007, 03:07 PM
I used the Empty Signature Cache option in Update Counters, seems to have done the trick :)I'll just add that in the notes so that anyone that wants to do the same thing will know how.

Eagle Creek
02-16-2007, 01:10 PM
Now tháts sweetness!
Clicked install.

StrifeX
02-25-2007, 08:37 PM
No you didn't Eagle Creek, you're all welcome...

hydn
02-27-2007, 04:04 AM
does this work on 3.5.4

or is there a version or similar hack for 3.5.4?

turblue
02-27-2007, 06:37 AM
I have installed this mod and emptied the signature cache, but oversized images are still viewable.

Is there something I am missing.???

BuRNZau
02-27-2007, 07:33 AM
Works a treat thanks! :)

turblue
02-28-2007, 05:44 AM
Any ideas.????

SpanishHarlem
03-14-2007, 12:09 AM
I seem to be having trouble with the oversized signatures as well.

MarcG
03-19-2007, 08:15 AM
I seem to be having trouble with the oversized signatures as well.


same here...cleared out the cache but oversized images are still viewable....

I'm running Version 3.6.4

six58
03-20-2007, 06:09 AM
if this had custom sizes for each usergroup as previously mentioned, but also able to control the total bytes size of the picture, it will be perfect for my needs

thank you

MarcG
03-20-2007, 08:21 AM
Well...I uninstalled this and reinstalled it, clearing the cache but no luck.

MarcG
04-06-2007, 11:00 AM
Any news on why this isn't working? could other mods or general settings be a problem?

Running Version 3.6.4

cdnbacon
04-09-2007, 05:40 AM
FYI, does not work.

Powered by vBulletin® Version 3.6.5

almightyone
04-15-2007, 12:04 PM
once this has a per usergroup i will make use of it but i dont want my sig size restricted or my staffs

jags2ooo
04-25-2007, 07:11 PM
Empty Signature Cache did not work i set the limit to 500x150 this guy here has a 584 px width sig >< any suggestions ? http://forum.lineage2exile.com/showthread.php?p=3965#post3965

another guy has OMG the width of a website
http://forum.lineage2exile.com/showthread.php?p=3978#post3978

da420
04-26-2007, 09:21 PM
Empty Signature Cache did not work i set the limit to 500x150 this guy here has a 584 px width sig >< any suggestions ? http://forum.lineage2exile.com/showthread.php?p=3965#post3965

another guy has OMG the width of a website
http://forum.lineage2exile.com/showthread.php?p=3978#post3978

I could be wrong as I don't have this installed, but from what I understand this does not resize, but a limits. So rebuilding the cache would have nothing to do with it. Next time they try and change their sigs it will inform them if it's too big or not. You will have to force them to update their sigs manually, by either informing them, or deleting the image yourself.

BSLFE
04-28-2007, 02:56 PM
sorry but it doesn't work for me either :(

vB 3.6.5

schanulleke
05-01-2007, 11:03 AM
I tried, but for me it doesn't work as well. :(

gg_luna128
05-01-2007, 03:01 PM
Does this work with Safe Mode On and Allow Fopen Off?

StrifeX
05-01-2007, 03:05 PM
It should work flawlessly the way I've claimed it does, I've never guarenteed that once they have a signature you could get rid of it, someone simply told me that.

I could be wrong as I don't have this installed, but from what I understand this does not resize, but a limits. So rebuilding the cache would have nothing to do with it. Next time they try and change their sigs it will inform them if it's too big or not. You will have to force them to update their sigs manually, by either informing them, or deleting the image yourself.Thanks for clearing that up.

gg_luna128
05-02-2007, 05:07 AM
It works with Safe Mode On! But, there's a way to add a limit to size in KB?
They might put a .bmp image in the signature =\

jw00dy
05-04-2007, 03:29 AM
Awesome work. It didn't fix the ones already there, but it won't let a new one be added which works for me. I bet when they save their sig it will probably give them the error and they will have to remove it or cancel then.

schanulleke
05-04-2007, 07:30 PM
After I installed this plugin, it gives an error when you save a signature. Even if the image is within the limits. If the image is too large, you get the same error and the image will still be shown.

Does anybody understand this message :

Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /profile.php(1189) : eval()'d code on line 10

Warning: getimagesize(http://img423.imageshack.us/img423/443/ilseai7.gif) [function.getimagesize]: failed to open stream: no suitable wrapper could be found in /profile.php(1189) : eval()'d code on line 10


I would really like the plugin to work.

phiber
05-10-2007, 01:04 AM
Nice hack, It is possible to limit text also? Thanks in advance!

Mrdby
05-18-2007, 08:08 PM
installed

Dannyloski
06-30-2007, 06:30 PM
w00t lovely hack, installed! ... Now all I need is an External Signature Image FileSize Limiter Hack, lol ... Hmmmm, can you do it?

oicyu8chu
06-30-2007, 07:18 PM
Thanks, works lovely.

Choo

JesterP
07-04-2007, 02:28 PM
I've installed and followed the instructions to the letter but it still allows users to post any size they wish.

Can anyone tell me this will work in 3.6.7? I'm starting to feel dumb. :/

Thanks!

J

Dannyloski
07-04-2007, 04:22 PM
^ What other Hacks do you have installed?

Have you gone into the Plugin Manager and set up the width and height accordingly?

AdminCP > Plugins & Products > Plugin Manager > Scroll down to Product : HS - External Signature Image Size Limiter > [Edit] > Change the top 2 Options under "// Set max image width and height"

StrifeX
07-09-2007, 06:40 AM
Hack updated, some of you may like it more. :)

Dannyloski
07-09-2007, 04:29 PM
Great job! I like the fact that the upgrade now supports the fact that you can edit the Width & Height via the AdminCP, rather then having to change the info manually in the Plugins section.

Any thoughts of creating a FileSize Hack for External Images?

In addition, I have tried using the Admin CP > Update Counters > Empty Signature Cache Setting, but it's still not making this hack apply to users who already have signatures over the limit ... Any suggestions?

- Danny

BaconDelight
07-09-2007, 07:07 PM
Is there a change history between the versions somewhere? It's not in the read me and I'd like to see if the changes made in this version warrant an upgrade. Thanks.

oicyu8chu
07-09-2007, 07:15 PM
Thanks for the update. The filesize option would be great for a future release. I hate it when people add gifs that are over 1MB in size. :(

Choo

StrifeX
07-09-2007, 07:22 PM
Great job! I like the fact that the upgrade now supports the fact that you can edit the Width & Height via the AdminCP, rather then having to change the info manually in the Plugins section.

Any thoughts of creating a FileSize Hack for External Images?

In addition, I have tried using the Admin CP > Update Counters > Empty Signature Cache Setting, but it's still not making this hack apply to users who already have signatures over the limit ... Any suggestions?

- DannyThe filesize option is planned for a future upgrade.

All that does is clear out current signatures so they'll have to re-enter their signature. In short, it's a more complex way of doing it than it sounds. Then again, it's the only way.

Is there a change history between the versions somewhere? It's not in the read me and I'd like to see if the changes made in this version warrant an upgrade. Thanks.Check out the first post on the first page. :)

Thanks for the update. The filesize option would be great for a future release. I hate it when people add gifs that are over 1MB in size. :(

ChooYou're welcome, and as I said above, the filesize option is planned for a future upgrade.

Dannyloski
07-09-2007, 08:51 PM
Ohhh so that's what that options does? Hmmmm it still isnt doing anything ... Anyways, glad to hear bout the FileSize Limiter in the near future ...

JesterP
07-09-2007, 10:13 PM
After I installed this plugin, it gives an error when you save a signature. Even if the image is within the limits. If the image is too large, you get the same error and the image will still be shown.

Does anybody understand this message :

Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /profile.php(1189) : eval()'d code on line 10

Warning: getimagesize(http://img423.imageshack.us/img423/443/ilseai7.gif) [function.getimagesize]: failed to open stream: no suitable wrapper could be found in /profile.php(1189) : eval()'d code on line 10


I would really like the plugin to work.

Check your php.ini file for this setting:

allow_url_fopen = on

Make sure yours says 'on', mine was 'off', and I got your exact error, I changed it to 'on' and it worked like a charm.

Hope that helps

J

StrifeX
07-09-2007, 10:18 PM
Ohhh so that's what that options does? Hmmmm it still isnt doing anything ... Anyways, glad to hear bout the FileSize Limiter in the near future ...
Your misinterpreting the purpose of the Update Counters function, it does exactly what I said it does.
Check your php.ini file for this setting:

allow_url_fopen = on

Make sure yours says 'on', mine was 'off', and I got your exact error, I changed it to 'on' and it worked like a charm.

Hope that helps

JGood job clearing that up, think I should include that in the main post?

JesterP
07-09-2007, 10:37 PM
Good job clearing that up, think I should include that in the main post?

I'm thinking there will be others with that issue, so it might be a good idea to add it as a "tip". :)

Even if it's so you don't have to repeat yourself over and over and over again.

J

PS Thanks for this hack, I couldn't believe vb didn't have this built in.

Dannyloski
07-09-2007, 10:47 PM
Your misinterpreting the purpose of the Update Counters function, it does exactly what I said it does.
I understand what the purpose of the function and what it does ... I just said that its not doing anything on my Forums - why? I have no idea. I clicked on it and I got the confirmation message that it had done it, but all the signatures still show ... Anyways, it's no biggie ...

Dannyloski
07-10-2007, 04:49 PM
StrifeX,
I am getting the following error when trying to Save or Preview a Signature ...

Fatal error: Cannot redeclare check_sig_size() (previously declared in /home/*******/public_html/profile.php(1210) : eval()'d code:5) in /home/*******/public_html/profile.php(1210) : eval()'d code on line 35

Dannyloski
07-10-2007, 05:23 PM
StrifeX,
I fixed my problem above all is working fine now .. It seems that when I installed the new version, it did not overwrite the plugin in hook "profile_updatesignature_start" instead it created a new one ... So I went to Plugin Manager and saw that I had two "HS - External Signature Image Size Limiter" in that hook, I hit EDIT on both of them to see which one of them was the old one from the previous version and just deleted it ... Now all is fixed and no errors appear when Saving or Previewing a Signature. Users who upgraded from your previous version might experience this problem since the new installation does not overwrite the old plugin in that hook, just creates a new one and having the two of them causes the error ...

StrifeX
07-12-2007, 03:59 AM
StrifeX,
I fixed my problem above all is working fine now .. It seems that when I installed the new version, it did not overwrite the plugin in hook "profile_updatesignature_start" instead it created a new one ... So I went to Plugin Manager and saw that I had two "HS - External Signature Image Size Limiter" in that hook, I hit EDIT on both of them to see which one of them was the old one from the previous version and just deleted it ... Now all is fixed and no errors appear when Saving or Previewing a Signature. Users who upgraded from your previous version might experience this problem since the new installation does not overwrite the old plugin in that hook, just creates a new one and having the two of them causes the error ...Thanks, and I'll be sure to tell them to delete and re-upload in the main post. :)

I'm glad you got it working, do you like it?

Dannyloski
07-12-2007, 11:46 AM
^ No problem ... Do I like it? Man, I love this hack! I just cant wait for the upcoming releases that will have the option to Limit FileSizes :D that will be awesome!

Mupetz
07-17-2007, 03:14 PM
I'm glad you share the information Dannyloski ; I had the same problem.
Thanks ;)

Dannyloski
07-17-2007, 07:07 PM
Mupetz, no problem ... I kinda figured others would encounter it, so that's why I posted it ...

StrifeX, any news or thoughts on when the External FileSize Limiter for Sigs will be released?

Majest
08-02-2007, 06:22 AM
Very nice. Installed. :)

StrifeX
08-02-2007, 08:28 PM
Mupetz, no problem ... I kinda figured others would encounter it, so that's why I posted it ...

StrifeX, any news or thoughts on when the External FileSize Limiter for Sigs will be released?Sorry, but no I don't really plan on releasing that soon. I'm a bit busy atm, I should be able to get to another update in a month or two.

Abe Babe
08-27-2007, 06:30 AM
Not sure why, but I was getting an error similar to the one that is fixed by changing the php.ini settings, even though I had that setting to on.

Then I realized that I had an old version, as I'd downloaded this a while back and kind of forgot about it. So I installed the latest version and it's working great now!

Combined with sinaluna's CSS Sig size limiter, this will hopefully solve 99.9% of sig issues now. As your hack will restrict the size of individual images, and the CSS one limits the total area that a signature takes up [imgs + text].

Abe Babe...

Riccardo83
09-13-2007, 09:15 AM
does this mod work with 3.6.8 ?

peterpigman
09-15-2007, 08:00 PM
Is there no way to do this without the php.ini file? i had to remove it to get vbseo to work and when i put it back it kills the site.

Dannyloski
09-22-2007, 02:11 PM
Works perfectly on vB 3.6.8 ... Any news on the FileSize Limiter StrifeX?

scarex80
09-25-2007, 05:50 AM
$maxsigweight=40000;
;
function check_sig_size($sig)
{
global $maxsigwidth, $maxsigheight, $maxsigweight, $errors, $vbulletin;
$sig = str_replace(array(' ', '\\"'), array('', '"'), $sig);
$ary_header = get_headers($sig, 1);
$imgdimension = $ary_header['Content-Length'];

if ($imginfo = getimagesize($sig))
{
if ($imginfo[0] > $maxsigwidth or $imginfo[1] > $maxsigheight or $imgdimension>$maxsigweight)
{
$vbulletin->GPC['preview'] = 'true';
$errors[] = fetch_error('signaturetoobig', $maxsigwidth, $maxsigheight,$maxsigweight);
}
}
}

With the addings in red, I'm now able to check even the size in bytes of the images :) It works on 3.6.8

Dannyloski
09-25-2007, 08:09 PM
^ I tried that, but I get this error when I hit "Save Signature" or "Preview Signature" on the Signature Page ... I added it to the Plugin ...

Fatal error: Call to undefined function: get_headers() in /home/talkjdm/public_html/profile.php(1210) : eval()'d code on line 20

9a-nofear
10-06-2007, 01:45 PM
i wonder where is php.ini ??

CP,
11-03-2007, 03:49 AM
Can i make a really impotant suggestion please. Can you please modify it so we can apply this hack to certain usergroups only?

Cheers

Creed3020
11-16-2007, 01:36 PM
Can i make a really impotant suggestion please. Can you please modify it so we can apply this hack to certain usergroups only?

Cheers

I would love to see that level of functionality. I do have certain usergroups who require this restriction more than other usergroups.

I finally found this mod as I was using ChrisM's mod for 3.5 on my updated board and glad that this works and was available.

virus9112002
11-17-2007, 11:05 AM
I have been waiting for this. Thanks!

SVTCobraLTD
11-27-2007, 02:30 PM
Great... i have been looking for this and after some searching, I found it.

SVT

HobbiesPR
12-23-2007, 10:26 PM
Does this work/will on 3.7 ?

kansei
01-16-2008, 10:04 PM
Is anyone else having trouble on the 'edit signature' page? It mentions a max size there but it is NOT the max size set in the plugin, it's the max size of images uploaded through the controls under the box.

I'm hunting around to see what phrases are added by this.. maybe my answer is there. I could just have it display the phrase somewhere near the signature edit box.

Ok so $vbphrase[signaturetoobig] is the phrase I want to display on the edit signature page. I need to read up on phrases now, because it isn't showing up if I just put that in a div. Must not be global?

FLMom
01-17-2008, 12:21 AM
Works great thanks!

LilSniper
01-19-2008, 03:05 PM
Installed and Nominated.

Stratto
01-25-2008, 11:24 AM
Great mod! our forum is forever warning people off oversized signatures. One thing though, do you think its possible you could add File size also? Because we have a limit on that also, especially when its a gif file.

Thanks and good work! ^_^

PamelaE
02-16-2008, 10:25 AM
Does this work/will on 3.7 ?

This is what I want to know. Any ideas?

vBB-vietnam
02-26-2008, 02:21 PM
it very slow with my server when checking image . :(

orok
04-26-2008, 04:58 AM
it's work with 3.7.0 Release Candidate 4
thank you :)

Mrdby
04-30-2008, 12:28 AM
the final release? i just updated to 3.7.0

rootnik
05-19-2008, 07:32 PM
I'll post another "works with 3.7.0" confirmation.

installed.

demoniavbh
11-20-2008, 11:33 PM
Why do I get this in the debug?

Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in [path]/profile.php(2210) : eval()'d code on line 20

greenspan
05-06-2009, 03:14 PM
Working in 3.8.2. Thanks ^_^

Mrdby
07-05-2009, 11:02 AM
3.8.3?

lonelyemo
07-12-2009, 08:47 PM
Thank you very long time looking for something like that when version 3.8.3 will add

unicorn2433
09-22-2009, 04:31 PM
Work with 3.8.3? And does it limit file size now too?

delfost
11-27-2009, 12:25 AM
this add-on don't work with vbulletin 3.8.4

Riccardo83
12-23-2009, 08:07 AM
wont work with vb4.0.0 either. an update would be great....

original'as
01-26-2010, 10:16 AM
It would be cool if admins could set size in KB too.

Uberguilds
03-19-2011, 10:19 PM
The attached version works with 4.0.5. (Tested with PHP 5.2)

It relies on curl and your PHP memory limit being set correctly. The default limits are 500x100 and 50 kb, memory usage is ~4MB at most. Memory usage goes up as you allow larger images.

Rean
04-28-2011, 09:30 AM
hi... i think this hack doesn't work for imageshack.com images..
i've limit the height for 50 pixels but this image (http://img356.imageshack.us/img356/5281/93717051nc9.jpg) still opened..

Staxed
05-01-2011, 02:16 AM
The attached version works with 4.0.5. (Tested with PHP 5.2)

It relies on curl and your PHP memory limit being set correctly. The default limits are 500x100 and 50 kb, memory usage is ~4MB at most. Memory usage goes up as you allow larger images.

just tested and installed, in case anyone is wondering, this works on 4.1.3 as well.

Jaukain
08-24-2013, 09:03 PM
does this work with 4.2.x?