Skip to content

Commit

Permalink
[21] Remove field name and link when field zone was changed.
Browse files Browse the repository at this point in the history
Highlight result of search and search by LIKE '%string%'.

Signed-off-by: Ivan <Dfyztimy@list.ru>
  • Loading branch information
Hantet committed Jul 6, 2010
1 parent a10dbaf commit cd2b228
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config.php
Expand Up @@ -49,7 +49,7 @@ function get($id)
## checkdiff: Different in days for recheck updates.
##################################################################################################*/
"CheckVersion" => false,
"version" => 20,
"version" => 21,
"checkdiff" => 2
);

Expand Down
3 changes: 3 additions & 0 deletions lib/main.js
Expand Up @@ -222,6 +222,7 @@ function send()

function next(id)
{
document.getElementById("searchview").style.display = "none";
switch(id)
{
case 0:
Expand Down Expand Up @@ -261,6 +262,8 @@ function next(id)
break;

case 3:
clear(4);
clear(5);
for(var i=4;i<7;i++)
document.getElementById("var"+i).style.display = "";
break;
Expand Down
19 changes: 10 additions & 9 deletions search.php
Expand Up @@ -18,27 +18,27 @@
{
case "quest":
if($cfg->get("lang") == 8)
$query = "SELECT `Title_loc8`,`entry` FROM `locales_quest` WHERE `Title_loc8` LIKE '".$string."%'";
$query = "SELECT `Title_loc8`,`entry` FROM `locales_quest` WHERE `Title_loc8` LIKE '%".$string."%'";
else if($cfg->get("lang") == 1)
$query = "SELECT `Title`,`entry` FROM `quest_template` WHERE `Title` LIKE '".$string."%'";
$query = "SELECT `Title`,`entry` FROM `quest_template` WHERE `Title` LIKE '%".$string."%'";
break;
case "item":
if($cfg->get("lang") == 8)
$query = "SELECT `name_loc8`,`entry` FROM `locales_item` WHERE `name_loc8` LIKE '".$string."%'";
$query = "SELECT `name_loc8`,`entry` FROM `locales_item` WHERE `name_loc8` LIKE '%".$string."%'";
else if($cfg->get("lang") == 1)
$query = "SELECT `name`,`entry` FROM `item_template` WHERE `name` LIKE '".$string."%'";
$query = "SELECT `name`,`entry` FROM `item_template` WHERE `name` LIKE '%".$string."%'";
break;
case "npc":
if($cfg->get("lang") == 8)
$query = "SELECT `name_loc8`,`entry` FROM `locales_creature` WHERE `name_loc8` LIKE '".$string."%'";
$query = "SELECT `name_loc8`,`entry` FROM `locales_creature` WHERE `name_loc8` LIKE '%".$string."%'";
else if($cfg->get("lang") == 1)
$query = "SELECT `name`,`entry` FROM `creature_template` WHERE `name` LIKE '".$string."%'";
$query = "SELECT `name`,`entry` FROM `creature_template` WHERE `name` LIKE '%".$string."%'";
break;
case "object":
if($cfg->get("lang") == 8)
$query = "SELECT `name_loc8`,`entry` FROM `locales_gameobject` WHERE `name_loc8` LIKE '".$string."%'";
$query = "SELECT `name_loc8`,`entry` FROM `locales_gameobject` WHERE `name_loc8` LIKE '%".$string."%'";
else if($cfg->get("lang") == 1)
$query = "SELECT `name`,`entry` FROM `gameobject_template` WHERE `name` LIKE '".$string."%'";
$query = "SELECT `name`,`entry` FROM `gameobject_template` WHERE `name` LIKE '%".$string."%'";
break;
}
$result = $sql->exe($cfg->get("mangos"),$query." LIMIT ".$cfg->get("searchlimit"));
Expand All @@ -47,11 +47,12 @@
while($row=$sql->fetch($result))
{
$name = str_replace("'","",$row[0]);
$pname = preg_replace('/('.$string.')/iu', '<font color="gold">\0</font>', $name);
$entry = $row[1];
$text.= '
<tr>
<td><div style="cursor:pointer;" onClick=\'document.getElementById("name").value="'.$name.'";searchresult('.$entry.');\'><img src="img/add.png"></div></td>
<td><div class="search"><a href="http://ru.wowhead.com/'.$table.'='.$entry.'" target="_blank">'.$name.'</a></div></td>
<td><div class="search"><a href="http://ru.wowhead.com/'.$table.'='.$entry.'" target="_blank">'.$pname.'</a></div></td>
</tr>';
$i++;
}
Expand Down

0 comments on commit cd2b228

Please sign in to comment.