diff --git a/includes/ajaxHandler.class.php b/includes/ajaxHandler.class.php index 656d00a5..d3d1d6c8 100644 --- a/includes/ajaxHandler.class.php +++ b/includes/ajaxHandler.class.php @@ -408,7 +408,7 @@ class AjaxHandler $result = ['success' => 1, 'up' => 0, 'down' => 0]; break; 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')]; break; diff --git a/includes/community.class.php b/includes/community.class.php index 33457b14..3381d4a2 100644 --- a/includes/community.class.php +++ b/includes/community.class.php @@ -29,8 +29,8 @@ class CommunityContent a3.displayName AS deleteUser, a4.displayName AS responseUser, IFNULL(SUM(cr.value), 0) AS rating, - SUM(IF (cr.userId = ?d, value, 0)) AS userRating, - SUM(IF (r.userId = ?d, 1, 0)) AS userReported + SUM(IF(cr.userId > 0 AND cr.userId = ?d, cr.value, 0)) AS userRating, + SUM(IF( r.userId > 0 AND r.userId = ?d, 1, 0)) AS userReported FROM ?_comments c JOIN @@ -238,7 +238,7 @@ class CommunityContent { $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" - FROM ?_screenshots s, + FROM ?_screenshots s LEFT JOIN ?_account a ON s.userIdOwner = a.id WHERE { s.type = ?d} diff --git a/includes/kernel.php b/includes/kernel.php index e7d8f73d..021a05b7 100644 --- a/includes/kernel.php +++ b/includes/kernel.php @@ -145,6 +145,9 @@ if (defined('CFG_SITE_HOST')) // points js to exec if (!CLI) { + if (!defined('CFG_SITE_HOST') || !defined('CFG_STATIC_HOST')) + die('error: SITE_HOST or STATIC_HOST not configured'); + // Setup Session session_set_cookie_params(15 * YEAR, '/', '', $secure, true); session_cache_limiter('private'); @@ -152,23 +155,6 @@ if (!CLI) if (!empty($AoWoWconf['aowow']) && User::init()) 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..?) // all strings attached.. if (!empty($AoWoWconf['aowow'])) diff --git a/includes/types/item.class.php b/includes/types/item.class.php index e15559d3..768fe6a5 100644 --- a/includes/types/item.class.php +++ b/includes/types/item.class.php @@ -1725,7 +1725,7 @@ class ItemListFilter extends Filter 59 => [FILTER_CR_NUMERIC, 'durability', null, true], // dura 104 => [FILTER_CR_STRING, 'description', true ], // flavortext 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 13 => [FILTER_CR_BOOLEAN, 'randomEnchant', ], // randomlyenchanted 14 => [FILTER_CR_BOOLEAN, 'pageTextId', ], // readable diff --git a/pages/class.php b/pages/class.php index df8139e5..d52d1925 100644 --- a/pages/class.php +++ b/pages/class.php @@ -126,7 +126,8 @@ class ClassPage extends GenericPage 'OR', ['s.cuFlags', SPELL_CU_LAST_RANK, '&'], ['s.rankNo', 0] - ] + ], + CFG_SQL_LIMIT_NONE ); $genSpells = new SpellList($conditions); diff --git a/pages/search.php b/pages/search.php index 832296e1..92a28d32 100644 --- a/pages/search.php +++ b/pages/search.php @@ -680,7 +680,6 @@ class SearchPage extends GenericPage { $data[$abilities->id]['param1'] = strToLower($abilities->getField('iconString')); $data[$abilities->id]['param2'] = $abilities->ranks[$abilities->id]; - } } @@ -1360,11 +1359,15 @@ class SearchPage extends GenericPage 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 = []; $cnd = array_merge($cndBase, array( - ['s.typeCat', [0, -9]], + [ + 'OR', + ['s.typeCat', [0, -9]], + ['AND', ['s.cuFlags', SPELL_CU_TRIGGERED, '&'], ['s.typeCat', [7, -2]]] + ], $this->createLookup() )); $misc = new SpellList($cnd); diff --git a/pages/spells.php b/pages/spells.php index fbbb0f1e..bf7370d3 100644 --- a/pages/spells.php +++ b/pages/spells.php @@ -345,10 +345,15 @@ class SpellsPage extends GenericPage } break; - case 0: // misc. Spells + case 0: // misc. Spells & triggered player abilities array_push($visibleCols, 'level'); - $conditions[] = ['s.typeCat', 0]; + $conditions[] = [ + 'OR', + ['s.typeCat', 0], + ['AND', ['s.cuFlags', SPELL_CU_TRIGGERED, '&'], ['s.typeCat', [7, -2]]] + ]; + break; } } @@ -387,13 +392,16 @@ class SpellsPage extends GenericPage if (in_array(9, $_['cr']) && !in_array('source', $visibleCols)) $visibleCols[] = 'source'; - $mask = $spells->hasSetFields(['reagent1', 'skillLines', 'trainingCost']); + $mask = $spells->hasSetFields(['reagent1', 'skillLines', 'trainingCost', 'reqClassMask']); if ($mask & 0x1) $visibleCols[] = 'reagents'; if (!($mask & 0x2) && $this->category && !in_array($this->category[0], [9, 11])) $hiddenCols[] = 'skill'; if (($mask & 0x4)) $visibleCols[] = 'trainingcost'; + if (($mask & 0x8) && !in_array('singleclass', $visibleCols)) + $visibleCols[] = 'singleclass'; + if ($visibleCols) $tab['params']['visibleCols'] = '$'.Util::toJSON($visibleCols);