diff --git a/.htaccess b/.htaccess index 753acd4f..bf2496d3 100644 --- a/.htaccess +++ b/.htaccess @@ -22,11 +22,9 @@ AddDefaultCharset utf8 RewriteEngine on # Mapper-Helper: If you cant provide maps for all locales, redirect the browser - RewriteRule ^static/images/wow/maps/(frfr|dede|eses|ruru)/(.*)$ static/images/wow/maps/enus/$2 [NC] + RewriteRule ^(.*/)static/images/wow/maps/(frfr|dede|eses|ruru)/(.*)$ $1static/images/wow/maps/enus/$3 [NC] # accept flattened urls | NYI - need more work :x RewriteRule ^([a-z0-9\-]+)$ ?$1 [NC] # /items => ?items RewriteRule ^([a-z0-9\-]+)=([^?&]*)$ ?$1=$2 [NC] # /items=4.1 => ?items=4.1 RewriteRule ^([a-z0-9\-]+)=([^?&]*)[&?](.*)$ ?$1=$2&$3 [NC] # /items=4.1?filter=sl=7 => ?items=4.1&filter=sl=7 - - diff --git a/includes/kernel.php b/includes/kernel.php index ab940dac..1257be4d 100644 --- a/includes/kernel.php +++ b/includes/kernel.php @@ -70,8 +70,13 @@ $sets = DB::Aowow()->select('SELECT `key` AS ARRAY_KEY, intValue as i, strValue foreach ($sets as $k => $v) define('CFG_'.strtoupper($k), $v['s'] ?: intVal($v['i'])); -define('STATIC_URL', substr('http://'.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1).'/static'); // points js to images & scripts (change here if you want to use a separate subdomain) -define('HOST_URL', substr('http://'.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1)); // points js to executable files + +$protocoll = 'http://'; +if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || CFG_FORCE_SSL) + $protocoll = 'https://'; + +define('STATIC_URL', substr($protocoll.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1).'/static'); // points js to images & scripts (change here if you want to use a separate subdomain) +define('HOST_URL', substr($protocoll.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1)); // points js to executable files $e = CFG_DEBUG ? (E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT)) : 0; error_reporting($e); diff --git a/pages/npc.php b/pages/npc.php index d5a0b371..9d3163db 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -410,7 +410,9 @@ class NpcPage extends GenericPage $soldItems = new ItemList(array(['id', $sells])); if (!$soldItems->error) { - $this->extendGlobalData($soldItems->getJSGlobals()); + $extraCols = ["Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", 'Listview.extraCols.cost']; + if ($soldItems->hasSetFields(['condition'])) + $extraCols[] = 'Listview.extraCols.condition'; $this->lvTabs[] = array( 'file' => 'item', @@ -418,9 +420,11 @@ class NpcPage extends GenericPage 'params' => array( 'name' => '$LANG.tab_sells', 'id' => 'currency-for', - 'extraCols' => "$[Listview.extraCols.condition, Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack'), Listview.extraCols.cost]" + 'extraCols' => '$['.implode(', ', $extraCols).']' ) ); + + $this->extendGlobalData($soldItems->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); } } diff --git a/setup/updates/06_config.sql b/setup/updates/06_config.sql new file mode 100644 index 00000000..74e9a5d5 --- /dev/null +++ b/setup/updates/06_config.sql @@ -0,0 +1,2 @@ +INSERT IGNORE INTO aowow_config (`key`, `intValue`, `comment`) VALUES ('force_ssl', 0, 'default: 0 - enforce SSL, if the server is behind a load balancer'); +