function prepare_upload($field, $controltype, $postfilename, $value, $table, $id, &$pageObject) { $abs = GetFieldData($table, $field, "Absolute", false); $file =& $_FILES["value_" . GoodFieldName($field) . "_" . $id]; if ($file["error"] || $value == "") { return false; } if (substr($controltype, 6, 1) == "1") { if (strlen($postfilename)) { $pageObject->filesToDelete[] = new DeleteFile($postfilename, GetUploadFolder($field, $table), $abs); if (GetCreateThumbnail($field, $table)) { $pageObject->filesToDelete[] = new DeleteFile(GetThumbnailPrefix($field, $table) . $postfilename, GetUploadFolder($field, $table), $abs); } } return ""; } if (substr($controltype, 6, 1) == "0") { return false; } if (strlen($file['tmp_name'])) { if (!ResizeOnUpload($field, $table)) { $pageObject->filesToMove[] = new MoveFile($file['tmp_name'], $value, GetUploadFolder($field, $table), $abs); } else { $contents = myfile_get_contents($file['tmp_name']); $ext = CheckImageExtension($file["name"]); $thumb = CreateThumbnail($contents, GetNewImageSize($field, $table), $ext); $pageObject->filesToSave[] = new SaveFile($thumb, $value, GetUploadFolder($field, $table), $abs); } } return $value; }
} else { if ($width_orig >= $height_orig) { $ratio_orig = $width_orig / $height_orig; $a["height"] = round($size / $ratio_orig); } } } else { $a["width"] = $width_orig; $a["height"] = $height_orig; } } return $a; } // Neue Bildgröße brechnen $a = array(); $a = GetNewImageSize(GetDocumentRoot() . $_GET["src"], $_GET["size"]); $width = $a["width"]; $height = $a["height"]; unset($a); // Originale Bildgröße und Bilddateityp ermitteln if (!(list($width_orig, $height_orig, $image_type) = getimagesize(GetDocumentRoot() . $_GET["src"]))) { SendEmptyImage(); exit; } // Neues Bild erstellen if (!($image_p = imagecreatetruecolor($width, $height))) { SendEmptyImage(); exit; } // GIF-, JPG- und PNG-Bildformat switch ($image_type) {
echo bin2hex(RC4("id=1&orderby=" . $orderby[1]["status"] . "&" . $GET3)); ?> \');', 'SMExplorer_Orderby(\'<?php echo bin2hex(RC4("id=1&orderby=" . $orderby[2]["status"] . "&" . $GET3)); ?> \');')); // Tabellenzeile(n) hinzufügen <?php for ($i = 0; $i < count($FILES); $i++) { $icon = ""; // Datei-Icon if (IsFileExt($FILES[$i], "jpg") || IsFileExt($FILES[$i], "jpeg") || IsFileExt($FILES[$i], "gif") || IsFileExt($FILES[$i], "png") || IsFileExt($FILES[$i], "bmp") || IsFileExt($FILES[$i], "tif") || IsFileExt($FILES[$i], "ico")) { if ($CONFIG["show_preview"] == 1) { $a = array(); $a = GetNewImageSize($SESSION["dir"] . $FILES[$i], 200); // Bilddatei mit Thumbnail-Anzeige $icon = "<div id=\"th" . $i . "\" class=\"jsmpreview\"></div><img style=\"cursor:pointer;\" src=\"img/icon_image_16x16.png\" border=\"0\" onmouseover=\"jSMP.Show(\\'th" . $i . "\\', \\'" . $SESSION["dir"] . $FILES[$i] . "\\', \\'" . $a["width"] . "\\', \\'" . $a["height"] . "\\');\" onmouseout=\"jSMP.Close(\\'th" . $i . "\\');\" onclick=\"SMExplorer_Insert(\\'" . $SESSION["server"] . "\\', \\'" . $SESSION["dir"] . $FILES[$i] . "\\', \\'" . $SESSION["link_target"] . "\\');\" />"; unset($a); } else { // Bilddatei ohne Thumbnail-Anzeige $icon = "<img style=\"cursor:pointer;\" src=\"img/icon_image_16x16.png\" border=\"0\" onclick=\"SMExplorer_Insert(\\'" . $SESSION["server"] . "\\', \\'" . $SESSION["dir"] . $FILES[$i] . "\\', \\'" . $SESSION["link_target"] . "\\');\" />"; } } else { // Keine Bilddatei $icon = "<img style=\"cursor:pointer;\" src=\"img/icon_file_16x16.png\" border=\"0\" onclick=\"SMExplorer_Insert(\\'" . $SESSION["server"] . "\\', \\'" . $SESSION["dir"] . $FILES[$i] . "\\', \\'" . $SESSION["link_target"] . "\\');\" />"; } if ($SESSION["show_file_menu"] == 1) { echo "jSMT.AddData(Array('<input id=\"td_checkbox" . $i . "\" name=\"td_checkbox" . $i . "\" class=\"checkbox\" type=\"checkbox\" value=\"0\" onclick=\"SMExplorer_Check(" . count($FILES) . ");\" />', '" . $icon . "', '<input id=\"fn_input" . $i . "\" name=\"fn_input" . $i . "\" class=\"edit\" style=\"width:98%;\" type=\"text\" value=\"" . $FILES[$i] . "\" title=\"" . $FILES[$i] . "\" onclick=\"SMExplorer_InputClick(this, " . $CONFIG["rename_file_ext"] . ");\" onblur=\"SMExplorer_InputBlur(this, \\'" . $FILES[$i] . "\\');\" onkeypress=\"SMExplorer_InputEnter(event, this, \\'" . $FILES[$i] . "\\', \\'" . bin2hex(RC4("id=1&" . $GET)) . "\\');\">', '<img id=\"i1" . $i . "\" style=\"cursor:pointer;\" src=\"img/icon_insert_16x16.png\" border=\"0\" title=\"\" onclick=\"SMExplorer_Insert(\\'" . $SESSION["server"] . "\\', \\'" . $SESSION["dir"] . $FILES[$i] . "\\', \\'" . $SESSION["link_target"] . "\\');\" />', '<img id=\"i3" . $i . "\" style=\"cursor:pointer;\" src=\"img/icon_show_16x16.png\" border=\"0\" title=\"\" onclick=\"SMExplorer_View_Show(\\'" . $SESSION["dir"] . $FILES[$i] . "\\');\" />', '<img id=\"i2" . $i . "\" style=\"cursor:pointer;\" src=\"img/icon_delete_16x16.png\" border=\"0\" title=\"\" onclick=\"SMExplorer_DeleteFile(\\'" . bin2hex(RC4("id=1&" . $GET)) . "\\', \\'" . $FILES[$i] . "\\');\" />', '" . number_format(@filesize(GetDocumentRoot() . $SESSION["dir"] . $FILES[$i]) / 1024, 2, ",", ".") . " KB', '" . date(GetDateFormat() . ' H:i', @filemtime(GetDocumentRoot() . $SESSION["dir"] . $FILES[$i])) . "'), Array('width:18px; text-align:center;', 'width:18px; text-align:center;', '', 'width:16px; text-align:center;', 'width:16px; text-align:center;', 'width:16px; text-align:center;', 'width:102px; text-align:right;', 'width:122px; text-align:center;'));"; } else { echo "jSMT.AddData(Array('" . $icon . "', '<input id=\"fn_input" . $i . "\" name=\"fn_input" . $i . "\" class=\"edit\" style=\"width:98%;\" type=\"text\" value=\"" . $FILES[$i] . "\" title=\"" . $FILES[$i] . "\" readonly=\"1\">', '" . number_format(@filesize(GetDocumentRoot() . $SESSION["dir"] . $FILES[$i]) / 1024, 2, ",", ".") . " KB', '" . date(GetDateFormat() . ' H:i', @filemtime(GetDocumentRoot() . $SESSION["dir"] . $FILES[$i])) . "'), Array('width:18px; text-align:center;', '', 'width:16px; text-align:center;', 'width:102px; text-align:right;', 'width:122px; text-align:center;'));";
echo "<td colspan=\"5\"> </td>"; } echo "</tr>"; $i++; } // Tabellen anzeigen for ($j = 0; $j < count($FILES); $j++) { // Dateien anzeigen if ($i % 2) { echo "<tr style=\"background-color:#f6f9fb;\" onmouseover=\"this.style.backgroundImage='url(img/table_tr_active_bg.gif)';\" onmouseout=\"this.style.backgroundImage='none';\">"; } else { echo "<tr onmouseover=\"this.style.backgroundImage='url(img/table_tr_active_bg.gif)';\" onmouseout=\"this.style.backgroundImage='none';\">"; } // Icon mit Thumbnail-Anzeige bei "onmouseover" $a = array(); $a = GetNewImageSize($IMAGE_PATH_2 . $FILES[$j], 200); echo "<td style=\"width:18px; text-align:center;\"><div id=\"smpreview" . $j . "\" class=\"smpreview\"></div><img style=\"cursor:pointer;\" src=\"img/icon_image_16x16.png\" border=\"0\" onmouseover=\"SMP.Show('smpreview" . $j . "', '" . $IMAGE_PATH_2 . $FILES[$j] . "', '" . $a["width"] . "', '" . $a["height"] . "');\" onmouseout=\"SMP.Close('smpreview" . $j . "');\" onclick=\"SMImage_Insert('" . $SESSION["server"] . "', '" . $IMAGE_PATH_2 . $FILES[$j] . "', '" . Image_GetWidth($IMAGE_PATH . $FILES[$j]) . "', '" . Image_GetHeight($IMAGE_PATH . $FILES[$j]) . "', '" . $CONFIG["style"] . "');\" /></td>"; unset($a); // Dateiname if ($SESSION["show_image_menu"] == 1) { echo "<td><input class=\"edit\" style=\"width:98%;\" type=\"text\" value=\"" . $FILES[$j] . "\" title=\"" . $FILES[$j] . "\" onclick=\"SMImage_InputFileClick(this);\" onblur=\"SMImage_InputFileBlur(this, '" . $FILES[$j] . "');\" onkeypress=\"SMImage_InputFileEnter(event, this, '" . $FILES[$j] . "', '" . bin2hex(RC4("id=1&" . $GET)) . "')\"></td>"; } else { echo "<td><input class=\"edit\" style=\"width:98%;\" type=\"text\" value=\"" . $FILES[$j] . "\" title=\"" . $FILES[$j] . "\" readonly=\"1\"></td>"; } // Icon "Bild einfügen" echo "<td style=\"width:16px; text-align:center;\"><img id=\"i1" . $i . "\" style=\"cursor:pointer;\" src=\"img/icon_insert_16x16.png\" border=\"0\" title=\"\" onclick=\"SMImage_Insert('" . $SESSION["server"] . "', '" . $IMAGE_PATH_2 . $FILES[$j] . "', '" . Image_GetWidth($IMAGE_PATH . $FILES[$j]) . "', '" . Image_GetHeight($IMAGE_PATH . $FILES[$j]) . "', '" . $CONFIG["style"] . "');\" /></td>"; // Icon "Bilddatei löschen" if ($SESSION["show_image_menu"] == 1) { echo "<td style=\"width:16px; text-align:center;\"><img id=\"i2" . $i . "\" style=\"cursor:pointer;\" src=\"img/icon_delete_16x16.png\" border=\"0\" title=\"\" onclick=\"SMImage_DeleteImage('" . bin2hex(RC4("id=1&" . $GET)) . "', '" . $FILES[$j] . "');\" /></td>"; } // Dateigröße