mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 09:49:22 +02:00
Added limit to search characters (#134)
* Update characters.php * Update config.php * Variable name change, better use LIMIT in query instead in loop * Just to be sure. Security first :) * use config function Co-authored-by: slawkens <slawkens@gmail.com>
This commit is contained in:
parent
f958b8dd4f
commit
dc536f0fc0
@ -150,6 +150,9 @@ $config = array(
|
|||||||
3 => 'Paladin Sample',
|
3 => 'Paladin Sample',
|
||||||
4 => 'Knight Sample'
|
4 => 'Knight Sample'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// it must show limited number of players after using search in character page
|
||||||
|
'characters_search_limit' => 15,
|
||||||
|
|
||||||
// town list used when creating character
|
// town list used when creating character
|
||||||
// won't be displayed if there is only one item (rookgaard for example)
|
// won't be displayed if there is only one item (rookgaard for example)
|
||||||
|
@ -432,7 +432,7 @@ else
|
|||||||
if($db->hasColumn('players', 'deletion'))
|
if($db->hasColumn('players', 'deletion'))
|
||||||
$deleted = 'deletion';
|
$deleted = 'deletion';
|
||||||
|
|
||||||
$query = $db->query('SELECT `name`, `level`, `vocation`' . $promotion . ' FROM `players` WHERE `name` LIKE ' . $db->quote('%' . $name . '%') . ' AND ' . $deleted . ' != 1;');
|
$query = $db->query('SELECT `name`, `level`, `vocation`' . $promotion . ' FROM `players` WHERE `name` LIKE ' . $db->quote('%' . $name . '%') . ' AND ' . $deleted . ' != 1 LIMIT ' . (int)config('characters_search_limit') . ';');
|
||||||
if($query->rowCount() > 0)
|
if($query->rowCount() > 0)
|
||||||
{
|
{
|
||||||
echo 'Did you mean:<ul>';
|
echo 'Did you mean:<ul>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user