Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 17

117.191.x.x log
117.191.x.x forum
129.205.x.x forum
216.244.x.x forum
3.17.x.x news
3.80.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
5.255.x.x forum
78.46.x.x user

Last Seen

mrstipfan Wed 19:48
Gagi2 Mon 16:30
EFiNST0RM Sun 15:39
85filip58 Sun 12:14
brlight Tue 04:18

Newest Members

Forums
online or offline check ?
lqlqlq
Sun Jul 24 2011, 03:24AM
Posts: 22
Joined: Fri Apr 29 2011, 11:18AM
Registered Member #6716
Anytime this code shows servers offline, please help.
echo"
<tr style='background: url(../images/list-tail-2.gif); border:1px solid #000000;'>
<td>
<span style='color: "; if($misc['text_status'] == "Online") { echo "green"; } else { echo "red"; } echo "; font-weight: bold;'>".htmlspecialchars(addslashes($server['s']['name']))."</span>
<br />
<span style='font-size: 11px;'>{$server['b']['ip']}:{$server['b']['c_port']}</span>
</td>
<td style='text-align: center; border:1px solid #000000;'>
<a href='serverlist.php?cat=$row[server_type]'>$row[server_type]</a>
</td>
<td style='text-align: center; border:1px solid #000000;'>
<a href='http://www.gametracker.com/server_info/{$server['b']['ip']}:{$server['b']['c_port']}/' target='_blank'>Инфо</a>
</td>
<td style='text-align: center; border:1px solid #000000;'>
<span style='color: "; if($misc['text_status'] == "Online") { echo "green"; } else { echo "red"; } echo "; font-weight: bold;'> "; if($misc['text_status'] == "Online") { echo "{$server['s']['players']} / {$server['s']['playersmax']}"; } else { echo "0 / 0"; } echo "</span>
</td>
</tr>";
KIKOFF
Sun Jul 24 2011, 10:07AM

Posts: 132
Joined: Thu Nov 18 2010, 08:18AM
Registered Member #6411
What version is this?

Tets with this:

if($misc['text_status'] == 'ONLINE'){$misc['text_status'] = '<font color="green">ONLINE</font>';}
if($misc['text_status'] == 'OFFLINE'){$misc['text_status'] = '<font color="red">OFFLINE</font>';}


Or with this:

if($misc['text_status'] == 'Online'){$misc['text_status'] = '<font color="green">Online</font>';}
if($misc['text_status'] == 'Offline'){$misc['text_status'] = '<font color="red">Offline</font>';}


Lo cortez, no quita lo valiente... ahhh... yes e107 Rock
lqlqlq
Sun Jul 24 2011, 10:31AM
Posts: 22
Joined: Fri Apr 29 2011, 11:18AM
Registered Member #6716
lgsl 5.8, dont work with your code's..
When i remove one of = - work (show as green text), but not show when server is offline (red color)...
KIKOFF
Sun Jul 24 2011, 10:51AM

Posts: 132
Joined: Thu Nov 18 2010, 08:18AM
Registered Member #6411
It must be with '==' ...
Work for me, test with code above and for <td> use this:

<td>
{$misc['text_status']}
</td>


Lo cortez, no quita lo valiente... ahhh... yes e107 Rock
lqlqlq
Sun Jul 24 2011, 10:55AM
Posts: 22
Joined: Fri Apr 29 2011, 11:18AM
Registered Member #6716
Yeah, show it "online", but... i dont know where is the problem.
KIKOFF
Sun Jul 24 2011, 10:59AM

Posts: 132
Joined: Thu Nov 18 2010, 08:18AM
Registered Member #6411
Is the SA version of LGSL?

Tets with this:

if($misc['text_status'] == 'ONLINE'){$misc['text_status'] = '<font color="green">ONLINE</font>';}
if($misc['text_status'] == 'NO RESPONSE'){$misc['text_status'] = '<font color="red">OFFLINE</font>';} 


