vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Signature Image Size Limiter (https://vborg.vbsupport.ru/showthread.php?t=83146)

FleaBag 07-28-2005 01:57 AM

Thanks Satan, always needed one of these!

Aerith_Freak 07-28-2005 08:36 AM

Quote:

Originally Posted by hellsatan
Whichever way you do it, it will cause longer loading times - Of course, like with the signature image checker here, nothing is stopping the user using a smaller image to bypass the check, then renaming a larger image to the same filename and extension as the one they used to bypass the check...

The only way to ensure it is to either have them upload them as attachments, or check it on every page-load :ermm:

Satan

Well if it is done during the posting process, say when the new post information is added to the database, if it checks it then - placing [url]path[*/url] if the image is too large and [img]path[*/img] if it is within the limits - even if they changed the file on the remote server, the post would still have the url tags in it. Then you could just repeat the same process for edit post should they try and get past it that way.

:ermm:

Brinnie 08-05-2005 03:54 AM

Quote:

Originally Posted by hellsatan
:confused: Um? Pardon?

Satan

Yet, once again, I was responding to the wrong thread. :rolleyes:

Anyways, thanks for the update. I'm sure the whole world could use this.

Brinnie 08-05-2005 04:25 AM

Quote:

Originally Posted by Aerith_Freak
Yeah I figured it might do that. I guess another soloution would to be when the message is posted it checks the image, and either places it in the img tag or if it is too big it places it in url tags, but I guess that would, in the long run on big forums cause massive load?



Now here's the real sollutions... To everything:
  • 1. You configure it to only allow images from a specific directory on your server, like:
    • A) Your vBadvanced gallery.
    • B) Or someone makes the long anticipated user upload signature pic hack.
    • C) FTP

I don't know how reasonable this is, but one way or another, the idea is to stop the user from updating his signature on the server end. Am I right? Because after his sig is set, he can go to photobucket and replace his mymugshot.jpg with a bigger mymugshot.jpg
  • 2. Limit the # of images.
    • (1) is safe number. Anything else and you're asking for it.

that is all. :)

dbembibre 08-05-2005 09:45 PM

Installed work ok, only one thing, i find the phrases group in "frontend error messages"

Snake 08-06-2005 08:50 AM

Great hack! Installs. ;)

Chris M 08-06-2005 11:17 AM

Quote:

Originally Posted by dbembibre
Installed work ok, only one thing, i find the phrases group in "frontend error messages"

If you have upgraded from vB 3.0.x it appears that the Name of the Error Messages is not reset from "Front-end Error Messages" that was used in vB3.0.x to "Error Messages" that is used in 3.5 :)

They are both the same thing though :)

Satan

Oblivion Knight 08-11-2005 06:56 PM

Much love to KirbyDE for helping me out with my request.. :D

This is the resulting plugin:
Code:

if ($vbulletin->options['allowsignatures'])
{
        $maxsigwidth = 400;
        $maxsigheight = 150;

        function check_sig_size($sig)
        {
                global $maxsigwidth, $maxsigheight, $errors, $vbulletin;
                $sig = str_replace(array('  ', '\\"'), array('', '"'), $sig);

                // check valid signature image size
                if ($imginfo = getimagesize($sig))
                {
                        if ($imginfo[0] > $maxsigwidth or $imginfo[1] > $maxsigheight)
                        {
                                $vbulletin->GPC['preview'] = 'true';
                                $errors[] = fetch_error('signaturetoobig', $maxsigwidth, $maxsigheight);
                        }
                }
        }

        $url = preg_replace('#\[img\]\s*(https?://([^<>*"' . iif(!$vbulletin->options['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "check_sig_size('\\1')", $signature);
}

The phrase then becomes something similar to:
Quote:

Your signature can not have images larger than {1}w x {2}h in pixels.

Boofo 08-11-2005 07:21 PM

Quote:

Originally Posted by Oblivion Knight
Much love to KirbyDE for helping me out with my request.. :D

This is the resulting plugin:
Code:

if ($vbulletin->options['allowsignatures'])
{
        $maxsigwidth = 400;
        $maxsigheight = 150;
 
        function check_sig_size($sig)
        {
                global $maxsigwidth, $maxsigheight, $errors, $vbulletin;
                $sig = str_replace(array(' ', '\\"'), array('', '"'), $sig);
 
                // check valid signature image size
                if ($imginfo = getimagesize($sig))
                {
                        if ($imginfo[0] > $maxsigwidth or $imginfo[1] > $maxsigheight)
                        {
                                $vbulletin->GPC['preview'] = 'true';
                                $errors[] = fetch_error('signaturetoobig', $maxsigwidth, $maxsigheight);
                        }
                }
        }
 
        $url = preg_replace('#\[img\]\s*(https?://([^<>*"' . iif(!$vbulletin->options['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "check_sig_size('\\1')", $signature);
}

The phrase then becomes something similar to:

Is that the entire hack in this xml then?

Oblivion Knight 08-12-2005 09:05 AM

Quote:

Originally Posted by Boofo
Is that the entire hack in this xml then?

Yes, you can install the plugin via hellsatan's .xml file and then replace the code with the above.


All times are GMT. The time now is 02:46 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.01131 seconds
  • Memory Usage 1,749KB
  • 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
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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