Редакция 536 | К новейшей редакции | Весь файл | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 536 | Редакция 537 | ||
---|---|---|---|
Строка 27... | Строка 27... | ||
27 | $DUA = $secure->checkStr($_POST["dua"],1); |
27 | $DUA = $secure->checkStr($_POST["dua"],1); |
28 | $DType = $secure->checkInt($_POST["dtype"]); |
28 | $DType = $secure->checkInt($_POST["dtype"]); |
29 | $DLogo = 0; |
29 | $DLogo = 0; |
30 | 30 | ||
31 | if ($_FILES["distlogo"]["type"]!="") { |
31 | if ($_FILES["distlogo"]["type"]!="") { |
32 | $folder = $picture.$DUA."-orig.png"; |
- | |
33 | $folderN = $picture.$DUA.".png"; |
- | |
34 | $folderEM = $picture.$DUA."-em.png"; |
32 | $DLogo = $core->uploadPicture($picture, $DUA, $_FILES); |
35 | - | ||
36 | if (move_uploaded_file($_FILES["distlogo"]["tmp_name"],$folder)) { |
- | |
37 | chmod($folder, 0644); |
- | |
38 | list($width, $height) = GetImageSize($folder); |
- | |
39 | $percent = 32/$height; |
- | |
40 | $newwidth = $width * $percent; |
- | |
41 | $newheight = $height * $percent; |
- | |
42 | - | ||
43 | $output = ImageCreateTrueColor($newwidth, $newheight); |
- | |
44 | $source = ImageCreateFromPNG($folder); |
- | |
45 | - | ||
46 | ImageCopyResampled($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
- | |
47 | ImagePNG($output, $folderEM); |
- | |
48 | - | ||
49 | $percent = 15/$height; |
- | |
50 | $newwidth = $width * $percent; |
- | |
51 | $newheight = $height * $percent; |
- | |
52 | - | ||
53 | $output = ImageCreateTrueColor($newwidth, $newheight); |
- | |
54 | - | ||
55 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
- | |
56 | ImagePNG($output, $folderN); |
- | |
57 | - | ||
58 | unlink($folder); |
- | |
59 | $DLogo = 1; |
- | |
60 | }
|
- | |
61 | }
|
33 | }
|
62 | 34 | ||
63 | $r = $core->addDistribution($DName, $DType, $DUA, $DLogo); |
35 | $r = $core->addDistribution($DName, $DType, $DUA, $DLogo); |
64 | if ($r["ERR"]==0) { |
36 | if ($r["ERR"]==0) { |
65 | header("Location: ".$manager."\n\n"); |
37 | header("Location: ".$manager."\n\n"); |