Требование: PHP => 5.3, часть 2
[cswow.git] / module / search / search.php
blob6c2dbc928a3057e060fc2210c9cdceed2f5b2a66
1 <?php
2 // Have 'Open Search' result like: "Dirty Leather Vest (Item)"
3 // Need fix it by extract name and type (get $name = "Dirty Leather Vest" and $type = "Item"
4 if (isset($_REQUEST['name']) && preg_match('/(^.*)\s\((.*?)\)/i', $_REQUEST['name'], $result))
6 // After need convert $type to search mode
7 if ($type = array_search($result[2],$ls_type_name))
9 $_REQUEST['s'] = $type;
10 $_REQUEST['name'] = $result[1]; // name
14 $s = @$_REQUEST['s'];
15 $name = @$_REQUEST['name'];
17 switch ($s)
19 case 'i':
20 include("search_item.php");
21 break;
22 case 'n':
23 include("search_npc.php");
24 break;
25 case 'q':
26 include("search_quest.php");
27 break;
28 case 's':
29 include("search_spell.php");
30 break;
31 case 'o':
32 include("search_go.php");
33 break;
34 case 'f':
35 include("search_faction.php");
36 break;
37 case 'p':
38 include("search_player.php");
39 break;
40 case 'set':
41 include("search_itemset.php");
42 break;
43 case 'a':
44 include("search_area.php");
45 break;
46 case 'all':
47 // include_once("include/report_generator.php");
48 // createReportTab();
50 echo '<h3>'.$lang['search_item_req'].'</h3>';
51 include("search_item.php");
53 echo "<br><hr><br>";
54 echo '<h3>'.$lang['search_set_req'].'</h3>';
55 include("search_itemset.php");
57 echo "<br><hr><br>";
58 echo '<h3>'.$lang['search_faction_req'].'</h3>';
59 include("search_faction.php");
61 echo "<br><hr><br>";
62 echo '<h3>'.$lang['search_npc_req'].'</h3>';
63 include("search_npc.php");
65 echo "<br><hr><br>";
66 echo '<h3>'.$lang['search_quest_req'].'</h3>';
67 include("search_quest.php");
69 echo "<br><hr><br>";
70 echo '<h3>'.$lang['search_go_req'].'</h3>';
71 include("search_go.php");
73 echo "<br><hr><br>";
74 echo '<h3>'.$lang['search_spell_req'].'</h3>';
75 include("search_spell.php");
77 echo "<br><hr><br>";
78 echo '<h3>'.$lang['search_area_req'].'</h3>';
79 include("search_area.php");
81 break;