Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Sig image size control Details »»
Sig image size control
Version: 1.00, by Herman Herman is offline
Developer Last Online: Oct 2008 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-23-2002 Last Update: Never Installs: 54
 
No support by the author.

I wrote this hack so i could obviously do what the title says.

When installed it you get an option in vb option of max height and width.

If a user's sig is too big, then when you look at their sig it'll say sorry this image is too large. And if the link doesn't work, then it'll say sorry that image doesn't exist. Thnx.. Don't forget to back up the databases!

[edit]This new one gets rid of the queries.. but, you have to submit your vbulletin options after installing the hack in order for it to work.[/edit]

[edit]Update again, this fixes smooties prob's with it images being set to unlimited[/edit]

Show Your Support

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

Comments
  #32  
Old 06-27-2002, 07:19 PM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Darren Evans
So, this hack won't work unless all my users update their bios? It won't work on the fly when the hack is installed?
That would be correct.
Reply With Quote
  #33  
Old 06-27-2002, 08:23 PM
Darren Evans Darren Evans is offline
 
Join Date: Jan 2002
Location: Lakewood, CA
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok... can someone post a query that deletes all sig files so I don't have to go in and manually delete each one?
Reply With Quote
  #34  
Old 06-27-2002, 08:29 PM
Smoothie Smoothie is offline
 
Join Date: Oct 2001
Location: New York
Posts: 1,834
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One thing you might try, turn off:
Allow vB IMG code in signatures in the admin cp, submit, then go back and turn it back on.
Reply With Quote
  #35  
Old 06-27-2002, 08:59 PM
Darren Evans Darren Evans is offline
 
Join Date: Jan 2002
Location: Lakewood, CA
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Smoothie
One thing you might try, turn off:
Allow vB IMG code in signatures in the admin cp, submit, then go back and turn it back on.
Nope. That didn't work. Thanks for the reply, though.
Reply With Quote
  #36  
Old 06-28-2002, 04:12 AM
Herman Herman is offline
 
Join Date: Apr 2002
Location: I dunno... VB heava?
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
update user set signature="";

and yes, it is possible to do it with Swf files, but I haven't written the code for that yet.
Reply With Quote
  #37  
Old 06-28-2002, 06:48 PM
LightBringer's Avatar
LightBringer LightBringer is offline
 
Join Date: Oct 2001
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Herman, has there been any updates on the swf code for this hack?
Reply With Quote
  #38  
Old 06-28-2002, 11:58 PM
Herman Herman is offline
 
Join Date: Apr 2002
Location: I dunno... VB heava?
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok for SWF! Here it is.. I haven't completely put a lot of thought into this code b/c I was busy today, but it will do the job.

I designed this addition to be completely independant of the IMG sig control hack.. This hack addition will only affect swf's, so if you don't care about IMG and want swfs controled, only install this, however, you can install them both, and it wll control both.

find:

Code:
  // check max images
  if ($maximages!=0) {
add ABOVE

Code:
    $signature = preg_replace("/(\[)(swf)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/swf\])/seiU", "\swf_size_check('\\5','\\7')", $signature);
find at the very end of the file:

Code:
?>
add ABOVE:

Code:
function swf_size_check($image, $h_w) {


  global $maxsigheight, $maxsigwidth;

  //parse_all img tags

  $image_xy=@getimagesize($image);

  if ($image_xy==NULL)
	{
	return "Image not found";
	}
  else	{
	//ok, here we need to see if the user specified a size(i believe the swf will
	//default to default size if no height width is specified, so lets get the 
	//dimensions of the swf..

	$im_width=$image_xy[0];
	$im_height=$image_xy[1];


	//ok, did the user specify a height? lets see...

	unset($params);
	$params=explode(" ", $h_w);

	foreach($params AS $param)
		{
		if (preg_match("/(height)(=)(['\"]?)([^\"']*)(\\3)/siU", $param))
			{
			$im_height=preg_replace("/(height)(=)(['\"]?)([^\"']*)(\\3)/seiU", "\intval('\\4')", $param);
			}
		if (preg_match("/(width)(=)(['\"]?)([^\"']*)(\\3)/siU", $param))
			{
			$im_width=preg_replace("/(width)(=)(['\"]?)([^\"']*)(\\3)/seiU", "\intval('\\4')", $param);
			}
		}


	if ($im_width > $maxsigwidth)
		{
		return "Sorry, swf size exceeds maximum width of ".$maxsigwidth.".";
		}

	if ($im_height > $maxsigheight)
		{
		return "Sorry, swf size exceeds maximum height of ".$maxsigheight.".";
		}

	}


return "[swf=".$image."]" . $h_w . "[/swf]";
}

Keep in mind, that this is NOT fully tested, but I wrote it b/c of requests.
Reply With Quote
  #39  
Old 06-29-2002, 12:01 AM
Herman Herman is offline
 
Join Date: Apr 2002
Location: I dunno... VB heava?
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BTW, why does it parse the BBCODE in the [code] statements? This is very annoying.. In my above post, where the words appear italicized, there should be [i ] and [/i ] ending tags, for those interested.
Reply With Quote
  #40  
Old 06-29-2002, 02:40 AM
DarkDraco07's Avatar
DarkDraco07 DarkDraco07 is offline
 
Join Date: Apr 2002
Posts: 414
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i could really use this
Reply With Quote
  #41  
Old 06-29-2002, 04:58 AM
Kinox Kinox is offline
 
Join Date: Mar 2002
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here is what i did

https://vborg.vbsupport.ru/attachmen...&postid=266944

https://vborg.vbsupport.ru/showthrea...threadid=40402
Reply With Quote
  #42  
Old 07-19-2002, 02:21 AM
ZiRu$'s Avatar
ZiRu$ ZiRu$ is offline
 
Join Date: Jan 2002
Location: Manitoba, Canada
Posts: 520
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thx man i installed it
Reply With Quote
  #43  
Old 08-08-2002, 05:04 PM
Thunderpuck Thunderpuck is offline
 
Join Date: Jan 2002
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent! I really needed this. Thanks!
Reply With Quote
  #44  
Old 08-15-2002, 06:27 PM
rstark rstark is offline
 
Join Date: May 2002
Location: Honolulu, HI
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought I had this working well, installed it and tested it. I have the max images per post/signature set to 20, I set the max image height to 200 and width to 500 and saved the changes in the options screen. I tested it with a 640x480 image and sure enough, it said I exceeded the width.

I just had a new user register today, and put in a signature of 224x464. The height exceeds my limit in the option yet his signature still show up. So for some reason, it's not checking the height but it checks the width. Can someone verify that if you upload a picture that only exceeds the height limit, that this hack will work? Thanks.

Oh yeah, I just double checked the code from the installation of this hack and everything matches up properly.
Reply With Quote
  #45  
Old 08-22-2002, 12:24 AM
1freegaia 1freegaia is offline
 
Join Date: Nov 2001
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does it work with VB2.0.3 ?

thanks !
Reply With Quote
  #46  
Old 08-23-2002, 02:19 PM
Herman Herman is offline
 
Join Date: Apr 2002
Location: I dunno... VB heava?
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

rstark, your problem may be that the HTML code is enabled, that will make him able to get a larger signature than usual, so, disable that and it ends.... And it should work with any version of vB.
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 08:27 PM.


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.05386 seconds
  • Memory Usage 2,357KB
  • Queries Executed 30 (?)
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
  • (5)bbcode_code
  • (2)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
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)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