vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   Quick Sig Image Size Limiter (https://vborg.vbsupport.ru/showthread.php?t=60354)

phlogiston 01-16-2004 10:00 PM

Quick Sig Image Size Limiter
 
A fairly quick and easy to install hack that attempts to check the pixel size of any images users place in their signatures. If the image is above admin set dimensions an error is given to the user explaining the valid dimensions.

I've not found a simple version of this for v3 - apologies if it's already out there somewhere!

- This is purely a BETA release as the getimagesize() function used seems to fail for certain images on one test install, unknown reason at present. This will not make the hack fail, simply some images on some servers will be allowed even if over the set size. To prevent this uncomment the five lines in the added code to give an invalid image message instead.


The options to set the size limits for signature images will be found in the admincp vBulletin Options --> User Profile Options


*****PLEASE NOTE*****
I am unable to provide any support at all for this hack - sometimes it works, sometimes it doesn't.
My knowledge dosn't reach far enough for me to understand or fix the reasons behind it failing on some installs, sorry.
If it works for you, I'm glad, if it doesn't then just revert everything and try looking at the other sig option hacks, sorry - best I can do :(

MindTrix 01-17-2004 06:01 PM

Sounds great, im sure some boards will need this due to people abusing Sig's with pics. Nice one and thank you, Oh and congrats on your first release :)

magnus 01-17-2004 06:08 PM

Nice hack, except there's a problem with the instructions. The 'settings' query is screwed up.

Replace:
Code:

INSERT INTO setting VALUES ('sigmaxwidth', '480', '', '141', 'user', '640', '0', '0');
INSERT INTO setting VALUES ('sigmaxheight', '120', '', '142', 'user', '480', '0', '0');

With:
Code:

INSERT INTO `setting` VALUES ('sigmaxwidth', 'user', '500', '500', '', 112, 0, 1);
INSERT INTO `setting` VALUES ('sigmaxheight', 'user', '150', '150', '', 111, 0, 1);

Or else it will not show up in the AdminCP. Other than that, it works like a charm! Great hack!

phlogiston 01-17-2004 06:48 PM

Quote:

Originally Posted by magnus
Nice hack, except there's a problem with the instructions. The 'settings' query is screwed up.

oops! thanks for pointing that out, I have updated the .txt file now with new queries for the settings which should work everywhere.

& glad it's working fine for you. :)

and MindTrix, thank you too, first release is rather nerve-racking!

FleaBag 01-17-2004 06:55 PM

Nice to see this released, it'll come in handy for my site.

Koutaru 01-17-2004 07:18 PM

Wow, thanks. I really need this one :) I'm really hoping this works!

Denz 01-18-2004 07:22 PM

Installed on RC 2, Works Great, Thanks

Peace

Delacroix 01-22-2004 05:09 PM

One more suggestion if it is even possible. I have one user (so far) that linked to a HUGE animated [img]. Is there a way to make this limit total file size as well?

Boofo 01-31-2004 08:48 AM

Looks good. I'll give it a shot. Thank you. ;)

monstergamer 02-01-2004 07:52 AM

works great, just what i wanted
/me clicks install

monstergamer 02-05-2004 04:52 PM

now members have links insted of the pics

pucca 02-28-2004 06:13 PM

Hmm.. it's not working for me at all. : ( I'm using RC4. When I update my signature, it doesn't show a warning. Can anyone help me? Thanks :D

btw - i'm not sure what you mean by "uncomment"? :x

milkmycow 02-28-2004 11:40 PM

didnt work for me on rc2. when i submit a new sig, it just never refreshes the page. I put my origial profile.php back on server, and page loaded fine. did that 2-3 times.

87accordlxi 03-01-2004 05:10 PM

This is great. It would definitely be a big help for it to also limit file sizes.

msimplay 03-11-2004 08:01 PM

does not work on rc4 as i have found out :P

Pheonix 03-12-2004 04:10 AM

I like the idea.. and may use the mod.. :) thanx

phlogiston 03-12-2004 04:54 AM

I'm gonna wait till gold version comes out before updating this as it seems to still work fine for me so it's obviously a compatability issue that isn't showing itself on first glance - I'll also add filesize checking at the same time.

msimplay 03-15-2004 04:40 PM

can u please do a quick one for rc4 because i won't be updating straight away :$
can't be that hard can it ?
its only 2 lines in the database

magnus 03-15-2004 04:47 PM

This works perfectly fine in RC4. I've been using it since RC4 was released.

CricketWeb 03-16-2004 06:55 AM

Will this work with vBulletin 3.0 FINAL?

Christine 03-17-2004 09:22 PM

phlogiston, Thanks for this -- my board is completely out of control with sigs. My mods will love you if this works! I am going to install it tonight.

:)

Edit to add: Installed and works like a charm. As written, it adds a link instead of the image for sizes that are too large. Uncommenting the allowimgsizefailure error message logic gives an error message when trying to submit a new sig with a pic too large. Perfect! :D

Oh, and a note for those who tried this and said it didn't work, before you give up -- make sure that you are going through your UserCP to change your sig and not the ACP or MCP. Sig limit checking by the profile.php file is only done in the UserCP.

:)

msimplay 03-21-2004 04:07 PM

i can also confirm this works on vb3 gold

msimplay 03-21-2004 04:12 PM

was just wondering if u could make the signature options more comprehensive
like for example this pic
i did try posting elsewhere but the thread got ignored but since this threads all about that kind of thing its best to ask here i guess

Pic

robin_ge 03-29-2004 07:42 PM

COOL~ works perfectly with gold

robin_ge clicks install

Indy 04-04-2004 11:04 PM

Just download and installed with my vB3 Gold. Works great!

Nice addition would be to limit the number of images in a signature as well! That would be sweet!! Even if not, GREAT JOB and GREAT HACK!

ImportPassion 04-08-2004 06:09 PM

I would like to see a weight check as well. most of my users have heavey images rather than too big.

Ecron Daemon 04-08-2004 11:04 PM

Mmmhh... Great hak, but... Is it possible to add a feature to limit the number of images in a signature? For example:Select that User can insert in the signature only one image, or only two, depending by the value choosen by admin in admin cp.

Is it possible to make it? :)

Sven 04-13-2004 09:45 AM

Installed ;)
Any Chance to see a check for imagesize in kb as well?

DS MrSinister 04-16-2004 03:27 AM

kewl hack.. going to intsall it late.. thanks

hukgwai 04-17-2004 02:54 AM

Keep up the good work! I hope this becomes final.

Oblivion Knight 04-17-2004 08:37 PM

It appears to work for some images and not others..

Any idea why this is the case?

Boofo 05-05-2004 12:41 PM

Which images are you having a problem with?

Christine 05-15-2004 03:33 PM

Working great on 3.0.0 without any problems!

Any plans to take this out of Beta?

hogarth 05-16-2004 10:46 PM

There's a problem with PHP's getimagesize(), I've run into it many times myself. I have no idea why this problem exists but some images, mainly ones I've found were saved from Photoshop, will fail to read corrently using PHP's imaging functions -- anything: getimagesize(), imagesx(), imagepng(), etc. Because of this "limitation," I've had to use X11's convert program to do my scaling, displaying, and image information. This is accomplished by a system() or exec() call and can be expensive but I've found it works 100% of the time no matter what's thrown at it. But, this is limited to a UNIX environment and assumes the vB installation has execute permission to the program convert.

Maybe a look into the ImageMagick PHP extension imagick might be worth looking at to see if this problem goes away then. But then this hack ends up with a "requirements" list.

This hack works great on 3.0.1 perfect. But on my board I also have a problem with members putting too many images in their sigs as well. I've made a very small modification to the original source that limits the total number of images and attached it for others.

ImportPassion 05-18-2004 10:54 AM

hogarth: does that include smilies too? if so, anyway that, that could be removed?

D

Boofo 05-18-2004 11:00 AM

Quote:

Originally Posted by hogarth
There's a problem with PHP's getimagesize(), I've run into it many times myself. I have no idea why this problem exists but some images, mainly ones I've found were saved from Photoshop, will fail to read corrently using PHP's imaging functions -- anything: getimagesize(), imagesx(), imagepng(), etc. Because of this "limitation," I've had to use X11's convert program to do my scaling, displaying, and image information. This is accomplished by a system() or exec() call and can be expensive but I've found it works 100% of the time no matter what's thrown at it. But, this is limited to a UNIX environment and assumes the vB installation has execute permission to the program convert.

Maybe a look into the ImageMagick PHP extension imagick might be worth looking at to see if this problem goes away then. But then this hack ends up with a "requirements" list.

This hack works great on 3.0.1 perfect. But on my board I also have a problem with members putting too many images in their sigs as well. I've made a very small modification to the original source that limits the total number of images and attached it for others.

Can you please tell us which code was changed from the original hack so we can just upgrade what we already have? ;)

Oblivion Knight 05-18-2004 11:10 AM

Quote:

Originally Posted by Boofo
Which images are you having a problem with?

I think this was because one of the images I tested with was under a .htaccess protected directory.. The image wouldn't be displayed to the public anyway and would be prompted to enter the name and password.

I've tested several other possibilities and it keeps coming back to this.

ImportPassion 05-18-2004 11:43 PM

Quote:

Originally Posted by Boofo
Can you please tell us which code was changed from the original hack so we can just upgrade what we already have? ;)

it's 30 lines, just paste over it.

Boofo 05-19-2004 02:11 AM

Quote:

Originally Posted by 7thgenCivic.Com
it's 30 lines, just paste over it.

That part wasn't worrying me. The extra queries we need to run is what I want to know about. ;)

ImportPassion 05-19-2004 02:13 AM

figured it out all by myself.

PHP Code:

    INSERT INTO phrase VALUES('''0''setting_sigmaximages_title''Total Number of Images In Signature''5000');
    
INSERT INTO phrase VALUES('''0''setting_sigmaximagest_desc''The total number of images in signatures.''5000');
INSERT INTO phrase VALUES('''0''sig_image_too_many''The total number of images in signatures is limited to $vboptions[sigmaximages].''1000');
INSERT INTO `setting` (varnamevalueoptioncodedisplayordergrouptitledefaultvalueadvancedvolatileVALUES ('sigmaximages''3'''143'user''3'00); 



All times are GMT. The time now is 05:47 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01390 seconds
  • Memory Usage 1,820KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete