Version: 1.00, by Herman
Developer Last Online: Oct 2008
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.
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.
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.
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.
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.