Posts: 14 Joined: Sun Jan 16 2011, 05:02PM Registered Member #6517
Hello!
I added another structure database column named "user" but when I add a server from administrator panel and give save the data in column "users" are deleted
Posts: 62 Joined: Fri Mar 04 2011, 08:41AM Registered Member #6619
That is BUG in Admin panel! If you do ANYTHING in Admin panel and click Save *(Keep Cache or Reset Cache)* that will reset your database to default settings and clear any of your added fields to empty value.. just don't use Admin.php from your lgsl and all will be ok! I did recreated Admin panel but in another structure for my gt and I don't have this problem for long time
Posts: 180 Joined: Sun Dec 12 2010, 09:16AM Registered Member #6457
thats true gt unless you also edit lgsl_add.php
for example when I added website column and added by column I had to edit a few areas to get it to keep all
so when a user adds a server he is asked in lgsl form for his name and website address. this is added to lgsl database and also shows in admin panel. gets tricky the more you want to modify.
require "lgsl_class.php";
include "logged_username2.php";
//-----------------------------------------------------------------------------------------------------------+
// will warn if public adding is disabled
if (!$lgsl_config['public_add'])
{
$output .= "
<div style='text-align:center;".lgsl_bg()."'>
<br />
{$lgsl_config['text']['asd']} <br />
<br />
</div>";
<tr style='".lgsl_bg()."'>
<td> {$lgsl_config['text']['svrname']} </td>
<td> <input type='text' name='form_comment' value='".lgsl_string_html($comment)."' size='40' maxlength='128' /> DO NOT use symbols for colored names</td>
</tr>
<tr style='".lgsl_bg()."'>
<td> {$lgsl_config['text']['adr']} </td>
<td> <input type='text' name='form_ip' value='".lgsl_string_html($ip)."' size='15' maxlength='128' /> game server ip (format = xxx.xxx.xxx.xxx)</td>
</tr>
<tr style='".lgsl_bg()."'>
<td> {$lgsl_config['text']['cpt']} </td>
<td> <input type='text' name='form_c_port' value='".lgsl_string_html($c_port)."' size='5' maxlength='5' /> Suggested for AA2: 1716 or 1916</td>
</tr>
<tr style='".lgsl_bg()."'>
<td> {$lgsl_config['text']['qpt']} </td>
<td> <input type='text' name='form_q_port' value='".lgsl_string_html($q_port)."' size='5' maxlength='5' /> Suggested for AA2: 1717 or 7778</td>
</tr>
<tr style='".lgsl_bg()."'>
<td> {$lgsl_config['text']['ynm']} </td>
<td> <input type='text' name='form_yourname' value='".lgsl_string_html($yourname)."' size='15' maxlength='50' /> Enter your name (your IP is {$_SERVER['REMOTE_ADDR']}) </td>
</tr>
<tr style='".lgsl_bg()."'>
<td> {$lgsl_config['text']['ysite']} </td>
<td> <input type='text' name='form_yoursite' value='".lgsl_string_html($yoursite)."' size='15' maxlength='50' /> Enter your web site (will link to your site from tracker, format = your-site.com/) </td>
</tr>
<tr style='".lgsl_bg()."'>
<td colspan='2' style='text-align:center'>
<br />ALL FIELDS MUST BE FILLED IN WITH VALID DATA OR SERVER WILL BE REJECTED BY ADMIN<br /><br />
<input type='submit' name='lgsl_submit_test' value='{$lgsl_config['text']['ats']}'> <a href='javascript:history.go(-1)'><img src='../../../images/back_button_color.gif'>
<br />
<br />
</td>
</tr>
$ip_check = gethostbyname($ip);
$mysql_result = mysql_query("SELECT `ip`,`disabled` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `type`='{$type}' AND `q_port`='{$q_port}'");
while ($mysql_row = mysql_fetch_array($mysql_result, MYSQL_ASSOC))
{
if ($ip_check == gethostbyname($mysql_row['ip']))
{
$output .= "
<div style='text-align:center;".lgsl_bg()."'>
<br />";
Posts: 180 Joined: Sun Dec 12 2010, 09:16AM Registered Member #6457
I correct myself
the user name is added to a text file that is written to when a user adds a server. It also gives me their ip and date and time, name of server, server ip and all that so I know who added what. but the website addy is in admin panel
The purpose of the website is so that user click the server name in the tracker and go to that clans website.
Posts: 62 Joined: Fri Mar 04 2011, 08:41AM Registered Member #6619
My gt is a real gametracker with server rank, players statistic, player banner, community's (with stats), server ownership confirm sistem (Gametracker(userid) for server name), so that simple lgsl Admin panel isn't the solution for me, it has 10 pages for now
if (!function_exists("fsockopen") && !$lgsl_config['feed']['method'])
{
if ((function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec")))
{
$output = "<div style='text-align:center'><br /><br /><b>FSOCKOPEN IS DISABLED - YOU MUST ENABLE THE FEED OPTION</b><br /><br /></div>".lgsl_help_info(); return;
}
else
{
$output = "<div style='text-align:center'><br /><br /><b>FSOCKOPEN AND CURL ARE DISABLED - LGSL WILL NOT WORK ON THIS HOST</b><br /><br /></div>".lgsl_help_info(); return;
}
}
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]);
// CACHE INDEXED BY TYPE:IP:Q_PORT SO IF THEY CHANGE THE CACHE IS IGNORED
list($status, $cache, $cache_time) = isset($db["{$type}:{$ip}:{$q_port}"]) ? $db["{$type}:{$ip}:{$q_port}"] : array("0", "", "");
// 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]; }
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 .= "
<form method='post' action=''>
<div style='text-align:center'>
<b>TYPE : IP : C PORT : Q PORT : S PORT : ZONES : DISABLED : COMMENT</b>
<br />
<br />
</div>
<div style='text-align:center'>
<textarea name='form_list' cols='90' rows='30' wrap='off' spellcheck='false' style='width:95%; height:500px; font-size:1.2em; font-family:courier new, monospace'>\r\n";
//---------------------------------------------------------+
$mysql_result = mysql_query("SELECT * FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` ORDER BY `id` ASC");
$last_type = $mysql_row['type']; // SET LAST TYPE ( $mysql_row EXISTS ONLY WITHIN THE LOOP )
}
//---------------------------------------------------------+
$id ++; // NEW SERVER ID CONTINUES ON FROM LAST
function lgsl_help_info()
{
return "
<div style='text-align:center; line-height:1em; font-size:1em;'>
<br /><br />
<a href='http://www.greycube.com/help/readme/lgsl/'>[ LGSL ONLINE README ]</a> <br /><br />
- To remove a server, delete the IP, then click Save. <br /><br />
- Leave the query port blank to have LGSL try to fill it in for you. <br /><br />
- Software port is only needed for a few games so it being set 0 is normal. <br /><br />
- Edit the lgsl_config.php to set the background colors and other options. <br /><br />
<table cellspacing='10' cellpadding='0' style='border:1px solid; margin:auto; text-align:left'>
<tr>
<td> <a href='http://php.net/fsockopen'>FSOCKOPEN</a> </td>
<td> Enabled: ".(function_exists("fsockopen") ? "YES" : "NO")." </td>
<td> ( Required for direct querying of servers ) </td>
</tr>
<tr>
<td> <a href='http://php.net/curl'>CURL</a> </td>
<td> Enabled: ".((function_exists("curl_init") && function_exists("curl_setopt") && function_exists("curl_exec")) ? "YES" : "NO")." </td>
<td> ( Used for the feed when fsockopen is disabled ) </td>
</tr>
<tr>
<td> <a href='http://php.net/mbstring'>MBSTRING</a> </td>
<td> Enabled: ".(function_exists("mb_convert_encoding") ? "YES" : "NO")." </td>
<td> ( Used to show UTF-8 server and player names correctly ) </td>
</tr>
<tr>
<td> <a href='http://php.net/bzip2'>BZIP2</a> </td>
<td> Enabled: ".(function_exists("bzdecompress") ? "YES" : "NO")." </td>
<td> ( Used to show Source server settings over a certain size ) </td>
</tr>
<tr>
<td> <a href='http://php.net/zlib'>ZLIB</a> </td>
<td> Enabled: ".(function_exists("gzuncompress") ? "YES" : "NO")." </td>
<td> ( Required for America's Army 3 ) </td>
</tr>
</table>
<br /><br />
<br /><br />
</div>";
}