function GetNewImageSize($file, $size) { $a = array(); $a["width"] = $size; $a["height"] = $size; if (list($width_orig, $height_orig, $image_type) = getimagesize(GetDocumentRoot() . $file)) { if ($height_orig > $size || $width_orig > $size) { if ($height_orig >= $width_orig) { $ratio_orig = $height_orig / $width_orig; $a["width"] = round($size / $ratio_orig); } 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; }
while (file_exists(GetDocumentRoot() . $SESSION["dir"] . $_POST["edit1"] . $_POST["edit2"])) { $_POST["edit1"] = "_" . $_POST["edit1"]; } // Bilddatei kopieren if ($SESSION["upload_filesize"] != "") { if (filesize($_FILES['input1']['tmp_name']) / 1024 <= $SESSION["upload_filesize"]) { $UPLOAD_RESULT = @move_uploaded_file($_FILES['input1']['tmp_name'], GetDocumentRoot() . $SESSION["dir"] . $_POST["edit1"] . $_POST["edit2"]); } else { $UPLOAD_RESULT = false; } } else { $UPLOAD_RESULT = @move_uploaded_file($_FILES['input1']['tmp_name'], GetDocumentRoot() . $SESSION["dir"] . $_POST["edit1"] . $_POST["edit2"]); } // Dateirechte anpassen if ($UPLOAD_RESULT) { @chmod(GetDocumentRoot() . $SESSION["dir"] . $_POST["edit1"] . $_POST["edit2"], $CONFIG["chmod_file"]); } } else { $UPLOAD_RESULT = false; } } ?> <div id="upload"> <form name="form1" action="" method="post" enctype="multipart/form-data"> <div style="margin-bottom:2px;"><b><script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.upload_label_1', '?'));</script>:</b> <span style="color:#8a95a2;">(<script language="javascript" type="text/javascript">document.write(tinyMCEPopup.getLang('smimage.upload_info_1', '?'));</script>: <?php if ($SESSION["upload_filesize"] != "") { echo $SESSION["upload_filesize"] . " KB"; } else { echo str_replace("M", "", ini_get('post_max_size')) * 1024 . " KB"; }
$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;'));"; } } ?> // Tabelle zeichnen jSMT.Paint(); <?php // Hinweis hinzufügen for ($i = 0; $i < count($FILES); $i++) { echo "document.getElementById('i1" . $i . "').title = tinyMCEPopup.getLang('smexplorer.file_menu_hint_1', '?'); document.getElementById('i2" . $i . "').title = tinyMCEPopup.getLang('smexplorer.file_menu_hint_2', '?'); document.getElementById('i3" . $i . "').title = tinyMCEPopup.getLang('smexplorer.file_menu_hint_3', '?');"; } ?> /* ]]> */ </script>
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output imagejpeg($image_p, null, $_GET["jpg_quality"]); } else { SendEmptyImage(); } } else { SendEmptyImage(); } break; case 3: if (ImageTypes() & IMG_PNG) { // Content type header("Content-type: image/png"); // Bilddatei laden if ($image = imagecreatefrompng(GetDocumentRoot() . $_GET["src"])) { // Transparenz erhalten imagealphablending($image_p, false); $colorTransparent = imagecolorallocatealpha($image_p, 0, 0, 0, 127); imagefill($image_p, 0, 0, $colorTransparent); imagesavealpha($image_p, true); // Resample imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); // Output imagepng($image_p); } else { SendEmptyImage(); } } else { SendEmptyImage(); }
echo "<img style=\"margin:0px; margin-left:4px;\" src=\"img/icon_tree_16x16.png\" border=\"0\" /><img src=\"img/icon_folder_16x16.png\" border=\"0\" />" . $folders[$i]; if ($SESSION["show_chmod"] == 1) { echo "<span style=\"margin-left:3px; font-size:7pt; color:#c4d3f6; font-weight:normal;\">[" . GetChmod($dir_root) . "]</span>"; } echo "</a></li>"; // Unterordner anzeigen ShowSubFolders($dir_root, $dir . $folders[$i] . "/", $depth + 1, $treemenu); } echo "</ul></div>"; } // Root-Ordner anzeigen for ($i = 0; $i < count($ROOT_FOLDER); $i++) { if ($i > 0) { echo "<div class=\"splitter_horizontal\"></div>"; } if (@file_exists(GetDocumentRoot() . $ROOT_FOLDER[$i])) { echo "<div class=\"tree_menu\"><ul>"; echo "<li><a href=\"javascript:;\" onclick=\"SMExplorer_OpenFolder('" . bin2hex(RC4("id=1&treemenu=" . $i . "&dir=" . $ROOT_FOLDER[$i] . "&" . $GET2)) . "'); if (window.event){ window.event.returnValue = false; }\"><img src=\"img/icon_folder_16x16.png\" border=\"0\" />"; if ($ROOT_FOLDER[$i] == $SESSION["dir"]) { echo "<b>" . basename($ROOT_FOLDER[$i]) . "</b>"; } else { echo basename($ROOT_FOLDER[$i]); } if ($SESSION["show_chmod"] == 1) { echo "<span style=\"margin-left:3px; font-size:7pt; color:#c4d3f6; font-weight:normal;\">[" . GetChmod($ROOT_FOLDER[$i]) . "]</span>"; } echo "</a></li>"; // Unterordner anzeigen ShowSubFolders($ROOT_FOLDER[$i], $ROOT_FOLDER[$i], 0, $i); echo "</ul></div>"; } else {
function GetFolders($dir, $hidden) { $folders = array(); // Server-Pfad ermitteln $dir = GetDocumentRoot() . $dir; // In Kleinbuchstaben umwandeln for ($i = 0; $i < count($hidden); $i++) { $hidden[$i] = strtolower($hidden[$i]); } // Leerzeichen entfernen for ($i = 0; $i < count($hidden); $i++) { $hidden[$i] = ltrim($hidden[$i]); $hidden[$i] = rtrim($hidden[$i]); } // Verzeichnisse ermitteln if ($dh = @opendir($dir)) { while ($file = readdir($dh)) { if (!preg_match("/^\\.+\$/", $file)) { if (is_dir($dir . $file) && !in_array(strtolower($file), $hidden)) { $folders[] = $file; } } } closedir($dh); } @sort($folders, SORT_STRING); // Server-Cache löschen clearstatcache(); // Ordner-Array zurückgeben return $folders; }
<?php error_reporting(0); include "php/tools.php"; include "php/config.php"; include "php/session.php"; include "php/image.php"; // Verzeichnispfad $IMAGE_PATH = GetDocumentRoot() . $SESSION["dir"]; $IMAGE_PATH_2 = $SESSION["dir"]; include "php/action.php"; // Verzeichnis lesen if ($SESSION["id"] == 1) { $FOLDERS = GetFolders($IMAGE_PATH); $FILES = GetFiles($IMAGE_PATH, $SESSION["orderby"]); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>SMImage</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="content-style-type" content="text/css" /> <meta http-equiv="content-script-type" content="text/javascript" /> <meta name="author" content="Jens Stolinski" /> <meta name="publisher" content="Jens Stolinski" /> <meta name="company" content="SYNASYS MEDIA" /> <?php // Webbrowser-Cache löschen