Редакция 524 | Редакция 526 | К новейшей редакции | Весь файл | Учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 524 | Редакция 525 | ||
---|---|---|---|
Строка 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"]!=0) { |
31 | if ($_FILES["distlogo"]["type"]!=0) { |
32 | $DLogo = $core->uploadPicture($picture, $DUA, $_FILES["distlogo"]); |
32 | $folder = $picture.$DUA."-orig.png"; |
- | 33 | $folderN = $picture.$DUA.".png"; |
|
- | 34 | $folderEM = $picture.$DUA."-em.png"; |
|
- | 35 | ||
- | 36 | if (move_uploaded_file($datafile["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 | }
|
|
33 | }
|
61 | }
|
34 | 62 | ||
35 | $r = $core->addDistribution($DName, $DType, $DUA, $DLogo); |
63 | $r = $core->addDistribution($DName, $DType, $DUA, $DLogo); |
36 | if ($r["ERR"]==0) { |
64 | if ($r["ERR"]==0) { |
37 | header("Location: ".$manager."\n\n"); |
65 | header("Location: ".$manager."\n\n"); |
Строка 47... | Строка 75... | ||
47 | $DUA = $secure->checkStr($_POST["dua"],1); |
75 | $DUA = $secure->checkStr($_POST["dua"],1); |
48 | $DType = $secure->checkInt($_POST["dtype"]); |
76 | $DType = $secure->checkInt($_POST["dtype"]); |
49 | $DLogo = 0; |
77 | $DLogo = 0; |
50 | 78 | ||
51 | if ($_FILES["distlogo"]["type"]!=0) { |
79 | if ($_FILES["distlogo"]["type"]!=0) { |
52 | $DLogo = $core->uploadPicture($picture, $DUA, $_FILES["distlogo"]); |
80 | $folder = $picture.$DUA."-orig.png"; |
- | 81 | $folderN = $picture.$DUA.".png"; |
|
- | 82 | $folderEM = $picture.$DUA."-em.png"; |
|
- | 83 | ||
- | 84 | if (move_uploaded_file($datafile["distlogo"]["tmp_name"],$folder)) { |
|
- | 85 | chmod($folder, 0644); |
|
- | 86 | list($width, $height) = GetImageSize($folder); |
|
- | 87 | $percent = 32/$height; |
|
- | 88 | $newwidth = $width * $percent; |
|
- | 89 | $newheight = $height * $percent; |
|
- | 90 | ||
- | 91 | $output = ImageCreateTrueColor($newwidth, $newheight); |
|
- | 92 | $source = ImageCreateFromPNG($folder); |
|
- | 93 | ||
- | 94 | ImageCopyResampled($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
|
- | 95 | ImagePNG($output, $folderEM); |
|
- | 96 | ||
- | 97 | $percent = 15/$height; |
|
- | 98 | $newwidth = $width * $percent; |
|
- | 99 | $newheight = $height * $percent; |
|
- | 100 | ||
- | 101 | $output = ImageCreateTrueColor($newwidth, $newheight); |
|
- | 102 | ||
- | 103 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
|
- | 104 | ImagePNG($output, $folderN); |
|
- | 105 | ||
- | 106 | unlink($folder); |
|
- | 107 | $DLogo = 1; |
|
- | 108 | }
|
|
53 | }
|
109 | }
|
54 | 110 | ||
55 | $r = $core->updateDistribution($ID, $DName, $DType, $DUA, $DLogo); |
111 | $r = $core->updateDistribution($ID, $DName, $DType, $DUA, $DLogo); |
56 | if ($r["ERR"]==0) { |
112 | if ($r["ERR"]==0) { |
57 | header("Location: ".$manager."\n\n"); |
113 | header("Location: ".$manager."\n\n"); |