Требование: PHP => 5.3, часть 2
[cswow.git] / include / ajax_tooltip.php
blobae757f3dc8ebb316b0d46b43f6250bf8a93564d0
1 <?php
2 include_once("include/functions.php");
4 $str = @$_REQUEST['tip'];
5 $tip = substr($str,0,1);
6 $entry = intval(substr($str,1,10));
7 switch ($tip)
9 // Ïîêàç âåùè
10 case "i":
11 if (substr($str,1,1)=='g')
13 $entry = intval(substr($str,2,10));
14 if ($item_data = getItemData($entry))
16 if ($item = getItem($item_data[ITEM_FIELD_ENTRY]))
17 noBorderItemTable($item, $item_data);
19 else
20 echo "Error item guid $entry";
22 else if ($item=getItem($entry))
23 noBorderItemTable($item,0,0);
24 else
25 echo "Error item $entry";
26 break;
27 // Ïîêàç Ñóùåñòâà
28 case "c":
29 if ($creature=getCreature($entry))
31 include_once("include/creature_table.php");
32 noBorderCreatureTable($creature);
34 else
35 echo "Error creature $entry";
36 break;
37 // Ïîêàç Îáüåêòà
38 case "o":
39 if ($obj=getGameobject($entry))
41 include_once("include/gameobject_table.php");
42 noBorderGameobjectTable($obj);
44 else
45 echo "Error object $entry";
46 break;
47 // Ïîêàç ñïåëëà
48 case "s":
49 if ($spell=getSpell($entry))
50 noBorderSpellTable($spell);
51 else
52 echo "Error spell $entry";
53 break;
54 // Ïîêàç ýí÷àíòà
55 case "e":
56 if ($enc=getEnchantment($entry))
57 noBorderEnchantTable($enc);
58 else
59 echo "Error enchant $entry";
60 break;
61 // Ïîêàç òàëàíòà
62 case "t":
63 $rank = intval(substr($str,1,1));
64 $entry = intval(substr($str,2,5));
65 $talentTab = $wDB->selectRow("SELECT * FROM `wowd_talents` WHERE `TalentID` = ?d", $entry);
66 if ($talentTab)
67 noBorderTalentTable($talentTab, $rank);
68 else
69 echo "Error talent $entry - $rank";
70 break;
71 // Ïîêàç ôðàêöèè
72 case "f":
73 if ($faction=getFaction($entry))
75 include_once("include/faction_table.php");
76 noBorderFactionTable($faction);
78 else
79 echo "Error faction $entry";
80 break;