Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pysis868 committed May 12, 2023
2 parents ca0497e + c697231 commit b9d186f
Show file tree
Hide file tree
Showing 52 changed files with 60,598 additions and 17,887 deletions.
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ gem 'standalone_migrations'
# Still relevant as `mysql` is still out-dated/-moded by Ruby 2/4
# Source: https://stackoverflow.com/a/41521197/1091943
gem 'mysql2'

group :development do
gem 'pry-byebug'
# gem 'pry-byebug', require: true
end
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
builder (3.2.4)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.2.2)
crass (1.0.6)
erubi (1.12.0)
Expand All @@ -40,6 +42,12 @@ GEM
nokogiri (1.14.2)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
racc (1.6.2)
rack (2.2.6.4)
rack-test (2.1.0)
Expand Down Expand Up @@ -71,6 +79,8 @@ PLATFORMS

DEPENDENCIES
mysql2
pry
pry-byebug
standalone_migrations

BUNDLED WITH
Expand Down
6 changes: 4 additions & 2 deletions ajax/get_category_tree.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?php
$path = __DIR__;

$path = DIRNAME(__FILE__);
include("$path/../config.php");

$map = $_GET["game"];

$query = 'select *
from ' . $map_prefix . 'marker_category
where parent_id is null
and container_id = ' . $map . '
and visible = 1
and marker_category_type_id <> 3
order by id
';

Expand Down
56 changes: 43 additions & 13 deletions ajax/get_container_name.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,56 @@
<?php
// debug_log("get_container_name START");

$path = __DIR__;
$path = __DIR__;

$game = $_GET["game"];
// debug_log("game: $game");
if(empty($_GET["game"])) {
print(json_encode(array(
"success" => false,
"result" => 'No game parameter given.'
)));

$query = "select name
from " . $map_prefix . "container c
where (c.id = '" . $game . "'
or c.short_name = '" . $game . "')
and c.visible = 1;
";
$result = @$mysqli->query($query);
return 1;
} else {
$game = $_GET["game"];
// debug_log("game: $game");
}

$query = "
SELECT `name`
FROM `${map_prefix}container` `c`
WHERE (
`c`.`id` = '$game'
OR `c`.`short_name` = '$game'
) AND `c`.`visible` = '1'
;
";
// debug_log("query: $query");

$result = @$mysqli->query($query);
// debug_log('mysqli info: '.@$mysqli->info); // Not helpful..

if(!$result) {
print($mysqli->error);
return;
return 2;
}

$row = $result->fetch_array();
echo json_encode(array("success"=>true,"name"=>$row['name']));
$row = $result->fetch_array();
// debug_log("empty(row): ".empty($row));
// debug_log("row: ".var_export($row, 1));
// debug_log("row num_rows: ${$row->num_rows}");
if(empty($row)) {
print(json_encode(array(
"success" => false,
"result" => 'No visible game container found.'
)));

return 3;
}

print(json_encode(array(
"success" => true,
"name" => $row['name']
)));

// debug_log("get_container_name END");
?>
46 changes: 26 additions & 20 deletions ajax/get_markers.php
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
<?php
if (!isset($_GET['newMarkerId'])) {
$path = __DIR__;
}
/*
session_start("zmap");
$query = 'select max(last_updated) as last_updated
if (!isset($_GET['newMarkerId'])) {
$path = __DIR__;
}
/*
session_start("zmap");
$query = 'select max(last_updated) as last_updated
from ' . $map_prefix . 'marker m
, ' . $map_prefix . 'map mp
where m.map_id = mp.id
and mp.container_id = ' . $_GET["game"] . '
and m.last_updated > \'' . $_SESSION["last_updated"] . '\';
';
$result = @$mysqli->query($query) or die(mysql_error());
$result = @$mysqli->query($query) or die(mysql_error());
$row = $mysqli->fetch_array($result, MYSQL_ASSOC);
$row = $mysqli->fetch_array($result, MYSQL_ASSOC);
if ($row['last_updated'] != $_SESSION["last_updated"]
&& $row['last_updated'] != "") {
$temp = $row['last_updated'];
} else {
exit("[]");
}
$_SESSION["last_updated"]
if ($row['last_updated'] != $_SESSION["last_updated"]
&& $row['last_updated'] != "") {
$temp = $row['last_updated'];
} else {
exit("[]");
}
$_SESSION["last_updated"]
*/
$visible = "1";
if (isset($_GET['all']) || (strpos($_SERVER["HTTP_REFERER"], 'grid.html') !== false)) {
$visible = "0,1";
}
$last_update = $temp = '1800-01-01 00:00:00';
$visible = "1";
if (
isset($_GET['all'])
|| (
isset ($_SERVER["HTTP_REFERER"])
&& strpos($_SERVER["HTTP_REFERER"], '/grid.html') !== false
)
) {
$visible = "0,1";
}
$last_update = $temp = '1800-01-01 00:00:00';
$query = "SET SESSION group_concat_max_len = 4294967295";
$result = @$mysqli->query($query);

Expand Down
Loading

0 comments on commit b9d186f

Please sign in to comment.