vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Sig image size control (https://vborg.vbsupport.ru/showthread.php?t=40216)

Smoothie 06-27-2002 07:19 PM

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.

Darren Evans 06-27-2002 08:23 PM

Ok... can someone post a query that deletes all sig files so I don't have to go in and manually delete each one?

Smoothie 06-27-2002 08:29 PM

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.

Darren Evans 06-27-2002 08:59 PM

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.

Herman 06-28-2002 04:12 AM

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.

LightBringer 06-28-2002 06:48 PM

Herman, has there been any updates on the swf code for this hack?

Herman 06-28-2002 11:58 PM

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.

Herman 06-29-2002 12:01 AM

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.

DarkDraco07 06-29-2002 02:40 AM

i could really use this

Kinox 06-29-2002 04:58 AM

here is what i did

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

https://vborg.vbsupport.ru/showthrea...threadid=40402


All times are GMT. The time now is 02:19 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.01161 seconds
  • Memory Usage 1,743KB
  • 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
  • (5)bbcode_code_printable
  • (2)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