Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Project U-232 (http://www.bvlist.com/forumdisplay.php?f=80)
-   -   U-232 V2 Modifications Image Resize Mod (http://www.bvlist.com/showthread.php?t=10151)

nicukent 10th December 2014 13:32

U-232 V2 Modifications Image Resize Mod
 
1 Attachment(s)
Add to stdhead beside the others :
Code:




Add to include/bbcode_functions.php :

Code:

function scale($src)
        {
            $max = 350;
            if (!isset($max, $src))
            return;
            $src = str_replace("", "%20", $src[1]);
            $info = @getimagesize($src);
            $sw = $info[0];
            $sh = $info[1];
            $addclass = false;
            $max_em = 0.06 * $max;
            if ($max < max($sw, $sh)) {
            if ($sw > $sh)
            $new = array($max_em . "em", "auto");
            if ($sw < $sh)
            $new = array("auto", $max_em . "em");
            $addclass = true;
            } else
            $new = array("auto", "auto");
            $id = mt_rand(0000, 9999);
            if ($new[0] == "auto" && $new[1] == "auto")
            $img = "\"\"";
            else
            $img = "\"\"";
            return $img;
            }

Replace old img pregs:
Code:

//--img   
    if (stripos($s, '[img') !== false) {     
    $s = preg_replace_callback("/\[img\](http:\/\/[^\s'\"<>]+(\.(jpg|gif|png)))\[\/img\]/i", "scale", $s);
    // [img=http://www/image.gif]
    $s = preg_replace_callback("/\[img=(http:\/\/[^\s'\"<>]+(\.(gif|jpg|png)))alt=\"\"\]/i", "scale", $s);
    }

Unzip and Upload image-resize to root.


All times are GMT +2. The time now is 20:45.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.