forked from X-Genesis-Qhulut/alpha
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwow_alpha_maps.php
154 lines (105 loc) · 3.1 KB
/
wow_alpha_maps.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
/*
Author: X'Genesis Qhulut <[email protected]>
Date: August 2022
See LICENSE for license details.
*/
// MAPS
// https://wowdev.wiki/DB/WorldMapArea
function mapshowMap ()
{
global $id;
//echo "<div class='object-container page-content'>\n";
comment ('MAP');
echo "
<!-- CAROUSSEL -->
<aside
class='caroussel caroussel--independant'
id='spawn-map-caroussel'
>
";
echo "<div class='caroussel__maps'>\n";
showMapHelp ();
if ($id == 1)
{
comment ('KALIMDOR');
$results = array ();
showSpawnPoints ($results, 'Spawn points — Kalimdor', SPAWNS_CREATURES,
'spawn_id', 'position_x', 'position_y', 'position_z', 'map', 'movement_type', 1);
} // end if Kalimdor
if ($id == 0)
{
comment ('EASTERN KINGDOMS');
$results = array ();
showSpawnPoints ($results, 'Spawn points — Eastern Kingdoms', SPAWNS_CREATURES,
'spawn_id', 'position_x', 'position_y', 'position_z', 'map', 'movement_type', 0);
} // end if Eastern Kingdoms
comment ('END MAP');
endDiv ('caroussel__maps');
echo "</aside>\n";
// endDiv ('object-container page-content');
} // end of mapshowMap
function mapDetails ($info)
{
global $id;
if ($id == 0 || $id == 1)
{
mapshowMap ();
}
bottomSection ($info, function ($info)
{
global $id;
$extras = $info ['extras'];
comment ('MAP DETAILS');
showOneThing (MAP, 'ID', $id, "Map", "Directory", $extras);
});
} // end of mapDetails
function showOneMap ()
{
global $id;
if (($id === false && !repositionSearch()) || !checkID ())
return;
$row = dbQueryOneParam ("SELECT * FROM ".MAP." WHERE ID = ?", array ('i', &$id));
if (!$row)
{
ShowWarning ("Map $id is not on the database");
return;
} // end of not finding it
$name = $row ['Directory'];
setTitle ("Map $name");
$extras = array ('MapName_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, 'Map', $name, 'maps', 'mapDetails', MAP);
} // end of showOneMap
function showMaps ()
{
global $where, $params, $sort_order, $matches;
$sortFields = array (
'ID',
'Directory',
);
setTitle ("Maps listing");
if (!in_array ($sort_order, $sortFields))
$sort_order = 'Directory';
$td = function ($s) use (&$row) { tdx ($row [$s]); };
$headings = array ('ID', 'Name');
$results = setUpSearch ('Maps', $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_map&id=$id$searchURI&pos=$pos&max=$matches'>$id</a>");
tdh ("<a href='?action=show_map&id=$id$searchURI&pos=$pos&max=$matches'>" . fixHTML ($row ['Directory']) . "</a>");
showFilterColumn ($row);
echo "</tr>\n";
}
wrapUpSearch ();
} // end of showMaps
?>