-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwow_alpha_zones.php
91 lines (69 loc) · 2.07 KB
/
wow_alpha_zones.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
<?php
/*
Author: X'Genesis Qhulut <[email protected]>
Date: August 2022
See LICENSE for license details.
*/
// ZONES
function zoneDetails ($info)
{
bottomSection ($info, function ($info)
{
global $id;
$extras = $info ['extras'];
comment ('ZONE DETAILS');
showOneThing (WORLDMAPAREA, 'ID', $id, "Zone", "AreaName", $extras);
});
} // end of zoneDetails
function showOneZone ()
{
global $id;
if (($id === false && !repositionSearch()) || !checkID ())
return;
// we need the item info in this function
$row = dbQueryOneParam ("SELECT * FROM ".WORLDMAPAREA." WHERE ID = ?", array ('i', &$id));
if (!$row)
{
ShowWarning ("Zone $id is not on the database");
return;
} // end of not finding it
$name = $row ['AreaName'];
setTitle ("Zone $name");
$extras = array ('MapID' => 'map');
// 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, 'zones', 'zoneDetails', WORLDMAPAREA);
} // end of showOneZone
function showZones ()
{
global $where, $params, $sort_order, $matches;
$sortFields = array (
'ID',
'AreaName',
'AreaID',
);
if (!in_array ($sort_order, $sortFields))
$sort_order = 'AreaName';
setTitle ("Zones listing");
$td = function ($s) use (&$row) { tdx ($row [$s]); };
$headings = array ('ID', 'Name', 'Area ID');
$results = setUpSearch ('Zones', $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_zone&id=$id$searchURI&pos=$pos&max=$matches'>$id</a>");
tdh ("<a href='?action=show_zone&id=$id$searchURI&pos=$pos&max=$matches'>" . fixHTML ($row ['AreaName']) . "</a>");
$td ('AreaID');
showFilterColumn ($row);
echo "</tr>\n";
}
wrapUpSearch ();
} // end of showZones
?>