- fixed rewriteRule if aowow is not in your root dir

- use https if available, added a config value to enforce it if nessecary
- NPC:
  * fixed currency icons when displaying extendedCost for vendor
  * display conditions column only if we actually have conditions set
This commit is contained in:
Sarjuuk
2014-09-09 20:40:12 +02:00
parent a5ce57ddf8
commit 2e18bf0d3e
4 changed files with 16 additions and 7 deletions

View File

@@ -22,11 +22,9 @@ AddDefaultCharset utf8
RewriteEngine on RewriteEngine on
# Mapper-Helper: If you cant provide maps for all locales, redirect the browser # 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 # accept flattened urls | NYI - need more work :x
RewriteRule ^([a-z0-9\-]+)$ ?$1 [NC] # /items => ?items 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 [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 RewriteRule ^([a-z0-9\-]+)=([^?&]*)[&?](.*)$ ?$1=$2&$3 [NC] # /items=4.1?filter=sl=7 => ?items=4.1&filter=sl=7

View File

@@ -70,8 +70,13 @@ $sets = DB::Aowow()->select('SELECT `key` AS ARRAY_KEY, intValue as i, strValue
foreach ($sets as $k => $v) foreach ($sets as $k => $v)
define('CFG_'.strtoupper($k), $v['s'] ?: intVal($v['i'])); 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; $e = CFG_DEBUG ? (E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT)) : 0;
error_reporting($e); error_reporting($e);

View File

@@ -410,7 +410,9 @@ class NpcPage extends GenericPage
$soldItems = new ItemList(array(['id', $sells])); $soldItems = new ItemList(array(['id', $sells]));
if (!$soldItems->error) 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( $this->lvTabs[] = array(
'file' => 'item', 'file' => 'item',
@@ -418,9 +420,11 @@ class NpcPage extends GenericPage
'params' => array( 'params' => array(
'name' => '$LANG.tab_sells', 'name' => '$LANG.tab_sells',
'id' => 'currency-for', '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));
} }
} }

View File

@@ -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');