add option to force a specific base url

This commit is contained in:
Shish 2016-07-11 13:00:54 +01:00
parent 17696f842c
commit c14a36079c
2 changed files with 6 additions and 2 deletions

View file

@ -39,7 +39,8 @@ _d("WH_SPLITS", 1); // int how many levels of subfolders to put in
_d("VERSION", '2.5.5+'); // string shimmie version _d("VERSION", '2.5.5+'); // string shimmie version
_d("TIMEZONE", null); // string timezone _d("TIMEZONE", null); // string timezone
_d("CORE_EXTS", "bbcode,user,mail,upload,image,view,handle_pixel,ext_manager,setup,upgrade,handle_404,comment,tag_list,index,tag_edit,alias_editor"); // extensions to always enable _d("CORE_EXTS", "bbcode,user,mail,upload,image,view,handle_pixel,ext_manager,setup,upgrade,handle_404,comment,tag_list,index,tag_edit,alias_editor"); // extensions to always enable
_d("EXTRA_EXTS", ""); // optional extra extensions _d("EXTRA_EXTS", ""); // string optional extra extensions
_d("BASE_URL", null); // string force a specific base URL (default is auto-detect)
/* /*

View file

@ -444,7 +444,10 @@ function make_link($page=null, $query=null) {
if(is_null($page)) $page = $config->get_string('main_page'); if(is_null($page)) $page = $config->get_string('main_page');
if(NICE_URLS || $config->get_bool('nice_urls', false)) { if(!is_null(BASE_URL)) {
$base = BASE_URL;
}
elseif(NICE_URLS || $config->get_bool('nice_urls', false)) {
$base = str_replace('/'.basename($_SERVER["SCRIPT_FILENAME"]), "", $_SERVER["PHP_SELF"]); $base = str_replace('/'.basename($_SERVER["SCRIPT_FILENAME"]), "", $_SERVER["PHP_SELF"]);
} }
else { else {