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