added support for UPLOAD_FORM_LOCATION

This commit is contained in:
Chris
2018-12-27 12:37:47 +01:00
parent d25d562598
commit f7adc73a86
2 changed files with 9 additions and 7 deletions

View File

@@ -46,8 +46,9 @@ Table of contents
- [x] WEBP_COMPRESSION
- [x] MASTER_DELETE_CODE
- [x] MASTER_DELETE_IP
- [x] UPLOAD_FORM_LOCATION
- [ ] UPLOAD_QUOTA
- [ ] UPLOAD_CODE
- [ ] UPLOAD_FORM_LOCATION
- [ ] LOW_PROFILE
- [ ] IMAGE_CHANGE_CODE
- [ ] MAX_RESIZED_IMAGES

View File

@@ -22,9 +22,9 @@ function architect($url)
//if there is no info in the URL, don't even bother checking with the controllers
//just show the site
if(count($u)==0)
if( (!defined('UPLOAD_FORM_LOCATION') && count($u)==0) || (defined('UPLOAD_FORM_LOCATION') && UPLOAD_FORM_LOCATION && '/'.implode('/',$u)==UPLOAD_FORM_LOCATION) )
{
renderTemplate('main',false);
renderTemplate('main');
return;
}
@@ -55,11 +55,11 @@ function architect($url)
}
}
//we didn't find a hash. Well let's just display the webpage instead
//we didn't find a hash. send error 404
if($hash===false)
{
//var_dump("main site");
renderTemplate('main',false);
http_response_code(404);
die("404");
}
else
{
@@ -154,7 +154,8 @@ function autoload($className)
function renderTemplate($template,$vars=false)
{
extract($vars);
if(is_array($vars))
extract($vars);
include_once(ROOT.DS.'templates'.DS.$template.'.html');
}