FSOCKOPEN IS DISABLED - YOU MUST ENABLE THE FEED OPTION

".lgsl_help_info(); return; } else { $output = "


FSOCKOPEN AND CURL ARE DISABLED - LGSL WILL NOT WORK ON THIS HOST

".lgsl_help_info(); return; } } //------------------------------------------------------------------------------------------------------------+ if ($_POST && get_magic_quotes_gpc()) { $_POST = lgsl_stripslashes_deep($_POST); } //------------------------------------------------------------------------------------------------------------+ if (!empty($_POST['lgsl_save_1']) || !empty($_POST['lgsl_save_2'])) { if (!empty($_POST['lgsl_save_1'])) { // LOAD SERVER CACHE INTO MEMORY $results = $db->resultQuery("SELECT * FROM `OGP_DB_PREFIXlgsl`"); foreach($results as $row) { $servers["{$row['type']}:{$row['ip']}:{$row['q_port']}"] = array($row['status'], $row['cache'], $row['cache_time']); } } // EMPTY SQL TABLE $db->query("TRUNCATE `OGP_DB_PREFIXlgsl`"); // CONVERT ADVANCED TO NORMAL DATA FORMAT if (!empty($_POST['lgsl_management'])) { $form_lines = preg_split('/\r?\n|\r|(\\\r)?\\\n|\\\r/', $_POST['form_list']); foreach ($form_lines as $form_key => $form_line) { list($_POST['form_type'] [$form_key], $_POST['form_ip'] [$form_key], $_POST['form_c_port'] [$form_key], $_POST['form_q_port'] [$form_key], $_POST['form_s_port'] [$form_key], $_POST['form_zone'] [$form_key], $_POST['form_disabled'][$form_key], $_POST['form_comment'] [$form_key]) = explode(":", "{$form_line}:::::::"); } } foreach ($_POST['form_type'] as $form_key => $not_used) { // COMMENTS LEFT IN THEIR NATIVE ENCODING WITH JUST HTML SPECIAL CHARACTERS CONVERTED $_POST['form_comment'][$form_key] = lgsl_htmlspecialchars($_POST['form_comment'][$form_key]); $type = $db->real_escape_string( strtolower(trim($_POST['form_type'] [$form_key]))); $ip = $db->real_escape_string( trim($_POST['form_ip'] [$form_key])); $c_port = $db->real_escape_string( intval(trim($_POST['form_c_port'] [$form_key]))); $q_port = $db->real_escape_string( intval(trim($_POST['form_q_port'] [$form_key]))); $s_port = $db->real_escape_string( intval(trim($_POST['form_s_port'] [$form_key]))); $zone = $db->real_escape_string( trim($_POST['form_zone'] [$form_key])); $disabled = isset($_POST['form_disabled'][$form_key])? intval(trim($_POST['form_disabled'][$form_key])) : "0"; $comment = $db->real_escape_string( trim($_POST['form_comment'] [$form_key])); // CACHE INDEXED BY TYPE:IP:Q_PORT SO IF THEY CHANGE THE CACHE IS IGNORED list($status, $cache, $cache_time) = isset($servers["{$type}:{$ip}:{$q_port}"]) ? $servers["{$type}:{$ip}:{$q_port}"] : array("0", "", ""); $status = $db->real_escape_string($status); $cache = $db->real_escape_string($cache); $cache_time = $db->real_escape_string($cache_time); // THIS PREVENTS PORTS OR WHITESPACE BEING PUT IN THE IP WHILE ALLOWING IPv6 if (preg_match("/(\[[0-9a-z\:]+\])/iU", $ip, $match)) { $ip = $match[1]; } elseif (preg_match("/([0-9a-z\.\-]+)/i", $ip, $match)) { $ip = $match[1]; } list($c_port, $q_port, $s_port) = lgsl_port_conversion($type, $c_port, $q_port, $s_port); // DISCARD SERVERS WITH AN EMPTY IP AND AUTO DISABLE SERVERS WITH SOMETHING WRONG if (!$ip) { continue; } elseif ($c_port < 1 || $c_port > 99999) { $disabled = 1; $c_port = 0; } elseif ($q_port < 1 || $q_port > 99999) { $disabled = 1; $q_port = 0; } elseif (!isset($lgsl_protocol_list[$type])) { $disabled = 1; } $db->query("INSERT INTO `OGP_DB_PREFIXlgsl` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`zone`,`disabled`,`comment`,`status`,`cache`,`cache_time`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','{$zone}','{$disabled}','{$comment}','{$status}','{$cache}','{$cache_time}')"); } } //------------------------------------------------------------------------------------------------------------+ if (!empty($_POST['lgsl_map_image_paths'])) { $server_list = lgsl_query_cached_all("s"); foreach ($server_list as $server) { if (!$server['b']['status']) { continue; } $image_map = lgsl_image_map($server['b']['status'], $server['b']['type'], $server['s']['game'], $server['s']['map'], FALSE); $output .= "
{$image_map}
"; } $output .= "