Lo cortez, no quita lo valiente... ahhh... yes e107 Rock
lqlqlq
Sun Jul 24 2011, 12:07PM
Posts: 22
Joined: Fri Apr 29 2011, 11:18AM
Registered Member #6716
i use SA, the codes not work.
Exampe:
if($misc['text_status'] == 'Online') {$misc['text_status'] = 'green';} else { echo"red"; }

Show only red color...
KIKOFF
Sun Jul 24 2011, 12:31PM

Posts: 132
Joined: Thu Nov 18 2010, 08:18AM
Registered Member #6411
The code that I have set before, it works ... I have no idea, that does not work for you.



Saludos, KIKOFF

Lo cortez, no quita lo valiente... ahhh... yes e107 Rock
KIKOFF
Sun Jul 24 2011, 12:33PM

Posts: 132
Joined: Thu Nov 18 2010, 08:18AM
Registered Member #6411
Have you tried using the word "ONLINE"

if($misc['text_status'] == 'ONLINE') {$misc['text_status'] = 'green';} else { echo"red"; }


Lo cortez, no quita lo valiente... ahhh... yes e107 Rock
lqlqlq
Sun Jul 24 2011, 12:43PM
Posts: 22
Joined: Fri Apr 29 2011, 11:18AM
Registered Member #6716
Yes i try this way.

Here is more code :
<?php
define("inc", true);
include "smsserv/includes/config.php";
?>

<table width="100%" border="1" style="border:1px solid #000000; border-collapse:collapse; font-family: Verdana; font-size: 12px;">
<tr style="background: url(../images/footer.gif);">
<td style="border:1px solid #000000;"><div align="center">Име и IP</div></td>
<td style="border:1px solid #000000;"><div align="center">Тип</div></td>
<td style="border:1px solid #000000;"><div align="center">GameTracker</div></td>
<td style="border:1px solid #000000;"><div align="center">Играчи</div></td>
</tr>
<?php
$category = addslashes(htmlspecialchars($_GET['cat']));
$time = time();
if($category) {
$sql = "SELECT * FROM `$table` WHERE expired>$time AND server_type='$category' ORDER BY `id` DESC";
}
else {
$sql = "SELECT * FROM `$table` WHERE expired>$time ORDER BY `id` DESC";
}
$result = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($result) == 0) {
echo "<center><b>Все още няма добавени сървъри!<br />Добави твоят сървър от <a href='http://cs-phenomsquad.com/addserver.php' title='добави сървър чрез sms' target='top'>тук</a></b></center>";
}
else {
while($row = mysql_fetch_assoc($result)) {
//------------------------------------------------------------------------------------------------------------+
// THIS CONTROLS HOW THE PLAYER FIELDS ARE DISPLAYED

$fields_show = array("name", "score", "kills", "deaths", "team", "ping", "bot", "time"); // ORDERED FIRST
$fields_hide = array("teamindex", "pid", "pbguid"); // REMOVED
$fields_other = TRUE; // FALSE TO ONLY SHOW FIELDS IN $fields_show

//------------------------------------------------------------------------------------------------------------+
// GET THE SERVER DETAILS AND PREPARE IT FOR DISPLAY

$server = lgsl_query_cached("", "", "", "", "", "sep", $row[id]);
$fields = lgsl_sort_fields($server, $fields_show, $fields_hide, $fields_other);
$server = lgsl_sort_players($server);
$server = lgsl_sort_extras($server);
$misc = lgsl_server_misc($server);
$server = lgsl_server_html($server);

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


echo"
<tr style='background: url(../images/list-tail-2.gif); border:1px solid #000000;'>
<td>
<span style='color: "; if($misc['text_status'] == 'Online') {$misc['text_status'] = 'green';} else { echo"red"; } echo "; font-weight: bold;'>".htmlspecialchars(addslashes($server['s']['name']))."</span>
<br />
<span style='font-size: 11px;'>{$server['b']['ip']}:{$server['b']['c_port']}</span>
</td>
<td style='text-align: center; border:1px solid #000000;'>
<a href='serverlist.php?cat=$row[server_type]'>$row[server_type]</a>
</td>
<td style='text-align: center; border:1px solid #000000;'>
<a href='http://www.gametracker.com/server_info/{$server['b']['ip']}:{$server['b']['c_port']}/' target='_blank'>Инфо</a>
</td>
<td style='text-align: center; border:1px solid #000000;'>
<span style='color: "; if($misc['text_status'] == "Online") { echo "green"; } else { echo "red"; } echo "; font-weight: bold;'> "; if($misc['text_status'] == "Online") { echo "{$server['s']['players']} / {$server['s']['playersmax']}"; } else { echo "0 / 0"; } echo "</span>
</td>
</tr>";
}
}
?>
</table>
»Stefan
Tue Jul 26 2011, 07:34AM
Posts: 210
Joined: Fri Feb 05 2010, 03:56PM
Registered Member #5774
check this

