Screenshots:

fixed sql-error in manager
Comments:
  no longer appear as upvoted for anonymous user
  can be voted on, again
Class detail page:
  removed default limit on class ability query (300). now shows all spells
Filter/Items:
  added missing table-prefix; fixed search for iconString
Spells/Search:
  display triggered player abilities as misc. spells. (previously hidden)
Misc:
  removed some obscure piece of old config
This commit is contained in:
Sarjuuk
2015-07-01 14:06:58 +02:00
parent 7673e256c8
commit a3c9b52073
7 changed files with 27 additions and 29 deletions

View File

@@ -408,7 +408,7 @@ class AjaxHandler
$result = ['success' => 1, 'up' => 0, 'down' => 0]; $result = ['success' => 1, 'up' => 0, 'down' => 0];
break; break;
case 'vote': // up, down and remove case 'vote': // up, down and remove
if (!User::$id || !$this->get('id') || $this->get('rating')) if (!User::$id || !$this->get('id') || !$this->get('rating'))
{ {
$result = ['error' => 1, 'message' => Lang::main('genericError')]; $result = ['error' => 1, 'message' => Lang::main('genericError')];
break; break;

View File

@@ -29,8 +29,8 @@ class CommunityContent
a3.displayName AS deleteUser, a3.displayName AS deleteUser,
a4.displayName AS responseUser, a4.displayName AS responseUser,
IFNULL(SUM(cr.value), 0) AS rating, IFNULL(SUM(cr.value), 0) AS rating,
SUM(IF (cr.userId = ?d, value, 0)) AS userRating, SUM(IF(cr.userId > 0 AND cr.userId = ?d, cr.value, 0)) AS userRating,
SUM(IF (r.userId = ?d, 1, 0)) AS userReported SUM(IF( r.userId > 0 AND r.userId = ?d, 1, 0)) AS userReported
FROM FROM
?_comments c ?_comments c
JOIN JOIN
@@ -238,7 +238,7 @@ class CommunityContent
{ {
$screenshots = DB::Aowow()->select(' $screenshots = DB::Aowow()->select('
SELECT s.id, a.displayName AS user, s.date, s.width, s.height, s.type, s.typeId, s.caption, s.status, s.status AS "flags" SELECT s.id, a.displayName AS user, s.date, s.width, s.height, s.type, s.typeId, s.caption, s.status, s.status AS "flags"
FROM ?_screenshots s, FROM ?_screenshots s
LEFT JOIN ?_account a ON s.userIdOwner = a.id LEFT JOIN ?_account a ON s.userIdOwner = a.id
WHERE WHERE
{ s.type = ?d} { s.type = ?d}

View File

@@ -145,6 +145,9 @@ if (defined('CFG_SITE_HOST')) // points js to exec
if (!CLI) if (!CLI)
{ {
if (!defined('CFG_SITE_HOST') || !defined('CFG_STATIC_HOST'))
die('error: SITE_HOST or STATIC_HOST not configured');
// Setup Session // Setup Session
session_set_cookie_params(15 * YEAR, '/', '', $secure, true); session_set_cookie_params(15 * YEAR, '/', '', $secure, true);
session_cache_limiter('private'); session_cache_limiter('private');
@@ -152,23 +155,6 @@ if (!CLI)
if (!empty($AoWoWconf['aowow']) && User::init()) if (!empty($AoWoWconf['aowow']) && User::init())
User::save(); // save user-variables in session User::save(); // save user-variables in session
// todo: (low) - move to setup web-interface (when it begins its existance)
if (!defined('CFG_SITE_HOST') || !defined('CFG_STATIC_HOST'))
{
$host = substr($_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1);
define('HOST_URL', ($secure ? 'https://' : 'http://').$host);
define('STATIC_URL', ($secure ? 'https://' : 'http://').$host.'/static');
if (User::isInGroup(U_GROUP_ADMIN)) // initial set
{
DB::Aowow()->query('REPLACE INTO ?_config VALUES (?a)',
[['site_host', $host, CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.' - points js to executable files (automaticly set on first run)'],
['static_host', $host.'/static', CON_FLAG_TYPE_STRING | CON_FLAG_PERSISTENT, 'default: '.$host.'/static - points js to images & scripts (automaticly set on first run)']]
);
}
}
// hard-override locale for this call (should this be here..?) // hard-override locale for this call (should this be here..?)
// all strings attached.. // all strings attached..
if (!empty($AoWoWconf['aowow'])) if (!empty($AoWoWconf['aowow']))

View File

@@ -1725,7 +1725,7 @@ class ItemListFilter extends Filter
59 => [FILTER_CR_NUMERIC, 'durability', null, true], // dura 59 => [FILTER_CR_NUMERIC, 'durability', null, true], // dura
104 => [FILTER_CR_STRING, 'description', true ], // flavortext 104 => [FILTER_CR_STRING, 'description', true ], // flavortext
7 => [FILTER_CR_BOOLEAN, 'description_loc0', true ], // hasflavortext 7 => [FILTER_CR_BOOLEAN, 'description_loc0', true ], // hasflavortext
142 => [FILTER_CR_STRING, 'iconString', ], // icon 142 => [FILTER_CR_STRING, 'ic.iconString', ], // icon
12 => [FILTER_CR_BOOLEAN, 'itemset', ], // partofset 12 => [FILTER_CR_BOOLEAN, 'itemset', ], // partofset
13 => [FILTER_CR_BOOLEAN, 'randomEnchant', ], // randomlyenchanted 13 => [FILTER_CR_BOOLEAN, 'randomEnchant', ], // randomlyenchanted
14 => [FILTER_CR_BOOLEAN, 'pageTextId', ], // readable 14 => [FILTER_CR_BOOLEAN, 'pageTextId', ], // readable

View File

@@ -126,7 +126,8 @@ class ClassPage extends GenericPage
'OR', 'OR',
['s.cuFlags', SPELL_CU_LAST_RANK, '&'], ['s.cuFlags', SPELL_CU_LAST_RANK, '&'],
['s.rankNo', 0] ['s.rankNo', 0]
] ],
CFG_SQL_LIMIT_NONE
); );
$genSpells = new SpellList($conditions); $genSpells = new SpellList($conditions);

View File

@@ -680,7 +680,6 @@ class SearchPage extends GenericPage
{ {
$data[$abilities->id]['param1'] = strToLower($abilities->getField('iconString')); $data[$abilities->id]['param1'] = strToLower($abilities->getField('iconString'));
$data[$abilities->id]['param2'] = $abilities->ranks[$abilities->id]; $data[$abilities->id]['param2'] = $abilities->ranks[$abilities->id];
} }
} }
@@ -1360,11 +1359,15 @@ class SearchPage extends GenericPage
return $result; return $result;
} }
private function _searchSpell($cndBase) // 24 Spells (Misc + GM) $searchMask & 0x1000000 private function _searchSpell($cndBase) // 24 Spells (Misc + GM + triggered abilities) $searchMask & 0x1000000
{ {
$result = []; $result = [];
$cnd = array_merge($cndBase, array( $cnd = array_merge($cndBase, array(
[
'OR',
['s.typeCat', [0, -9]], ['s.typeCat', [0, -9]],
['AND', ['s.cuFlags', SPELL_CU_TRIGGERED, '&'], ['s.typeCat', [7, -2]]]
],
$this->createLookup() $this->createLookup()
)); ));
$misc = new SpellList($cnd); $misc = new SpellList($cnd);

View File

@@ -345,10 +345,15 @@ class SpellsPage extends GenericPage
} }
break; break;
case 0: // misc. Spells case 0: // misc. Spells & triggered player abilities
array_push($visibleCols, 'level'); array_push($visibleCols, 'level');
$conditions[] = ['s.typeCat', 0]; $conditions[] = [
'OR',
['s.typeCat', 0],
['AND', ['s.cuFlags', SPELL_CU_TRIGGERED, '&'], ['s.typeCat', [7, -2]]]
];
break; break;
} }
} }
@@ -387,13 +392,16 @@ class SpellsPage extends GenericPage
if (in_array(9, $_['cr']) && !in_array('source', $visibleCols)) if (in_array(9, $_['cr']) && !in_array('source', $visibleCols))
$visibleCols[] = 'source'; $visibleCols[] = 'source';
$mask = $spells->hasSetFields(['reagent1', 'skillLines', 'trainingCost']); $mask = $spells->hasSetFields(['reagent1', 'skillLines', 'trainingCost', 'reqClassMask']);
if ($mask & 0x1) if ($mask & 0x1)
$visibleCols[] = 'reagents'; $visibleCols[] = 'reagents';
if (!($mask & 0x2) && $this->category && !in_array($this->category[0], [9, 11])) if (!($mask & 0x2) && $this->category && !in_array($this->category[0], [9, 11]))
$hiddenCols[] = 'skill'; $hiddenCols[] = 'skill';
if (($mask & 0x4)) if (($mask & 0x4))
$visibleCols[] = 'trainingcost'; $visibleCols[] = 'trainingcost';
if (($mask & 0x8) && !in_array('singleclass', $visibleCols))
$visibleCols[] = 'singleclass';
if ($visibleCols) if ($visibleCols)
$tab['params']['visibleCols'] = '$'.Util::toJSON($visibleCols); $tab['params']['visibleCols'] = '$'.Util::toJSON($visibleCols);