Skip to content

Commit

Permalink
🐞 fix: Ingame pages not displaying weapon names #32
Browse files Browse the repository at this point in the history
  • Loading branch information
DNA-styx committed Dec 15, 2024
1 parent 1bb0b1e commit 8e8590f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
20 changes: 19 additions & 1 deletion web/pages/ingame/accuracy.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,30 @@
else
list($gamename) = $db->fetch_row();

// Get Weapon Name
$result = $db->query
("
SELECT
hlstats_Weapons.code,
hlstats_Weapons.name
FROM
hlstats_Weapons
WHERE
hlstats_Weapons.game = '$game'
");
while ($rowdata = $db->fetch_row($result))
{
$code = $rowdata[0];
$fname[strToLower($code)] = $rowdata[1];
}

$tblWeaponstats = new Table(
array(
new TableColumn(
'smweapon',
'Weapon',
'width=10&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game=$game")
'width=10&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game=$game"),
$fname
),
new TableColumn(
'smshots',
Expand Down
20 changes: 19 additions & 1 deletion web/pages/ingame/targets.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,30 @@
list($gamename) = $db->fetch_row();
}

// Get Weapon Name
$result = $db->query
("
SELECT
hlstats_Weapons.code,
hlstats_Weapons.name
FROM
hlstats_Weapons
WHERE
hlstats_Weapons.game = '$game'
");
while ($rowdata = $db->fetch_row($result))
{
$code = $rowdata[0];
$fname[strToLower($code)] = $rowdata[1];
}

$tblWeaponstats2 = new Table(
array(
new TableColumn(
'smweapon',
'Weapon',
'width=10&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game=$game")
'width=10&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game=$game"),
$fname
),
new TableColumn(
'smhits',
Expand Down
20 changes: 19 additions & 1 deletion web/pages/ingame/weapons.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,30 @@
list($gamename) = $db->fetch_row();
}

// Get Weapon Name
$result = $db->query
("
SELECT
hlstats_Weapons.code,
hlstats_Weapons.name
FROM
hlstats_Weapons
WHERE
hlstats_Weapons.game = '$game'
");
while ($rowdata = $db->fetch_row($result))
{
$code = $rowdata[0];
$fname[strToLower($code)] = $rowdata[1];
}

$tblWeapons = new Table(
array(
new TableColumn(
'weapon',
'Weapon',
'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game=$game")
'width=15&type=weaponimg&align=center&link=' . urlencode("mode=weaponinfo&weapon=%k&game=$game"),
$fname
),
new TableColumn(
'modifier',
Expand Down

0 comments on commit 8e8590f

Please sign in to comment.