Skip to content

Commit

Permalink
Remove spacer lines
Browse files Browse the repository at this point in the history
  • Loading branch information
tltneon committed Apr 19, 2024
1 parent aa763ed commit 3759e13
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 80 deletions.
23 changes: 2 additions & 21 deletions src/lgsl_add.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@
| |
\-----------------------------------------------------------------------------------------------------------*/

//------------------------------------------------------------------------------------------------------------+

require "lgsl_class.php";
global $output;

//-----------------------------------------------------------------------------------------------------------+

if ($lgsl_config['public_add']) {

//-----------------------------------------------------------------------------------------------------------+

$lgsl_type_list = Protocol::lgsl_type_list();
unset($lgsl_type_list['test']);

Expand All @@ -39,8 +32,6 @@

list($c_port, $q_port, $s_port) = Protocol::lgsl_port_conversion($type, $c_port, $q_port, $s_port);

//-----------------------------------------------------------------------------------------------------------+

$output .= "
<form method='post' action='{$url}'>
<div>
Expand All @@ -59,12 +50,12 @@
<td> {$lgsl_config['text']['typ']} </td>
<td>
<select name='form_type'>";
//---------------------------------------------------------+

foreach ($lgsl_type_list as $key => $value) {
$output .= "
<option ".($key == $type ? "selected='selected'" : "")." value='{$key}'> {$value} </option>";
}
//---------------------------------------------------------+

$output .= "
</select>
</td>
Expand Down Expand Up @@ -101,14 +92,11 @@
</div>
</form>";

//-----------------------------------------------------------------------------------------------------------+

if (isset($_POST['lgsl_submit_test']) || isset($_POST['lgsl_submit_add'])) {
if (isset($lgsl_type_list[$type]) && $ip && $c_port && $q_port) {
if ($type === "discord") {$c_port = 1; $q_port = 1;}

//-----------------------------------------------------------------------------------------------------------+

$db = LGSL::db();

$ip = $db->escape_string($ip);
Expand All @@ -117,8 +105,6 @@
$s_port = $db->escape_string($s_port);
$type = $db->escape_string($type);

//-----------------------------------------------------------------------------------------------------------+

$ip_check = gethostbyname($ip);
$mysql_query = $db->query("SELECT `ip`,`disabled` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE (`ip`='{$ip}' OR `ip`='$ip_check') AND `q_port`='{$q_port}'", true);
if ($mysql_query) {
Expand All @@ -135,13 +121,10 @@
</div>";
} else {

//-----------------------------------------------------------------------------------------------------------+

$server = new Server(["type" => $type, "ip" => $ip, "c_port" => $c_port, "q_port" => $q_port, "s_port" => $s_port]);
$server->lgsl_live_query("s");

if ($server->get_status() != Server::OFFLINE) {
//-----------------------------------------------------------------------------------------------------------+

if (!empty($_POST['lgsl_submit_add'])) {
$disabled = ($lgsl_config['public_add'] == "2") ? "0" : "1";
Expand All @@ -166,8 +149,6 @@
</div>";
} else {

//-----------------------------------------------------------------------------------------------------------+

$output .= "
<form method='post' action=''>
<div class='annotation'> {$lgsl_config['text']['asc']} </div>
Expand Down
6 changes: 0 additions & 6 deletions src/lgsl_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@
| |
\-----------------------------------------------------------------------------------------------------------*/

//------------------------------------------------------------------------------------------------------------+
//------------------------------------------------------------------------------------------------------------+

if (!function_exists('lgsl_url_path')) { // START OF DOUBLE LOAD PROTECTION

//------------------------------------------------------------------------------------------------------------+
//------------------------------------------------------------------------------------------------------------+
class LGSL {
const NONE = "--";
const VERSION = "7.0.0";
Expand Down
11 changes: 0 additions & 11 deletions src/lgsl_cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
| |
\-----------------------------------------------------------------------------------------------------------*/

//------------------------------------------------------------------------------------------------------------+

require "lgsl_class.php";

$db = LGSL::db();

//------------------------------------------------------------------------------------------------------------+
Expand All @@ -22,12 +19,8 @@
$lgsl_config['cache_time'] = 60; // HOW OLD CACHE MUST BE BEFORE IT NEEDS REFRESHING
$request = "seph"; // WHAT TO PRE-CACHE: [s] = BASIC INFO [e] = SETTINGS [p] = PLAYERS [h] = HISTORY

//------------------------------------------------------------------------------------------------------------+

echo "<pre>STARTING [ TIME LIMIT: ".ini_get("max_execution_time")." ] [ CACHE TIME: {$lgsl_config['cache_time']} ]\r\n\r\n";

//------------------------------------------------------------------------------------------------------------+

$db_query = "SELECT `type`,`ip`,`c_port`,`q_port`,`s_port` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `disabled`= 0 ORDER BY `cache_time` ASC;";
$db_result = $db->query($db_query);

Expand All @@ -46,8 +39,4 @@
ob_flush();
}

//------------------------------------------------------------------------------------------------------------+

echo "\r\nFINISHED</pre>";

//------------------------------------------------------------------------------------------------------------+
6 changes: 0 additions & 6 deletions src/lgsl_details.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
//$server = lgsl_sort_players($server->get_players());
//$server = lgsl_sort_extras($server->get_extras());

//------------------------------------------------------------------------------------------------------------+

$output .= "
<div style='margin:auto; text-align:center'>
<div class='spacer'></div>";
Expand Down Expand Up @@ -180,8 +178,6 @@
$output .= "
</div>";

//------------------------------------------------------------------------------------------------------------+

$output .= "<div class='spacer'></div>";

//------------------------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -230,8 +226,6 @@
}
}

//------------------------------------------------------------------------------------------------------------+

$output .= "<div class='spacer'></div>";

$output .= "
Expand Down
12 changes: 0 additions & 12 deletions src/lgsl_export.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
| |
\-----------------------------------------------------------------------------------------------------------*/

//------------------------------------------------------------------------------------------------------------+

require "lgsl_class.php";

$db = LGSL::db();
//------------------------------------------------------------------------------------------------------------+

$json = empty($_GET['json']) ? FALSE : TRUE;
$xml = empty($_GET['xml']) ? FALSE : TRUE;
$online = empty($_GET['online']) ? FALSE : TRUE;
Expand All @@ -24,8 +19,6 @@
$sort = empty($_GET['sort']) ? FALSE : $_GET['sort'];
$randomzones = empty($_GET['randomzones']) ? FALSE : intval($_GET['randomzones']);

//------------------------------------------------------------------------------------------------------------+

$output = "";
$db_filter = "";
$db_where = [];
Expand All @@ -39,8 +32,6 @@
elseif ($sort === "type") { $db_filter .= " ORDER BY `type` ASC"; }
else { $db_filter .= " ORDER BY `id` ASC"; }

//------------------------------------------------------------------------------------------------------------+

$db_result = $db->query("SELECT * FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` {$db_filter}");

foreach ($db_result as $db_row) {
Expand Down Expand Up @@ -73,8 +64,6 @@
}
}

//------------------------------------------------------------------------------------------------------------+

if ($json) {
$output = json_encode($jsarray);
}
Expand All @@ -93,7 +82,6 @@
exit;
}

//------------------------------------------------------------------------------------------------------------+
?>
<!DOCTYPE html>

Expand Down
8 changes: 0 additions & 8 deletions src/lgsl_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
| |
\-----------------------------------------------------------------------------------------------------------*/

//------------------------------------------------------------------------------------------------------------+

require "lgsl_class.php";

//------------------------------------------------------------------------------------------------------------+

$type = $_GET['type'] ?? "";
$ip = $_GET['ip'] ?? "";
$request = $_GET['request'] ?? "sc";
Expand All @@ -24,7 +19,6 @@
$xml = intval($_GET['xml'] ?? 0);
$format = intval($_GET['format'] ?? 0);

//------------------------------------------------------------------------------------------------------------+
// VALIDATE REQUEST

if (!$type && !$ip && $lgsl_config['api']) {
Expand Down Expand Up @@ -155,5 +149,3 @@
}

echo "</server>\r\n";

//------------------------------------------------------------------------------------------------------------+
4 changes: 0 additions & 4 deletions src/lgsl_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
}

$server_list = Database::get_servers_group(["type" => $type, "game" => $game, "mode" => $mode, "page" => $page, "sort" => $sort, "order" => $order]);

//------------------------------------------------------------------------------------------------------------+
$servers = count($server_list);
if ($servers == 0 && $page < 2) {
$output .= "<div id='back_to_servers_list'><a href='./admin.php'>ADD YOUR FIRST SERVER</a></div>";
Expand Down Expand Up @@ -134,8 +132,6 @@
";
}

//------------------------------------------------------------------------------------------------------------+

if ($lgsl_config['list']['totals']) {
$total = LGSL::groupTotals();

Expand Down
12 changes: 0 additions & 12 deletions src/lgsl_zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
| |
\-----------------------------------------------------------------------------------------------------------*/

//------------------------------------------------------------------------------------------------------------+

global $lgsl_config, $lgsl_zone_number;
$lgsl_zone_number = $_GET['zone'] ?? null;
$ip = $_GET['ip'] ?? null;
Expand All @@ -26,8 +24,6 @@
$zone_count = 0;
$output = '';

//------------------------------------------------------------------------------------------------------------+

$request = empty($lgsl_config['players'][$lgsl_zone_number]) ? "s" : "sp";
if ($lgsl_zone_number) {
$server_list = Database::get_servers_group(["request"=>$request, "zone"=>$lgsl_zone_number]);
Expand All @@ -37,14 +33,10 @@
}
//$server_list = lgsl_sort_servers($server_list);

//------------------------------------------------------------------------------------------------------------+

if (!$server_list) {
$output .= "<div style='margin:auto; text-align:center'>NO SERVERS IN ZONE {$lgsl_zone_number}</div>"; return;
}

//------------------------------------------------------------------------------------------------------------+

$output .= "
<link rel='stylesheet' href='other/_lgsl_locations.css' type='text/css' />
<style>
Expand Down Expand Up @@ -101,15 +93,13 @@

foreach ($server_list as $server) {

//------------------------------------------------------------------------------------------------------------+
if ($zone_count != 0 && !($zone_count % $zone_grid)) {
$output .= "
</tr>
<tr>";
}

$zone_count ++;
//------------------------------------------------------------------------------------------------------------+

$marquee = strlen($server->get_name()) > 25 ? "class='on'" : "";
$output .= "
Expand Down Expand Up @@ -210,8 +200,6 @@
</tr>
</table>";

//------------------------------------------------------------------------------------------------------------+

if ($lgsl_config['preloader']) {
echo $output;
}

0 comments on commit 3759e13

Please sign in to comment.