<?php
if(!isset($_SESSION)) { session_start(); }
include('../../../../config.php');
if($_SESSION['apstatus']=="Admin"){
$_SESSION['fstatus'] = 1;
}else{
$_SESSION['fstatus'] = 0;
}
$root = rtrim($_SERVER['DOCUMENT_ROOT'],'/'); // don't touch this configuration
if($ap_folder==""){
$root = $root;
}else{
$root = $root.'/'.$ap_folder;
}
//**********************
//Path configuration
//**********************
// In this configuration the folder tree is
// root
// |- tinymce
// | |- source <- upload folder
// | |- js
// | | |- tinymce
// | | | |- plugins
// | | | |- |- filemanager
// | | | |- |- |- thumbs <- folder of thumbs [must have the write permission]
$base_url = "$ap_site"."$ap_folder"; //url base of site if you want only relative url leave empty
//echo $base_url;
//echo $_SESSION['fstatus']
if($_SESSION['fstatus']==1){
if (!file_exists($root.'/contents/')) {
mkdir($root.'/contents/', 0777, true);
}
$upload_dir = '/contents/'; // path from base_url to upload base dir
$current_path = '../../../../contents/'; // relative path from filemanager folder to upload files folder
$users = '';
}else{
if(!file_exists($root.'/contents/'.$_SESSION['user'].'/')) {
mkdir($root.'/contents/'.$_SESSION['user'].'/', 0777, true);
}
if(!file_exists('thumbs/'.$_SESSION['user'].'/')) {
mkdir('thumbs/'.$_SESSION['user'].'/', 0777, true);
}
$upload_dir = '/contents/'.$_SESSION['user'].'/'; // path from base_url to upload base dir
$current_path = '../../../../contents/'.$_SESSION['user'].'/'; // relative path from filemanager folder to upload files folder
//echo $_SESSION['user'];
$users = $_SESSION['user'].'/';
}
$MaxSizeUpload = "10240"; //Mb
//**********************
//Image config
//**********************
//set max width pixel or the max height pixel for all images
//If you set dimension limit, automatically the images that exceed this limit are convert to limit, instead
//if the images are lower the dimension is maintained
//if you don't have limit set both to 0
$image_max_width = 0;
$image_max_height = 0;
//Automatic resizing //
//If you set true $image_resizing the script convert all images uploaded in image_width x image_height resolution
//If you set width or height to 0 the script calcolate automatically the other size
$image_resizing = false;
$image_width = 0;
$image_height = 0;
//******************
//Permits config
//******************
$delete_file = true;
$create_folder = true;
$delete_folder = true;
$upload_files = true;
//**********************
//Allowed extensions
//**********************
$ext_img = array('jpg','JPG','jpeg','JPEG','png','PNG','gif','GIF','ico','ICO'); //Images 'ico', 'tiff',
$ext_file = array('doc','DOC','docx','DOCX','pdf','PDF','xls','XLS','xlsx','XLSX','txt','TXT','csv','CSV','ppt','PPT','pptx','PPTX'); //Files
$ext_video = array('mp4','MP4','m4v','M4V','mov','MOV'); //Videos
$ext_music = array('mp3','MP3'); //Music
$ext_misc = array('zip','ZIP','rar','RAR'); //Archives
$ext = array_merge($ext_img, $ext_file,$ext_video,$ext_music,$ext_misc); //allowed extensions
?>