Skip to content

Commit

Permalink
Automatically create file upload directory
Browse files Browse the repository at this point in the history
  • Loading branch information
integry committed Jul 21, 2010
1 parent 4d7eafb commit 2e13dbd
Showing 1 changed file with 48 additions and 42 deletions.
90 changes: 48 additions & 42 deletions inc/config.base.php
@@ -1,20 +1,20 @@
<?php <?php




/** /**
* sysem base config setting * sysem base config setting
* @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
* @link www.phpletter.com * @link www.phpletter.com
* @since 1/August/2007 * @since 1/August/2007
* *
*/ */



// error_reporting(E_ALL);
// error_reporting(E_ALL ^ E_NOTICE); // error_reporting(E_ALL);

// error_reporting(E_ALL ^ E_NOTICE);





//Access Control Setting //Access Control Setting
/** /**
Expand All @@ -25,17 +25,17 @@
define("CONFIG_LOGIN_USERNAME", 'ajax'); define("CONFIG_LOGIN_USERNAME", 'ajax');
define('CONFIG_LOGIN_PASSWORD', '123456'); define('CONFIG_LOGIN_PASSWORD', '123456');
define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page

//SYSTEM MODE CONFIG //SYSTEM MODE CONFIG
/** /**
* turn it on when you have this system for demo purpose * turn it on when you have this system for demo purpose
* that means changes made to each image is not physically applied to it * that means changes made to each image is not physically applied to it
* and all uploaded files/created folders will be removed automatically * and all uploaded files/created folders will be removed automatically
*/ */
define('CONFIG_SYS_DEMO_ENABLE', false); define('CONFIG_SYS_DEMO_ENABLE', false);
define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only
define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false

//User Permissions //User Permissions
define('CONFIG_OPTIONS_DELETE', true); define('CONFIG_OPTIONS_DELETE', true);
define('CONFIG_OPTIONS_CUT', true); define('CONFIG_OPTIONS_CUT', true);
Expand All @@ -50,19 +50,25 @@
and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder
these two paths accept relative path only, don't use absolute path these two paths accept relative path only, don't use absolute path
*/ */






define('CONFIG_SYS_DEFAULT_PATH', '../../../../public/upload/files'); //accept relative path only define('CONFIG_SYS_DEFAULT_PATH', '../../../../public/upload/files'); //accept relative path only
define('CONFIG_SYS_ROOT_PATH', '../../../../public/upload/files'); //accept relative path only define('CONFIG_SYS_ROOT_PATH', '../../../../public/upload/files'); //accept relative path only


define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name if (!file_exists(CONFIG_SYS_DEFAULT_PATH))

{
mkdir(CONFIG_SYS_DEFAULT_PATH, 0777);
chmod(CONFIG_SYS_DEFAULT_PATH, 0777);
}

define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name

define("CONFIG_SYS_DIR_SESSION_PATH", null); // using LiveCart session define("CONFIG_SYS_DIR_SESSION_PATH", null); // using LiveCart session

define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns
/** /**
* reg => regulare expression * reg => regulare expression
Expand All @@ -76,71 +82,71 @@
define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple
define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple
define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1

//UPLOAD OPTIONS CONFIG //UPLOAD OPTIONS CONFIG
define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 & 1024 ); //by bytes define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 & 1024 ); //by bytes
//define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes
//define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');//


define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid

define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste
define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');//
define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf');
//define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); //
define('CONFIG_UPLOAD_INVALID_EXTS', ''); define('CONFIG_UPLOAD_INVALID_EXTS', '');


//Preview //Preview
define('CONFIG_IMG_THUMBNAIL_MAX_X', 100); define('CONFIG_IMG_THUMBNAIL_MAX_X', 100);
define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100); define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100);
define('CONFIG_THICKBOX_MAX_WIDTH', 700); define('CONFIG_THICKBOX_MAX_WIDTH', 700);
define('CONFIG_THICKBOX_MAX_HEIGHT', 430); define('CONFIG_THICKBOX_MAX_HEIGHT', 430);


/** /**
* CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8 * CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8
* Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT * Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT
* Howerver, some Web Hosts do not have standard php.ini setting * Howerver, some Web Hosts do not have standard php.ini setting
* which you will find the file manager can not locate your files correctly * which you will find the file manager can not locate your files correctly
* if you do have such issue, please change it to fit your system. * if you do have such issue, please change it to fit your system.
* so what should you to do get it * so what should you to do get it
* 1. create a php script file (let's call it document_root.php) * 1. create a php script file (let's call it document_root.php)
* 2. add the following codes in in * 2. add the following codes in in
* <?php * <?php
* echo dirname(__FILE__); * echo dirname(__FILE__);
* ?> * ?>
* 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer * 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer
* 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that * 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that
* 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be * 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be
* 6. enjoy it * 6. enjoy it
* *
*/ */



define('CONFIG_WEBSITE_DOCUMENT_ROOT', '');
define('CONFIG_WEBSITE_DOCUMENT_ROOT', '');
//theme related setting //theme related setting
/* /*
* options avaialbe for CONFIG_EDITOR_NAME are: * options avaialbe for CONFIG_EDITOR_NAME are:
stand_alone stand_alone
tinymce tinymce
fckeditor fckeditor
*/ */
//CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8
// define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone')); // define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone'));

define('CONFIG_EDITOR_NAME', 'tinymce'); define('CONFIG_EDITOR_NAME', 'tinymce');

define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default
define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail
define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10);
define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client

//General Option Declarations //General Option Declarations
//LANGAUGAE DECLARATIONNS //LANGAUGAE DECLARATIONNS
define('CONFIG_LANG_INDEX', 'language'); //the index in the session define('CONFIG_LANG_INDEX', 'language'); //the index in the session

define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php')?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php')?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en
?> ?>

0 comments on commit 2e13dbd

Please sign in to comment.