Fix Signature Images
DLE don't control the size of signature images. That is a big problem. Member can upload a big image. For example : 1024 x 768.
With this h@ck, we will solve this problem and it apply to all version of DLE.
GO GO GO
1. Open file /modules/profile.php
find
Below Add
2. Open file language/English/website.lng
find
Below Add
3. Go back to step 1 and see 350 and 19. You can change "350" and "19" on the maximum size you needed. Can be done in the admin panel, but I was too lazy
DLE don't control the size of signature images. That is a big problem. Member can upload a big image. For example : 1024 x 768.
With this h@ck, we will solve this problem and it apply to all version of DLE.
GO GO GO
1. Open file /modules/profile.php
find
$stop .= $lang['news_err_22'];
Below Add
// Fix Signature Images
$replace_a = preg_replace ("'.*?\\[url.*?\\](.*?)\\[/url\\].*?'si", "\\1", $_POST['signature']); // get code pictures in signature
$replace = preg_replace ("'.*?\\[img.*?\\](.*?)\\[/img\\].*?'si", "\\1", $replace_a);Â Â // Now get links of them
$explode = explode (" ", $replace); // We divide the resulting string of different images
$count = count ($explode); // count images
foreach (range(0, $count-1) as $number) // Being put in the meter
{
    $link = $explode[$number]; // Final link
    $name = basename ($link); // Name pictures
    $type = explode (".", $name); // Get extension
    $end = end ($type); // We turn now to the last element
    if ($end == "jpg") $img = @imagecreatefromjpeg ($name); // Create images
    if ($end == "gif") $img = @imagecreatefromgif ($name);
    if ($end == "png") $img = @imagecreatefrompng ($name);
    if ($end == "bmp") $img = @imagecreatefrombmp ($name);
    if ($img) // Check, got-it
    {
        $width = @imagesx ($img); // Get width of the picture
        $height = @imagesy ($img); // Get height of the picture
        if ($width > 350 or $height > 19) // We compare
        {
            $find = array ('{%name%}', '{%width%}', '{%height%}');
            $replace = array ($name, "350", "19");
            $mess_error = str_replace ($find, $replace, $lang['reg_pic_big']);
            $stop .= $mess_error;
        }
    }
}
// Fix Signature Images
$replace_a = preg_replace ("'.*?\\[url.*?\\](.*?)\\[/url\\].*?'si", "\\1", $_POST['signature']); // get code pictures in signature
$replace = preg_replace ("'.*?\\[img.*?\\](.*?)\\[/img\\].*?'si", "\\1", $replace_a);Â Â // Now get links of them
$explode = explode (" ", $replace); // We divide the resulting string of different images
$count = count ($explode); // count images
foreach (range(0, $count-1) as $number) // Being put in the meter
{
    $link = $explode[$number]; // Final link
    $name = basename ($link); // Name pictures
    $type = explode (".", $name); // Get extension
    $end = end ($type); // We turn now to the last element
    if ($end == "jpg") $img = @imagecreatefromjpeg ($name); // Create images
    if ($end == "gif") $img = @imagecreatefromgif ($name);
    if ($end == "png") $img = @imagecreatefrompng ($name);
    if ($end == "bmp") $img = @imagecreatefrombmp ($name);
    if ($img) // Check, got-it
    {
        $width = @imagesx ($img); // Get width of the picture
        $height = @imagesy ($img); // Get height of the picture
        if ($width > 350 or $height > 19) // We compare
        {
            $find = array ('{%name%}', '{%width%}', '{%height%}');
            $replace = array ($name, "350", "19");
            $mess_error = str_replace ($find, $replace, $lang['reg_pic_big']);
            $stop .= $mess_error;
        }
    }
}
// Fix Signature Images
2. Open file language/English/website.lng
find
'pm_del'Â Â Â Â Â Â Â Â Â Â Â Â =>Â Â Â Â "Remove",
Below Add
'reg_pic_big' => "<li>Image  <b>{%name%}</b> too much! Image size in signature could not be more  {%width%} width, and {%height%} height</li>",
3. Go back to step 1 and see 350 and 19. You can change "350" and "19" on the maximum size you needed. Can be done in the admin panel, but I was too lazy

Updates
Dle templates English