"; return; } //------------------------------------------------------------------------------------------------------------+ if ((!empty($_POST['lgsl_management']) && empty($_POST['lgsl_switch'])) || (empty($_POST['lgsl_management']) && !empty($_POST['lgsl_switch'])) || (!isset($_POST['lgsl_management']) && $lgsl_config['management'])) { $output .= "
TYPE : IP : C PORT : Q PORT : S PORT : ZONES : DISABLED : COMMENT

"; $output .= lgsl_help_info(); return $output; } //------------------------------------------------------------------------------------------------------------+ $output .= "
"; //---------------------------------------------------------+ $result = $db->resultQuery("SELECT * FROM `OGP_DB_PREFIXlgsl` ORDER BY `id` ASC"); foreach($result as $row) { $id = $row['id']; // ID USED AS [] ONLY RETURNS TICKED CHECKBOXES $output .= " "; $last_type = $row['type']; // SET LAST TYPE ( $row EXISTS ONLY WITHIN THE LOOP ) } //---------------------------------------------------------+ $id ++; // NEW SERVER ID CONTINUES ON FROM LAST $output .= "
[ ID ] [ Game Type ] [ IP ] [ Connection Port ] [ Query Port ] [ Software Port ] [ Zones ] [ Disabled ] [ Comment ]
{$id}
NEW
"; $output .= lgsl_help_info(); //------------------------------------------------------------------------------------------------------------+ function lgsl_help_info() { return "


[ LGSL ONLINE README ]

- To remove a server, delete the IP, then click Save.

- Leave the query port blank to have LGSL try to fill it in for you.

- Software port is only needed for a few games so it being set 0 is normal.

- Edit the lgsl_config.php to set the background colors and other options.

FSOCKOPEN Enabled: ".(function_exists("fsockopen") ? "YES" : "NO")." ( Required for direct querying of servers )
CURL Enabled: ".((function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec")) ? "YES" : "NO")." ( Used for the feed when fsockopen is disabled )
MBSTRING Enabled: ".(function_exists("mb_convert_encoding") ? "YES" : "NO")." ( Used to show UTF-8 server and player names correctly )
BZIP2 Enabled: ".(function_exists("bzdecompress") ? "YES" : "NO")." ( Used to show Source server settings over a certain size )
ZLIB Enabled: ".(function_exists("gzuncompress") ? "YES" : "NO")." ( Required for America's Army 3 )




"; } //------------------------------------------------------------------------------------------------------------+ function lgsl_stripslashes_deep($value) { $value = is_array($value) ? array_map('lgsl_stripslashes_deep', $value) : stripslashes($value); return $value; } //------------------------------------------------------------------------------------------------------------+ function lgsl_htmlspecialchars($string) { // PHP4 COMPATIBLE WAY OF CONVERTING SPECIAL CHARACTERS WITHOUT DOUBLE ENCODING EXISTING ENTITIES $string = str_replace("\x05\x06", "", $string); $string = preg_replace("/&([a-z\d]{2,7}|#\d{2,5});/i", "\x05\x06$1", $string); $string = htmlspecialchars($string, ENT_QUOTES); $string = str_replace("\x05\x06", "&", $string); return $string; } //------------------------------------------------------------------------------------------------------------+