mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
ListPages/Filter
* vastly improved input validation * content and type validation occurs when filter is created * contextual filters like itemTypes are now only applied in context
This commit is contained in:
96
includes/ajaxHandler/filter.class.php
Normal file
96
includes/ajaxHandler/filter.class.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
class AjaxFilter extends AjaxHandler
|
||||
{
|
||||
public $doRedirect = true;
|
||||
|
||||
private $cat = [];
|
||||
private $page = '';
|
||||
private $filter = null;
|
||||
|
||||
public function __construct(array $params)
|
||||
{
|
||||
if (!$params)
|
||||
return;
|
||||
|
||||
$p = explode('=', $params[0]);
|
||||
|
||||
$this->page = $p[0];
|
||||
|
||||
if (isset($p[1]))
|
||||
$this->cat[] = $p[1];
|
||||
|
||||
if (count($params) > 1)
|
||||
for ($i = 1; $i < count($params); $i++)
|
||||
$this->cat[] = $params[$i];
|
||||
|
||||
$opts = ['parentCats' => $this->cat];
|
||||
|
||||
switch ($p[0])
|
||||
{
|
||||
case 'achievements':
|
||||
$this->filter = (new AchievementListFilter(true, $opts));
|
||||
break;
|
||||
case 'enchantments':
|
||||
$this->filter = (new EnchantmentListFilter(true, $opts));
|
||||
break;
|
||||
case 'icons':
|
||||
$this->filter = (new IconListFilter(true, $opts));
|
||||
break;
|
||||
case 'items':
|
||||
$this->filter = (new ItemListFilter(true, $opts));
|
||||
break;
|
||||
case 'itemsets':
|
||||
$this->filter = (new ItemsetListFilter(true, $opts));
|
||||
break;
|
||||
case 'npcs':
|
||||
$this->filter = (new CreatureListFilter(true, $opts));
|
||||
break;
|
||||
case 'objects':
|
||||
$this->filter = (new GameObjectListFilter(true, $opts));
|
||||
break;
|
||||
case 'quests':
|
||||
$this->filter = (new QuestListFilter(true, $opts));
|
||||
break;
|
||||
case 'sounds':
|
||||
$this->filter = (new SoundListFilter(true, $opts));
|
||||
break;
|
||||
case 'spells':
|
||||
$this->filter = (new SpellListFilter(true, $opts));
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
parent::__construct($params);
|
||||
|
||||
// always this one
|
||||
$this->handler = 'handleFilter';
|
||||
}
|
||||
|
||||
protected function handleFilter()
|
||||
{
|
||||
$url = '?'.$this->page;
|
||||
|
||||
if ($this->cat)
|
||||
$url .= '='.implode('.', $this->cat);
|
||||
|
||||
$fi = [];
|
||||
if ($x = $this->filter->getFilterString())
|
||||
$url .= '&filter='.$x;
|
||||
|
||||
if ($this->filter->error)
|
||||
$_SESSION['fiError'] = get_class($this->filter);
|
||||
|
||||
if ($fi)
|
||||
$url .= '&filter='.implode(';', $fi);
|
||||
|
||||
// do get request
|
||||
return $url;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -754,14 +754,14 @@ trait spawnHelper
|
||||
|
||||
abstract class Filter
|
||||
{
|
||||
private static $pattern = "/[\p{C}]/ui"; // delete unprintable characters
|
||||
private static $wCards = ['*' => '%', '?' => '_'];
|
||||
private static $criteria = ['cr', 'crs', 'crv']; // [cr]iterium, [cr].[s]ign, [cr].[v]alue
|
||||
|
||||
public $error = false; // erronous search fields
|
||||
|
||||
private $cndSet = [];
|
||||
|
||||
protected $parentCats = []; // used to validate ty-filter
|
||||
protected $inputFields = []; // list of input fields defined per page
|
||||
protected $fiData = ['c' => [], 'v' =>[]];
|
||||
protected $formData = array( // data to fill form fields
|
||||
'form' => [], // base form - unsanitized
|
||||
@@ -771,130 +771,24 @@ abstract class Filter
|
||||
'reputationCols' => [] // simlar and exclusive to extraCols - added as required
|
||||
);
|
||||
|
||||
// parse the provided request into a usable format; recall self with GET-params if nessecary
|
||||
public function __construct()
|
||||
// parse the provided request into a usable format
|
||||
public function __construct($fromPOST = false, $opts = [])
|
||||
{
|
||||
// prefer POST over GET, translate to url
|
||||
if (!empty($_POST))
|
||||
{
|
||||
foreach ($_POST as $k => $v)
|
||||
{
|
||||
if (is_array($v)) // array -> max depths:1
|
||||
{
|
||||
if (in_array($k, ['cr', 'wt']) && empty($v[0]))
|
||||
continue;
|
||||
if (!empty($opts['parentCats']))
|
||||
$this->parentCats = $opts['parentCats'];
|
||||
|
||||
$sub = [];
|
||||
foreach ($v as $sk => $sv)
|
||||
$sub[$sk] = Util::checkNumeric($sv) ? $sv : urlencode($sv);
|
||||
|
||||
if (!empty($sub) && in_array($k, self::$criteria))
|
||||
$this->fiData['c'][$k] = $sub;
|
||||
else if (!empty($sub))
|
||||
$this->fiData['v'][$k] = $sub;
|
||||
}
|
||||
else // stings and integer
|
||||
{
|
||||
if (in_array($k, self::$criteria))
|
||||
$this->fiData['c'][$k] = Util::checkNumeric($v) ? $v : urlencode($v);
|
||||
else
|
||||
$this->fiData['v'][$k] = Util::checkNumeric($v) ? $v : urlencode($v);
|
||||
}
|
||||
}
|
||||
|
||||
// do get request
|
||||
header('Location: '.HOST_URL.'?'.$_SERVER['QUERY_STRING'].'='.$this->urlize(), true, 302);
|
||||
}
|
||||
// sanitize input and build sql
|
||||
else if (!empty($_GET['filter']))
|
||||
{
|
||||
$tmp = explode(';', $_GET['filter']);
|
||||
$cr = $crs = $crv = [];
|
||||
|
||||
foreach (self::$criteria as $c)
|
||||
{
|
||||
foreach ($tmp as $i => $term)
|
||||
{
|
||||
if (strpos($term, $c.'=') === 0)
|
||||
{
|
||||
$$c = explode(':', explode('=', $term)[1]);
|
||||
unset($tmp[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// handle erronous input
|
||||
if (count($cr) != count($crv) || count($cr) != count($crs))
|
||||
{
|
||||
// use min provided criterion as basis
|
||||
$min = min(count($cr), count($crv), count($crs));
|
||||
if (count($cr) > $min)
|
||||
array_splice($cr, $min);
|
||||
|
||||
if (count($crv) > $min)
|
||||
array_splice($crv, $min);
|
||||
|
||||
if (count($crs) > $min)
|
||||
array_splice($crs, $min);
|
||||
|
||||
$this->error = true;
|
||||
}
|
||||
|
||||
foreach (self::$criteria as $c)
|
||||
$this->formData['setCriteria'][$c] = $$c;
|
||||
|
||||
for ($i = 0; $i < count($cr); $i++)
|
||||
{
|
||||
if (!isset($cr[$i]) || !isset($crs[$i]) || !isset($crv[$i]) ||
|
||||
!intVal($cr[$i]) || $crs[$i] === '' || $crv[$i] === '')
|
||||
{
|
||||
$this->error = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->sanitize($crv[$i]);
|
||||
|
||||
if ($crv[$i] !== '')
|
||||
{
|
||||
$this->fiData['c']['cr'][] = intVal($cr[$i]);
|
||||
$this->fiData['c']['crs'][] = intVal($crs[$i]);
|
||||
$this->fiData['c']['crv'][] = $crv[$i];
|
||||
}
|
||||
else
|
||||
$this->error = true;
|
||||
|
||||
}
|
||||
|
||||
foreach ($tmp as $v)
|
||||
{
|
||||
if (!strstr($v, '='))
|
||||
continue;
|
||||
|
||||
$w = explode('=', $v);
|
||||
|
||||
if (strstr($w[1], ':'))
|
||||
{
|
||||
$tmp2 = explode(':', $w[1]);
|
||||
|
||||
$this->formData['form'][$w[0]] = $tmp2;
|
||||
|
||||
array_walk($tmp2, function(&$v) {
|
||||
$v = intVal($v);
|
||||
});
|
||||
$this->fiData['v'][$w[0]] = $tmp2;
|
||||
}
|
||||
if ($fromPOST)
|
||||
$this->evaluatePOST();
|
||||
else
|
||||
{
|
||||
$this->formData['form'][$w[0]] = $w[1];
|
||||
|
||||
$this->sanitize($w[1]);
|
||||
|
||||
if ($w[1] !== '')
|
||||
$this->fiData['v'][$w[0]] = $w[1];
|
||||
else
|
||||
$this->error = true;
|
||||
}
|
||||
// an error occured, while processing POST
|
||||
if (isset($_SESSION['fiError']))
|
||||
{
|
||||
$this->error = $_SESSION['fiError'] == get_class($this);
|
||||
unset($_SESSION['fiError']);
|
||||
}
|
||||
|
||||
$this->evaluateGET();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -904,7 +798,25 @@ abstract class Filter
|
||||
return ['formData'];
|
||||
}
|
||||
|
||||
public function urlize(array $override = [], array $addCr = [])
|
||||
private function &criteriaIterator()
|
||||
{
|
||||
if (!$this->fiData['c'])
|
||||
return;
|
||||
|
||||
for ($i = 0; $i < count($this->fiData['c']['cr']); $i++)
|
||||
{
|
||||
// throws a notice if yielded directly "Only variable references should be yielded by reference"
|
||||
$v = [&$this->fiData['c']['cr'][$i], &$this->fiData['c']['crs'][$i], &$this->fiData['c']['crv'][$i]];
|
||||
yield $i => $v;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************/
|
||||
/* get prepared values */
|
||||
/***********************/
|
||||
|
||||
public function getFilterString(array $override = [], array $addCr = [])
|
||||
{
|
||||
$_ = [];
|
||||
foreach (array_merge($this->fiData['c'], $this->fiData['v'], $override) as $k => $v)
|
||||
@@ -932,8 +844,34 @@ abstract class Filter
|
||||
return implode(';', $_);
|
||||
}
|
||||
|
||||
// todo: kill data, that is unexpected or points to wrong indizes
|
||||
private function evaluateFilter()
|
||||
public function getExtraCols()
|
||||
{
|
||||
return $this->formData['extraCols'];
|
||||
}
|
||||
|
||||
public function getSetCriteria()
|
||||
{
|
||||
return $this->formData['setCriteria'];
|
||||
}
|
||||
|
||||
public function getSetWeights()
|
||||
{
|
||||
return $this->formData['setWeights'];
|
||||
}
|
||||
|
||||
public function getReputationCols()
|
||||
{
|
||||
return $this->formData['reputationCols'];
|
||||
}
|
||||
|
||||
public function getForm()
|
||||
{
|
||||
return $this->formData['form'];
|
||||
}
|
||||
|
||||
public function getConditions()
|
||||
{
|
||||
if (!$this->cndSet)
|
||||
{
|
||||
// values
|
||||
$this->cndSet = $this->createSQLForValues();
|
||||
@@ -946,65 +884,275 @@ abstract class Filter
|
||||
array_unshift($this->cndSet, empty($this->fiData['v']['ma']) ? 'AND' : 'OR');
|
||||
}
|
||||
|
||||
public function getForm($key = null, $raw = false)
|
||||
{
|
||||
$form = [];
|
||||
|
||||
if (!$this->formData)
|
||||
return $form;
|
||||
|
||||
foreach ($this->formData as $name => $data)
|
||||
{
|
||||
if (!$data || ($key && $name != $key))
|
||||
continue;
|
||||
|
||||
switch ($name)
|
||||
{
|
||||
case 'setCriteria':
|
||||
if ($data || $raw)
|
||||
$form[$name] = $raw ? $data : 'fi_setCriteria('.Util::toJSON($data['cr']).', '.Util::toJSON($data['crs']).', '.Util::toJSON($data['crv']).');';
|
||||
else
|
||||
$form[$name] = 'fi_setCriteria([], [], []);';
|
||||
break;
|
||||
case 'extraCols':
|
||||
$form[$name] = $raw ? $data : 'fi_extraCols = '.Util::toJSON(array_unique($data)).';';
|
||||
break;
|
||||
case 'setWeights':
|
||||
$form[$name] = $raw ? $data : 'fi_setWeights('.Util::toJSON($data).', 0, 1, 1);';
|
||||
break;
|
||||
case 'form':
|
||||
case 'reputationCols':
|
||||
if ($key == $name) // only if explicitely specified
|
||||
$form[$name] = $data;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $key ? (empty($form[$key]) ? [] : $form[$key]) : $form;
|
||||
}
|
||||
|
||||
public function getConditions()
|
||||
{
|
||||
if (!$this->cndSet)
|
||||
$this->evaluateFilter();
|
||||
|
||||
return $this->cndSet;
|
||||
}
|
||||
|
||||
// santas little helper..
|
||||
private function &criteriaIterator()
|
||||
|
||||
/**********************/
|
||||
/* input sanitization */
|
||||
/**********************/
|
||||
|
||||
private function evaluatePOST()
|
||||
{
|
||||
if (!$this->fiData['c'])
|
||||
// doesn't need to set formData['form']; this happens in GET-step
|
||||
|
||||
foreach ($this->inputFields as $inp => list($type, $valid, $asArray))
|
||||
{
|
||||
if (!isset($_POST[$inp]) || $_POST[$inp] === '')
|
||||
continue;
|
||||
|
||||
$val = $_POST[$inp];
|
||||
$k = in_array($inp, ['cr', 'crs', 'crv']) ? 'c' : 'v';
|
||||
|
||||
if ($asArray)
|
||||
{
|
||||
$buff = [];
|
||||
foreach ((array)$val as $v)
|
||||
if ($v !== '' && $this->checkInput($type, $valid, $v))
|
||||
$buff[] = $v;
|
||||
|
||||
if ($buff)
|
||||
$this->fiData[$k][$inp] = $buff;
|
||||
}
|
||||
else if ($this->checkInput($type, $valid, $val))
|
||||
$this->fiData[$k][$inp] = $val;
|
||||
}
|
||||
|
||||
$this->setWeights();
|
||||
$this->setCriteria();
|
||||
}
|
||||
|
||||
private function evaluateGET()
|
||||
{
|
||||
if (empty($_GET['filter']))
|
||||
return;
|
||||
|
||||
for ($i = 0; $i < count($this->fiData['c']['cr']); $i++)
|
||||
// squash into usable format
|
||||
$post = [];
|
||||
foreach (explode(';', $_GET['filter']) as $f)
|
||||
{
|
||||
// throws a notice if yielded directly "Only variable references should be yielded by reference"
|
||||
$v = [&$this->fiData['c']['cr'][$i], &$this->fiData['c']['crs'][$i], &$this->fiData['c']['crv'][$i]];
|
||||
yield $i => $v;
|
||||
if (!strstr($f, '='))
|
||||
{
|
||||
$this->error = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
$_ = explode('=', $f);
|
||||
$post[$_[0]] = $_[1];
|
||||
}
|
||||
|
||||
$cr = $crs = $crv = [];
|
||||
foreach ($this->inputFields as $inp => list($type, $valid, $asArray))
|
||||
{
|
||||
if (!isset($post[$inp]) || $post[$inp] === '')
|
||||
continue;
|
||||
|
||||
$val = $post[$inp];
|
||||
$k = in_array($inp, ['cr', 'crs', 'crv']) ? 'c' : 'v';
|
||||
|
||||
if ($asArray)
|
||||
{
|
||||
$buff = [];
|
||||
foreach (explode(':', $val) as $v)
|
||||
if ($v !== '' && $this->checkInput($type, $valid, $v))
|
||||
$buff[] = $v;
|
||||
|
||||
if ($buff)
|
||||
{
|
||||
if ($k == 'v')
|
||||
$this->formData['form'][$inp] = $buff;
|
||||
|
||||
$this->fiData[$k][$inp] = array_map(function ($x) { return strtr($x, Filter::$wCards); }, $buff);
|
||||
}
|
||||
}
|
||||
else if ($this->checkInput($type, $valid, $val))
|
||||
{
|
||||
if ($k == 'v')
|
||||
$this->formData['form'][$inp] = $val;
|
||||
|
||||
$this->fiData[$k][$inp] = strtr($val, Filter::$wCards);
|
||||
}
|
||||
}
|
||||
|
||||
$this->setWeights();
|
||||
$this->setCriteria();
|
||||
}
|
||||
|
||||
private function setCriteria() // [cr]iterium, [cr].[s]ign, [cr].[v]alue
|
||||
{
|
||||
if (empty($this->fiData['c']['cr']) && empty($this->fiData['c']['crs']) && empty($this->fiData['c']['crv']))
|
||||
return;
|
||||
else if (empty($this->fiData['c']['cr']) || empty($this->fiData['c']['crs']) || empty($this->fiData['c']['crv']))
|
||||
{
|
||||
unset($this->fiData['c']['cr']);
|
||||
unset($this->fiData['c']['crs']);
|
||||
unset($this->fiData['c']['crv']);
|
||||
|
||||
$this->error = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$_cr = &$this->fiData['c']['cr'];
|
||||
$_crs = &$this->fiData['c']['crs'];
|
||||
$_crv = &$this->fiData['c']['crv'];
|
||||
|
||||
if (count($_cr) != count($_crv) || count($_cr) != count($_crs))
|
||||
{
|
||||
// use min provided criterion as basis
|
||||
$min = min(count($_cr), count($_crv), count($_crs));
|
||||
if (count($_cr) > $min)
|
||||
array_splice($_cr, $min);
|
||||
|
||||
if (count($_crv) > $min)
|
||||
array_splice($_crv, $min);
|
||||
|
||||
if (count($_crs) > $min)
|
||||
array_splice($_crs, $min);
|
||||
|
||||
$this->error = true;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < count($_cr); $i++)
|
||||
{
|
||||
// conduct filter specific checks & casts here
|
||||
$unsetme = false;
|
||||
if (isset($this->genericFilter[$_cr[$i]]))
|
||||
{
|
||||
$gf = $this->genericFilter[$_cr[$i]];
|
||||
switch ($gf[0])
|
||||
{
|
||||
case FILTER_CR_NUMERIC:
|
||||
$_ = $_crs[$i];
|
||||
if (!Util::checkNumeric($_crv[$i], $gf[2]) || !$this->int2Op($_))
|
||||
$unsetme = true;
|
||||
break;
|
||||
case FILTER_CR_BOOLEAN:
|
||||
case FILTER_CR_FLAG:
|
||||
case FILTER_CR_STAFFFLAG:
|
||||
$_ = $_crs[$i];
|
||||
if (!$this->int2Bool($_))
|
||||
$unsetme = true;
|
||||
break;
|
||||
case FILTER_CR_ENUM:
|
||||
if (!Util::checkNumeric($_crs[$i], NUM_REQ_INT))
|
||||
$unsetme = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$unsetme && intval($_cr[$i]) && $_crs[$i] !== '' && $_crv[$i] !== '')
|
||||
continue;
|
||||
|
||||
unset($_cr[$i]);
|
||||
unset($_crs[$i]);
|
||||
unset($_crv[$i]);
|
||||
|
||||
$this->error = true;
|
||||
}
|
||||
|
||||
$this->formData['setCriteria'] = array(
|
||||
'cr' => $_cr,
|
||||
'crs' => $_crs,
|
||||
'crv' => $_crv
|
||||
);
|
||||
}
|
||||
|
||||
private function setWeights()
|
||||
{
|
||||
if (empty($this->fiData['v']['wt']) && empty($this->fiData['v']['wtv']))
|
||||
return;
|
||||
|
||||
$_wt = &$this->fiData['v']['wt'];
|
||||
$_wtv = &$this->fiData['v']['wtv'];
|
||||
|
||||
if (empty($_wt) && !empty($_wtv))
|
||||
{
|
||||
unset($_wtv);
|
||||
$this->error = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (empty($_wtv) && !empty($_wt))
|
||||
{
|
||||
unset($_wt);
|
||||
$this->error = true;
|
||||
return;
|
||||
}
|
||||
|
||||
$nwt = count($_wt);
|
||||
$nwtv = count($_wtv);
|
||||
|
||||
if ($nwt > $nwtv)
|
||||
{
|
||||
array_splice($_wt, $nwtv);
|
||||
$this->error = true;
|
||||
}
|
||||
else if ($nwtv > $nwt)
|
||||
{
|
||||
array_splice($_wtv, $nwt);
|
||||
$this->error = true;
|
||||
}
|
||||
|
||||
$this->formData['setWeights'] = [$_wt, $_wtv];
|
||||
}
|
||||
|
||||
protected function checkInput($type, $valid, &$val, $recursive = false)
|
||||
{
|
||||
switch ($type)
|
||||
{
|
||||
case FILTER_V_EQUAL:
|
||||
if (gettype($valid) == 'integer')
|
||||
$val = intval($val);
|
||||
else if (gettype($valid) == 'double')
|
||||
$val = floatval($val);
|
||||
else /* if (gettype($valid) == 'string') */
|
||||
$var = strval($val);
|
||||
|
||||
if ($valid == $val)
|
||||
return true;
|
||||
|
||||
break;
|
||||
case FILTER_V_LIST:
|
||||
if (!Util::checkNumeric($val, NUM_CAST_INT))
|
||||
return false;
|
||||
|
||||
foreach ($valid as $k => $v)
|
||||
{
|
||||
if (gettype($v) != 'array')
|
||||
continue;
|
||||
|
||||
if ($this->checkInput(FILTER_V_RANGE, $v, $val, true))
|
||||
return true;
|
||||
|
||||
unset($valid[$k]);
|
||||
}
|
||||
|
||||
if (in_array($val, $valid))
|
||||
return true;
|
||||
|
||||
break;
|
||||
case FILTER_V_RANGE:
|
||||
if (Util::checkNumeric($val, NUM_CAST_INT) && $val >= $valid[0] && $val <= $valid[1])
|
||||
return true;
|
||||
|
||||
break;
|
||||
case FILTER_V_CALLBACK:
|
||||
if ($this->$valid($val))
|
||||
return true;
|
||||
|
||||
break;
|
||||
case FILTER_V_REGEX:
|
||||
if (!preg_match($valid, $val))
|
||||
return true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (!$recursive)
|
||||
$this->error = true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function modularizeString(array $fields, $string = '', $exact = false)
|
||||
@@ -1072,36 +1220,22 @@ abstract class Filter
|
||||
}
|
||||
}
|
||||
|
||||
protected function list2Mask($list, $noOffset = false)
|
||||
protected function list2Mask(array $list, $noOffset = false)
|
||||
{
|
||||
$mask = 0x0;
|
||||
$o = $noOffset ? 0 : 1; // schoolMask requires this..?
|
||||
|
||||
if (!is_array($list))
|
||||
$mask = (1 << (intVal($list) - $o));
|
||||
else
|
||||
foreach ($list as $itm)
|
||||
$mask += (1 << (intVal($itm) - $o));
|
||||
$mask += (1 << (intval($itm) - $o));
|
||||
|
||||
return $mask;
|
||||
}
|
||||
|
||||
protected function isSaneNumeric(&$val, $castInt = true)
|
||||
{
|
||||
if ($castInt && is_float($val))
|
||||
$val = intVal($val);
|
||||
|
||||
if (is_int($val) || (is_float($val) && $val >= 0.0))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function sanitize(&$str)
|
||||
{
|
||||
$str = preg_replace(Filter::$pattern, '', trim($str));
|
||||
$str = Util::checkNumeric($str) ? $str : strtr($str, Filter::$wCards);
|
||||
}
|
||||
/**************************/
|
||||
/* create conditions from */
|
||||
/* generic criteria */
|
||||
/**************************/
|
||||
|
||||
private function genericBoolean($field, $op, $isString)
|
||||
{
|
||||
@@ -1134,7 +1268,7 @@ abstract class Filter
|
||||
|
||||
private function genericNumeric($field, &$value, $op, $castInt)
|
||||
{
|
||||
if (!$this->isSaneNumeric($value, $castInt))
|
||||
if (!Util::checkNumeric($value, $castInt))
|
||||
return null;
|
||||
|
||||
if ($this->int2Op($op))
|
||||
@@ -1165,7 +1299,7 @@ abstract class Filter
|
||||
switch ($gen[0])
|
||||
{
|
||||
case FILTER_CR_NUMERIC:
|
||||
$result = $this->genericNumeric($gen[1], $cr[2], $cr[1], empty($gen[2]));
|
||||
$result = $this->genericNumeric($gen[1], $cr[2], $cr[1], $gen[2]);
|
||||
break;
|
||||
case FILTER_CR_FLAG:
|
||||
$result = $this->genericBooleanFlags($gen[1], $gen[2], $cr[1]);
|
||||
@@ -1183,17 +1317,40 @@ abstract class Filter
|
||||
case FILTER_CR_ENUM:
|
||||
if (isset($this->enums[$cr[0]][$cr[1]]))
|
||||
$result = $this->genericEnum($gen[1], $this->enums[$cr[0]][$cr[1]]);
|
||||
else if (intVal($cr[1]) != 0)
|
||||
$result = $this->genericEnum($gen[1], intVal($cr[1]));
|
||||
else if (intval($cr[1]) != 0)
|
||||
$result = $this->genericEnum($gen[1], intval($cr[1]));
|
||||
break;
|
||||
case FILTER_CR_CALLBACK:
|
||||
$result = $this->{$gen[1]}($cr, $gen[2], $gen[3]);
|
||||
break;
|
||||
case FILTER_CR_NYI_PH: // do not limit with not implemented filters
|
||||
if (is_int($gen[2]))
|
||||
return [$gen[2]];
|
||||
|
||||
// for nonsensical values; compare against 0
|
||||
if ($this->int2Op($cr[1]) && Util::checkNumeric($cr[2]))
|
||||
{
|
||||
if ($cr[1] == '=')
|
||||
$cr[1] = '==';
|
||||
|
||||
return eval('return ('.$cr[2].' '.$cr[1].' 0);') ? [1] : [0];
|
||||
}
|
||||
else
|
||||
return [0];
|
||||
}
|
||||
|
||||
if ($result && !empty($gen[3]))
|
||||
if ($result && $gen[0] == FILTER_CR_NUMERIC && !empty($gen[3]))
|
||||
$this->formData['extraCols'][] = $cr[0];
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/***********************************/
|
||||
/* create conditions from */
|
||||
/* non-generic values and criteria */
|
||||
/***********************************/
|
||||
|
||||
abstract protected function createSQLForCriterium(&$cr);
|
||||
abstract protected function createSQLForValues();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ if (!defined('AOWOW_REVISION'))
|
||||
* Page
|
||||
*/
|
||||
|
||||
define('E_AOWOW', E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT));
|
||||
|
||||
// TypeIds
|
||||
define('TYPE_NPC', 1);
|
||||
define('TYPE_OBJECT', 2);
|
||||
@@ -171,6 +173,13 @@ define('FILTER_CR_NUMERIC', 3);
|
||||
define('FILTER_CR_STRING', 4);
|
||||
define('FILTER_CR_ENUM', 5);
|
||||
define('FILTER_CR_STAFFFLAG', 6);
|
||||
define('FILTER_CR_CALLBACK', 7);
|
||||
define('FILTER_CR_NYI_PH', 999);
|
||||
define('FILTER_V_EQUAL', 8);
|
||||
define('FILTER_V_RANGE', 9);
|
||||
define('FILTER_V_LIST', 10);
|
||||
define('FILTER_V_CALLBACK', 11);
|
||||
define('FILTER_V_REGEX', 12);
|
||||
|
||||
define('FILTER_ENUM_ANY', -2323);
|
||||
define('FILTER_ENUM_NONE', -2324);
|
||||
@@ -214,6 +223,12 @@ define('CONTRIBUTE_SS', 0x2);
|
||||
define('CONTRIBUTE_VI', 0x4);
|
||||
define('CONTRIBUTE_ANY', CONTRIBUTE_CO | CONTRIBUTE_SS | CONTRIBUTE_VI);
|
||||
|
||||
define('NUM_ANY', 0);
|
||||
define('NUM_CAST_INT', 1);
|
||||
define('NUM_CAST_FLOAT', 2);
|
||||
define('NUM_REQ_INT', 3);
|
||||
define('NUM_REQ_FLOAT', 4);
|
||||
|
||||
/*
|
||||
* Game
|
||||
*/
|
||||
|
||||
@@ -26,7 +26,7 @@ require_once 'pages/genericPage.class.php';
|
||||
|
||||
// autoload List-classes, associated filters and pages
|
||||
spl_autoload_register(function ($class) {
|
||||
$class = strtolower(str_replace('Filter', '', $class));
|
||||
$class = strtolower(str_replace('ListFilter', 'List', $class));
|
||||
|
||||
if (class_exists($class)) // already registered
|
||||
return;
|
||||
@@ -117,7 +117,7 @@ foreach ($sets as $k => $v)
|
||||
|
||||
|
||||
// handle non-fatal errors and notices
|
||||
error_reporting(!empty($AoWoWconf['aowow']) && CFG_DEBUG ? (E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT)) : 0);
|
||||
error_reporting(!empty($AoWoWconf['aowow']) && CFG_DEBUG ? E_AOWOW : 0);
|
||||
set_error_handler(function($errNo, $errStr, $errFile, $errLine)
|
||||
{
|
||||
$errName = 'unknown error'; // errors not in this list can not be handled by set_error_handler (as per documentation) or are ignored
|
||||
@@ -149,7 +149,7 @@ set_error_handler(function($errNo, $errStr, $errFile, $errLine)
|
||||
);
|
||||
|
||||
return true;
|
||||
}, E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E_STRICT));
|
||||
}, E_AOWOW);
|
||||
|
||||
// handle exceptions
|
||||
set_exception_handler(function ($ex)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
define('AOWOW_REVISION', 25);
|
||||
define('AOWOW_REVISION', 26);
|
||||
define('CLI', PHP_SAPI === 'cli');
|
||||
|
||||
|
||||
|
||||
@@ -281,22 +281,39 @@ class AchievementListFilter extends Filter
|
||||
321 => -1, 424 => -1, 301 => -1
|
||||
)
|
||||
);
|
||||
|
||||
protected $genericFilter = array( // misc (bool): _NUMERIC => useFloat; _STRING => localized; _FLAG => match Value; _BOOLEAN => stringSet
|
||||
2 => [FILTER_CR_BOOLEAN, 'reward_loc0', true ], // givesreward
|
||||
3 => [FILTER_CR_STRING, 'reward', true ], // rewardtext
|
||||
4 => [FILTER_CR_NYI_PH, null, 1, ], // location [enum]
|
||||
5 => [FILTER_CR_CALLBACK, 'cbSeries', ACHIEVEMENT_CU_FIRST_SERIES, null], // first in series [yn]
|
||||
6 => [FILTER_CR_CALLBACK, 'cbSeries', ACHIEVEMENT_CU_LAST_SERIES, null], // last in series [yn]
|
||||
7 => [FILTER_CR_BOOLEAN, 'chainId', ], // partseries
|
||||
9 => [FILTER_CR_NUMERIC, 'id', null, true], // id
|
||||
9 => [FILTER_CR_NUMERIC, 'id', NUM_CAST_INT, true], // id
|
||||
10 => [FILTER_CR_STRING, 'ic.name', ], // icon
|
||||
18 => [FILTER_CR_STAFFFLAG, 'flags', ], // flags
|
||||
11 => [FILTER_CR_CALLBACK, 'cbRelEvent', null, null], // related event [enum]
|
||||
14 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
15 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
16 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_VIDEO ], // hasvideos
|
||||
18 => [FILTER_CR_STAFFFLAG, 'flags', ] // flags
|
||||
);
|
||||
|
||||
// fieldId => [checkType, checkValue[, fieldIsArray]]
|
||||
protected $inputFields = array(
|
||||
'cr' => [FILTER_V_RANGE, [2, 18], true ], // criteria ids
|
||||
'crs' => [FILTER_V_LIST, [FILTER_ENUM_NONE, FILTER_ENUM_ANY, [0, 99999]], true ], // criteria operators
|
||||
'crv' => [FILTER_V_REGEX, '/[\p{C};:]/ui', true ], // criteria values - only printable chars, no delimiters
|
||||
'na' => [FILTER_V_REGEX, '/[\p{C};]/ui', false], // name / description - only printable chars, no delimiter
|
||||
'ex' => [FILTER_V_EQUAL, 'on', false], // extended name search
|
||||
'ma' => [FILTER_V_EQUAL, 1, false], // match any / all filter
|
||||
'si' => [FILTER_V_LIST, [1, 2, 3, -1, -2], false], // side
|
||||
'minpt' => [FILTER_V_RANGE, [1, 99], false], // required level min
|
||||
'maxpt' => [FILTER_V_RANGE, [1, 99], false] // required level max
|
||||
);
|
||||
|
||||
protected function createSQLForCriterium(&$cr)
|
||||
{
|
||||
if (in_array($cr[0], array_keys($this->genericFilter)))
|
||||
{
|
||||
if ($genCr = $this->genericCriterion($cr))
|
||||
return $genCr;
|
||||
|
||||
@@ -305,43 +322,6 @@ class AchievementListFilter extends Filter
|
||||
return [1];
|
||||
}
|
||||
|
||||
switch ($cr[0])
|
||||
{
|
||||
case 4: // location [enum]
|
||||
/* todo */ return [1]; // no plausible locations parsed yet
|
||||
case 5: // first in series [yn]
|
||||
if ($this->int2Bool($cr[1]))
|
||||
return $cr[1] ? ['AND', ['chainId', 0, '!'], ['cuFlags', ACHIEVEMENT_CU_FIRST_SERIES, '&']] : ['AND', ['chainId', 0, '!'], [['cuFlags', ACHIEVEMENT_CU_FIRST_SERIES, '&'], 0]];
|
||||
|
||||
break;
|
||||
case 6: // last in series [yn]
|
||||
if ($this->int2Bool($cr[1]))
|
||||
return $cr[1] ? ['AND', ['chainId', 0, '!'], ['cuFlags', ACHIEVEMENT_CU_LAST_SERIES, '&']] : ['AND', ['chainId', 0, '!'], [['cuFlags', ACHIEVEMENT_CU_LAST_SERIES, '&'], 0]];
|
||||
|
||||
break;
|
||||
case 11: // Related Event [enum]
|
||||
$_ = isset($this->enums[$cr[0]][$cr[1]]) ? $this->enums[$cr[0]][$cr[1]] : null;
|
||||
if ($_ !== null)
|
||||
{
|
||||
if (is_int($_))
|
||||
return ($_ > 0) ? ['category', $_] : ['id', abs($_)];
|
||||
else
|
||||
{
|
||||
$ids = array_filter($this->enums[$cr[0]], function($x) {
|
||||
return is_int($x) && $x > 0;
|
||||
});
|
||||
|
||||
return ['category', $ids, $_ ? null : '!'];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
unset($cr);
|
||||
$this->error = true;
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
$parts = [];
|
||||
@@ -362,45 +342,57 @@ class AchievementListFilter extends Filter
|
||||
|
||||
// points min
|
||||
if (isset($_v['minpt']))
|
||||
{
|
||||
if ($this->isSaneNumeric($_v['minpt']))
|
||||
$parts[] = ['points', $_v['minpt'], '>='];
|
||||
else
|
||||
unset($_v['minpt']);
|
||||
}
|
||||
|
||||
// points max
|
||||
if (isset($_v['maxpt']))
|
||||
{
|
||||
if ($this->isSaneNumeric($_v['maxpt']))
|
||||
$parts[] = ['points', $_v['maxpt'], '<='];
|
||||
else
|
||||
unset($_v['maxpt']);
|
||||
}
|
||||
|
||||
// faction (side)
|
||||
if (isset($_v['si']))
|
||||
{
|
||||
switch ($_v['si'])
|
||||
{
|
||||
case 3: // both
|
||||
$parts[] = ['faction', 0];
|
||||
break;
|
||||
case -1: // faction, exclusive both
|
||||
case -2:
|
||||
$parts[] = ['faction', -$_v['si']];
|
||||
break;
|
||||
case 1: // faction, inclusive both
|
||||
case 2:
|
||||
$parts[] = ['OR', ['faction', 0], ['faction', $_v['si']]];
|
||||
case 3: // both
|
||||
$parts[] = ['faction', $_v['si'], '&'];
|
||||
break;
|
||||
default:
|
||||
unset($_v['si']);
|
||||
}
|
||||
}
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
protected function cbRelEvent($cr, $value)
|
||||
{
|
||||
if (!isset($this->enums[$cr[0]][$cr[1]]))
|
||||
return false;
|
||||
|
||||
$_ = $this->enums[$cr[0]][$cr[1]];
|
||||
if (is_int($_))
|
||||
return ($_ > 0) ? ['category', $_] : ['id', abs($_)];
|
||||
else
|
||||
{
|
||||
$ids = array_filter($this->enums[$cr[0]], function($x) { return is_int($x) && $x > 0; });
|
||||
|
||||
return ['category', $ids, $_ ? null : '!'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbSeries($cr, $value)
|
||||
{
|
||||
if ($this->int2Bool($cr[1]))
|
||||
return $cr[1] ? ['AND', ['chainId', 0, '!'], ['cuFlags', $value, '&']] : ['AND', ['chainId', 0, '!'], [['cuFlags', $value, '&'], 0]];
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -169,7 +169,7 @@ class CreatureList extends BaseType
|
||||
$data = [];
|
||||
$rewRep = [];
|
||||
|
||||
if ($addInfoMask & NPCINFO_REP)
|
||||
if ($addInfoMask & NPCINFO_REP && $this->getFoundIDs())
|
||||
{
|
||||
$rewRep = DB::World()->selectCol('
|
||||
SELECT creature_id AS ARRAY_KEY, RewOnKillRepFaction1 AS ARRAY_KEY2, RewOnKillRepValue1 FROM creature_onkill_reputation WHERE creature_id IN (?a) AND RewOnKillRepFaction1 > 0 UNION
|
||||
@@ -179,6 +179,7 @@ class CreatureList extends BaseType
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
foreach ($this->iterate() as $__)
|
||||
{
|
||||
if ($addInfoMask & NPCINFO_MODEL)
|
||||
@@ -221,6 +222,7 @@ class CreatureList extends BaseType
|
||||
'react' => [$this->curTpl['A'], $this->curTpl['H']],
|
||||
);
|
||||
|
||||
|
||||
if ($this->getField('startsQuests'))
|
||||
$data[$this->id]['hasQuests'] = 1;
|
||||
|
||||
@@ -275,6 +277,7 @@ class CreatureList extends BaseType
|
||||
|
||||
public function addRewardsToJScript(&$refs) { }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -290,10 +293,19 @@ class CreatureListFilter extends Filter
|
||||
|
||||
// cr => [type, field, misc, extraCol]
|
||||
protected $genericFilter = array( // misc (bool): _NUMERIC => useFloat; _STRING => localized; _FLAG => match Value; _BOOLEAN => stringSet
|
||||
1 => [FILTER_CR_CALLBACK, 'cbHealthMana', 'healthMax', 'healthMin'], // health [num]
|
||||
2 => [FILTER_CR_CALLBACK, 'cbHealthMana', 'manaMin', 'manaMax' ], // mana [num]
|
||||
3 => [FILTER_CR_CALLBACK, 'cbFaction', null, null ], // faction [enum]
|
||||
5 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_REPAIRER ], // canrepair
|
||||
6 => [FILTER_CR_ENUM, 's.areaId', null ], // foundin
|
||||
7 => [FILTER_CR_CALLBACK, 'cbQuestRelation', 'startsQuests', 0x1 ], // startsquest [enum]
|
||||
8 => [FILTER_CR_CALLBACK, 'cbQuestRelation', 'endsQuests', 0x2 ], // endsquest [enum]
|
||||
9 => [FILTER_CR_BOOLEAN, 'lootId', ], // lootable
|
||||
10 => [FILTER_CR_BOOLEAN, 'cbRegularSkinLoot', NPC_TYPEFLAG_SPECIALLOOT ], // skinnable [yn]
|
||||
11 => [FILTER_CR_BOOLEAN, 'pickpocketLootId', ], // pickpocketable
|
||||
12 => [FILTER_CR_CALLBACK, 'cbMoneyDrop', null, null ], // averagemoneydropped [op] [int]
|
||||
15 => [FILTER_CR_CALLBACK, 'cbSpecialSkinLoot', NPC_TYPEFLAG_HERBLOOT, null ], // gatherable [yn]
|
||||
16 => [FILTER_CR_CALLBACK, 'cbSpecialSkinLoot', NPC_TYPEFLAG_ENGINEERLOOT, null ], // minable [yn]
|
||||
18 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_AUCTIONEER ], // auctioneer
|
||||
19 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_BANKER ], // banker
|
||||
20 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_BATTLEMASTER ], // battlemaster
|
||||
@@ -305,19 +317,39 @@ class CreatureListFilter extends Filter
|
||||
27 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_STABLE_MASTER ], // stablemaster
|
||||
28 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_TRAINER ], // trainer
|
||||
29 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_VENDOR ], // vendor
|
||||
19 => [FILTER_CR_FLAG, 'npcflag', NPC_FLAG_BANKER ], // banker
|
||||
37 => [FILTER_CR_NUMERIC, 'id', null, true], // id
|
||||
35 => [FILTER_CR_STRING, 'textureString' ], // useskin
|
||||
31 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
32 => [FILTER_CR_FLAG, 'cuFlags', NPC_CU_INSTANCE_BOSS ], // instanceboss
|
||||
33 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
31 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
34 => [FILTER_CR_NYI_PH, 1, null ], // usemodel [str] - displayId -> id:creatureDisplayInfo.dbc/model -> id:cratureModelData.dbc/modelPath
|
||||
35 => [FILTER_CR_STRING, 'textureString' ], // useskin
|
||||
37 => [FILTER_CR_NUMERIC, 'id', NUM_CAST_INT, true ], // id
|
||||
38 => [FILTER_CR_CALLBACK, 'cbRelEvent', null, null ], // relatedevent [enum]
|
||||
40 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_VIDEO ], // hasvideos
|
||||
41 => [FILTER_CR_NYI_PH, 1, null ], // haslocation [yn] [staff]
|
||||
42 => [FILTER_CR_CALLBACK, 'cbReputation', '>', null ], // increasesrepwith [enum]
|
||||
43 => [FILTER_CR_CALLBACK, 'cbReputation', '<', null ], // decreasesrepwith [enum]
|
||||
44 => [FILTER_CR_CALLBACK, 'cbSpecialSkinLoot', NPC_TYPEFLAG_MININGLOOT, null ] // salvageable [yn]
|
||||
);
|
||||
|
||||
// fieldId => [checkType, checkValue[, fieldIsArray]]
|
||||
protected $inputFields = array(
|
||||
'cr' => [FILTER_V_LIST, [[1, 3],[5, 12], 15, 16, [18, 25], [27, 29], [31, 35], 37, 38, [40, 44]], true ], // criteria ids
|
||||
'crs' => [FILTER_V_LIST, [FILTER_ENUM_NONE, FILTER_ENUM_ANY, [0, 9999]], true ], // criteria operators
|
||||
'crv' => [FILTER_V_REGEX, '/[\p{C}:;]/ui', true ], // criteria values - only printable chars, no delimiter
|
||||
'na' => [FILTER_V_REGEX, '/[\p{C};]/ui', false], // name / subname - only printable chars, no delimiter
|
||||
'ex' => [FILTER_V_EQUAL, 'on', false], // also match subname
|
||||
'ma' => [FILTER_V_EQUAL, 1, false], // match any / all filter
|
||||
'fa' => [FILTER_V_CALLBACK, 'cbPetFamily', true ], // pet family [list] - cat[0] == 1
|
||||
'minle' => [FILTER_V_RANGE, [1, 99], false], // min level [int]
|
||||
'maxle' => [FILTER_V_RANGE, [1, 99], false], // max level [int]
|
||||
'cl' => [FILTER_V_RANGE, [0, 4], true ], // classification [list]
|
||||
'ra' => [FILTER_V_LIST, [-1, 0, 1], false], // react alliance [int]
|
||||
'rh' => [FILTER_V_LIST, [-1, 0, 1], false] // react horde [int]
|
||||
);
|
||||
|
||||
protected function createSQLForCriterium(&$cr)
|
||||
{
|
||||
if (in_array($cr[0], array_keys($this->genericFilter)))
|
||||
{
|
||||
if ($genCr = $this->genericCriterion($cr))
|
||||
return $genCr;
|
||||
|
||||
@@ -326,203 +358,6 @@ class CreatureListFilter extends Filter
|
||||
return [1];
|
||||
}
|
||||
|
||||
switch ($cr[0])
|
||||
{
|
||||
case 1: // health [num]
|
||||
if (!$this->isSaneNumeric($cr[2]) || !$this->int2Op($cr[1]))
|
||||
break;
|
||||
|
||||
// remap OP for this special case
|
||||
switch ($cr[1])
|
||||
{
|
||||
case '=': // min > max is totally possible
|
||||
$this->extraOpts['ct']['h'][] = 'healthMin = healthMax AND healthMin = '.$cr[2];
|
||||
break;
|
||||
case '>':
|
||||
$this->extraOpts['ct']['h'][] = 'IF(healthMin > healthMax, healthMax, healthMin) > '.$cr[2];
|
||||
break;
|
||||
case '>=':
|
||||
$this->extraOpts['ct']['h'][] = 'IF(healthMin > healthMax, healthMax, healthMin) >= '.$cr[2];
|
||||
break;
|
||||
case '<':
|
||||
$this->extraOpts['ct']['h'][] = 'IF(healthMin > healthMax, healthMin, healthMax) < '.$cr[2];
|
||||
break;
|
||||
case '<=':
|
||||
$this->extraOpts['ct']['h'][] = 'IF(healthMin > healthMax, healthMin, healthMax) <= '.$cr[2];
|
||||
break;
|
||||
}
|
||||
return [1]; // always true, use post-filter
|
||||
case 2: // mana [num]
|
||||
if (!$this->isSaneNumeric($cr[2]) || !$this->int2Op($cr[1]))
|
||||
break;
|
||||
|
||||
// remap OP for this special case
|
||||
switch ($cr[1])
|
||||
{
|
||||
case '=':
|
||||
$this->extraOpts['ct']['h'][] = 'manaMin = manaMax AND manaMin = '.$cr[2];
|
||||
break;
|
||||
case '>':
|
||||
$this->extraOpts['ct']['h'][] = 'IF(manaMin > manaMax, manaMin, manaMax) > '.$cr[2];
|
||||
break;
|
||||
case '>=':
|
||||
$this->extraOpts['ct']['h'][] = 'IF(manaMin > manaMax, manaMin, manaMax) >= '.$cr[2];
|
||||
break;
|
||||
case '<':
|
||||
$this->extraOpts['ct']['h'][] = 'IF(manaMin > manaMax, manaMax, manaMin) < '.$cr[2];
|
||||
break;
|
||||
case '<=':
|
||||
$this->extraOpts['ct']['h'][] = 'IF(manaMin > manaMax, manaMax, manaMin) <= '.$cr[2];
|
||||
break;
|
||||
}
|
||||
return [1]; // always true, use post-filter
|
||||
case 7: // startsquest [enum]
|
||||
switch ($cr[1])
|
||||
{
|
||||
case 1: // any
|
||||
return ['AND', ['qse.method', 0x1, '&'], ['qse.questId', null, '!']];
|
||||
case 2: // alliance
|
||||
return ['AND', ['qse.method', 0x1, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_HORDE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&']];
|
||||
case 3: // horde
|
||||
return ['AND', ['qse.method', 0x1, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']];
|
||||
case 4: // both
|
||||
return ['AND', ['qse.method', 0x1, '&'], ['qse.questId', null, '!'], ['OR', ['AND', ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']], ['qt.reqRaceMask', 0]]];
|
||||
case 5: // none
|
||||
$this->extraOpts['ct']['h'][] = 'startsQuests = 0';
|
||||
return [1];
|
||||
}
|
||||
break;
|
||||
case 8: // endsquest [enum]
|
||||
switch ($cr[1])
|
||||
{
|
||||
case 1: // any
|
||||
return ['AND', ['qse.method', 0x2, '&'], ['qse.questId', null, '!']];
|
||||
case 2: // alliance
|
||||
return ['AND', ['qse.method', 0x2, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_HORDE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&']];
|
||||
case 3: // horde
|
||||
return ['AND', ['qse.method', 0x2, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']];
|
||||
case 4: // both
|
||||
return ['AND', ['qse.method', 0x2, '&'], ['qse.questId', null, '!'], ['OR', ['AND', ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']], ['qt.reqRaceMask', 0]]];
|
||||
case 5: // none
|
||||
$this->extraOpts['ct']['h'][] = 'endsQuests = 0';
|
||||
return [1];
|
||||
}
|
||||
break;
|
||||
case 3: // faction [enum]
|
||||
if (in_array($cr[1], $this->enums[$cr[0]]))
|
||||
{
|
||||
$facTpls = [];
|
||||
$facs = new FactionList(array('OR', ['parentFactionId', $cr[1]], ['id', $cr[1]]));
|
||||
foreach ($facs->iterate() as $__)
|
||||
$facTpls = array_merge($facTpls, $facs->getField('templateIds'));
|
||||
|
||||
if (!$facTpls)
|
||||
return [0];
|
||||
|
||||
return ['faction', $facTpls];
|
||||
}
|
||||
break;
|
||||
case 38; // relatedevent
|
||||
if (!$this->isSaneNumeric($cr[1]))
|
||||
break;
|
||||
|
||||
if ($cr[1] == FILTER_ENUM_ANY)
|
||||
{
|
||||
$eventIds = DB::Aowow()->selectCol('SELECT id FROM ?_events WHERE holidayId <> 0');
|
||||
$cGuids = DB::World()->selectCol('SELECT DISTINCT guid FROM game_event_creature WHERE eventEntry IN (?a)', $eventIds);
|
||||
return ['s.guid', $cGuids];
|
||||
}
|
||||
else if ($cr[1] == FILTER_ENUM_NONE)
|
||||
{
|
||||
$eventIds = DB::Aowow()->selectCol('SELECT id FROM ?_events WHERE holidayId <> 0');
|
||||
$cGuids = DB::World()->selectCol('SELECT DISTINCT guid FROM game_event_creature WHERE eventEntry IN (?a)', $eventIds);
|
||||
return ['s.guid', $cGuids, '!'];
|
||||
}
|
||||
else if ($cr[1])
|
||||
{
|
||||
$eventIds = DB::Aowow()->selectCol('SELECT id FROM ?_events WHERE holidayId = ?d', $cr[1]);
|
||||
$cGuids = DB::World()->selectCol('SELECT DISTINCT guid FROM game_event_creature WHERE eventEntry IN (?a)', $eventIds);
|
||||
return ['s.guid', $cGuids];
|
||||
}
|
||||
|
||||
break;
|
||||
case 42: // increasesrepwith [enum]
|
||||
if (in_array($cr[1], $this->enums[3])) // reuse
|
||||
{
|
||||
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_factions WHERE id = ?d', $cr[1]))
|
||||
$this->formData['reputationCols'][] = [$cr[1], Util::localizedString($_, 'name')];
|
||||
|
||||
if ($cIds = DB::World()->selectCol('SELECT creature_id FROM creature_onkill_reputation WHERE (RewOnKillRepFaction1 = ?d AND RewOnKillRepValue1 > 0) OR (RewOnKillRepFaction2 = ?d AND RewOnKillRepValue2 > 0)', $cr[1], $cr[1]))
|
||||
return ['id', $cIds];
|
||||
else
|
||||
return [0];
|
||||
}
|
||||
|
||||
break;
|
||||
case 43: // decreasesrepwith [enum]
|
||||
if (in_array($cr[1], $this->enums[3])) // reuse
|
||||
{
|
||||
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_factions WHERE id = ?d', $cr[1]))
|
||||
$this->formData['reputationCols'][] = [$cr[1], Util::localizedString($_, 'name')];
|
||||
|
||||
if ($cIds = DB::World()->selectCol('SELECT creature_id FROM creature_onkill_reputation WHERE (RewOnKillRepFaction1 = ?d AND RewOnKillRepValue1 < 0) OR (RewOnKillRepFaction2 = ?d AND RewOnKillRepValue2 < 0)', $cr[1], $cr[1]))
|
||||
return ['id', $cIds];
|
||||
else
|
||||
return [0];
|
||||
}
|
||||
|
||||
break;
|
||||
case 12: // averagemoneydropped [op] [int]
|
||||
if (!$this->isSaneNumeric($cr[2]) || !$this->int2Op($cr[1]))
|
||||
break;
|
||||
|
||||
return ['AND', ['((minGold + maxGold) / 2)', $cr[2], $cr[1]]];
|
||||
case 15: // gatherable [yn]
|
||||
if ($this->int2Bool($cr[1]))
|
||||
{
|
||||
if ($cr[1])
|
||||
return ['AND', ['skinLootId', 0, '>'], ['typeFlags', NPC_TYPEFLAG_HERBLOOT, '&']];
|
||||
else
|
||||
return ['OR', ['skinLootId', 0], [['typeFlags', NPC_TYPEFLAG_HERBLOOT, '&'], 0]];
|
||||
}
|
||||
break;
|
||||
case 44: // salvageable [yn]
|
||||
if ($this->int2Bool($cr[1]))
|
||||
{
|
||||
if ($cr[1])
|
||||
return ['AND', ['skinLootId', 0, '>'], ['typeFlags', NPC_TYPEFLAG_ENGINEERLOOT, '&']];
|
||||
else
|
||||
return ['OR', ['skinLootId', 0], [['typeFlags', NPC_TYPEFLAG_ENGINEERLOOT, '&'], 0]];
|
||||
}
|
||||
break;
|
||||
case 16: // minable [yn]
|
||||
if ($this->int2Bool($cr[1]))
|
||||
{
|
||||
if ($cr[1])
|
||||
return ['AND', ['skinLootId', 0, '>'], ['typeFlags', NPC_TYPEFLAG_MININGLOOT, '&']];
|
||||
else
|
||||
return ['OR', ['skinLootId', 0], [['typeFlags', NPC_TYPEFLAG_MININGLOOT, '&'], 0]];
|
||||
}
|
||||
break;
|
||||
case 10: // skinnable [yn]
|
||||
if ($this->int2Bool($cr[1]))
|
||||
{
|
||||
if ($cr[1])
|
||||
return ['AND', ['skinLootId', 0, '>'], [['typeFlags', NPC_TYPEFLAG_SPECIALLOOT, '&'], 0]];
|
||||
else
|
||||
return ['OR', ['skinLootId', 0], [['typeFlags', NPC_TYPEFLAG_SPECIALLOOT, '&'], 0, '!']];
|
||||
}
|
||||
break;
|
||||
case 34: // usemodel [str] // displayId -> id:creatureDisplayInfo.dbc/model -> id:cratureModelData.dbc/modelPath
|
||||
case 41: // haslocation [yn] [staff]
|
||||
/* todo */ return [1];
|
||||
}
|
||||
|
||||
unset($cr);
|
||||
$this->error = true;
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
$parts = [];
|
||||
@@ -543,65 +378,176 @@ class CreatureListFilter extends Filter
|
||||
|
||||
// pet family [list]
|
||||
if (isset($_v['fa']))
|
||||
{
|
||||
$_ = (array)$_v['fa'];
|
||||
if (!array_diff($_, [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 20, 21, 24, 25, 26, 27, 30, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46]))
|
||||
$parts[] = ['family', $_];
|
||||
else
|
||||
unset($_v['cl']);
|
||||
}
|
||||
$parts[] = ['family', $_v['fa']];
|
||||
|
||||
// creatureLevel min [int]
|
||||
if (isset($_v['minle']))
|
||||
{
|
||||
if (is_int($_v['minle']) && $_v['minle'] > 0)
|
||||
$parts[] = ['minLevel', $_v['minle'], '>='];
|
||||
else
|
||||
unset($_v['minle']);
|
||||
}
|
||||
|
||||
// creatureLevel max [int]
|
||||
if (isset($_v['maxle']))
|
||||
{
|
||||
if (is_int($_v['maxle']) && $_v['maxle'] > 0)
|
||||
$parts[] = ['maxLevel', $_v['maxle'], '<='];
|
||||
else
|
||||
unset($_v['maxle']);
|
||||
}
|
||||
|
||||
// classification [list]
|
||||
if (isset($_v['cl']))
|
||||
{
|
||||
$_ = (array)$_v['cl'];
|
||||
if (!array_diff($_, [0, 1, 2, 3, 4]))
|
||||
$parts[] = ['rank', $_];
|
||||
else
|
||||
unset($_v['cl']);
|
||||
}
|
||||
$parts[] = ['rank', $_v['cl']];
|
||||
|
||||
// react Alliance [int]
|
||||
if (isset($_v['ra']))
|
||||
{
|
||||
$_ = (int)$_v['ra'];
|
||||
if (in_array($_, [-1, 0, 1]))
|
||||
$parts[] = ['ft.A', $_];
|
||||
else
|
||||
unset($_v['ra']);
|
||||
}
|
||||
$parts[] = ['ft.A', $_v['ra']];
|
||||
|
||||
// react Horde [int]
|
||||
if (isset($_v['rh']))
|
||||
{
|
||||
$_ = (int)$_v['rh'];
|
||||
if (in_array($_, [-1, 0, 1]))
|
||||
$parts[] = ['ft.H', $_];
|
||||
else
|
||||
unset($_v['rh']);
|
||||
}
|
||||
$parts[] = ['ft.H', $_v['rh']];
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
protected function cbPetFamily(&$val)
|
||||
{
|
||||
if (!$this->parentCats || $this->parentCats[0] != 1)
|
||||
return false;
|
||||
|
||||
if (!Util::checkNumeric($val, NUM_REQ_INT))
|
||||
return false;
|
||||
|
||||
$type = FILTER_V_LIST;
|
||||
$valid = [[1, 9], 11, 12, 20, 21, [24, 27], [30, 35], [37, 39], [41, 46]];
|
||||
|
||||
return $this->checkInput($type, $valid, $val);
|
||||
}
|
||||
|
||||
protected function cbRelEvent($cr)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[1], NUM_REQ_INT))
|
||||
return false;
|
||||
|
||||
if ($cr[1] == FILTER_ENUM_ANY)
|
||||
{
|
||||
$eventIds = DB::Aowow()->selectCol('SELECT id FROM ?_events WHERE holidayId <> 0');
|
||||
$cGuids = DB::World()->selectCol('SELECT DISTINCT guid FROM game_event_creature WHERE eventEntry IN (?a)', $eventIds);
|
||||
return ['s.guid', $cGuids];
|
||||
}
|
||||
else if ($cr[1] == FILTER_ENUM_NONE)
|
||||
{
|
||||
$eventIds = DB::Aowow()->selectCol('SELECT id FROM ?_events WHERE holidayId <> 0');
|
||||
$cGuids = DB::World()->selectCol('SELECT DISTINCT guid FROM game_event_creature WHERE eventEntry IN (?a)', $eventIds);
|
||||
return ['s.guid', $cGuids, '!'];
|
||||
}
|
||||
else if ($cr[1])
|
||||
{
|
||||
$eventIds = DB::Aowow()->selectCol('SELECT id FROM ?_events WHERE holidayId = ?d', $cr[1]);
|
||||
$cGuids = DB::World()->selectCol('SELECT DISTINCT guid FROM game_event_creature WHERE eventEntry IN (?a)', $eventIds);
|
||||
return ['s.guid', $cGuids];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbMoneyDrop($cr)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1]))
|
||||
return false;
|
||||
|
||||
return ['AND', ['((minGold + maxGold) / 2)', $cr[2], $cr[1]]];
|
||||
}
|
||||
|
||||
protected function cbQuestRelation($cr, $field, $val)
|
||||
{
|
||||
switch ($cr[1])
|
||||
{
|
||||
case 1: // any
|
||||
return ['AND', ['qse.method', $val, '&'], ['qse.questId', null, '!']];
|
||||
case 2: // alliance
|
||||
return ['AND', ['qse.method', $val, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_HORDE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&']];
|
||||
case 3: // horde
|
||||
return ['AND', ['qse.method', $val, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']];
|
||||
case 4: // both
|
||||
return ['AND', ['qse.method', $val, '&'], ['qse.questId', null, '!'], ['OR', ['AND', ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']], ['qt.reqRaceMask', 0]]];
|
||||
case 5: // none
|
||||
$this->extraOpts['ct']['h'][] = $field.' = 0';
|
||||
return [1];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbHealthMana($cr, $minField, $maxField)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1]))
|
||||
return false;
|
||||
|
||||
// remap OP for this special case
|
||||
switch ($cr[1])
|
||||
{
|
||||
case '=': // min > max is totally possible
|
||||
$this->extraOpts['ct']['h'][] = $minField.' = '.$maxField.' AND '.$minField.' = '.$cr[2];
|
||||
break;
|
||||
case '>':
|
||||
case '>=':
|
||||
case '<':
|
||||
case '<=':
|
||||
$this->extraOpts['ct']['h'][] = 'IF('.$minField.' > '.$maxField.', '.$maxField.', '.$minField.') '.$cr[1].' '.$cr[2];
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return [1]; // always true, use post-filter
|
||||
}
|
||||
|
||||
protected function cbSpecialSkinLoot($cr, $typeFlag)
|
||||
{
|
||||
if (!$this->int2Bool($cr[1]))
|
||||
return false;
|
||||
|
||||
|
||||
if ($cr[1])
|
||||
return ['AND', ['skinLootId', 0, '>'], ['typeFlags', $typeFlag, '&']];
|
||||
else
|
||||
return ['OR', ['skinLootId', 0], [['typeFlags', $typeFlag, '&'], 0]];
|
||||
}
|
||||
|
||||
protected function cbRegularSkinLoot($cr, $typeFlag)
|
||||
{
|
||||
if (!$this->int2Bool($cr[1]))
|
||||
return false;
|
||||
|
||||
if ($cr[1])
|
||||
return ['AND', ['skinLootId', 0, '>'], [['typeFlags', $typeFlag, '&'], 0]];
|
||||
else
|
||||
return ['OR', ['skinLootId', 0], ['typeFlags', $typeFlag, '&']];
|
||||
}
|
||||
|
||||
protected function cbReputation($cr, $op)
|
||||
{
|
||||
if (!in_array($cr[1], $this->enums[3])) // reuse
|
||||
return false;
|
||||
|
||||
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_factions WHERE id = ?d', $cr[1]))
|
||||
$this->formData['reputationCols'][] = [$cr[1], Util::localizedString($_, 'name')];
|
||||
|
||||
if ($cIds = DB::World()->selectCol('SELECT creature_id FROM creature_onkill_reputation WHERE (RewOnKillRepFaction1 = ?d AND RewOnKillRepValue1 '.$op.' 0) OR (RewOnKillRepFaction2 = ?d AND RewOnKillRepValue2 '.$op.' 0)', $cr[1], $cr[1]))
|
||||
return ['id', $cIds];
|
||||
else
|
||||
return [0];
|
||||
}
|
||||
|
||||
protected function cbFaction($cr)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[1], NUM_REQ_INT))
|
||||
return false;
|
||||
|
||||
if (!in_array($cr[1], $this->enums[$cr[0]]))
|
||||
return false;
|
||||
|
||||
|
||||
$facTpls = [];
|
||||
$facs = new FactionList(array('OR', ['parentFactionId', $cr[1]], ['id', $cr[1]]));
|
||||
foreach ($facs->iterate() as $__)
|
||||
$facTpls = array_merge($facTpls, $facs->getField('templateIds'));
|
||||
|
||||
return $facTpls ? ['faction', $facTpls] : [0];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -244,71 +244,80 @@ class EnchantmentListFilter extends Filter
|
||||
);
|
||||
|
||||
protected $genericFilter = array( // misc (bool): _NUMERIC => useFloat; _STRING => localized; _FLAG => match Value; _BOOLEAN => stringSet
|
||||
2 => [FILTER_CR_NUMERIC, 'id', null, true], // id
|
||||
2 => [FILTER_CR_NUMERIC, 'id', NUM_CAST_INT, true], // id
|
||||
3 => [FILTER_CR_ENUM, 'skillLine' ], // requiresprof
|
||||
4 => [FILTER_CR_NUMERIC, 'skillLevel', ], // reqskillrank
|
||||
4 => [FILTER_CR_NUMERIC, 'skillLevel', NUM_CAST_INT ], // reqskillrank
|
||||
5 => [FILTER_CR_BOOLEAN, 'conditionId' ], // hascondition
|
||||
10 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
11 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
12 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_VIDEO ], // hasvideos
|
||||
21 => [FILTER_CR_NUMERIC, 'is.agi', null, true], // agi
|
||||
23 => [FILTER_CR_NUMERIC, 'is.int', null, true], // int
|
||||
22 => [FILTER_CR_NUMERIC, 'is.sta', null, true], // sta
|
||||
24 => [FILTER_CR_NUMERIC, 'is.spi', null, true], // spi
|
||||
20 => [FILTER_CR_NUMERIC, 'is.str', null, true], // str
|
||||
115 => [FILTER_CR_NUMERIC, 'is.health', null, true], // health
|
||||
116 => [FILTER_CR_NUMERIC, 'is.mana', null, true], // mana
|
||||
60 => [FILTER_CR_NUMERIC, 'is.healthrgn', null, true], // healthrgn
|
||||
61 => [FILTER_CR_NUMERIC, 'is.manargn', null, true], // manargn
|
||||
41 => [FILTER_CR_NUMERIC, 'is.armor' , null, true], // armor
|
||||
44 => [FILTER_CR_NUMERIC, 'is.blockrtng', null, true], // blockrtng
|
||||
43 => [FILTER_CR_NUMERIC, 'is.block', null, true], // block
|
||||
42 => [FILTER_CR_NUMERIC, 'is.defrtng', null, true], // defrtng
|
||||
45 => [FILTER_CR_NUMERIC, 'is.dodgertng', null, true], // dodgertng
|
||||
46 => [FILTER_CR_NUMERIC, 'is.parryrtng', null, true], // parryrtng
|
||||
79 => [FILTER_CR_NUMERIC, 'is.resirtng', null, true], // resirtng
|
||||
77 => [FILTER_CR_NUMERIC, 'is.atkpwr', null, true], // atkpwr
|
||||
97 => [FILTER_CR_NUMERIC, 'is.feratkpwr', null, true], // feratkpwr
|
||||
114 => [FILTER_CR_NUMERIC, 'is.armorpenrtng', null, true], // armorpenrtng
|
||||
96 => [FILTER_CR_NUMERIC, 'is.critstrkrtng', null, true], // critstrkrtng
|
||||
117 => [FILTER_CR_NUMERIC, 'is.exprtng', null, true], // exprtng
|
||||
103 => [FILTER_CR_NUMERIC, 'is.hastertng', null, true], // hastertng
|
||||
119 => [FILTER_CR_NUMERIC, 'is.hitrtng', null, true], // hitrtng
|
||||
94 => [FILTER_CR_NUMERIC, 'is.splpen', null, true], // splpen
|
||||
123 => [FILTER_CR_NUMERIC, 'is.splpwr', null, true], // splpwr
|
||||
52 => [FILTER_CR_NUMERIC, 'is.arcsplpwr', null, true], // arcsplpwr
|
||||
53 => [FILTER_CR_NUMERIC, 'is.firsplpwr', null, true], // firsplpwr
|
||||
54 => [FILTER_CR_NUMERIC, 'is.frosplpwr', null, true], // frosplpwr
|
||||
55 => [FILTER_CR_NUMERIC, 'is.holsplpwr', null, true], // holsplpwr
|
||||
56 => [FILTER_CR_NUMERIC, 'is.natsplpwr', null, true], // natsplpwr
|
||||
57 => [FILTER_CR_NUMERIC, 'is.shasplpwr', null, true], // shasplpwr
|
||||
32 => [FILTER_CR_NUMERIC, 'is.dps', true, true], // dps
|
||||
34 => [FILTER_CR_NUMERIC, 'is.dmg', true, true], // dmg
|
||||
25 => [FILTER_CR_NUMERIC, 'is.arcres', null, true], // arcres
|
||||
26 => [FILTER_CR_NUMERIC, 'is.firres', null, true], // firres
|
||||
28 => [FILTER_CR_NUMERIC, 'is.frores', null, true], // frores
|
||||
30 => [FILTER_CR_NUMERIC, 'is.holres', null, true], // holres
|
||||
27 => [FILTER_CR_NUMERIC, 'is.natres', null, true], // natres
|
||||
29 => [FILTER_CR_NUMERIC, 'is.shares', null, true], // shares
|
||||
37 => [FILTER_CR_NUMERIC, 'is.mleatkpwr', null, true], // mleatkpwr
|
||||
84 => [FILTER_CR_NUMERIC, 'is.mlecritstrkrtng', null, true], // mlecritstrkrtng
|
||||
78 => [FILTER_CR_NUMERIC, 'is.mlehastertng', null, true], // mlehastertng
|
||||
95 => [FILTER_CR_NUMERIC, 'is.mlehitrtng', null, true], // mlehitrtng
|
||||
38 => [FILTER_CR_NUMERIC, 'is.rgdatkpwr', null, true], // rgdatkpwr
|
||||
40 => [FILTER_CR_NUMERIC, 'is.rgdcritstrkrtng', null, true], // rgdcritstrkrtng
|
||||
101 => [FILTER_CR_NUMERIC, 'is.rgdhastertng', null, true], // rgdhastertng
|
||||
39 => [FILTER_CR_NUMERIC, 'is.rgdhitrtng', null, true], // rgdhitrtng
|
||||
49 => [FILTER_CR_NUMERIC, 'is.splcritstrkrtng', null, true], // splcritstrkrtng
|
||||
102 => [FILTER_CR_NUMERIC, 'is.splhastertng', null, true], // splhastertng
|
||||
48 => [FILTER_CR_NUMERIC, 'is.splhitrtng', null, true], // splhitrtng
|
||||
51 => [FILTER_CR_NUMERIC, 'is.spldmg', null, true], // spldmg
|
||||
50 => [FILTER_CR_NUMERIC, 'is.splheal', null, true] // splheal
|
||||
20 => [FILTER_CR_NUMERIC, 'is.str', NUM_CAST_INT, true], // str
|
||||
21 => [FILTER_CR_NUMERIC, 'is.agi', NUM_CAST_INT, true], // agi
|
||||
22 => [FILTER_CR_NUMERIC, 'is.sta', NUM_CAST_INT, true], // sta
|
||||
23 => [FILTER_CR_NUMERIC, 'is.int', NUM_CAST_INT, true], // int
|
||||
24 => [FILTER_CR_NUMERIC, 'is.spi', NUM_CAST_INT, true], // spi
|
||||
25 => [FILTER_CR_NUMERIC, 'is.arcres', NUM_CAST_INT, true], // arcres
|
||||
26 => [FILTER_CR_NUMERIC, 'is.firres', NUM_CAST_INT, true], // firres
|
||||
27 => [FILTER_CR_NUMERIC, 'is.natres', NUM_CAST_INT, true], // natres
|
||||
28 => [FILTER_CR_NUMERIC, 'is.frores', NUM_CAST_INT, true], // frores
|
||||
29 => [FILTER_CR_NUMERIC, 'is.shares', NUM_CAST_INT, true], // shares
|
||||
30 => [FILTER_CR_NUMERIC, 'is.holres', NUM_CAST_INT, true], // holres
|
||||
32 => [FILTER_CR_NUMERIC, 'is.dps', NUM_CAST_FLOAT, true], // dps
|
||||
34 => [FILTER_CR_NUMERIC, 'is.dmg', NUM_CAST_FLOAT, true], // dmg
|
||||
37 => [FILTER_CR_NUMERIC, 'is.mleatkpwr', NUM_CAST_INT, true], // mleatkpwr
|
||||
38 => [FILTER_CR_NUMERIC, 'is.rgdatkpwr', NUM_CAST_INT, true], // rgdatkpwr
|
||||
39 => [FILTER_CR_NUMERIC, 'is.rgdhitrtng', NUM_CAST_INT, true], // rgdhitrtng
|
||||
40 => [FILTER_CR_NUMERIC, 'is.rgdcritstrkrtng', NUM_CAST_INT, true], // rgdcritstrkrtng
|
||||
41 => [FILTER_CR_NUMERIC, 'is.armor' , NUM_CAST_INT, true], // armor
|
||||
42 => [FILTER_CR_NUMERIC, 'is.defrtng', NUM_CAST_INT, true], // defrtng
|
||||
43 => [FILTER_CR_NUMERIC, 'is.block', NUM_CAST_INT, true], // block
|
||||
44 => [FILTER_CR_NUMERIC, 'is.blockrtng', NUM_CAST_INT, true], // blockrtng
|
||||
45 => [FILTER_CR_NUMERIC, 'is.dodgertng', NUM_CAST_INT, true], // dodgertng
|
||||
46 => [FILTER_CR_NUMERIC, 'is.parryrtng', NUM_CAST_INT, true], // parryrtng
|
||||
48 => [FILTER_CR_NUMERIC, 'is.splhitrtng', NUM_CAST_INT, true], // splhitrtng
|
||||
49 => [FILTER_CR_NUMERIC, 'is.splcritstrkrtng', NUM_CAST_INT, true], // splcritstrkrtng
|
||||
50 => [FILTER_CR_NUMERIC, 'is.splheal', NUM_CAST_INT, true], // splheal
|
||||
51 => [FILTER_CR_NUMERIC, 'is.spldmg', NUM_CAST_INT, true], // spldmg
|
||||
52 => [FILTER_CR_NUMERIC, 'is.arcsplpwr', NUM_CAST_INT, true], // arcsplpwr
|
||||
53 => [FILTER_CR_NUMERIC, 'is.firsplpwr', NUM_CAST_INT, true], // firsplpwr
|
||||
54 => [FILTER_CR_NUMERIC, 'is.frosplpwr', NUM_CAST_INT, true], // frosplpwr
|
||||
55 => [FILTER_CR_NUMERIC, 'is.holsplpwr', NUM_CAST_INT, true], // holsplpwr
|
||||
56 => [FILTER_CR_NUMERIC, 'is.natsplpwr', NUM_CAST_INT, true], // natsplpwr
|
||||
57 => [FILTER_CR_NUMERIC, 'is.shasplpwr', NUM_CAST_INT, true], // shasplpwr
|
||||
60 => [FILTER_CR_NUMERIC, 'is.healthrgn', NUM_CAST_INT, true], // healthrgn
|
||||
61 => [FILTER_CR_NUMERIC, 'is.manargn', NUM_CAST_INT, true], // manargn
|
||||
77 => [FILTER_CR_NUMERIC, 'is.atkpwr', NUM_CAST_INT, true], // atkpwr
|
||||
78 => [FILTER_CR_NUMERIC, 'is.mlehastertng', NUM_CAST_INT, true], // mlehastertng
|
||||
79 => [FILTER_CR_NUMERIC, 'is.resirtng', NUM_CAST_INT, true], // resirtng
|
||||
84 => [FILTER_CR_NUMERIC, 'is.mlecritstrkrtng', NUM_CAST_INT, true], // mlecritstrkrtng
|
||||
94 => [FILTER_CR_NUMERIC, 'is.splpen', NUM_CAST_INT, true], // splpen
|
||||
95 => [FILTER_CR_NUMERIC, 'is.mlehitrtng', NUM_CAST_INT, true], // mlehitrtng
|
||||
96 => [FILTER_CR_NUMERIC, 'is.critstrkrtng', NUM_CAST_INT, true], // critstrkrtng
|
||||
97 => [FILTER_CR_NUMERIC, 'is.feratkpwr', NUM_CAST_INT, true], // feratkpwr
|
||||
101 => [FILTER_CR_NUMERIC, 'is.rgdhastertng', NUM_CAST_INT, true], // rgdhastertng
|
||||
102 => [FILTER_CR_NUMERIC, 'is.splhastertng', NUM_CAST_INT, true], // splhastertng
|
||||
103 => [FILTER_CR_NUMERIC, 'is.hastertng', NUM_CAST_INT, true], // hastertng
|
||||
114 => [FILTER_CR_NUMERIC, 'is.armorpenrtng', NUM_CAST_INT, true], // armorpenrtng
|
||||
115 => [FILTER_CR_NUMERIC, 'is.health', NUM_CAST_INT, true], // health
|
||||
116 => [FILTER_CR_NUMERIC, 'is.mana', NUM_CAST_INT, true], // mana
|
||||
117 => [FILTER_CR_NUMERIC, 'is.exprtng', NUM_CAST_INT, true], // exprtng
|
||||
119 => [FILTER_CR_NUMERIC, 'is.hitrtng', NUM_CAST_INT, true], // hitrtng
|
||||
123 => [FILTER_CR_NUMERIC, 'is.splpwr', NUM_CAST_INT, true] // splpwr
|
||||
);
|
||||
|
||||
// fieldId => [checkType, checkValue[, fieldIsArray]]
|
||||
protected $inputFields = array(
|
||||
'cr' => [FILTER_V_RANGE, [2, 123], true ], // criteria ids
|
||||
'crs' => [FILTER_V_RANGE, [1, 15], true ], // criteria operators
|
||||
'crv' => [FILTER_V_RANGE, [0, 99999], true ], // criteria values - only numerals
|
||||
'na' => [FILTER_V_REGEX, '/[\p{C};]/ui', false], // name - only printable chars, no delimiter
|
||||
'ma' => [FILTER_V_EQUAL, 1, false], // match any / all filter
|
||||
'ty' => [FILTER_V_RANGE, [1, 8], true ] // types
|
||||
);
|
||||
|
||||
protected function createSQLForCriterium(&$cr)
|
||||
{
|
||||
if (in_array($cr[0], array_keys($this->genericFilter)))
|
||||
{
|
||||
if ($genCr = $this->genericCriterion($cr))
|
||||
return $genCr;
|
||||
|
||||
@@ -316,7 +325,6 @@ class EnchantmentListFilter extends Filter
|
||||
$this->error = true;
|
||||
return [1];
|
||||
}
|
||||
}
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
|
||||
@@ -143,17 +143,30 @@ class GameObjectListFilter extends Filter
|
||||
|
||||
protected $genericFilter = array(
|
||||
1 => [FILTER_CR_ENUM, 's.areaId', null ], // foundin
|
||||
7 => [FILTER_CR_NUMERIC, 'reqSkill', null ], // requiredskilllevel
|
||||
11 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT], // hasscreenshots
|
||||
2 => [FILTER_CR_CALLBACK, 'cbQuestRelation', 'startsQuests', 0x1 ], // startsquest [side]
|
||||
3 => [FILTER_CR_CALLBACK, 'cbQuestRelation', 'endsQuests', 0x2 ], // endsquest [side]
|
||||
4 => [FILTER_CR_CALLBACK, 'cbOpenable', null, null], // openable [yn]
|
||||
5 => [FILTER_CR_NYI_PH, null, null ], // averagemoneycontained [op] [int] - GOs don't contain money, match against 0
|
||||
7 => [FILTER_CR_NUMERIC, 'reqSkill', NUM_CAST_INT ], // requiredskilllevel
|
||||
11 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
13 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
15 => [FILTER_CR_NUMERIC, 'id', null ], // id
|
||||
18 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_VIDEO ], // hasvideos
|
||||
15 => [FILTER_CR_NUMERIC, 'id', NUM_CAST_INT ], // id
|
||||
16 => [FILTER_CR_CALLBACK, 'cbRelEvent', null, null], // relatedevent (ignore removed by event)
|
||||
18 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_VIDEO ] // hasvideos
|
||||
);
|
||||
|
||||
// fieldId => [checkType, checkValue[, fieldIsArray]]
|
||||
protected $inputFields = array(
|
||||
'cr' => [FILTER_V_LIST, [[1, 5], 7, 11, 13, 15, 16, 18], true ], // criteria ids
|
||||
'crs' => [FILTER_V_LIST, [FILTER_ENUM_NONE, FILTER_ENUM_ANY, [0, 5000]], true ], // criteria operators
|
||||
'crv' => [FILTER_V_RANGE, [0, 99999], true ], // criteria values - only numeric input values expected
|
||||
'na' => [FILTER_V_REGEX, '/[\p{C};]/ui', false], // name - only printable chars, no delimiter
|
||||
'ma' => [FILTER_V_EQUAL, 1, false] // match any / all filter
|
||||
);
|
||||
|
||||
protected function createSQLForCriterium(&$cr)
|
||||
{
|
||||
if (in_array($cr[0], array_keys($this->genericFilter)))
|
||||
{
|
||||
if ($genCR = $this->genericCriterion($cr))
|
||||
return $genCR;
|
||||
|
||||
@@ -162,53 +175,51 @@ class GameObjectListFilter extends Filter
|
||||
return [1];
|
||||
}
|
||||
|
||||
switch ($cr[0])
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
case 4:
|
||||
if (!$this->int2Bool($cr[1]))
|
||||
break;
|
||||
$parts = [];
|
||||
$_v = $this->fiData['v'];
|
||||
|
||||
// name
|
||||
if (isset($_v['na']))
|
||||
if ($_ = $this->modularizeString(['name_loc'.User::$localeId]))
|
||||
$parts[] = $_;
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
protected function cbOpenable($cr)
|
||||
{
|
||||
if ($this->int2Bool($cr[1]))
|
||||
return $cr[1] ? ['OR', ['flags', 0x2, '&'], ['type', 3]] : ['AND', [['flags', 0x2, '&'], 0], ['type', 3, '!']];
|
||||
case 5: // averagemoneycontained [op] [int] GOs don't contain money .. eval to 0 == true
|
||||
if (!$this->isSaneNumeric($cr[2], false) || !$this->int2Op($cr[1]))
|
||||
break;
|
||||
|
||||
return eval('return ('.$cr[2].' '.$cr[1].' 0)') ? [1] : [0];
|
||||
case 2: // startsquest [side]
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbQuestRelation($cr, $field, $value)
|
||||
{
|
||||
switch ($cr[1])
|
||||
{
|
||||
case 1: // any
|
||||
return ['AND', ['qse.method', 0x1, '&'], ['qse.questId', null, '!']];
|
||||
return ['AND', ['qse.method', $value, '&'], ['qse.questId', null, '!']];
|
||||
case 2: // alliance only
|
||||
return ['AND', ['qse.method', 0x1, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_HORDE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&']];
|
||||
return ['AND', ['qse.method', $value, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_HORDE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&']];
|
||||
case 3: // horde only
|
||||
return ['AND', ['qse.method', 0x1, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']];
|
||||
return ['AND', ['qse.method', $value, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']];
|
||||
case 4: // both
|
||||
return ['AND', ['qse.method', 0x1, '&'], ['qse.questId', null, '!'], ['OR', ['AND', ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']], ['qt.reqRaceMask', 0]]];
|
||||
case 5: // none
|
||||
$this->extraOpts['o']['h'][] = 'startsQuests = 0';
|
||||
return ['AND', ['qse.method', $value, '&'], ['qse.questId', null, '!'], ['OR', ['AND', ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']], ['qt.reqRaceMask', 0]]];
|
||||
case 5: // none todo (low): broken, if entry starts and ends quests...
|
||||
$this->extraOpts['o']['h'][] = $field.' = 0';
|
||||
return [1];
|
||||
}
|
||||
break;
|
||||
case 3: // endsquest [side]
|
||||
switch ($cr[1])
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbRelEvent($cr)
|
||||
{
|
||||
case 1: // any
|
||||
return ['AND', ['qse.method', 0x2, '&'], ['qse.questId', null, '!']];
|
||||
case 2: // alliance only
|
||||
return ['AND', ['qse.method', 0x2, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_HORDE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&']];
|
||||
case 3: // horde only
|
||||
return ['AND', ['qse.method', 0x2, '&'], ['qse.questId', null, '!'], [['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], 0], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']];
|
||||
case 4: // both
|
||||
return ['AND', ['qse.method', 0x2, '&'], ['qse.questId', null, '!'], ['OR', ['AND', ['qt.reqRaceMask', RACE_MASK_ALLIANCE, '&'], ['qt.reqRaceMask', RACE_MASK_HORDE, '&']], ['qt.reqRaceMask', 0]]];
|
||||
case 5: // none todo: broken, if entry starts and ends quests...
|
||||
$this->extraOpts['o']['h'][] = 'endsQuests = 0';
|
||||
return [1];
|
||||
}
|
||||
break;
|
||||
case 16; // relatedevent (ignore removed by event)
|
||||
if (!$this->isSaneNumeric($cr[1]))
|
||||
break;
|
||||
if (!Util::checkNumeric($cr[1], NUM_REQ_INT))
|
||||
return false;;
|
||||
|
||||
if ($cr[1] == FILTER_ENUM_ANY)
|
||||
{
|
||||
@@ -229,25 +240,7 @@ class GameObjectListFilter extends Filter
|
||||
return ['s.guid', $goGuids];
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
unset($cr);
|
||||
$this->error = 1;
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
$parts = [];
|
||||
$_v = $this->fiData['v'];
|
||||
|
||||
// name
|
||||
if (isset($_v['na']))
|
||||
if ($_ = $this->modularizeString(['name_loc'.User::$localeId]))
|
||||
$parts[] = $_;
|
||||
|
||||
return $parts;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,25 @@ class IconListFilter extends Filter
|
||||
);
|
||||
private $totalUses = [];
|
||||
|
||||
protected $genericFilter = array(
|
||||
1 => [FILTER_CR_CALLBACK, 'cbUseAny' ], // items [num]
|
||||
2 => [FILTER_CR_CALLBACK, 'cbUseAny' ], // spells [num]
|
||||
3 => [FILTER_CR_CALLBACK, 'cbUseAny' ], // achievements [num]
|
||||
6 => [FILTER_CR_CALLBACK, 'cbUseAny' ], // currencies [num]
|
||||
9 => [FILTER_CR_CALLBACK, 'cbUseAny' ], // hunterpets [num]
|
||||
11 => [FILTER_CR_NYI_PH, null, null], // classes [num]
|
||||
13 => [FILTER_CR_CALLBACK, 'cbUseAll' ] // used [num]
|
||||
);
|
||||
|
||||
// fieldId => [checkType, checkValue[, fieldIsArray]]
|
||||
protected $inputFields = array(
|
||||
'cr' => [FILTER_V_LIST, [1, 2, 3, 6, 9, 11, 13], true ], // criteria ids
|
||||
'crs' => [FILTER_V_RANGE, [1, 6], true ], // criteria operators
|
||||
'crv' => [FILTER_V_RANGE, [0, 99999], true ], // criteria values - all criteria are numeric here
|
||||
'na' => [FILTER_V_REGEX, '/[\p{C};]/ui', false], // name - only printable chars, no delimiter
|
||||
'ma' => [FILTER_V_EQUAL, 1, false] // match any / all filter
|
||||
);
|
||||
|
||||
private function _getCnd($op, $val, $tbl)
|
||||
{
|
||||
switch ($op)
|
||||
@@ -147,13 +166,43 @@ class IconListFilter extends Filter
|
||||
return $ids ? ['id', array_keys($ids), '!'] : [1];
|
||||
}
|
||||
|
||||
|
||||
protected function createSQLForCriterium(&$cr)
|
||||
{
|
||||
if (isset($this->criterion2field[$cr[0]]))
|
||||
if (in_array($cr[0], array_keys($this->genericFilter)))
|
||||
if ($genCr = $this->genericCriterion($cr))
|
||||
return $genCr;
|
||||
|
||||
unset($cr);
|
||||
$this->error = true;
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
if ($cr[0] == 13 && $this->isSaneNumeric($cr[2]) && $this->int2Op($cr[1]))
|
||||
$parts = [];
|
||||
$_v = &$this->fiData['v'];
|
||||
|
||||
//string
|
||||
if (isset($_v['na']))
|
||||
if ($_ = $this->modularizeString(['name']))
|
||||
$parts[] = $_;
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
protected function cbUseAny($cr, $value)
|
||||
{
|
||||
if (Util::checkNumeric($cr[2], NUM_CAST_INT) && $this->int2Op($cr[1]))
|
||||
return $this->_getCnd($cr[1], $cr[2], $this->criterion2field[$cr[0]]);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbUseAll($cr)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1]))
|
||||
return false;
|
||||
|
||||
if (!$this->totalUses)
|
||||
{
|
||||
foreach ($this->criterion2field as $tbl)
|
||||
@@ -183,29 +232,6 @@ class IconListFilter extends Filter
|
||||
else
|
||||
return $ids ? ['id', array_keys($ids)] : ['id', array_keys($this->totalUses), '!'];
|
||||
}
|
||||
else if ($cr[0] == 11)
|
||||
return [0];
|
||||
else if ($this->isSaneNumeric($cr[2]) && $this->int2Op($cr[1]))
|
||||
return $this->_getCnd($cr[1], $cr[2], $this->criterion2field[$cr[0]]);
|
||||
}
|
||||
|
||||
unset($cr);
|
||||
$this->error = true;
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
$parts = [];
|
||||
$_v = &$this->fiData['v'];
|
||||
|
||||
//string
|
||||
if (isset($_v['na']))
|
||||
if ($_ = $this->modularizeString(['name']))
|
||||
$parts[] = $_;
|
||||
|
||||
return $parts;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -171,20 +171,37 @@ class ItemsetListFilter extends Filter
|
||||
{
|
||||
// cr => [type, field, misc, extraCol]
|
||||
protected $genericFilter = array( // misc (bool): _NUMERIC => useFloat; _STRING => localized; _FLAG => match Value; _BOOLEAN => stringSet
|
||||
2 => [FILTER_CR_NUMERIC, 'id', null, true], // id
|
||||
3 => [FILTER_CR_NUMERIC, 'npieces', ], // pieces
|
||||
2 => [FILTER_CR_NUMERIC, 'id', NUM_CAST_INT, true], // id
|
||||
3 => [FILTER_CR_NUMERIC, 'npieces', NUM_CAST_INT ], // pieces
|
||||
4 => [FILTER_CR_STRING, 'bonusText', true ], // bonustext
|
||||
5 => [FILTER_CR_BOOLEAN, 'heroic', ], // heroic
|
||||
6 => [FILTER_CR_ENUM, 'e.holidayId', ], // relatedevent
|
||||
8 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
9 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
10 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_VIDEO ], // hasvideos
|
||||
12 => [FILTER_CR_NYI_PH, null, 1 ] // available to players [yn] - ugh .. scan loot, quest and vendor templates and write to ?_itemset
|
||||
);
|
||||
|
||||
// fieldId => [checkType, checkValue[, fieldIsArray]]
|
||||
protected $inputFields = array(
|
||||
'cr' => [FILTER_V_RANGE, [2, 12], true ], // criteria ids
|
||||
'crs' => [FILTER_V_LIST, [FILTER_ENUM_NONE, FILTER_ENUM_ANY, [0, 424]], true ], // criteria operators
|
||||
'crv' => [FILTER_V_REGEX, '/[\p{C};:]/ui', true ], // criteria values - only printable chars, no delimiters
|
||||
'na' => [FILTER_V_REGEX, '/[\p{C};]/ui', false], // name / description - only printable chars, no delimiter
|
||||
'ma' => [FILTER_V_EQUAL, 1, false], // match any / all filter
|
||||
'qu' => [FILTER_V_RANGE, [0, 7], true ], // quality
|
||||
'ty' => [FILTER_V_RANGE, [1, 12], true ], // set type
|
||||
'minle' => [FILTER_V_RANGE, [1, 999], false], // min item level
|
||||
'maxle' => [FILTER_V_RANGE, [1, 999], false], // max itemlevel
|
||||
'minrl' => [FILTER_V_RANGE, [1, MAX_LEVEL], false], // min required level
|
||||
'maxrl' => [FILTER_V_RANGE, [1, MAX_LEVEL], false], // max required level
|
||||
'cl' => [FILTER_V_LIST, [[1, 9], 11], false], // class
|
||||
'ta' => [FILTER_V_RANGE, [1, 30], false] // tag / content group
|
||||
);
|
||||
|
||||
protected function createSQLForCriterium(&$cr)
|
||||
{
|
||||
if (in_array($cr[0], array_keys($this->genericFilter)))
|
||||
{
|
||||
if ($genCR = $this->genericCriterion($cr))
|
||||
return $genCR;
|
||||
|
||||
@@ -193,17 +210,6 @@ class ItemsetListFilter extends Filter
|
||||
return [1];
|
||||
}
|
||||
|
||||
switch ($cr[0])
|
||||
{
|
||||
case 12: // available to players [yn] ugh .. scan loot, quest and vendor templates and write to ?_itemset
|
||||
/* todo */ return [1];
|
||||
}
|
||||
|
||||
unset($cr);
|
||||
$this->error = true;
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
$parts = [];
|
||||
@@ -216,65 +222,35 @@ class ItemsetListFilter extends Filter
|
||||
|
||||
// quality [enum]
|
||||
if (isset($_v['qu']))
|
||||
$parts[] = ['quality', (array)$_v['qu']];
|
||||
$parts[] = ['quality', $_v['qu']];
|
||||
|
||||
// type [enum]
|
||||
if (isset($_v['ty']))
|
||||
$parts[] = ['type', (array)$_v['ty']];
|
||||
$parts[] = ['type', $_v['ty']];
|
||||
|
||||
// itemLevel min [int]
|
||||
if (isset($_v['minle']))
|
||||
{
|
||||
if (is_int($_v['minle']) && $_v['minle'] > 0)
|
||||
$parts[] = ['minLevel', $_v['minle'], '>='];
|
||||
else
|
||||
unset($_v['minle']);
|
||||
}
|
||||
|
||||
// itemLevel max [int]
|
||||
if (isset($_v['maxle']))
|
||||
{
|
||||
if (is_int($_v['maxle']) && $_v['maxle'] > 0)
|
||||
$parts[] = ['maxLevel', $_v['maxle'], '<='];
|
||||
else
|
||||
unset($_v['maxle']);
|
||||
}
|
||||
|
||||
// reqLevel min [int]
|
||||
if (isset($_v['minrl']))
|
||||
{
|
||||
if (is_int($_v['minrl']) && $_v['minrl'] > 0)
|
||||
$parts[] = ['reqLevel', $_v['minrl'], '>='];
|
||||
else
|
||||
unset($_v['minrl']);
|
||||
}
|
||||
|
||||
// reqLevel max [int]
|
||||
if (isset($_v['maxrl']))
|
||||
{
|
||||
if (is_int($_v['maxrl']) && $_v['maxrl'] > 0)
|
||||
$parts[] = ['reqLevel', $_v['maxrl'], '<='];
|
||||
else
|
||||
unset($_v['maxrl']);
|
||||
}
|
||||
|
||||
// class [enum]
|
||||
if (isset($_v['cl']))
|
||||
{
|
||||
if (in_array($_v['cl'], [1, 2, 3, 4, 5, 6, 7, 8, 9, 11]))
|
||||
$parts[] = ['classMask', $this->list2Mask($_v['cl']), '&'];
|
||||
else
|
||||
unset($_v['cl']);
|
||||
}
|
||||
$parts[] = ['classMask', $this->list2Mask([$_v['cl']]), '&'];
|
||||
|
||||
// tag [enum]
|
||||
if (isset($_v['ta']))
|
||||
{
|
||||
if ($_v['ta'] > 0 && $_v['ta'] < 31)
|
||||
$parts[] = ['contentGroup', intVal($_v['ta'])];
|
||||
else
|
||||
unset($_v['ta']);
|
||||
}
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
@@ -430,27 +430,59 @@ class QuestListFilter extends Filter
|
||||
38 => [null, 1, 2, 3, 4, 5, 6, 7, 8, null, 10, 11, true, false],
|
||||
);
|
||||
protected $genericFilter = array(
|
||||
1 => [FILTER_CR_CALLBACK, 'cbReputation', '>', null], // increasesrepwith
|
||||
2 => [FILTER_CR_NUMERIC, 'rewardXP', NUM_CAST_INT ], // experiencegained
|
||||
3 => [FILTER_CR_NUMERIC, 'rewardOrReqMoney', NUM_CAST_INT ], // moneyrewarded
|
||||
4 => [FILTER_CR_CALLBACK, 'cbSpellRewards', null, null], // spellrewarded [yn]
|
||||
5 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_SHARABLE ], // sharable
|
||||
6 => [FILTER_CR_NUMERIC, 'timeLimit', NUM_CAST_INT ], // timer
|
||||
7 => [FILTER_CR_NYI_PH, null, 1 ], // firstquestseries
|
||||
9 => [FILTER_CR_CALLBACK, 'cbEarnReputation', null, null], // objectiveearnrepwith [enum]
|
||||
10 => [FILTER_CR_CALLBACK, 'cbReputation', '<', null], // decreasesrepwith
|
||||
11 => [FILTER_CR_NUMERIC, 'suggestedPlayers', NUM_CAST_INT ], // suggestedplayers
|
||||
15 => [FILTER_CR_NYI_PH, null, 1 ], // lastquestseries
|
||||
16 => [FILTER_CR_NYI_PH, null, 1 ], // partseries
|
||||
18 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
19 => [FILTER_CR_CALLBACK, 'cbQuestRelation', 0x1, null], // startsfrom [enum]
|
||||
21 => [FILTER_CR_CALLBACK, 'cbQuestRelation', 0x2, null], // endsat [enum]
|
||||
22 => [FILTER_CR_CALLBACK, 'cbItemRewards', null, null], // itemrewards [op] [int]
|
||||
23 => [FILTER_CR_CALLBACK, 'cbItemChoices', null, null], // itemchoices [op] [int]
|
||||
24 => [FILTER_CR_CALLBACK, 'cbLacksStartEnd', null, null], // lacksstartend [yn]
|
||||
25 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
27 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_DAILY ], // daily
|
||||
28 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_WEEKLY ], // weekly
|
||||
29 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_REPEATABLE ], // repeatable
|
||||
30 => [FILTER_CR_NUMERIC, 'id', null, true], // id
|
||||
5 => [FILTER_CR_FLAG, 'flags', QUEST_FLAG_SHARABLE ], // sharable
|
||||
11 => [FILTER_CR_NUMERIC, 'suggestedPlayers', ], // suggestedplayers
|
||||
6 => [FILTER_CR_NUMERIC, 'timeLimit', ], // timer
|
||||
42 => [FILTER_CR_STAFFFLAG, 'flags', ], // flags
|
||||
45 => [FILTER_CR_BOOLEAN, 'rewardTitleId', ], // titlerewarded
|
||||
2 => [FILTER_CR_NUMERIC, 'rewardXP', ], // experiencegained
|
||||
3 => [FILTER_CR_NUMERIC, 'rewardOrReqMoney', ], // moneyrewarded
|
||||
33 => [FILTER_CR_ENUM, 'e.holidayId', ], // relatedevent
|
||||
25 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
18 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
30 => [FILTER_CR_NUMERIC, 'id', NUM_CAST_INT, true], // id
|
||||
33 => [FILTER_CR_ENUM, 'e.holidayId' ], // relatedevent
|
||||
34 => [FILTER_CR_CALLBACK, 'cbAvailable', null, null], // availabletoplayers [yn]
|
||||
36 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_VIDEO ], // hasvideos
|
||||
37 => [FILTER_CR_CALLBACK, 'cbClassSpec', null, null], // classspecific [enum]
|
||||
37 => [FILTER_CR_CALLBACK, 'cbRaceSpec', null, null], // racespecific [enum]
|
||||
42 => [FILTER_CR_STAFFFLAG, 'flags' ], // flags
|
||||
43 => [FILTER_CR_CALLBACK, 'cbCurrencyReward', null, null], // currencyrewarded [enum]
|
||||
44 => [FILTER_CR_CALLBACK, 'cbLoremaster', null, null], // countsforloremaster_stc [yn]
|
||||
45 => [FILTER_CR_BOOLEAN, 'rewardTitleId' ] // titlerewarded
|
||||
);
|
||||
|
||||
// fieldId => [checkType, checkValue[, fieldIsArray]]
|
||||
protected $inputFields = array(
|
||||
'cr' => [FILTER_V_RANGE, [1, 45], true ], // criteria ids
|
||||
'crs' => [FILTER_V_LIST, [FILTER_ENUM_NONE, FILTER_ENUM_ANY, [0, 99999]], true ], // criteria operators
|
||||
'crv' => [FILTER_V_REGEX, '/\D/', true ], // criteria values - only numerals
|
||||
'na' => [FILTER_V_REGEX, '/[\p{C};]/ui', false], // name / text - only printable chars, no delimiter
|
||||
'ex' => [FILTER_V_EQUAL, 'on', false], // also match subname
|
||||
'ma' => [FILTER_V_EQUAL, 1, false], // match any / all filter
|
||||
'minle' => [FILTER_V_RANGE, [1, 99], false], // min quest level
|
||||
'maxle' => [FILTER_V_RANGE, [1, 99], false], // max quest level
|
||||
'minrl' => [FILTER_V_RANGE, [1, 99], false], // min required level
|
||||
'maxrl' => [FILTER_V_RANGE, [1, 99], false], // max required level
|
||||
'si' => [FILTER_V_LIST, [-2, -1, 1, 2, 3], false], // siede
|
||||
'ty' => [FILTER_V_LIST, [0, 1, 21, 41, 62, [81, 85], 88, 89], true ] // type
|
||||
);
|
||||
|
||||
protected function createSQLForCriterium(&$cr)
|
||||
{
|
||||
if (in_array($cr[0], array_keys($this->genericFilter)))
|
||||
{
|
||||
if ($genCr = $this->genericCriterion($cr))
|
||||
return $genCr;
|
||||
|
||||
@@ -459,169 +491,6 @@ class QuestListFilter extends Filter
|
||||
return [1];
|
||||
}
|
||||
|
||||
switch ($cr[0])
|
||||
{
|
||||
case 1: // increasesrepwith
|
||||
if ($this->isSaneNumeric($cr[1]) && $cr[1] > 0)
|
||||
{
|
||||
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_factions WHERE id = ?d', $cr[1]))
|
||||
$this->formData['reputationCols'][] = [$cr[1], Util::localizedString($_, 'name')];
|
||||
|
||||
return [
|
||||
'OR',
|
||||
['AND', ['rewardFactionId1', $cr[1]], ['rewardFactionValue1', 0, '>']],
|
||||
['AND', ['rewardFactionId2', $cr[1]], ['rewardFactionValue2', 0, '>']],
|
||||
['AND', ['rewardFactionId3', $cr[1]], ['rewardFactionValue3', 0, '>']],
|
||||
['AND', ['rewardFactionId4', $cr[1]], ['rewardFactionValue4', 0, '>']],
|
||||
['AND', ['rewardFactionId5', $cr[1]], ['rewardFactionValue5', 0, '>']]
|
||||
];
|
||||
}
|
||||
break;
|
||||
case 10: // decreasesrepwith
|
||||
if ($this->isSaneNumeric($cr[1]) && $cr[1] > 0)
|
||||
{
|
||||
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_factions WHERE id = ?d', $cr[1]))
|
||||
$this->formData['reputationCols'][] = [$cr[1], Util::localizedString($_, 'name')];
|
||||
|
||||
return [
|
||||
'OR',
|
||||
['AND', ['rewardFactionId1', $cr[1]], ['rewardFactionValue1', 0, '<']],
|
||||
['AND', ['rewardFactionId2', $cr[1]], ['rewardFactionValue2', 0, '<']],
|
||||
['AND', ['rewardFactionId3', $cr[1]], ['rewardFactionValue3', 0, '<']],
|
||||
['AND', ['rewardFactionId4', $cr[1]], ['rewardFactionValue4', 0, '<']],
|
||||
['AND', ['rewardFactionId5', $cr[1]], ['rewardFactionValue5', 0, '<']]
|
||||
];
|
||||
}
|
||||
break;
|
||||
case 43: // currencyrewarded
|
||||
if ($this->isSaneNumeric($cr[1]) && $cr[1] > 0)
|
||||
{
|
||||
return [
|
||||
'OR',
|
||||
['rewardItemId1', $cr[1]], ['rewardItemId2', $cr[1]], ['rewardItemId3', $cr[1]], ['rewardItemId4', $cr[1]],
|
||||
['rewardChoiceItemId1', $cr[1]], ['rewardChoiceItemId2', $cr[1]], ['rewardChoiceItemId3', $cr[1]], ['rewardChoiceItemId4', $cr[1]], ['rewardChoiceItemId5', $cr[1]], ['rewardChoiceItemId6', $cr[1]]
|
||||
];
|
||||
}
|
||||
break;
|
||||
case 34: // availabletoplayers
|
||||
if ($this->int2Bool($cr[1]))
|
||||
{
|
||||
if ($cr[1])
|
||||
return [['cuFlags', CUSTOM_UNAVAILABLE | CUSTOM_DISABLED, '&'], 0];
|
||||
else
|
||||
return ['cuFlags', CUSTOM_UNAVAILABLE | CUSTOM_DISABLED, '&'];
|
||||
}
|
||||
break;
|
||||
case 23: // itemchoices [op] [int]
|
||||
if (!$this->isSaneNumeric($cr[2], false) || !$this->int2Op($cr[1]))
|
||||
break;
|
||||
|
||||
$this->extraOpts['q']['s'][] = ', (IF(rewardChoiceItemId1, 1, 0) + IF(rewardChoiceItemId2, 1, 0) + IF(rewardChoiceItemId3, 1, 0) + IF(rewardChoiceItemId4, 1, 0) + IF(rewardChoiceItemId5, 1, 0) + IF(rewardChoiceItemId6, 1, 0)) as numChoices';
|
||||
$this->extraOpts['q']['h'][] = 'numChoices '.$cr[1].' '.$cr[2];
|
||||
return [1];
|
||||
case 22: // itemrewards [op] [int]
|
||||
if (!$this->isSaneNumeric($cr[2], false) || !$this->int2Op($cr[1]))
|
||||
break;
|
||||
|
||||
$this->extraOpts['q']['s'][] = ', (IF(rewardItemId1, 1, 0) + IF(rewardItemId2, 1, 0) + IF(rewardItemId3, 1, 0) + IF(rewardItemId4, 1, 0)) as numRewards';
|
||||
$this->extraOpts['q']['h'][] = 'numRewards '.$cr[1].' '.$cr[2];
|
||||
return [1];
|
||||
case 44: // countsforloremaster_stc [bool]
|
||||
if ($this->int2Bool($cr[1]))
|
||||
{
|
||||
if ($cr[1])
|
||||
return ['AND', ['zoneOrSort', 0, '>'], [['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE , '&'], 0], [['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE | QUEST_FLAG_SPECIAL_MONTHLY , '&'], 0]];
|
||||
else
|
||||
return ['OR', ['zoneOrSort', 0, '<'], ['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE , '&'], ['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE | QUEST_FLAG_SPECIAL_MONTHLY , '&']];;
|
||||
}
|
||||
|
||||
break;
|
||||
case 4: // spellrewarded [bool]
|
||||
if ($this->int2Bool($cr[1]))
|
||||
{
|
||||
if ($cr[1])
|
||||
return ['OR', ['sourceSpellId', 0, '>'], ['rewardSpell', 0, '>'], ['rsc.effect1Id', SpellList::$effects['teach']], ['rsc.effect2Id', SpellList::$effects['teach']], ['rsc.effect3Id', SpellList::$effects['teach']]];
|
||||
else
|
||||
return ['AND', ['sourceSpellId', 0], ['rewardSpell', 0], ['rewardSpellCast', 0]];
|
||||
}
|
||||
break;
|
||||
case 9: // objectiveearnrepwith [enum]
|
||||
$_ = intVal($cr[1]);
|
||||
if ($_ > 0)
|
||||
return ['OR', ['reqFactionId1', $_], ['reqFactionId2', $_]];
|
||||
else if ($cr[1] == FILTER_ENUM_ANY) // any
|
||||
return ['OR', ['reqFactionId1', 0, '>'], ['reqFactionId2', 0, '>']];
|
||||
else if ($cr[1] == FILTER_ENUM_NONE) // none
|
||||
return ['AND', ['reqFactionId1', 0], ['reqFactionId2', 0]];
|
||||
|
||||
break;
|
||||
case 37: // classspecific [enum]
|
||||
$_ = isset($this->enums[$cr[0]][$cr[1]]) ? $this->enums[$cr[0]][$cr[1]] : null;
|
||||
if ($_ !== null)
|
||||
{
|
||||
if ($_ === true)
|
||||
return ['AND', ['reqClassMask', 0, '!'], [['reqClassMask', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!']];
|
||||
else if ($_ === false)
|
||||
return ['OR', ['reqClassMask', 0], [['reqClassMask', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL]];
|
||||
else if (is_int($_))
|
||||
return ['AND', ['reqClassMask', (1 << ($_ - 1)), '&'], [['reqClassMask', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!']];
|
||||
}
|
||||
break;
|
||||
case 38: // racespecific [enum]
|
||||
$_ = isset($this->enums[$cr[0]][$cr[1]]) ? $this->enums[$cr[0]][$cr[1]] : null;
|
||||
if ($_ !== null)
|
||||
{
|
||||
if ($_ === true)
|
||||
return ['AND', ['reqRaceMask', 0, '!'], [['reqRaceMask', RACE_MASK_ALL, '&'], RACE_MASK_ALL, '!'], [['reqRaceMask', RACE_MASK_ALLIANCE, '&'], RACE_MASK_ALLIANCE, '!'], [['reqRaceMask', RACE_MASK_HORDE, '&'], RACE_MASK_HORDE, '!']];
|
||||
else if ($_ === false)
|
||||
return ['OR', ['reqRaceMask', 0], ['reqRaceMask', RACE_MASK_ALL], ['reqRaceMask', RACE_MASK_ALLIANCE], ['reqRaceMask', RACE_MASK_HORDE]];
|
||||
else if (is_int($_))
|
||||
return ['AND', ['reqRaceMask', (1 << ($_ - 1)), '&'], [['reqRaceMask', RACE_MASK_ALLIANCE, '&'], RACE_MASK_ALLIANCE, '!'], [['reqRaceMask', RACE_MASK_HORDE, '&'], RACE_MASK_HORDE, '!']];
|
||||
}
|
||||
break;
|
||||
case 19: // startsfrom [enum]
|
||||
switch ($cr[1])
|
||||
{
|
||||
case 1: // npc
|
||||
return ['AND', ['qse.type', TYPE_NPC], ['qse.method', 0x1, '&']];
|
||||
case 2: // object
|
||||
return ['AND', ['qse.type', TYPE_OBJECT], ['qse.method', 0x1, '&']];
|
||||
case 3: // item
|
||||
return ['AND', ['qse.type', TYPE_ITEM], ['qse.method', 0x1, '&']];
|
||||
}
|
||||
break;
|
||||
case 21: // endsat [enum]
|
||||
switch ($cr[1])
|
||||
{
|
||||
case 1: // npc
|
||||
return ['AND', ['qse.type', TYPE_NPC], ['qse.method', 0x2, '&']];
|
||||
case 2: // object
|
||||
return ['AND', ['qse.type', TYPE_OBJECT], ['qse.method', 0x2, '&']];
|
||||
}
|
||||
break;
|
||||
case 24: // lacksstartend [bool]
|
||||
$missing = DB::Aowow()->selectCol('SELECT questId, max(method) a, min(method) b FROM ?_quests_startend GROUP BY questId HAVING (a | b) <> 3');
|
||||
if ($this->int2Bool($cr[1]))
|
||||
{
|
||||
if ($cr[1])
|
||||
return ['id', $missing];
|
||||
else
|
||||
return ['id', $missing, '!'];
|
||||
}
|
||||
break;
|
||||
case 7: // firstquestseries
|
||||
case 15: // lastquestseries
|
||||
case 16: // partseries
|
||||
/* todo */ return [1]; // self-joining eats substential amounts of time: should restructure that and also incorporate reqQ and openQ cases from infobox
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
unset($cr);
|
||||
$this->error = 1;
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
$parts = [];
|
||||
@@ -642,39 +511,19 @@ class QuestListFilter extends Filter
|
||||
|
||||
// level min
|
||||
if (isset($_v['minle']))
|
||||
{
|
||||
if (is_int($_v['minle']) && $_v['minle'] > 0)
|
||||
$parts[] = ['level', $_v['minle'], '>=']; // not considering quests that are always at player level (-1)
|
||||
else
|
||||
unset($_v['minle']);
|
||||
}
|
||||
|
||||
// level max
|
||||
if (isset($_v['maxle']))
|
||||
{
|
||||
if (is_int($_v['maxle']) && $_v['maxle'] > 0)
|
||||
$parts[] = ['level', $_v['maxle'], '<='];
|
||||
else
|
||||
unset($_v['maxle']);
|
||||
}
|
||||
|
||||
// reqLevel min
|
||||
if (isset($_v['minrl']))
|
||||
{
|
||||
if (is_int($_v['minrl']) && $_v['minrl'] > 0)
|
||||
$parts[] = ['minLevel', $_v['minrl'], '>='];// ignoring maxLevel
|
||||
else
|
||||
unset($_v['minrl']);
|
||||
}
|
||||
$parts[] = ['minLevel', $_v['minrl'], '>=']; // ignoring maxLevel
|
||||
|
||||
// reqLevel max
|
||||
if (isset($_v['maxrl']))
|
||||
{
|
||||
if (is_int($_v['maxrl']) && $_v['maxrl'] > 0)
|
||||
$parts[] = ['minLevel', $_v['maxrl'], '<='];// ignoring maxLevel
|
||||
else
|
||||
unset($_v['maxrl']);
|
||||
}
|
||||
$parts[] = ['minLevel', $_v['maxrl'], '<=']; // ignoring maxLevel
|
||||
|
||||
// side
|
||||
if (isset($_v['si']))
|
||||
@@ -699,23 +548,172 @@ class QuestListFilter extends Filter
|
||||
case -1:
|
||||
$parts[] = ['AND', $ex, ['reqRaceMask', RACE_MASK_ALLIANCE, '&']];
|
||||
break;
|
||||
default:
|
||||
unset($_v['si']);
|
||||
}
|
||||
}
|
||||
|
||||
// type [list]
|
||||
if (isset($_v['ty']))
|
||||
{
|
||||
$_ = (array)$_v['ty'];
|
||||
if (!array_diff($_, [0, 1, 21, 41, 62, 81, 82, 83, 84, 85, 88, 89]))
|
||||
$parts[] = ['type', $_];
|
||||
else
|
||||
unset($_v['ty']);
|
||||
}
|
||||
$parts[] = ['type', $_v['ty']];
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
protected function cbReputation($cr, $sign)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[1], NUM_REQ_INT) || $cr[1] <= 0)
|
||||
return false;
|
||||
|
||||
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_factions WHERE id = ?d', $cr[1]))
|
||||
$this->formData['reputationCols'][] = [$cr[1], Util::localizedString($_, 'name')];
|
||||
|
||||
return [
|
||||
'OR',
|
||||
['AND', ['rewardFactionId1', $cr[1]], ['rewardFactionValue1', 0, $sign]],
|
||||
['AND', ['rewardFactionId2', $cr[1]], ['rewardFactionValue2', 0, $sign]],
|
||||
['AND', ['rewardFactionId3', $cr[1]], ['rewardFactionValue3', 0, $sign]],
|
||||
['AND', ['rewardFactionId4', $cr[1]], ['rewardFactionValue4', 0, $sign]],
|
||||
['AND', ['rewardFactionId5', $cr[1]], ['rewardFactionValue5', 0, $sign]]
|
||||
];
|
||||
}
|
||||
|
||||
protected function cbQuestRelation($cr, $flags)
|
||||
{
|
||||
switch ($cr[1])
|
||||
{
|
||||
case 1: // npc
|
||||
return ['AND', ['qse.type', TYPE_NPC], ['qse.method', $flags, '&']];
|
||||
case 2: // object
|
||||
return ['AND', ['qse.type', TYPE_OBJECT], ['qse.method', $flags, '&']];
|
||||
case 3: // item
|
||||
return ['AND', ['qse.type', TYPE_ITEM], ['qse.method', $flags, '&']];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbCurrencyReward($cr)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[1], NUM_REQ_INT) || $cr[1] <= 0)
|
||||
return false;
|
||||
|
||||
return [
|
||||
'OR',
|
||||
['rewardItemId1', $cr[1]], ['rewardItemId2', $cr[1]], ['rewardItemId3', $cr[1]], ['rewardItemId4', $cr[1]],
|
||||
['rewardChoiceItemId1', $cr[1]], ['rewardChoiceItemId2', $cr[1]], ['rewardChoiceItemId3', $cr[1]], ['rewardChoiceItemId4', $cr[1]], ['rewardChoiceItemId5', $cr[1]], ['rewardChoiceItemId6', $cr[1]]
|
||||
];
|
||||
}
|
||||
|
||||
protected function cbAvailable($cr)
|
||||
{
|
||||
if (!$this->int2Bool($cr[1]))
|
||||
return false;
|
||||
|
||||
if ($cr[1])
|
||||
return [['cuFlags', CUSTOM_UNAVAILABLE | CUSTOM_DISABLED, '&'], 0];
|
||||
else
|
||||
return ['cuFlags', CUSTOM_UNAVAILABLE | CUSTOM_DISABLED, '&'];
|
||||
}
|
||||
|
||||
protected function cbItemChoices($cr)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1]))
|
||||
return false;
|
||||
|
||||
$this->extraOpts['q']['s'][] = ', (IF(rewardChoiceItemId1, 1, 0) + IF(rewardChoiceItemId2, 1, 0) + IF(rewardChoiceItemId3, 1, 0) + IF(rewardChoiceItemId4, 1, 0) + IF(rewardChoiceItemId5, 1, 0) + IF(rewardChoiceItemId6, 1, 0)) as numChoices';
|
||||
$this->extraOpts['q']['h'][] = 'numChoices '.$cr[1].' '.$cr[2];
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function cbItemRewards($cr)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1]))
|
||||
return false;
|
||||
|
||||
$this->extraOpts['q']['s'][] = ', (IF(rewardItemId1, 1, 0) + IF(rewardItemId2, 1, 0) + IF(rewardItemId3, 1, 0) + IF(rewardItemId4, 1, 0)) as numRewards';
|
||||
$this->extraOpts['q']['h'][] = 'numRewards '.$cr[1].' '.$cr[2];
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function cbLoremaster($cr)
|
||||
{
|
||||
if (!$this->int2Bool($cr[1]))
|
||||
return false;
|
||||
|
||||
if ($cr[1])
|
||||
return ['AND', ['zoneOrSort', 0, '>'], [['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE , '&'], 0], [['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE | QUEST_FLAG_SPECIAL_MONTHLY , '&'], 0]];
|
||||
else
|
||||
return ['OR', ['zoneOrSort', 0, '<'], ['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE , '&'], ['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE | QUEST_FLAG_SPECIAL_MONTHLY , '&']];;
|
||||
}
|
||||
|
||||
protected function cbSpellRewards($cr)
|
||||
{
|
||||
if (!$this->int2Bool($cr[1]))
|
||||
return false;
|
||||
|
||||
if ($cr[1])
|
||||
return ['OR', ['sourceSpellId', 0, '>'], ['rewardSpell', 0, '>'], ['rsc.effect1Id', SpellList::$effects['teach']], ['rsc.effect2Id', SpellList::$effects['teach']], ['rsc.effect3Id', SpellList::$effects['teach']]];
|
||||
else
|
||||
return ['AND', ['sourceSpellId', 0], ['rewardSpell', 0], ['rewardSpellCast', 0]];
|
||||
}
|
||||
|
||||
protected function cbEarnReputation($cr)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[1], NUM_REQ_INT))
|
||||
return false;
|
||||
|
||||
if ($cr[1] > 0)
|
||||
return ['OR', ['reqFactionId1', $cr[1]], ['reqFactionId2', $cr[1]]];
|
||||
else if ($cr[1] == FILTER_ENUM_ANY) // any
|
||||
return ['OR', ['reqFactionId1', 0, '>'], ['reqFactionId2', 0, '>']];
|
||||
else if ($cr[1] == FILTER_ENUM_NONE) // none
|
||||
return ['AND', ['reqFactionId1', 0], ['reqFactionId2', 0]];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbClassSpec($cr)
|
||||
{
|
||||
if (!isset($this->enums[$cr[0]][$cr[1]]))
|
||||
return false;
|
||||
|
||||
$_ = $this->enums[$cr[0]][$cr[1]];
|
||||
if ($_ === true)
|
||||
return ['AND', ['reqClassMask', 0, '!'], [['reqClassMask', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!']];
|
||||
else if ($_ === false)
|
||||
return ['OR', ['reqClassMask', 0], [['reqClassMask', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL]];
|
||||
else if (is_int($_))
|
||||
return ['AND', ['reqClassMask', (1 << ($_ - 1)), '&'], [['reqClassMask', CLASS_MASK_ALL, '&'], CLASS_MASK_ALL, '!']];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbRaceSpec($cr)
|
||||
{
|
||||
if (!isset($this->enums[$cr[0]][$cr[1]]))
|
||||
return false;
|
||||
|
||||
$_ = $this->enums[$cr[0]][$cr[1]];
|
||||
if ($_ === true)
|
||||
return ['AND', ['reqRaceMask', 0, '!'], [['reqRaceMask', RACE_MASK_ALL, '&'], RACE_MASK_ALL, '!'], [['reqRaceMask', RACE_MASK_ALLIANCE, '&'], RACE_MASK_ALLIANCE, '!'], [['reqRaceMask', RACE_MASK_HORDE, '&'], RACE_MASK_HORDE, '!']];
|
||||
else if ($_ === false)
|
||||
return ['OR', ['reqRaceMask', 0], ['reqRaceMask', RACE_MASK_ALL], ['reqRaceMask', RACE_MASK_ALLIANCE], ['reqRaceMask', RACE_MASK_HORDE]];
|
||||
else if (is_int($_))
|
||||
return ['AND', ['reqRaceMask', (1 << ($_ - 1)), '&'], [['reqRaceMask', RACE_MASK_ALLIANCE, '&'], RACE_MASK_ALLIANCE, '!'], [['reqRaceMask', RACE_MASK_HORDE, '&'], RACE_MASK_HORDE, '!']];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbLacksStartEnd($cr)
|
||||
{
|
||||
if (!$this->int2Bool($cr[1]))
|
||||
return false;
|
||||
|
||||
$missing = DB::Aowow()->selectCol('SELECT questId, max(method) a, min(method) b FROM ?_quests_startend GROUP BY questId HAVING (a | b) <> 3');
|
||||
if ($cr[1])
|
||||
return ['id', $missing];
|
||||
else
|
||||
return ['id', $missing, '!'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -109,6 +109,12 @@ class SoundListFilter extends Filter
|
||||
return [1];
|
||||
}
|
||||
|
||||
// fieldId => [checkType, checkValue[, fieldIsArray]]
|
||||
protected $inputFields = array(
|
||||
'na' => [FILTER_V_REGEX, '/[\p{C};]/ui', false], // name - only printable chars, no delimiter
|
||||
'ty' => [FILTER_V_LIST, [[1, 4], 6, 9, 10, 12, 13, 14, 16, 17, [19, 23], [25, 31], 50, 52, 53], true ] // type
|
||||
);
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
$parts = [];
|
||||
@@ -121,15 +127,7 @@ class SoundListFilter extends Filter
|
||||
|
||||
// type [list]
|
||||
if (isset($_v['ty']))
|
||||
{
|
||||
if ($_ = array_intersect((array)$_v['ty'], [1, 2, 3, 4, 6, 9, 10, 12, 13, 14, 16, 17, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 50, 52, 53]))
|
||||
$parts[] = ['cat', $_];
|
||||
else
|
||||
{
|
||||
$this->error = true;
|
||||
unset($_v['ty']);
|
||||
}
|
||||
}
|
||||
$parts[] = ['cat', $_v['ty']];
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
@@ -2159,26 +2159,48 @@ class SpellListFilter extends Filter
|
||||
|
||||
// cr => [type, field, misc, extraCol]
|
||||
protected $genericFilter = array( // misc (bool): _NUMERIC => useFloat; _STRING => localized; _FLAG => match Value; _BOOLEAN => stringSet
|
||||
2 => [FILTER_CR_NUMERIC, 'powerCostPercent', ], // prcntbasemanarequired
|
||||
1 => [FILTER_CR_CALLBACK, 'cbCost', null, null], // costAbs [op] [int]
|
||||
2 => [FILTER_CR_NUMERIC, 'powerCostPercent', NUM_CAST_INT ], // prcntbasemanarequired
|
||||
3 => [FILTER_CR_BOOLEAN, 'spellFocusObject' ], // requiresnearbyobject
|
||||
4 => [FILTER_CR_NUMERIC, 'trainingcost' ], // trainingcost
|
||||
4 => [FILTER_CR_NUMERIC, 'trainingcost', NUM_CAST_INT ], // trainingcost
|
||||
5 => [FILTER_CR_BOOLEAN, 'reqSpellId' ], // requiresprofspec
|
||||
10 => [FILTER_CR_FLAG, 'cuFlags', SPELL_CU_FIRST_RANK ], // firstrank
|
||||
12 => [FILTER_CR_FLAG, 'cuFlags', SPELL_CU_LAST_RANK ], // lastrank
|
||||
13 => [FILTER_CR_NUMERIC, 'rankNo', ], // rankno
|
||||
14 => [FILTER_CR_NUMERIC, 'id', null, true], // id
|
||||
15 => [FILTER_CR_STRING, 'ic.name', ], // icon
|
||||
19 => [FILTER_CR_FLAG, 'attributes0', 0x80000 ], // scaling
|
||||
25 => [FILTER_CR_BOOLEAN, 'skillLevelYellow' ], // rewardsskillups
|
||||
11 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
8 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_SCREENSHOT ], // hasscreenshots
|
||||
9 => [FILTER_CR_CALLBACK, 'cbSource', null, null], // source [enum]
|
||||
10 => [FILTER_CR_FLAG, 'cuFlags', SPELL_CU_FIRST_RANK ], // firstrank
|
||||
11 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_COMMENT ], // hascomments
|
||||
12 => [FILTER_CR_FLAG, 'cuFlags', SPELL_CU_LAST_RANK ], // lastrank
|
||||
13 => [FILTER_CR_NUMERIC, 'rankNo', NUM_CAST_INT ], // rankno
|
||||
14 => [FILTER_CR_NUMERIC, 'id', NUM_CAST_INT, true], // id
|
||||
15 => [FILTER_CR_STRING, 'ic.name', ], // icon
|
||||
17 => [FILTER_CR_FLAG, 'cuFlags', CUSTOM_HAS_VIDEO ], // hasvideos
|
||||
19 => [FILTER_CR_FLAG, 'attributes0', 0x80000 ], // scaling
|
||||
20 => [FILTER_CR_CALLBACK, 'cbReagents', null, null], // has Reagents [yn]
|
||||
25 => [FILTER_CR_BOOLEAN, 'skillLevelYellow' ] // rewardsskillups
|
||||
);
|
||||
|
||||
// fieldId => [checkType, checkValue[, fieldIsArray]]
|
||||
protected $inputFields = array(
|
||||
'cr' => [FILTER_V_RANGE, [1, 25], true ], // criteria ids
|
||||
'crs' => [FILTER_V_LIST, [FILTER_ENUM_NONE, FILTER_ENUM_ANY, [0, 99999]], true ], // criteria operators
|
||||
'crv' => [FILTER_V_REGEX, '/[\p{C};:]/ui', true ], // criteria values - only printable chars, no delimiters
|
||||
'na' => [FILTER_V_REGEX, '/[\p{C};]/ui', false], // name / text - only printable chars, no delimiter
|
||||
'ex' => [FILTER_V_EQUAL, 'on', false], // extended name search
|
||||
'ma' => [FILTER_V_EQUAL, 1, false], // match any / all filter
|
||||
'minle' => [FILTER_V_RANGE, [1, 99], false], // spell level min
|
||||
'maxle' => [FILTER_V_RANGE, [1, 99], false], // spell level max
|
||||
'minrs' => [FILTER_V_RANGE, [1, 999], false], // required skill level min
|
||||
'maxrs' => [FILTER_V_RANGE, [1, 999], false], // required skill level max
|
||||
'ra' => [FILTER_V_LIST, [[1, 8], 10, 11], false], // races
|
||||
'cl' => [FILTER_V_CALLBACK, 'cbClasses', true ], // classes
|
||||
'gl' => [FILTER_V_CALLBACK, 'cbGlyphs', true ], // glyph type
|
||||
'sc' => [FILTER_V_RANGE, [0, 6], true ], // magic schools
|
||||
'dt' => [FILTER_V_LIST, [[1, 6], 9], false], // dispel types
|
||||
'me' => [FILTER_V_RANGE, [1, 31], false] // mechanics
|
||||
);
|
||||
|
||||
protected function createSQLForCriterium(&$cr)
|
||||
{
|
||||
if (in_array($cr[0], array_keys($this->genericFilter)))
|
||||
{
|
||||
if ($genCr = $this->genericCriterion($cr))
|
||||
return $genCr;
|
||||
|
||||
@@ -2187,43 +2209,6 @@ class SpellListFilter extends Filter
|
||||
return [1];
|
||||
}
|
||||
|
||||
switch ($cr[0])
|
||||
{
|
||||
case 1: // costAbs [op] [int]
|
||||
if (!$this->isSaneNumeric($cr[2]))
|
||||
break;
|
||||
|
||||
if (!$this->int2Op($cr[1]))
|
||||
break;
|
||||
|
||||
return ['OR', ['AND', ['powerType', [1, 6]], ['powerCost', (10 * $cr[2]), $cr[1]]], ['AND', ['powerType', [1, 6], '!'], ['powerCost', $cr[2], $cr[1]]]];
|
||||
case 9: // source [enum]
|
||||
$_ = isset($this->enums[$cr[0]][$cr[1]]) ? $this->enums[$cr[0]][$cr[1]] : null;
|
||||
if ($_ !== null)
|
||||
{
|
||||
if (is_int($_)) // specific
|
||||
return ['src.src'.$_, null, '!'];
|
||||
else if ($_) // any
|
||||
return ['OR', ['src.src1', null, '!'], ['src.src2', null, '!'], ['src.src4', null, '!'], ['src.src5', null, '!'], ['src.src6', null, '!'], ['src.src7', null, '!'], ['src.src9', null, '!']];
|
||||
else if (!$_) // none
|
||||
return ['AND', ['src.src1', null], ['src.src2', null], ['src.src4', null], ['src.src5', null], ['src.src6', null], ['src.src7', null], ['src.src9', null]];
|
||||
}
|
||||
break;
|
||||
case 20: // has Reagents [yn]
|
||||
if ($this->int2Bool($cr[1]))
|
||||
{
|
||||
if ($cr[1])
|
||||
return ['OR', ['reagent1', 0, '>'], ['reagent2', 0, '>'], ['reagent3', 0, '>'], ['reagent4', 0, '>'], ['reagent5', 0, '>'], ['reagent6', 0, '>'], ['reagent7', 0, '>'], ['reagent8', 0, '>']];
|
||||
else
|
||||
return ['AND', ['reagent1', 0], ['reagent2', 0], ['reagent3', 0], ['reagent4', 0], ['reagent5', 0], ['reagent6', 0], ['reagent7', 0], ['reagent8', 0]];
|
||||
}
|
||||
}
|
||||
|
||||
unset($cr);
|
||||
$this->error = true;
|
||||
return [1];
|
||||
}
|
||||
|
||||
protected function createSQLForValues()
|
||||
{
|
||||
$parts = [];
|
||||
@@ -2244,98 +2229,109 @@ class SpellListFilter extends Filter
|
||||
|
||||
// spellLevel min todo (low): talentSpells (typeCat -2) commonly have spellLevel 1 (and talentLevel >1) -> query is inaccurate
|
||||
if (isset($_v['minle']))
|
||||
{
|
||||
if (is_int($_v['minle']) && $_v['minle'] > 0)
|
||||
$parts[] = ['spellLevel', $_v['minle'], '>='];
|
||||
else
|
||||
unset($_v['minle']);
|
||||
}
|
||||
|
||||
// spellLevel max
|
||||
if (isset($_v['maxle']))
|
||||
{
|
||||
if (is_int($_v['maxle']) && $_v['maxle'] > 0)
|
||||
$parts[] = ['spellLevel', $_v['maxle'], '<='];
|
||||
else
|
||||
unset($_v['maxle']);
|
||||
}
|
||||
|
||||
// skillLevel min
|
||||
if (isset($_v['minrs']))
|
||||
{
|
||||
if (is_int($_v['minrs']) && $_v['minrs'] > 0)
|
||||
$parts[] = ['learnedAt', $_v['minrs'], '>='];
|
||||
else
|
||||
unset($_v['minrs']);
|
||||
}
|
||||
|
||||
// skillLevel max
|
||||
if (isset($_v['maxrs']))
|
||||
{
|
||||
if (is_int($_v['maxrs']) && $_v['maxrs'] > 0)
|
||||
$parts[] = ['learnedAt', $_v['maxrs'], '<='];
|
||||
else
|
||||
unset($_v['maxrs']);
|
||||
}
|
||||
|
||||
// race
|
||||
if (isset($_v['ra']))
|
||||
{
|
||||
if (in_array($_v['ra'], [1, 2, 3, 4, 5, 6, 7, 8, 10, 11]))
|
||||
$parts[] = ['AND', [['reqRaceMask', RACE_MASK_ALL, '&'], RACE_MASK_ALL, '!'], ['reqRaceMask', $this->list2Mask($_v['ra']), '&']];
|
||||
else
|
||||
unset($_v['ra']);
|
||||
}
|
||||
$parts[] = ['AND', [['reqRaceMask', RACE_MASK_ALL, '&'], RACE_MASK_ALL, '!'], ['reqRaceMask', $this->list2Mask([$_v['ra']]), '&']];
|
||||
|
||||
// class [list]
|
||||
if (isset($_v['cl']))
|
||||
{
|
||||
$_ = (array)$_v['cl'];
|
||||
if (!array_diff($_, [1, 2, 3, 4, 5, 6, 7, 8, 9, 11]))
|
||||
$parts[] = ['reqClassMask', $this->list2Mask($_), '&'];
|
||||
else
|
||||
unset($_v['cl']);
|
||||
}
|
||||
$parts[] = ['reqClassMask', $this->list2Mask($_v['cl']), '&'];
|
||||
|
||||
// school [list]
|
||||
if (isset($_v['sc']))
|
||||
{
|
||||
$_ = (array)$_v['sc'];
|
||||
if (!array_diff($_, [0, 1, 2, 3, 4, 5, 6]))
|
||||
$parts[] = ['schoolMask', $this->list2Mask($_, true), '&'];
|
||||
else
|
||||
unset($_v['sc']);
|
||||
}
|
||||
$parts[] = ['schoolMask', $this->list2Mask($_v['sc'], true), '&'];
|
||||
|
||||
// glyph type [list] wonky, admittedly, but consult SPELL_CU_* in defines and it makes sense
|
||||
if (isset($_v['gl']))
|
||||
{
|
||||
if (in_array($_v['gl'], [1, 2]))
|
||||
$parts[] = ['cuFlags', ($this->list2Mask($_v['gl']) << 6), '&'];
|
||||
else
|
||||
unset($_v['gl']);
|
||||
}
|
||||
|
||||
// dispel type
|
||||
if (isset($_v['dt']))
|
||||
{
|
||||
if (in_array($_v['dt'], [1, 2, 3, 4, 5, 6, 9]))
|
||||
$parts[] = ['dispelType', $_v['dt']];
|
||||
else
|
||||
unset($_v['dt']);
|
||||
}
|
||||
|
||||
// mechanic
|
||||
if (isset($_v['me']))
|
||||
{
|
||||
if ($_v['me'] > 0 && $_v['me'] < 32)
|
||||
$parts[] = ['OR', ['mechanic', $_v['me']], ['effect1Mechanic', $_v['me']], ['effect2Mechanic', $_v['me']], ['effect3Mechanic', $_v['me']]];
|
||||
else
|
||||
unset($_v['me']);
|
||||
}
|
||||
|
||||
return $parts;
|
||||
}
|
||||
|
||||
protected function cbClasses(&$val)
|
||||
{
|
||||
if (!$this->parentCats || !in_array($this->parentCats[0], [-13, -2, 7]))
|
||||
return false;
|
||||
|
||||
if (!Util::checkNumeric($val, NUM_REQ_INT))
|
||||
return false;
|
||||
|
||||
$type = FILTER_V_LIST;
|
||||
$valid = [[1, 9], 11];
|
||||
|
||||
return $this->checkInput($type, $valid, $val);
|
||||
}
|
||||
|
||||
protected function cbGlyphs(&$val)
|
||||
{
|
||||
if (!$this->parentCats || $this->parentCats[0] != -13)
|
||||
return false;
|
||||
|
||||
if (!Util::checkNumeric($val, NUM_REQ_INT))
|
||||
return false;
|
||||
|
||||
$type = FILTER_V_LIST;
|
||||
$valid = [1, 2];
|
||||
|
||||
return $this->checkInput($type, $valid, $val);
|
||||
}
|
||||
|
||||
protected function cbCost($cr)
|
||||
{
|
||||
if (!Util::checkNumeric($cr[2], NUM_CAST_INT) || !$this->int2Op($cr[1]))
|
||||
return false;
|
||||
|
||||
return ['OR', ['AND', ['powerType', [1, 6]], ['powerCost', (10 * $cr[2]), $cr[1]]], ['AND', ['powerType', [1, 6], '!'], ['powerCost', $cr[2], $cr[1]]]];
|
||||
}
|
||||
|
||||
protected function cbSource($cr)
|
||||
{
|
||||
if (!isset($this->enums[$cr[0]][$cr[1]]))
|
||||
return false;
|
||||
|
||||
$_ = $this->enums[$cr[0]][$cr[1]];
|
||||
if (is_int($_)) // specific
|
||||
return ['src.src'.$_, null, '!'];
|
||||
else if ($_) // any
|
||||
return ['OR', ['src.src1', null, '!'], ['src.src2', null, '!'], ['src.src4', null, '!'], ['src.src5', null, '!'], ['src.src6', null, '!'], ['src.src7', null, '!'], ['src.src9', null, '!']];
|
||||
else if (!$_) // none
|
||||
return ['AND', ['src.src1', null], ['src.src2', null], ['src.src4', null], ['src.src5', null], ['src.src6', null], ['src.src7', null], ['src.src9', null]];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cbReagents($cr)
|
||||
{
|
||||
if (!$this->int2Bool($cr[1]))
|
||||
return false;
|
||||
|
||||
if ($cr[1])
|
||||
return ['OR', ['reagent1', 0, '>'], ['reagent2', 0, '>'], ['reagent3', 0, '>'], ['reagent4', 0, '>'], ['reagent5', 0, '>'], ['reagent6', 0, '>'], ['reagent7', 0, '>'], ['reagent8', 0, '>']];
|
||||
else
|
||||
return ['AND', ['reagent1', 0], ['reagent2', 0], ['reagent3', 0], ['reagent4', 0], ['reagent5', 0], ['reagent6', 0], ['reagent7', 0], ['reagent8', 0]];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -96,7 +96,6 @@ class Util
|
||||
public static $tryFilteringString = '$$WH.sprintf(%s, %s, %s) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'<a>\', \'<a href="javascript:;" onclick="fi_toggle()">\')';
|
||||
public static $tryFilteringEntityString = '$$WH.sprintf(LANG.lvnote_entitiesfound, %s, %s, %s) + LANG.dash + LANG.lvnote_tryfiltering.replace(\'<a>\', \'<a href="javascript:;" onclick="fi_toggle()">\')';
|
||||
public static $tryNarrowingString = '$$WH.sprintf(%s, %s, %s) + LANG.dash + LANG.lvnote_trynarrowing';
|
||||
public static $setCriteriaString = "fi_setCriteria(%s, %s, %s);\n";
|
||||
|
||||
public static $dfnString = '<dfn title="%s" class="w">%s</dfn>';
|
||||
|
||||
@@ -496,31 +495,37 @@ class Util
|
||||
}
|
||||
|
||||
// note: valid integer > 32bit are returned as float
|
||||
public static function checkNumeric(&$data)
|
||||
public static function checkNumeric(&$data, $typeCast = NUM_ANY)
|
||||
{
|
||||
if ($data === null)
|
||||
return false;
|
||||
else if (!is_array($data))
|
||||
{
|
||||
$data = trim($data);
|
||||
if (preg_match('/^-?\d*,\d+$/', $data))
|
||||
$data = strtr($data, ',', '.');
|
||||
|
||||
if (is_numeric($data))
|
||||
{
|
||||
$data += 0;
|
||||
return true;
|
||||
}
|
||||
else if (preg_match('/^\d*,\d+$/', $data))
|
||||
{
|
||||
$data = floatVal(strtr($data, ',', '.'));
|
||||
$data += 0; // becomes float or int
|
||||
|
||||
if ((is_float($data) && $typeCast == NUM_REQ_INT) ||
|
||||
(is_int($data) && $typeCast == NUM_REQ_FLOAT))
|
||||
return false;
|
||||
|
||||
if (is_float($data) && $typeCast == NUM_CAST_INT)
|
||||
$data = intval($data);
|
||||
|
||||
if (is_int($data) && $typeCast == NUM_CAST_FLOAT)
|
||||
$data = floatval($data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
array_walk($data, function(&$item, $key) {
|
||||
self::checkNumeric($item);
|
||||
});
|
||||
array_walk($data, function(&$x) use($typeCast) { self::checkNumeric($x, $typeCast); });
|
||||
|
||||
return false; // always false for passed arrays
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ switch ($pageCall)
|
||||
case 'cookie': // lossless cookies and user settings
|
||||
case 'contactus':
|
||||
case 'comment':
|
||||
// case 'filter': // just a note: this would be accessed from filtrable pages as ?filter=typeStr (with POST-data) and forwards back to page with GET-data .. why? Hell if i know..
|
||||
case 'filter': // pre-evaluate filter POST-data; sanitize and forward as GET-data
|
||||
case 'go-to-comment': // find page the comment is on and forward
|
||||
case 'locale': // subdomain-workaround, change the language
|
||||
$cleanName = str_replace(['-', '_'], '', ucFirst($altClass ?: $pageCall));
|
||||
|
||||
@@ -42,8 +42,8 @@ class AchievementsPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
$this->filterObj = new AchievementListFilter();
|
||||
$this->getCategoryFromUrl($pageParam);
|
||||
$this->filterObj = new AchievementListFilter(false, $this->category);
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
@@ -63,9 +63,12 @@ class AchievementsPage extends GenericPage
|
||||
$conditions[] = ['category', (int)end($this->category)];
|
||||
|
||||
// recreate form selection
|
||||
$this->filter = $this->filterObj->getForm('form');
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
$this->filter['initData'] = ['init' => 'achievements'];
|
||||
|
||||
if ($x = $this->filterObj->getSetCriteria())
|
||||
$this->filter['initData']['sc'] = $x;
|
||||
|
||||
if ($fiCnd = $this->filterObj->getConditions())
|
||||
$conditions[] = $fiCnd;
|
||||
|
||||
@@ -19,8 +19,8 @@ class EnchantmentsPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
$this->filterObj = new EnchantmentListFilter();
|
||||
$this->getCategoryFromUrl($pageParam);;
|
||||
$this->filterObj = new EnchantmentListFilter(false, ['parentCats' => $this->category]);
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
@@ -49,11 +49,14 @@ class EnchantmentsPage extends GenericPage
|
||||
$this->extendGlobalData($ench->getJSGlobals());
|
||||
|
||||
// recreate form selection
|
||||
$this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
$this->filter['initData'] = ['init' => 'enchantments'];
|
||||
|
||||
$xCols = $this->filterObj->getForm('extraCols', true);
|
||||
if ($x = $this->filterObj->getSetCriteria())
|
||||
$this->filter['initData']['sc'] = $x;
|
||||
|
||||
$xCols = $this->filterObj->getExtraCols();
|
||||
foreach (Util::$itemFilter as $fiId => $str)
|
||||
if (array_column($tabData['data'], $str))
|
||||
$xCols[] = $fiId;
|
||||
@@ -62,9 +65,9 @@ class EnchantmentsPage extends GenericPage
|
||||
$xCols[] = 34;
|
||||
|
||||
if ($xCols)
|
||||
$this->filter['fi']['extraCols'] = "fi_extraCols = ".Util::toJSON(array_values(array_unique($xCols))).";";
|
||||
$this->filter['initData']['ec'] = array_values(array_unique($xCols));
|
||||
|
||||
if (!empty($this->filter['fi']['extraCols']))
|
||||
if ($xCols)
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
if ($ench->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
|
||||
@@ -48,9 +48,12 @@ class IconsPage extends GenericPage
|
||||
$this->extendGlobalData($icons->getJSGlobals());
|
||||
|
||||
// recreate form selection
|
||||
$this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
$this->filter['initData'] = ['init' => 'icons'];
|
||||
|
||||
if ($x = $this->filterObj->getSetCriteria())
|
||||
$this->filter['initData']['sc'] = $x;
|
||||
|
||||
if ($icons->getMatches() > $sqlLimit)
|
||||
{
|
||||
@@ -66,7 +69,7 @@ class IconsPage extends GenericPage
|
||||
|
||||
protected function generateTitle()
|
||||
{
|
||||
$setCrt = $this->filterObj->getForm('setCriteria', true);
|
||||
$setCrt = $this->filterObj->getSetCriteria();
|
||||
$title = $this->name;
|
||||
if (isset($setCrt['cr']) && count($setCrt['cr']) == 1)
|
||||
{
|
||||
@@ -98,7 +101,7 @@ class IconsPage extends GenericPage
|
||||
|
||||
protected function generatePath()
|
||||
{
|
||||
$setCrt = $this->filterObj->getForm('setCriteria', true);
|
||||
$setCrt = $this->filterObj->getSetCriteria();
|
||||
if (isset($setCrt['cr']) && count($setCrt['cr']) == 1)
|
||||
$this->path[] = $setCrt['cr'][0];
|
||||
}
|
||||
|
||||
@@ -81,13 +81,14 @@ class ItemsPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
$this->filterObj = new ItemListFilter();
|
||||
$this->getCategoryFromUrl($pageParam);
|
||||
|
||||
$this->filterObj = new ItemListFilter(false, ['parentCats' => $this->category]);
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
$this->name = Util::ucFirst(Lang::game('items'));
|
||||
$this->subCat = $pageParam !== NULL ? '='.$pageParam : '';
|
||||
$this->subCat = $pageParam !== null ? '='.$pageParam : '';
|
||||
}
|
||||
|
||||
protected function generateContent()
|
||||
@@ -107,9 +108,19 @@ class ItemsPage extends GenericPage
|
||||
if ($_ = $this->filterObj->getConditions())
|
||||
$conditions[] = $_;
|
||||
|
||||
$this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
$this->filter['initData'] = ['init' => 'items'];
|
||||
|
||||
if ($x = $this->filterObj->getSetCriteria())
|
||||
$this->filter['initData']['sc'] = $x;
|
||||
|
||||
$xCols = $this->filterObj->getExtraCols();
|
||||
if ($xCols)
|
||||
$this->filter['initData']['ec'] = $xCols;
|
||||
|
||||
if ($x = $this->filterObj->getSetWeights())
|
||||
$this->filter['initData']['sw'] = $x;
|
||||
|
||||
$menu = $this->createExtraMenus();
|
||||
foreach ($menu['type'][0] as $k => $str)
|
||||
@@ -123,13 +134,12 @@ class ItemsPage extends GenericPage
|
||||
if (isset($this->filter['slot'][INVTYPE_SHIELD])) // "Off Hand" => "Shield"
|
||||
$this->filter['slot'][INVTYPE_SHIELD] = Lang::item('armorSubClass', 6);
|
||||
|
||||
$xCols = $this->filterObj->getForm('extraCols', true);
|
||||
|
||||
$infoMask = ITEMINFO_JSON;
|
||||
if (array_intersect([63, 64, 125], $xCols)) // 63:buyPrice; 64:sellPrice; 125:reqarenartng
|
||||
$infoMask |= ITEMINFO_VENDOR;
|
||||
|
||||
if (!empty($this->filter['fi']['extraCols']))
|
||||
if ($xCols)
|
||||
$this->sharedLV['extraCols'] = '$fi_getExtraCols(fi_extraCols, '.(isset($this->filter['gm']) ? $this->filter['gm'] : 0).', '.(array_intersect([63], $xCols) ? 1 : 0).')';
|
||||
|
||||
if ($this->filterObj->error)
|
||||
@@ -157,7 +167,7 @@ class ItemsPage extends GenericPage
|
||||
/*************************/
|
||||
|
||||
$upgItemData = [];
|
||||
if (!empty($this->filter['upg']) && !empty($this->filter['fi']['setWeights']))
|
||||
if (!empty($this->filter['upg']) && !empty($this->filterObj->getSetWeights()))
|
||||
{
|
||||
$upgItems = new ItemList(array(['id', array_keys($this->filter['upg'])]), ['extraOpts' => $this->filterObj->extraOpts]);
|
||||
if (!$upgItems->error)
|
||||
@@ -352,7 +362,7 @@ class ItemsPage extends GenericPage
|
||||
$tabData['tabs'] = '$tabsGroups';
|
||||
}
|
||||
|
||||
if (!empty($this->filter['fi']['setWeights']))
|
||||
if (!empty($this->filterObj->getSetWeights()))
|
||||
if ($items->hasSetFields(['armor']))
|
||||
$tabData['visibleCols'][] = 'armor';
|
||||
|
||||
@@ -449,7 +459,7 @@ class ItemsPage extends GenericPage
|
||||
$this->path[] = $c;
|
||||
|
||||
// if slot-dropdown is available && Armor && $path points to Armor-Class
|
||||
$form = $this->filterObj->getForm('form');
|
||||
$form = $this->filterObj->getForm();
|
||||
if (count($this->path) == 4 && $this->category[0] == 4 && isset($form['sl']) && !is_array($form['sl']))
|
||||
$this->path[] = $form['sl'];
|
||||
else if (!empty($this->category[0]) && $this->category[0] == 0 && isset($form['ty']) && !is_array($form['ty']))
|
||||
@@ -461,7 +471,7 @@ class ItemsPage extends GenericPage
|
||||
{
|
||||
$gemScores = [];
|
||||
|
||||
if (empty($this->filter['fi']['setWeights']))
|
||||
if (empty($this->filterObj->getSetWeights()))
|
||||
return [];
|
||||
|
||||
if (!empty($this->filter['gm']))
|
||||
|
||||
@@ -19,8 +19,8 @@ class ItemsetsPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
$this->filterObj = new ItemsetListFilter();
|
||||
$this->getCategoryFromUrl($pageParam);
|
||||
$this->filterObj = new ItemsetListFilter(false, ['parentCats' => $this->category]);
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
@@ -29,6 +29,8 @@ class ItemsetsPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addJS('?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
||||
|
||||
$conditions = [];
|
||||
|
||||
if (!User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
@@ -41,15 +43,20 @@ class ItemsetsPage extends GenericPage
|
||||
$this->extendGlobalData($itemsets->getJSGlobals());
|
||||
|
||||
// recreate form selection
|
||||
$this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
$this->filter['initData'] = ['init' => 'itemsets'];
|
||||
|
||||
$this->addJS('?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']);
|
||||
if ($x = $this->filterObj->getSetCriteria())
|
||||
$this->filter['initData']['sc'] = $x;
|
||||
|
||||
$xCols = $this->filterObj->getExtraCols();
|
||||
if ($xCols)
|
||||
$this->filter['initData']['ec'] = $xCols;
|
||||
|
||||
$tabData = ['data' => array_values($itemsets->getListviewData())];
|
||||
|
||||
if (!empty($this->filter['fi']['extraCols']))
|
||||
if ($xCols)
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
// create note if search limit was exceeded
|
||||
|
||||
@@ -20,8 +20,8 @@ class NpcsPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
$this->filterObj = new CreatureListFilter();
|
||||
$this->getCategoryFromUrl($pageParam);;
|
||||
$this->filterObj = new CreatureListFilter(false, ['parentCats' => $this->category]);
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
@@ -53,19 +53,26 @@ class NpcsPage extends GenericPage
|
||||
$npcs = new CreatureList($conditions, ['extraOpts' => $this->filterObj->extraOpts]);
|
||||
|
||||
// recreate form selection
|
||||
$this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
|
||||
$this->filter['initData'] = ['init' => 'npcs'];
|
||||
|
||||
$repCols = $this->filterObj->getForm('reputationCols');
|
||||
$rCols = $this->filterObj->getReputationCols();
|
||||
$xCols = $this->filterObj->getExtraCols();
|
||||
if ($rCols)
|
||||
$this->filter['initData']['rc'] = $rCols;
|
||||
|
||||
$tabData = array(
|
||||
'data' => array_values($npcs->getListviewData($repCols ? NPCINFO_REP : 0x0)),
|
||||
);
|
||||
if ($xCols)
|
||||
$this->filter['initData']['ec'] = $xCols;
|
||||
|
||||
if ($repCols)
|
||||
$tabData['extraCols'] = '$fi_getReputationCols('.Util::toJSON($repCols).')';
|
||||
else if (!empty($this->filter['fi']['extraCols']))
|
||||
if ($x = $this->filterObj->getSetCriteria())
|
||||
$this->filter['initData']['sc'] = $x;
|
||||
|
||||
$tabData = ['data' => array_values($npcs->getListviewData($rCols ? NPCINFO_REP : 0x0))];
|
||||
|
||||
if ($rCols) // never use pretty-print
|
||||
$tabData['extraCols'] = '$fi_getReputationCols('.Util::toJSON($rCols, JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE).')';
|
||||
else if ($xCols)
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
if ($this->category)
|
||||
|
||||
@@ -20,8 +20,8 @@ class ObjectsPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
$this->filterObj = new GameObjectListFilter();
|
||||
$this->getCategoryFromUrl($pageParam);;
|
||||
$this->filterObj = new GameObjectListFilter(false, ['parentCats' => $this->category]);
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
@@ -42,9 +42,12 @@ class ObjectsPage extends GenericPage
|
||||
$conditions[] = ['typeCat', (int)$this->category[0]];
|
||||
|
||||
// recreate form selection
|
||||
$this->filter = $this->filterObj->getForm('form');
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
$this->filter['initData'] = ['init' => 'objects'];
|
||||
|
||||
if ($x = $this->filterObj->getSetCriteria())
|
||||
$this->filter['initData']['sc'] = $x;
|
||||
|
||||
if ($_ = $this->filterObj->getConditions())
|
||||
$conditions[] = $_;
|
||||
|
||||
@@ -21,8 +21,8 @@ class QuestsPage extends GenericPage
|
||||
{
|
||||
$this->validCats = Game::$questClasses; // needs reviewing (not allowed to set this as default)
|
||||
|
||||
$this->filterObj = new QuestListFilter();
|
||||
$this->getCategoryFromUrl($pageParam);
|
||||
$this->filterObj = new QuestListFilter(false, ['parentCats' => $this->category]);
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
@@ -50,15 +50,26 @@ class QuestsPage extends GenericPage
|
||||
$this->extendGlobalData($quests->getJSGlobals());
|
||||
|
||||
// recreate form selection
|
||||
$this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
|
||||
$this->filter['initData'] = ['init' => 'quests'];
|
||||
|
||||
$rCols = $this->filterObj->getReputationCols();
|
||||
$xCols = $this->filterObj->getExtraCols();
|
||||
if ($rCols)
|
||||
$this->filter['initData']['rc'] = $rCols;
|
||||
|
||||
if ($xCols)
|
||||
$this->filter['initData']['ec'] = $xCols;
|
||||
|
||||
if ($x = $this->filterObj->getSetCriteria())
|
||||
$this->filter['initData']['sc'] = $x;
|
||||
|
||||
$tabData = ['data' => array_values($quests->getListviewData())];
|
||||
|
||||
if ($_ = $this->filterObj->getForm('reputationCols'))
|
||||
$tabData['extraCols'] = '$fi_getReputationCols('.json_encode($_, JSON_NUMERIC_CHECK).')';
|
||||
else if (!empty($this->filter['fi']['extraCols']))
|
||||
if ($rCols)
|
||||
$tabData['extraCols'] = '$fi_getReputationCols('.json_encode($rCols, JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE).')';
|
||||
else if ($xCols)
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
|
||||
// create note if search limit was exceeded
|
||||
|
||||
@@ -198,7 +198,7 @@ class ScreenshotPage extends GenericPage
|
||||
if (count($dims) != 4)
|
||||
return 3;
|
||||
|
||||
Util::checkNumeric($dims);
|
||||
Util::checkNumeric($dims, NUM_REQ_INT);
|
||||
|
||||
// actually crop the image
|
||||
$srcImg = imagecreatefromjpeg($fullPath);
|
||||
|
||||
@@ -40,7 +40,6 @@ class SearchPage extends GenericPage
|
||||
protected $search = ''; // output
|
||||
protected $invalid = [];
|
||||
|
||||
private $statWeight = ['wt' => null, 'wtv' => null];
|
||||
private $maxResults = CFG_SQL_LIMIT_SEARCH;
|
||||
private $searchMask = 0x0;
|
||||
private $query = ''; // lookup
|
||||
@@ -64,15 +63,6 @@ class SearchPage extends GenericPage
|
||||
if ($this->reqUGroup && !User::isInGroup($this->reqUGroup))
|
||||
$this->error();
|
||||
|
||||
// statWeight for JSON-search
|
||||
if (isset($_GET['wt']) && isset($_GET['wtv']))
|
||||
{
|
||||
$this->statWeight = array(
|
||||
'wt' => explode(':', $_GET['wt']),
|
||||
'wtv' => explode(':', $_GET['wtv'])
|
||||
);
|
||||
}
|
||||
|
||||
// select search mode
|
||||
if (isset($_GET['json']))
|
||||
{
|
||||
@@ -577,8 +567,12 @@ class SearchPage extends GenericPage
|
||||
if ($_ = array_filter($slots))
|
||||
$cnd[] = ['slot', $_];
|
||||
|
||||
// trick ItemListFilter into evaluating weights
|
||||
if (isset($_GET['wt']) && isset($_GET['wtv']))
|
||||
$_GET['filter'] = 'wt='.$_GET['wt'].';wtv='.$_GET['wtv'];
|
||||
|
||||
$itemFilter = new ItemListFilter();
|
||||
if ($_ = $itemFilter->createConditionsForWeights($this->statWeight))
|
||||
if ($_ = $itemFilter->createConditionsForWeights())
|
||||
{
|
||||
$miscData['extraOpts'] = $itemFilter->extraOpts;
|
||||
$cnd = array_merge($cnd, [$_]);
|
||||
|
||||
@@ -39,9 +39,8 @@ class SoundsPage extends GenericPage
|
||||
if ($_ = $this->filterObj->getConditions())
|
||||
$conditions[] = $_;
|
||||
|
||||
$this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : null;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
|
||||
$sounds = new SoundList($conditions);
|
||||
$tabData = [];
|
||||
@@ -66,15 +65,15 @@ class SoundsPage extends GenericPage
|
||||
|
||||
protected function generateTitle()
|
||||
{
|
||||
$form = $this->filterObj->getForm('form');
|
||||
if (isset($form['ty']) && !is_array($form['ty']))
|
||||
array_unshift($this->title, Lang::sound('cat', $form['ty']));
|
||||
$form = $this->filterObj->getForm();
|
||||
if (isset($form['ty']) && count($form['ty']) == 1)
|
||||
array_unshift($this->title, Lang::sound('cat', $form['ty'][0]));
|
||||
}
|
||||
|
||||
protected function generatePath()
|
||||
{
|
||||
$form = $this->filterObj->getForm('form');
|
||||
if (isset($form['ty']) && !is_array($form['ty']))
|
||||
$form = $this->filterObj->getForm();
|
||||
if (isset($form['ty']) && count($form['ty']) == 1)
|
||||
$this->path[] = $form['ty'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -630,11 +630,8 @@ class SpellPage extends GenericPage
|
||||
$lv[$bar]['condition'][0][$this->typeId][] = [[CND_SPELL, $extraItem['requiredSpecialization']]];
|
||||
$this->extendGlobalIds(TYPE_SPELL, $extraItem['requiredSpecialization']);
|
||||
$extraCols[] = '$Listview.extraCols.condition';
|
||||
if ($max = $extraItem['additionalMaxNum'])
|
||||
{
|
||||
$lv[$bar]['mincount'] = 1;
|
||||
$lv[$bar]['maxcount'] = $max;
|
||||
}
|
||||
if ($max = ($extraItem['additionalMaxNum'] - 1))
|
||||
$lv[$bar]['stack'] = [1, $max];
|
||||
|
||||
break; // skill_extra_item_template can only contain 1 item
|
||||
}
|
||||
|
||||
@@ -85,14 +85,16 @@ class SpellsPage extends GenericPage
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
$this->filterObj = new SpellListFilter();
|
||||
$this->getCategoryFromUrl($pageParam);;
|
||||
$this->filterObj = new SpellListFilter(false, ['parentCats' => $this->category]);
|
||||
|
||||
parent::__construct($pageCall, $pageParam);
|
||||
|
||||
$this->name = Util::ucFirst(Lang::game('spells'));
|
||||
$this->subCat = $pageParam !== null ? '='.$pageParam : '';
|
||||
$this->filter = ['classPanel' => false, 'glyphPanel' => false];
|
||||
|
||||
$this->classPanel = false;
|
||||
$this->glyphPanel = false;
|
||||
}
|
||||
|
||||
protected function generateContent()
|
||||
@@ -108,7 +110,7 @@ class SpellsPage extends GenericPage
|
||||
switch ($this->category[0])
|
||||
{
|
||||
case -2: // Character Talents
|
||||
$this->filter['classPanel'] = true;
|
||||
$this->classPanel = true;
|
||||
|
||||
array_push($visibleCols, 'singleclass', 'level', 'schools', 'tier');
|
||||
|
||||
@@ -218,8 +220,8 @@ class SpellsPage extends GenericPage
|
||||
|
||||
break;
|
||||
case -13: // Glyphs
|
||||
$this->filter['classPanel'] = true;
|
||||
$this->filter['glyphPanel'] = true;
|
||||
$this->classPanel = true;
|
||||
$this->glyphPanel = true;
|
||||
|
||||
array_push($visibleCols, 'singleclass', 'glyphtype');
|
||||
|
||||
@@ -230,7 +232,7 @@ class SpellsPage extends GenericPage
|
||||
|
||||
break;
|
||||
case 7: // Abilities
|
||||
$this->filter['classPanel'] = true;
|
||||
$this->classPanel = true;
|
||||
|
||||
array_push($visibleCols, 'level', 'singleclass', 'schools');
|
||||
|
||||
@@ -366,12 +368,24 @@ class SpellsPage extends GenericPage
|
||||
$tabData['data'] = array_values($spells->getListviewData());
|
||||
|
||||
// recreate form selection
|
||||
$this->filter = array_merge($this->filterObj->getForm('form'), $this->filter);
|
||||
$this->filter = $this->filterObj->getForm();
|
||||
$this->filter['query'] = isset($_GET['filter']) ? $_GET['filter'] : NULL;
|
||||
$this->filter['fi'] = $this->filterObj->getForm();
|
||||
$this->filter['initData'] = ['init' => 'spells'];
|
||||
|
||||
if (!empty($this->filter['fi']['extraCols']))
|
||||
if ($ec = $this->filterObj->getExtraCols())
|
||||
{
|
||||
$this->filter['initData']['ec'] = $ec;
|
||||
$tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)';
|
||||
}
|
||||
|
||||
if ($sc = $this->filterObj->getSetCriteria())
|
||||
{
|
||||
$this->filter['initData']['sc'] = $sc;
|
||||
|
||||
// add source to cols if explicitly searching for it
|
||||
if (in_array(9, $sc['cr']) && !in_array('source', $visibleCols))
|
||||
$visibleCols[] = 'source';
|
||||
}
|
||||
|
||||
// create note if search limit was exceeded; overwriting 'note' is intentional
|
||||
if ($spells->getMatches() > CFG_SQL_LIMIT_DEFAULT)
|
||||
@@ -383,10 +397,6 @@ class SpellsPage extends GenericPage
|
||||
if ($this->filterObj->error)
|
||||
$tabData['_errors'] = 1;
|
||||
|
||||
// add source to cols if explicitly searching for it
|
||||
if ($_ = $this->filterObj->getForm('setCriteria', true))
|
||||
if (in_array(9, $_['cr']) && !in_array('source', $visibleCols))
|
||||
$visibleCols[] = 'source';
|
||||
|
||||
$mask = $spells->hasSetFields(['reagent1', 'skillLines', 'trainingCost', 'reqClassMask']);
|
||||
if ($mask & 0x1)
|
||||
@@ -444,8 +454,8 @@ class SpellsPage extends GenericPage
|
||||
foreach ($this->category as $c)
|
||||
$this->path[] = $c;
|
||||
|
||||
$form = $this->filterObj->getForm('form');
|
||||
if (count($this->path) == 4 && $this->category[0] == -13 && isset($form['gl']) && !is_array($form['gl']))
|
||||
$form = $this->filterObj->getForm();
|
||||
if (count($this->path) == 4 && $this->category[0] == -13 && isset($form['gl']) && count($form['gl']) == 1)
|
||||
$this->path[] = $form['gl'];
|
||||
}
|
||||
}
|
||||
|
||||
14
template/bricks/filter.tpl.php
Normal file
14
template/bricks/filter.tpl.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('<?=$fi['init'];?>');
|
||||
<?php
|
||||
if (!empty($fi['sc'])):
|
||||
echo ' fi_setCriteria('.Util::toJSON($fi['sc']['cr'] ?: []).', '.Util::toJSON($fi['sc']['crs'] ?: []).', '.Util::toJSON($fi['sc']['crv'] ?: []).");\n";
|
||||
endif;
|
||||
if (!empty($fi['sw'])):
|
||||
echo ' fi_setWeights('.Util::toJSON($fi['sw']).", 0, 1, 1);\n";
|
||||
endif;
|
||||
if (!empty($fi['ec'])):
|
||||
echo ' fi_extraCols = '.Util::toJSON($fi['ec']).";\n";
|
||||
endif;
|
||||
?>
|
||||
//]]></script>
|
||||
@@ -14,7 +14,7 @@ $this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block'; ?>;">
|
||||
<form action="?achievements<?php echo $this->subCat; ?>&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<form action="?filter=achievements<?php echo $this->subCat; ?>" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
@@ -63,14 +63,7 @@ endforeach;
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('achievements');
|
||||
<?php
|
||||
foreach ($f['fi'] as $str):
|
||||
echo ' '.$str."\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 101]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
<form action="?enchantments&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=enchantments" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?php echo Util::ucFirst(Lang::game('type')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Util::ucFirst(Lang::game('type')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="ty[]" size="8" multiple="multiple" class="rightselect">
|
||||
<?php
|
||||
@@ -31,40 +31,33 @@ endforeach;
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?php echo isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null; ?>/></td>
|
||||
<td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
</table>
|
||||
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php echo Lang::main('addFilter'); ?></a></div>
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?=Lang::main('addFilter'); ?></a></div>
|
||||
|
||||
<div class="padded2">
|
||||
<?php echo Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?php echo !isset($f['ma']) ? 'checked="checked" ' : null ?>/><label for="ma-0"><?php echo Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?php echo isset($f['ma']) ? 'checked="checked" ' : null ?> /><label for="ma-1"><?php echo Lang::main('oneFilter'); ?></label>
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=()!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?php echo Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?php echo Lang::main('resetForm'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('enchantments');
|
||||
<?php
|
||||
foreach ($f['fi'] as $str):
|
||||
echo ' '.$str."\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
@@ -13,44 +13,37 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 101]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
<form action="?icons&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=icons" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?php echo isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null; ?>/></td>
|
||||
<td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
</table>
|
||||
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php echo Lang::main('addFilter'); ?></a></div>
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?=Lang::main('addFilter'); ?></a></div>
|
||||
|
||||
<div class="padded2">
|
||||
<?php echo Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?php echo !isset($f['ma']) ? 'checked="checked" ' : null ?>/><label for="ma-0"><?php echo Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?php echo isset($f['ma']) ? 'checked="checked" ' : null ?> /><label for="ma-1"><?php echo Lang::main('oneFilter'); ?></label>
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?php echo Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?php echo Lang::main('resetForm'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('icons');
|
||||
<?php
|
||||
foreach ($f['fi'] as $str):
|
||||
echo ' '.$str."\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 0]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
<form action="?items<?php echo $this->subCat; ?>&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=items<?=$this->subCat; ?>" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?php echo Lang::item('_quality').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['qu[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Lang::item('_quality').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['qu[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="qu[]" size="7" multiple="multiple" class="rightselect" style="background-color: #181818">
|
||||
<?php
|
||||
@@ -32,10 +32,10 @@ endforeach;
|
||||
if (!empty($f['slot'])):
|
||||
?>
|
||||
<div class="rightpanel2">
|
||||
<div style="float: left"><?php echo Lang::item('slot').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['sl[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Lang::item('slot').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['sl[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="sl[]" size="<?php echo min(count($f['slot']), 7); ?>" multiple="multiple" class="rightselect">
|
||||
<select name="sl[]" size="<?=min(count($f['slot']), 7); ?>" multiple="multiple" class="rightselect">
|
||||
<?php
|
||||
foreach ($f['slot'] as $k => $str):
|
||||
echo ' <option value="'.$k.'" '.(isset($f['sl']) && in_array($k, (array)$f['sl']) ? ' selected' : null).'>'.$str."</option>\n";
|
||||
@@ -49,10 +49,10 @@ endif;
|
||||
if (!empty($f['type'])):
|
||||
?>
|
||||
<div class="rightpanel2">
|
||||
<div style="float: left"><?php echo Lang::game('type').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Lang::game('type').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="ty[]" size="<?php echo min(count($f['type']), 7); ?>" multiple="multiple" class="rightselect">
|
||||
<select name="ty[]" size="<?=min(count($f['type']), 7); ?>" multiple="multiple" class="rightselect">
|
||||
<?php
|
||||
foreach ($f['type'] as $k => $str):
|
||||
$selected = false;
|
||||
@@ -71,23 +71,23 @@ if (!empty($f['type'])):
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2"> <input type="text" name="na" size="30" <?php echo isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null; ?>/></td>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2"> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
<td></td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?php echo Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="3" class="smalltextbox2" <?php echo isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null; ?>/> - <input type="text" name="maxle" maxlength="3" class="smalltextbox2" <?php echo isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null; ?>/></td>
|
||||
<td class="padded"><?=Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="3" class="smalltextbox2" <?=(isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null); ?>/> - <input type="text" name="maxle" maxlength="3" class="smalltextbox2" <?=(isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null); ?>/></td>
|
||||
<td class="padded">
|
||||
<table>
|
||||
<tr>
|
||||
<td> <?php echo Lang::main('_reqLevel').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minrl" maxlength="2" class="smalltextbox" <?php echo isset($f['minrl']) ? 'value="'.$f['minrl'].'" ' : null; ?>/> - <input type="text" name="maxrl" maxlength="2" class="smalltextbox" <?php echo isset($f['maxrl']) ? 'value="'.$f['maxrl'].'" ' : null; ?>/></td>
|
||||
<td> <?=Lang::main('_reqLevel').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minrl" maxlength="2" class="smalltextbox" <?=(isset($f['minrl']) ? 'value="'.$f['minrl'].'" ' : null); ?>/> - <input type="text" name="maxrl" maxlength="2" class="smalltextbox" <?=(isset($f['maxrl']) ? 'value="'.$f['maxrl'].'" ' : null); ?>/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td></td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?php echo Lang::item('usableBy').Lang::main('colon'); ?></td>
|
||||
<td class="padded"><?=Lang::item('usableBy').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <select name="si" style="margin-right: 0.5em">
|
||||
<option></option>
|
||||
<?php
|
||||
@@ -111,47 +111,47 @@ endforeach;
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php echo Lang::main('addFilter'); ?></a></div>
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?=Lang::main('addFilter'); ?></a></div>
|
||||
|
||||
<div class="padded2">
|
||||
<div style="float: right"><?php echo Lang::main('refineSearch'); ?></div>
|
||||
<?php echo Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?php echo !isset($f['ma']) ? 'checked="checked" ' : null; ?>/><label for="ma-0"><?php echo Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?php echo isset($f['ma']) ? 'checked="checked" ' : null; ?>/><label for="ma-1"><?php echo Lang::main('oneFilter'); ?></label>
|
||||
<div style="float: right"><?=Lang::main('refineSearch'); ?></div>
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="pad3"></div>
|
||||
|
||||
<div class="text">
|
||||
<h3 class="first"><a id="fi_weight_toggle" href="javascript:;" class="disclosure-off" onclick="return g_disclose($WH.ge('statweight-disclosure'), this)"><?php echo Lang::main('createWS'); ?></a></h3>
|
||||
<h3 class="first"><a id="fi_weight_toggle" href="javascript:;" class="disclosure-off" onclick="return g_disclose($WH.ge('statweight-disclosure'), this)"><?=Lang::main('createWS'); ?></a></h3>
|
||||
</div>
|
||||
|
||||
<div id="statweight-disclosure" style="display: none">
|
||||
<div id="statweight-help">
|
||||
<div><a href="?help=stat-weighting" target="_blank" id="statweight-help" class="icon-help"><?php echo Lang::main('help'); ?></a></div>
|
||||
<div><a href="?help=stat-weighting" target="_blank" id="statweight-help" class="icon-help"><?=Lang::main('help'); ?></a></div>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Lang::main('preset').Lang::main('colon'); ?></td>
|
||||
<td><?=Lang::main('preset').Lang::main('colon'); ?></td>
|
||||
<td id="fi_presets"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padded"><?php echo Lang::item('gems').Lang::main('colon'); ?></td>
|
||||
<td class="padded"><?=Lang::item('gems').Lang::main('colon'); ?></td>
|
||||
<td class="padded">
|
||||
<select name="gm">
|
||||
<option<?php echo !isset($f['gm']) ? ' selected' : null; ?>></option>
|
||||
<option value="2"<?php echo (isset($f['gm']) && $f['gm'] == 2 ? ' selected' : null).'>'.Lang::item('quality', 2); ?></option>
|
||||
<option value="3"<?php echo (isset($f['gm']) && $f['gm'] == 3 ? ' selected' : null).'>'.Lang::item('quality', 3); ?></option>
|
||||
<option value="4"<?php echo (isset($f['gm']) && $f['gm'] == 4 ? ' selected' : null).'>'.Lang::item('quality', 4); ?></option>
|
||||
<option<?=(!isset($f['gm']) ? ' selected' : null); ?>></option>
|
||||
<option value="2"<?=(isset($f['gm']) && $f['gm'] == 2 ? ' selected' : null).'>'.Lang::item('quality', 2); ?></option>
|
||||
<option value="3"<?=(isset($f['gm']) && $f['gm'] == 3 ? ' selected' : null).'>'.Lang::item('quality', 3); ?></option>
|
||||
<option value="4"<?=(isset($f['gm']) && $f['gm'] == 4 ? ' selected' : null).'>'.Lang::item('quality', 4); ?></option>
|
||||
</select>
|
||||
<input type="checkbox" name="jc" value="1" id="jc" <?php echo isset($f['jc']) && $f['jc'] == 1 ? 'checked="checked" ' : null; ?>/><label for="jc"><?php echo sprintf(Lang::main('jcGemsOnly'), ' class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_jconlygems, 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"'); ?></label>
|
||||
<input type="checkbox" name="jc" value="1" id="jc" <?=(isset($f['jc']) && $f['jc'] == 1 ? 'checked="checked" ' : null); ?>/><label for="jc"><?=sprintf(Lang::main('jcGemsOnly'), ' class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_jconlygems, 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"'); ?></label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="fi_weight" class="criteria" style="display: none"><div></div></div>
|
||||
<div><a href="javascript:;" id="fi_addweight" onclick="fi_addCriterion(this); return false" style="display: none"><?php echo Lang::main('addWeight'); ?></a></div>
|
||||
<div><a href="javascript:;" id="fi_addweight" onclick="fi_addCriterion(this); return false" style="display: none"><?=Lang::main('addWeight'); ?></a></div>
|
||||
<div class="pad2"></div>
|
||||
<small><?php echo Lang::main('cappedHint'); ?></small>
|
||||
<small><?=Lang::main('cappedHint'); ?></small>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -172,11 +172,11 @@ endforeach;
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?php echo Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?php echo Lang::main('resetForm'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="upg"<?php echo !empty($f['upg']) ? ' value="'.$f['upg'].'"' : null; ?>/>
|
||||
<input type="hidden" name="upg"<?=(!empty($f['upg']) ? ' value="'.$f['upg'].'"' : null); ?>/>
|
||||
|
||||
<div class="pad"></div>
|
||||
|
||||
@@ -184,14 +184,7 @@ endforeach;
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('items');
|
||||
<?php
|
||||
foreach ($f['fi'] as $str):
|
||||
echo ' '.$str."\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 2]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
<form action="?itemsets&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=itemsets" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?php echo Lang::item('_quality').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['qu[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Lang::item('_quality').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['qu[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="qu[]" size="7" multiple="multiple" class="rightselect" style="background-color: #181818">
|
||||
<?php
|
||||
@@ -29,8 +29,8 @@ endforeach;
|
||||
</div>
|
||||
|
||||
<div class="rightpanel2">
|
||||
<div style="float: left"><?php echo Lang::game('type').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Lang::game('type').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="ty[]" size="7" multiple="multiple" class="rightselect">
|
||||
<?php
|
||||
@@ -45,19 +45,19 @@ endforeach;
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="3"> <input type="text" name="na" size="30" <?php echo isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null; ?>/></td>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="3"> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?php echo Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="3" class="smalltextbox2" <?php echo isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null; ?>/> - <input type="text" name="maxle" maxlength="3" class="smalltextbox2" <?php echo isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null; ?>/></td>
|
||||
<td class="padded"><?=Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="3" class="smalltextbox2" <?=(isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null); ?>/> - <input type="text" name="maxle" maxlength="3" class="smalltextbox2" <?=(isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null); ?>/></td>
|
||||
<td class="padded" width="100%">
|
||||
<table><tr>
|
||||
<td> <?php echo Lang::main('_reqLevel').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minrl" maxlength="2" class="smalltextbox" <?php echo isset($f['minrl']) ? 'value="'.$f['minrl'].'" ' : null; ?>/> - <input type="text" name="maxrl" maxlength="2" class="smalltextbox" <?php echo isset($f['maxrl']) ? 'value="'.$f['maxrl'].'" ' : null; ?>/></td>
|
||||
<td> <?=Lang::main('_reqLevel').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minrl" maxlength="2" class="smalltextbox" <?=(isset($f['minrl']) ? 'value="'.$f['minrl'].'" ' : null); ?>/> - <input type="text" name="maxrl" maxlength="2" class="smalltextbox" <?=(isset($f['maxrl']) ? 'value="'.$f['maxrl'].'" ' : null); ?>/></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?php echo Util::ucFirst(Lang::game('class')).Lang::main('colon'); ?></td>
|
||||
<td class="padded"><?=Util::ucFirst(Lang::game('class')).Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <select name="cl">
|
||||
<option></option>
|
||||
<?php
|
||||
@@ -70,7 +70,7 @@ endforeach;
|
||||
</select></td>
|
||||
<td class="padded">
|
||||
<table><tr>
|
||||
<td> <?php echo Lang::itemset('_tag').Lang::main('colon'); ?></td>
|
||||
<td> <?=Lang::itemset('_tag').Lang::main('colon'); ?></td>
|
||||
<td> <select name="ta">
|
||||
<option></option>
|
||||
<?php
|
||||
@@ -86,32 +86,25 @@ endforeach;
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php echo Lang::main('addFilter'); ?></a></div>
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?=Lang::main('addFilter'); ?></a></div>
|
||||
|
||||
<div class="padded2">
|
||||
<div style="float: right"><?php echo Lang::main('refineSearch'); ?></div>
|
||||
<?php echo Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?php echo !isset($f['ma']) ? 'checked="checked" ' : null ?>/><label for="ma-0"><?php echo Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?php echo isset($f['ma']) ? 'checked="checked" ' : null ?> /><label for="ma-1"><?php echo Lang::main('oneFilter'); ?></label>
|
||||
<div style="float: right"><?=Lang::main('refineSearch'); ?></div>
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?php echo Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?php echo Lang::main('resetForm'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('itemsets');
|
||||
<?php
|
||||
foreach ($f['fi'] as $str):
|
||||
echo ' '.$str."\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 4]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
<form action="?npcs<?php echo $this->subCat; ?>&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=npcs<?=$this->subCat; ?>" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?php echo Lang::npc('classification').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['cl[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Lang::npc('classification').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['cl[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="cl[]" size="5" multiple="multiple" class="rightselect" style="width: 9.5em">
|
||||
<?php
|
||||
@@ -31,7 +31,7 @@ endforeach;
|
||||
</div>
|
||||
<?php if ($this->petFamPanel): ?>
|
||||
<div class="rightpanel2">
|
||||
<div style="float: left"><?php echo Lang::npc('petFamily').Lang::main('colon'); ?></div><small><a href="javascript:;" onclick="document.forms['fi'].elements['fa[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Lang::npc('petFamily').Lang::main('colon'); ?></div><small><a href="javascript:;" onclick="document.forms['fi'].elements['fa[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="fa[]" size="7" multiple="multiple" class="rightselect">
|
||||
<?php
|
||||
@@ -46,31 +46,31 @@ endforeach;
|
||||
<?php endif; ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?php echo isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null; ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="npc-ex" <?php echo isset($f['ex']) ? 'checked="checked" ' : null; ?>/></td>
|
||||
<td><label for="npc-ex"><span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_extendednpcsearch, 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><?php echo Lang::main('extSearch'); ?></span></label></td>
|
||||
<td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="npc-ex" <?=(isset($f['ex']) ? 'checked="checked" ' : null); ?>/></td>
|
||||
<td><label for="npc-ex"><span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_extendednpcsearch, 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><?=Lang::main('extSearch'); ?></span></label></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?php echo Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="2" class="smalltextbox" <?php echo isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null; ?>/> - <input type="text" name="maxle" maxlength="2" class="smalltextbox" <?php echo isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null; ?>/></td>
|
||||
<td class="padded"><?=Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="2" class="smalltextbox" <?=(isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null); ?>/> - <input type="text" name="maxle" maxlength="2" class="smalltextbox" <?=(isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null); ?>/></td>
|
||||
<td class="padded" width="100%">
|
||||
<table><tr>
|
||||
<td> <?php echo Lang::npc('react').Lang::main('colon'); ?></td>
|
||||
<td> <select name="ra" onchange="fi_dropdownSync(this)" onkeyup="fi_dropdownSync(this)" style="background-color: #181818"<?php echo isset($f['ra']) ? ' class="q'.($f['ra'] == 1 ? '2' : ($f['ra'] == -1 ? '10' : null)).'"' : null; ?>>
|
||||
<td> <?=Lang::npc('react').Lang::main('colon'); ?></td>
|
||||
<td> <select name="ra" onchange="fi_dropdownSync(this)" onkeyup="fi_dropdownSync(this)" style="background-color: #181818"<?=(isset($f['ra']) ? ' class="q'.($f['ra'] == 1 ? '2' : ($f['ra'] == -1 ? '10' : null)).'"' : null); ?>>
|
||||
<option></option>
|
||||
<option value="1" class="q2"<?php echo isset($f['ra']) && $f['ra'] == 1 ? ' selected' : null; ?>>A</option>
|
||||
<option value="0" class="q"<?php echo isset($f['ra']) && $f['ra'] == 0 ? ' selected' : null; ?>>A</option>
|
||||
<option value="-1" class="q10"<?php echo isset($f['ra']) && $f['ra'] == -1 ? ' selected' : null; ?>>A</option>
|
||||
<option value="1" class="q2"<?=(isset($f['ra']) && $f['ra'] == 1 ? ' selected' : null); ?>>A</option>
|
||||
<option value="0" class="q"<?=(isset($f['ra']) && $f['ra'] == 0 ? ' selected' : null); ?>>A</option>
|
||||
<option value="-1" class="q10"<?=(isset($f['ra']) && $f['ra'] == -1 ? ' selected' : null); ?>>A</option>
|
||||
</select>
|
||||
<select name="rh" onchange="fi_dropdownSync(this)" onkeyup="fi_dropdownSync(this)" style="background-color: #181818"<?php echo isset($f['rh']) ? ' class="q'.($f['rh'] == 1 ? '2' : ($f['rh'] == -1 ? '10' : null)).'"' : null; ?>>
|
||||
<select name="rh" onchange="fi_dropdownSync(this)" onkeyup="fi_dropdownSync(this)" style="background-color: #181818"<?=(isset($f['rh']) ? ' class="q'.($f['rh'] == 1 ? '2' : ($f['rh'] == -1 ? '10' : null)).'"' : null); ?>>
|
||||
<option></option>
|
||||
<option value="1" class="q2"<?php echo isset($f['rh']) && $f['rh'] == 1 ? ' selected' : null; ?>>H</option>
|
||||
<option value="0" class="q"<?php echo isset($f['rh']) && $f['rh'] == 0 ? ' selected' : null; ?>>H</option>
|
||||
<option value="-1" class="q10"<?php echo isset($f['rh']) && $f['rh'] == -1 ? ' selected' : null; ?>>H</option>
|
||||
<option value="1" class="q2"<?=(isset($f['rh']) && $f['rh'] == 1 ? ' selected' : null); ?>>H</option>
|
||||
<option value="0" class="q"<?=(isset($f['rh']) && $f['rh'] == 0 ? ' selected' : null); ?>>H</option>
|
||||
<option value="-1" class="q10"<?=(isset($f['rh']) && $f['rh'] == -1 ? ' selected' : null); ?>>H</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr></table>
|
||||
@@ -78,32 +78,25 @@ endforeach;
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php echo Lang::main('addFilter'); ?></a></div>
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?=Lang::main('addFilter'); ?></a></div>
|
||||
|
||||
<div class="padded2 clear">
|
||||
<div style="float: right"><?php echo Lang::main('refineSearch'); ?></div>
|
||||
<?php echo Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?php echo !isset($f['ma']) ? 'checked="checked" ' : null ?>/><label for="ma-0"><?php echo Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?php echo isset($f['ma']) ? 'checked="checked" ' : null ?> /><label for="ma-1"><?php echo Lang::main('oneFilter'); ?></label>
|
||||
<div style="float: right"><?=Lang::main('refineSearch'); ?></div>
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?php echo Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?php echo Lang::main('resetForm'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('npcs');
|
||||
<?php
|
||||
foreach ($f['fi'] as $str):
|
||||
echo ' '.$str."\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
@@ -13,38 +13,31 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 5]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
<form action="?objects<?php echo $this->subCat; ?>&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=objects<?=$this->subCat; ?>" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<table>
|
||||
<tr><td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td><td> <input type="text" name="na" size="30" <?php echo isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null; ?>/></td></tr>
|
||||
<tr><td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td><td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td></tr>
|
||||
</table>
|
||||
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php echo Lang::main('addFilter'); ?></a></div>
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?=Lang::main('addFilter'); ?></a></div>
|
||||
|
||||
<div class="padded2 clear">
|
||||
<div style="float: right"><?php echo Lang::main('refineSearch'); ?></div>
|
||||
<?php echo Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?php echo !isset($f['ma']) ? 'checked="checked" ' : null ?>/><label for="ma-0"><?php echo Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?php echo isset($f['ma']) ? 'checked="checked" ' : null ?> /><label for="ma-1"><?php echo Lang::main('oneFilter'); ?></label>
|
||||
<div style="float: right"><?=Lang::main('refineSearch'); ?></div>
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?php echo Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?php echo Lang::main('resetForm'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('objects');
|
||||
<?php
|
||||
foreach ($f['fi'] as $str):
|
||||
echo ' '.$str."\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ $this->brick('pageTemplate');
|
||||
# for some arcane reason a newline (\n) means, the first childNode is a text instead of the form for the following div
|
||||
?>
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;"><form
|
||||
action="?profiles&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
action="?filter=profiles" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?php echo Util::ucFirst(Lang::game('class')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['cl[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
|
||||
@@ -13,10 +13,10 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 3]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
<form action="?quests<?php echo $this->subCat; ?>&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=quests<?=$this->subCat; ?>" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?php echo Lang::game('type').Lang::main('colon'); ?></div><small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Lang::game('type').Lang::main('colon'); ?></div><small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="ty[]" size="6" multiple="multiple" class="rightselect">
|
||||
<?php
|
||||
@@ -29,27 +29,27 @@ endforeach;
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="3">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?php echo isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null; ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="quest-ex" <?php echo isset($f['ex']) ? 'checked ' : null; ?>/></td>
|
||||
<td><label for="quest-ex"><span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_extendedquestsearch, 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><?php echo Lang::main('extSearch'); ?></span></label></td>
|
||||
<td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="quest-ex" <?=(isset($f['ex']) ? 'checked ' : null); ?>/></td>
|
||||
<td><label for="quest-ex"><span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_extendedquestsearch, 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><?=Lang::main('extSearch'); ?></span></label></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padded"><?php echo Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="2" class="smalltextbox" <?php echo isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null; ?>/> - <input type="text" name="maxle" maxlength="2" class="smalltextbox" <?php echo isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null; ?>/></td>
|
||||
<td class="padded"><?=Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="2" class="smalltextbox" <?=(isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null); ?>/> - <input type="text" name="maxle" maxlength="2" class="smalltextbox" <?=(isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null); ?>/></td>
|
||||
<td class="padded" width="100%">
|
||||
<table><tr>
|
||||
<td> <?php echo Lang::main('_reqLevel').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minrl" maxlength="2" class="smalltextbox" <?php echo isset($f['minrl']) ? 'value="'.$f['minrl'].'" ' : null; ?>/> - <input type="text" name="maxrl" maxlength="2" class="smalltextbox" <?php echo isset($f['maxrl']) ? 'value="'.$f['maxrl'].'" ' : null; ?>/></td>
|
||||
<td> <?=Lang::main('_reqLevel').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minrl" maxlength="2" class="smalltextbox" <?=(isset($f['minrl']) ? 'value="'.$f['minrl'].'" ' : null); ?>/> - <input type="text" name="maxrl" maxlength="2" class="smalltextbox" <?=(isset($f['maxrl']) ? 'value="'.$f['maxrl'].'" ' : null); ?>/></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="padded"><?php echo Lang::main('side').Lang::main('colon'); ?></td>
|
||||
<td class="padded"><?=Lang::main('side').Lang::main('colon'); ?></td>
|
||||
<td class="padded" colspan="3"> <select name="si">
|
||||
<option></option>
|
||||
<?php
|
||||
@@ -60,32 +60,25 @@ endforeach;
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php echo Lang::main('addFilter'); ?></a></div>
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?=Lang::main('addFilter'); ?></a></div>
|
||||
|
||||
<div class="padded2 clear">
|
||||
<div style="float: right"><?php echo Lang::main('refineSearch'); ?></div>
|
||||
<?php echo Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?php echo !isset($f['ma']) ? 'checked="checked" ' : null ?>/><label for="ma-0"><?php echo Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?php echo isset($f['ma']) ? 'checked="checked" ' : null ?> /><label for="ma-1"><?php echo Lang::main('oneFilter'); ?></label>
|
||||
<div style="float: right"><?=Lang::main('refineSearch'); ?></div>
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?php echo Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?php echo Lang::main('resetForm'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('quests');
|
||||
<?php
|
||||
foreach ($f['fi'] as $str):
|
||||
echo ' '.$str."\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
@@ -13,11 +13,11 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 101]]);
|
||||
?>
|
||||
<div class="text"><h1><?=$this->name; ?> <?=$this->brick('redButtons'); ?></h1></div>
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
<form action="?sounds&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=sounds" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?php echo Util::ucFirst(Lang::game('type')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Util::ucFirst(Lang::game('type')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="ty[]" size="6" multiple="multiple" class="rightselect">
|
||||
<?php
|
||||
@@ -31,10 +31,10 @@ endforeach;
|
||||
</div>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?php echo isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null; ?>/></td>
|
||||
<td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
@@ -43,8 +43,8 @@ endforeach;
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?php echo Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?php echo Lang::main('resetForm'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -13,11 +13,11 @@ $this->brick('announcement');
|
||||
$this->brick('pageTemplate', ['fi' => empty($f['query']) ? null : ['query' => $f['query'], 'menuItem' => 1]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?php echo empty($f['query']) ? 'none' : 'block' ?>;">
|
||||
<form action="?spells<?php echo $this->subCat; ?>&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div id="fi" style="display: <?=(empty($f['query']) ? 'none' : 'block'); ?>;">
|
||||
<form action="?filter=spells<?=$this->subCat; ?>" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?php echo Lang::game('school').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['sc[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Lang::game('school').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['sc[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="sc[]" size="7" multiple="multiple" class="rightselect" style="width: 8em">
|
||||
<?php
|
||||
@@ -29,10 +29,10 @@ endforeach;
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<?php if ($f['classPanel']): ?>
|
||||
<?php if ($this->classPanel): ?>
|
||||
<div class="rightpanel2">
|
||||
<div style="float: left"><?php echo Util::ucFirst(Lang::game('class')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['cl[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Util::ucFirst(Lang::game('class')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['cl[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="cl[]" size="8" multiple="multiple" class="rightselect" style="width: 8em; background-color: #181818">
|
||||
<?php
|
||||
@@ -47,11 +47,11 @@ endforeach;
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if ($f['glyphPanel']):
|
||||
if ($this->glyphPanel):
|
||||
?>
|
||||
<div class="rightpanel2">
|
||||
<div style="float: left"><?php echo Util::ucFirst(Lang::game('glyphType')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['gl[]'].selectedIndex = -1; return false" onmousedown="return false"><?php echo Lang::main('clear'); ?></a></small>
|
||||
<div style="float: left"><?=Util::ucFirst(Lang::game('glyphType')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['gl[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="gl[]" size="2" multiple="multiple" class="rightselect" style="width: 8em">
|
||||
<?php
|
||||
@@ -66,25 +66,25 @@ endforeach;
|
||||
<?php endif; ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?php echo Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?php echo isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null; ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="spell-ex" <?php echo isset($f['ex']) ? 'checked="checked" ' : null; ?>/></td>
|
||||
<td><label for="spell-ex"><span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_extendedspellsearch, 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><?php echo Lang::main('extSearch'); ?></span></label></td>
|
||||
<td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="spell-ex" <?=(isset($f['ex']) ? 'checked="checked" ' : null); ?>/></td>
|
||||
<td><label for="spell-ex"><span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_extendedspellsearch, 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><?=Lang::main('extSearch'); ?></span></label></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?php echo Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="2" class="smalltextbox" <?php echo isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null; ?>/> - <input type="text" name="maxle" maxlength="2" class="smalltextbox" <?php echo isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null; ?>/></td>
|
||||
<td class="padded"><?=Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="2" class="smalltextbox" <?=(isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null); ?>/> - <input type="text" name="maxle" maxlength="2" class="smalltextbox" <?=(isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null); ?>/></td>
|
||||
<td class="padded">
|
||||
<table cellpadding="0" cellspacing="0" border="0"><tr>
|
||||
<td> <?php echo Lang::game('reqSkillLevel').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minrs" maxlength="3" class="smalltextbox2" <?php echo isset($f['minrs']) ? 'value="'.$f['minrs'].'" ' : null; ?>/> - <input type="text" name="maxrs" maxlength="3" class="smalltextbox2" <?php echo isset($f['maxrs']) ? 'value="'.$f['maxrs'].'" ' : null; ?>/></td>
|
||||
<td> <?=Lang::game('reqSkillLevel').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minrs" maxlength="3" class="smalltextbox2" <?=(isset($f['minrs']) ? 'value="'.$f['minrs'].'" ' : null); ?>/> - <input type="text" name="maxrs" maxlength="3" class="smalltextbox2" <?=(isset($f['maxrs']) ? 'value="'.$f['maxrs'].'" ' : null); ?>/></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?php echo Util::ucFirst(Lang::game('race')).Lang::main('colon'); ?></td>
|
||||
<td class="padded"><?=Util::ucFirst(Lang::game('race')).Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <select name="ra">
|
||||
<option></option>
|
||||
<?php
|
||||
@@ -97,7 +97,7 @@ endforeach;
|
||||
</select></td>
|
||||
<td class="padded"></td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?php echo Lang::game('mechAbbr').Lang::main('colon'); ?></td>
|
||||
<td class="padded"><?=Lang::game('mechAbbr').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <select name="me">
|
||||
<option></option>
|
||||
<?php
|
||||
@@ -110,7 +110,7 @@ endforeach;
|
||||
</select></td>
|
||||
<td>
|
||||
<table cellpadding="0" cellspacing="0" border="0"><tr>
|
||||
<td class="padded"> <?php echo Lang::game('dispelType').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <?=Lang::game('dispelType').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <select name="dt">
|
||||
<option></option>
|
||||
<?php
|
||||
@@ -126,32 +126,25 @@ endforeach;
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php echo Lang::main('addFilter'); ?></a></div>
|
||||
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?=Lang::main('addFilter'); ?></a></div>
|
||||
|
||||
<div class="padded2">
|
||||
<div style="float: right"><?php echo Lang::main('refineSearch'); ?></div>
|
||||
<?php echo Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?php echo !isset($f['ma']) ? 'checked="checked" ' : null ?>/><label for="ma-0"><?php echo Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?php echo isset($f['ma']) ? 'checked="checked" ' : null ?> /><label for="ma-1"><?php echo Lang::main('oneFilter'); ?></label>
|
||||
<div style="float: right"><?=Lang::main('refineSearch'); ?></div>
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="padded">
|
||||
<input type="submit" value="<?php echo Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?php echo Lang::main('resetForm'); ?>" />
|
||||
<input type="submit" value="<?=Lang::main('applyFilter'); ?>" />
|
||||
<input type="reset" value="<?=Lang::main('resetForm'); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
fi_init('spells');
|
||||
<?php
|
||||
foreach ($f['fi'] as $str):
|
||||
echo ' '.$str."\n";
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
<?php $this->brick('filter', ['fi' => $f['initData']]); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user