1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | | PHP-Quelltext <?php
if (adminaccess('images')) {
if ($_REQUEST['entries']!='') $entries=$_REQUEST['entries'];
else $entries=0;
if (isset($_POST['action'])) $ACTION=$_POST['action'];
else $ACTION='view';
if ($ACTION==$_POST['cancel']) {header("location: admin.php?path=images.phpsession_id()); exit();}
elseif (isset($_REQUEST['upload'])) {
if ($ACTION==$_POST['upload'] && $_FILES['image_file']['tmp_name']!='') {
$UPLOAD=new UPLOAD();
$uploadreturned=$UPLOAD->images($_FILES['image_file'],'../'.$config['image_archive'],$_POST['image_name']);
if ($uploadreturned[0]==TRUE) $file_name=str_replace('../','',$uploadreturned[1]);
else eval ("\$upload_info= \"".templateinclude("images_upload_error")."\";");
eval ("\$upload_info= \"".templateinclude("images_upload_info")."\";");
}
$max_file_size=(ini_get('upload_max_filesize')*1024*1024);
$max_execution_time=ini_get('max_execution_time');
$max_filesize=FileSizeExt('','B',$max_file_size);
eval ("\$site_body.= \"".templateinclude("images_upload")."\";");
}
elseif ($ACTION==$_POST['delete']) {
@unlink("../content/images/".$_POST['filename']);
header("location: admin.php?path=images.php&entries=".$entries."session_id()); exit();
}
else {
$epp=20;
if ($_REQUEST['dir']!='') $dir=$_REQUEST['dir'];
if (!strstr($dir,$config['image_archive']) or $dir=='') $dir='../'.$config['image_archive'];
$dirpath=str_replace("../","",$dir);
$dirlist='';
$filelist='';
$count=0;
$width=1;
$a=opendir($dir);
while ($datei=readdir($a)) {
if (is_dir($dir.'/'.$datei) && $datei!='.' && $datei!='..') eval ("\$dirlist.= \"".templateinclude("images_dirlist")."\";");
elseif (filecheck($dir.'/'.$datei) && $datei!='.' && $datei!='..') {
$filepath=$dirpath.'/'.$datei;
eval ("\$dirlist.= \"".templateinclude("images_filelist")."\";");
}
if (strstr($datei,"gif") || strstr($datei,"jpg") || strstr($datei,"png")) {
$count++;
if ($count>$entries && $count<($entries+$epp+1)) {
if ($width == 6) {eval ("\$show_images.= \"".templateinclude("images_row_break")."\";"); $width=1;}
eval ("\$show_images.= \"".templateinclude("images_cell")."\";");
$width++;
}
}
}
$cs=6-$width;
if ($cs > 0) {eval ("\$show_images.= \"".templateinclude("images_row_spacer")."\";");}
closedir($a);
$page_link=sidelinkfull($count,$epp,$entries,"admin.php?path=images.php","small");
eval ("\$site_body.= \"".templateinclude("images")."\";");
}
}
else {header ("location: admin.phpsession_id()); exit();}
?> |