<span style='color: if($misc['text_status'] == "Online") { echo "green"; } else { echo "red"; }; font-weight: bold;'>".htmlspecialchars(addslashes($server['s']['name']))."</span>


We work for new version 2017

Coming SOON
https://www.youtube.com/watch?v=Mi1Po0_Rraw
lqlqlq
Tue Jul 26 2011, 01:41PM
Posts: 22
Joined: Fri Apr 29 2011, 11:18AM
Registered Member #6716
Thanks, but not work:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/csgigaby/public_html/smsserv/slist.php on line 53
xMin
Tue Jul 26 2011, 02:57PM
Posts: 86
Joined: Fri Mar 04 2011, 08:41AM
Registered Member #6619
Hi, lqlqlq

Send me on PM complete code of page where you want that and I will fix that for you! And send me the //[ TRANSLATION ] part from lgsl_config.php
Mac[PLATOoN]
Wed Jul 27 2011, 01:55AM
Posts: 75
Joined: Sun Nov 21 2010, 09:37AM
Registered Member #6416
well i had some similar problems before too. In my case it must have to do with latest lgsl_protocol.php. With version v5.8 our server are always shown offline when some players are in. It only works when server is empty. changing back to lgsl_protocol.php version 5.7 fixed this issue... i already had taken a look at newer version but i cant find the failure..... maybe this is something similar?

KIKOFF
Wed Jul 27 2011, 06:07AM

Posts: 132
Joined: Thu Nov 18 2010, 08:18AM
Registered Member #6411
lqlqlq wrote ...

Yes i try this way.

Here is more code :
<?php
define("inc", true);
include "smsserv/includes/config.php";
?>

<table width="100%" border="1" style="border:1px solid #000000; border-collapse:collapse; font-family: Verdana; font-size: 12px;">
<tr style="background: url(../images/footer.gif);">
<td style="border:1px solid #000000;"><div align="center">Име и IP</div></td>
<td style="border:1px solid #000000;"><div align="center">Тип</div></td>
<td style="border:1px solid #000000;"><div align="center">GameTracker</div></td>
<td style="border:1px solid #000000;"><div align="center">Играчи</div></td>
</tr>
<?php
$category = addslashes(htmlspecialchars($_GET['cat']));
.................



This code is not the "LGSL SA" or another cms variation. It seems some mod like redacid...

Lo cortez, no quita lo valiente... ahhh... yes e107 Rock
»Stefan
Sat Jul 30 2011, 03:20PM
Posts: 210
Joined: Fri Feb 05 2010, 03:56PM
Registered Member #5774
<span style='color: <? if($misc['text_status'] == "Online") { echo "green"; } else { echo "red"; }?>; font-weight: bold;'>".htmlspecialchars(addslashes($server['s']['name']))."</span>


We work for new version 2017

Coming SOON
https://www.youtube.com/watch?v=Mi1Po0_Rraw
 

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org