Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Signature Image Size Limiter Details »»
Signature Image Size Limiter
Version: 1.0.2, by Chris M Chris M is offline
Developer Last Online: Feb 2013 Show Printable Version Email this Page

Version: 3.5.0 Rating:
Released: 06-14-2005 Last Update: 10-21-2005 Installs: 316
Uses Plugins
 
No support by the author.

[high]Installation Instructions[/high]

Step 1: Upload the .xml file to the Product Manager
Step 2: Alter the plugin code variables to reflect your signature image limits in height and width
Step 2: Click [high]INSTALL[/high]

[high]Credits[/high]
Zero Tolerance - For helping with the regex and troubleshooting my annoying problems

[high]Updates[/high]
1.0.1 - Nothing major, just removed some code that is not needed

To remove this without re-uploading the plugin, find in your plugin code:
PHP Code:
print_r($imginfo); 
and remove it - I put this in there for testing purposes and forgot to remove it

1.0.2 - This is just a bug fix update

Find in the plugin code:
PHP Code:
$this->registry->options['allowdynimg'
replace with:
PHP Code:
$vbulletin->options['allowdynimg'
As always, no need to upload the new plugin if you apply the fix directly to your plugin code

Chris

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 07-28-2005, 01:57 AM
FleaBag's Avatar
FleaBag FleaBag is offline
 
Join Date: Dec 2001
Posts: 1,674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Satan, always needed one of these!
Reply With Quote
  #53  
Old 07-28-2005, 08:36 AM
Aerith_Freak's Avatar
Aerith_Freak Aerith_Freak is offline
 
Join Date: Dec 2001
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
Reply With Quote
  #54  
Old 08-05-2005, 03:54 AM
Brinnie's Avatar
Brinnie Brinnie is offline
 
Join Date: Jul 2005
Location: Louisiana
Posts: 360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hellsatan
Um? Pardon?

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

Anyways, thanks for the update. I'm sure the whole world could use this.
Reply With Quote
  #55  
Old 08-05-2005, 04:25 AM
Brinnie's Avatar
Brinnie Brinnie is offline
 
Join Date: Jul 2005
Location: Louisiana
Posts: 360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #56  
Old 08-05-2005, 09:45 PM
dbembibre's Avatar
dbembibre dbembibre is offline
 
Join Date: Sep 2004
Location: Madrid (Spain)
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed work ok, only one thing, i find the phrases group in "frontend error messages"
Reply With Quote
  #57  
Old 08-06-2005, 08:50 AM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great hack! Installs.
Reply With Quote
  #58  
Old 08-06-2005, 11:17 AM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #59  
Old 08-11-2005, 06:56 PM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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.
Reply With Quote
  #60  
Old 08-11-2005, 07:21 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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?
Reply With Quote
  #61  
Old 08-12-2005, 09:05 AM
Oblivion Knight's Avatar
Oblivion Knight Oblivion Knight is offline
 
Join Date: May 2002
Location: Sheffield, UK
Posts: 1,757
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:50 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09734 seconds
  • Memory Usage 2,325KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (3)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete