Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

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
Reply

Thread Tools

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 09:34 AM.


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.05114 seconds
  • Memory Usage 2,296KB
  • Queries Executed 25 (?)
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
  • (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