Редакция 80 | Редакция 83 | К новейшей редакции | Весь файл | Не учитывать пробелы | Содержимое файла | Авторство | Последнее изменение | Открыть журнал | RSS
Редакция 80 | Редакция 82 | ||
---|---|---|---|
Строка 36... | Строка 36... | ||
36 | $distua = mysql_real_escape_string($_POST["distUA"]); |
36 | $distua = mysql_real_escape_string($_POST["distUA"]); |
37 | $disttype = abs(intval($_POST["distType"])); |
37 | $disttype = abs(intval($_POST["distType"])); |
38 | 38 | ||
39 | $distlogo = 0; |
39 | $distlogo = 0; |
40 | if ($_FILES["distLOGO"]["type"]!=0) { |
40 | if ($_FILES["distLOGO"]["type"]!=0) { |
41 | $folder = "./img/logo/".stripslashes($distua)."-orig.gif"; |
41 | $folder = "./img/logo/".stripslashes($distua)."-orig.png"; |
42 | $folderN = "./img/logo/".stripslashes($distua).".gif"; |
42 | $folderN = "./img/logo/".stripslashes($distua).".png"; |
43 | $folderEM = "./img/logo/".stripslashes($distua)."-em.gif"; |
43 | $folderEM = "./img/logo/".stripslashes($distua)."-em.png"; |
44 | if (move_uploaded_file($_FILES["distLOGO"]["tmp_name"],$folder)) { |
44 | if (move_uploaded_file($_FILES["distLOGO"]["tmp_name"],$folder)) { |
45 | chmod($folder, 0644); |
45 | chmod($folder, 0644); |
46 | list($width, $height) = GetImageSize($folder); |
46 | list($width, $height) = GetImageSize($folder); |
47 | $percent = 32/$height; |
47 | $percent = 32/$height; |
48 | $newwidth = $width * $percent; |
48 | $newwidth = $width * $percent; |
49 | $newheight = $height * $percent; |
49 | $newheight = $height * $percent; |
50 | 50 | ||
51 | $output = ImageCreateTrueColor($newwidth, $newheight); |
51 | $output = ImageCreateTrueColor($newwidth, $newheight); |
52 | $source = ImageCreateFromGIF($folder); |
52 | $source = ImageCreateFromPNG($folder); |
53 | 53 | ||
54 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
54 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
55 | ImageGIF($output, $folderEM); |
55 | ImagePNG($output, $folderEM); |
56 | 56 | ||
57 | $percent = 15/$height; |
57 | $percent = 15/$height; |
58 | $newwidth = $width * $percent; |
58 | $newwidth = $width * $percent; |
59 | $newheight = $height * $percent; |
59 | $newheight = $height * $percent; |
60 | 60 | ||
61 | $output = ImageCreateTrueColor($newwidth, $newheight); |
61 | $output = ImageCreateTrueColor($newwidth, $newheight); |
62 | 62 | ||
63 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
63 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
64 | ImageGIF($output, $folderN); |
64 | ImagePNG($output, $folderN); |
65 | 65 | ||
66 | unlink($folder); |
66 | unlink($folder); |
67 | $distlogo = 1; |
67 | $distlogo = 1; |
68 | }
|
68 | }
|
69 | }
|
69 | }
|
Строка 77... | Строка 77... | ||
77 | $distua = mysql_real_escape_string($_POST["distUA"]); |
77 | $distua = mysql_real_escape_string($_POST["distUA"]); |
78 | $disttype = abs(intval($_POST["distType"])); |
78 | $disttype = abs(intval($_POST["distType"])); |
79 | $distID = abs(intval($_POST["distID"])); |
79 | $distID = abs(intval($_POST["distID"])); |
80 | 80 | ||
81 | if ($_FILES["distLOGO"]["type"]!=0) { |
81 | if ($_FILES["distLOGO"]["type"]!=0) { |
82 | $folder = "./img/logo/".stripslashes($distua)."-orig.gif"; |
82 | $folder = "./img/logo/".stripslashes($distua)."-orig.png"; |
83 | $folderN = "./img/logo/".stripslashes($distua).".gif"; |
83 | $folderN = "./img/logo/".stripslashes($distua).".png"; |
84 | $folderEM = "./img/logo/".stripslashes($distua)."-em.gif"; |
84 | $folderEM = "./img/logo/".stripslashes($distua)."-em.png"; |
85 | if (move_uploaded_file($_FILES["distLOGO"]["tmp_name"],$folder)) { |
85 | if (move_uploaded_file($_FILES["distLOGO"]["tmp_name"],$folder)) { |
86 | chmod ($folder, 0644); |
86 | chmod ($folder, 0644); |
87 | list($width, $height) = GetImageSize($folder); |
87 | list($width, $height) = GetImageSize($folder); |
88 | $percent = 32/$height; |
88 | $percent = 32/$height; |
89 | $newwidth = $width * $percent; |
89 | $newwidth = $width * $percent; |
90 | $newheight = $height * $percent; |
90 | $newheight = $height * $percent; |
91 | 91 | ||
92 | $output = ImageCreateTrueColor($newwidth, $newheight); |
92 | $output = ImageCreateTrueColor($newwidth, $newheight); |
93 | $source = ImageCreateFromGIF($folder); |
93 | $source = ImageCreateFromPNG($folder); |
94 | 94 | ||
95 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
95 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
96 | ImageGIF($output, $folderEM); |
96 | ImagePNG($output, $folderEM); |
97 | 97 | ||
98 | $percent = 15/$height; |
98 | $percent = 15/$height; |
99 | $newwidth = $width * $percent; |
99 | $newwidth = $width * $percent; |
100 | $newheight = $height * $percent; |
100 | $newheight = $height * $percent; |
101 | 101 | ||
102 | $output = ImageCreateTrueColor($newwidth, $newheight); |
102 | $output = ImageCreateTrueColor($newwidth, $newheight); |
103 | 103 | ||
104 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
104 | ImageCopyResized($output, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); |
105 | ImageGIF($output, $folderN); |
105 | ImagePNG($output, $folderN); |
106 | 106 | ||
107 | unlink($folder); |
107 | unlink($folder); |
108 | 108 | ||
109 | $res =& $db->query("UPDATE distribution SET distlogo='1' WHERE dist_id='$distID'"); |
109 | $res =& $db->query("UPDATE distribution SET distlogo='1' WHERE dist_id='$distID'"); |
110 | 110 |