-
Notifications
You must be signed in to change notification settings - Fork 6
/
wow_alpha_skills.php
105 lines (78 loc) · 2.41 KB
/
wow_alpha_skills.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
/*
Author: X'Genesis Qhulut <XGenesis-Qhulut@protonmail.com>
Date: August 2022
See LICENSE for license details.
*/
// SKILLS
function skillDetails ($info)
{
bottomSection ($info, function ($info)
{
global $id;
$extras = $info ['extras'];
comment ('MAP DETAILS');
showOneThing (SKILLLINE, 'ID', $id, "Skill", "DisplayName_enUS", $extras);
});
} // end of skillDetails
function showOneSkill ()
{
global $id;
if (($id === false && !repositionSearch()) || !checkID ())
return;
// we need the item info in this function
$row = dbQueryOneParam ("SELECT * FROM ".SKILLLINE." WHERE ID = ?", array ('i', &$id));
if (!$row)
{
ShowWarning ("Skill $id is not on the database");
return;
} // end of not finding it
$name = $row ['DisplayName_enUS'];
setTitle ("Skill $name");
$extras = array (
'RaceMask' => 'race_mask',
'ClassMask' => 'class_mask',
'SkillType' => 'skill_type',
'DisplayName_Mask' => 'mask',
);
// we pass this stuff around to the helper functions
$info = array ('row' => $row, 'extras' => $extras, 'limit' => array ());
// ready to go! show the page info and work our way down into the sub-functions
pageContent ($info, 'Skill', $name, 'skills', 'skillDetails', SKILLLINE);
} // end of showOneSkill
function showSkills ()
{
global $where, $params, $maps, $sort_order, $matches;
$sortFields = array (
'ID',
'DisplayName_enUS',
'RaceMask',
'ClassMask',
'MaxRank',
);
if (!in_array ($sort_order, $sortFields))
$sort_order = 'DisplayName_enUS';
setTitle ("Skills listing");
$td = function ($s) use (&$row) { tdx ($row [$s]); };
$headings = array ('ID', 'Name', 'Race', 'Class', 'Max Rank');
$results = setUpSearch ('Skills', $sortFields, $headings);
if (!$results)
return;
$searchURI = makeSearchURI (true);
$pos = 0;
foreach ($results as $row)
{
$pos++;
echo "<tr>\n";
$id = $row ['ID'];
tdh ("<a href='?action=show_skill&id=$id$searchURI&pos=$pos&max=$matches'>$id</a>");
tdh ("<a href='?action=show_skill&id=$id$searchURI&pos=$pos&max=$matches'>" . fixHTML ($row ['DisplayName_enUS']) . "</a>");
tdx (expandRaceMask ($row ['RaceMask']));
tdx (expandClassMask ($row ['ClassMask']));
$td ('MaxRank');
showFilterColumn ($row);
echo "</tr>\n";
}
wrapUpSearch ();
} // end of showSkills
?>