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

Guests: 14

157.55.x.x dilbertplus
163.172.x.x download
164.132.x.x download
207.46.x.x dilbertplus
217.69.x.x news
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x forum
46.229.x.x forum
5.255.x.x forum
54.225.x.x forum
68.180.x.x forum

Last Seen

Dodgeitorelse Thu 16:19
Wussie Thu 12:55
reegad Wed 13:18
Nazari Tue 01:24
jimmyjames1987 Mon 18:00

Newest Members

Forums
code
caspy
Thu Mar 18 2010, 03:18PM
Posts: 32
Joined: Sun Mar 30 2008, 07:50AM
Registered Member #3889
Hello
I am having some difficulty in editing the lgsl_list.php
to show the players in game

Here is what i have at the moment

http://jtf-2.com/lgsl/

I'am looking at having the players names who are ingame at the same time
Could anyone point me in the right direction of the code or where to edit to add this to my page

thankyou

Website
Rich
Thu Mar 18 2010, 04:13PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

Where it says "s" you need to make it "sp" so that a ['p'] array with the players is returned.

You may wish to take a look at this:

http://www.greycube.com/site/e107_plugins/forum/forum_viewtopic.php?9986.0

And this:

http://www.greycube.com/site/e107_plugins/forum/forum_viewtopic.php?10509.0
Website
caspy
Thu Mar 18 2010, 04:21PM
Posts: 32
Joined: Sun Mar 30 2008, 07:50AM
Registered Member #3889
Hello
Well here is what i have at the moment, and its a no go at this time could you point out the codeing for me


$output .= "
<div style='text-align:center; font-size:10px; font-face:arial'>
<table cellpadding='4' cellspacing='2' style='margin:auto'>";

foreach ($server_list as $server)
{
$misc = lgsl_server_misc($server);
$server = lgsl_server_html($server);

$output .= "
<tr style='".lgsl_bg().";table-layout:fixed'>

<td>
<img alt='' src='{$misc['icon_game']}' title='{$misc['text_type_game']}' />
</td>

<td title='{$lgsl_config['text']['slk']}' style='text-align:right'>
<a href='{$misc['software_link']}' style='text-decoration:none'>
{$server['b']['ip']}:{$server['b']['c_port']}
</a>
</td>

<td title='{$server['s']['name']}' style='text-align:left'>
<div style='width:100%; overflow:hidden; height:1.3em'>
{$misc['name_filtered']}
</div>
</td>

<td style='white-space:nowrap; text-align:left'>
{$server['s']['map']}
</td>


<td style='white-space:nowrap; text-align:left'>
{$server['sp']['name']}
</td>

<td style='white-space:nowrap; text-align:right'>
{$server['s']['players']} / {$server['s']['playersmax']}
</td>


<td style='white-space:nowrap; text-align:center'>
<a href='".lgsl_link($server['o']['id'])."'>
<img alt='' src='{$misc['icon_details']}' style='border:none' title='{$lgsl_config['text']['vsd']}' />
</a>
</td>

</tr>";
}

$output .= "
</table>
</div>";

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

if ($lgsl_config['list']['totals'])
{
$total = lgsl_cached_totals();

$output .= "
<div>
<br />
</div>
<div style='text-align:center'>
<table cellpadding='4' cellspacing='4' style='margin:auto'>
<tr style='".lgsl_bg()."'>
<td> {$lgsl_config['text']['tns']} {$total['servers']} </td>
<td> {$lgsl_config['text']['tnp']} {$total['players']} </td>
<td> {$lgsl_config['text']['tmp']} {$total['playersmax']} </td>
</tr>
</table>
</div>";
}
Website
Rich
Thu Mar 18 2010, 04:48PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

I see no player code in there ?
Website
caspy
Thu Mar 18 2010, 05:37PM
Posts: 32
Joined: Sun Mar 30 2008, 07:50AM
Registered Member #3889
<?php

/*----------------------------------------------------------------------------------------------------------\
| |
| [ LIVE GAME SERVER LIST ] [ © RICHARD PERRY FROM GREYCUBE.COM ] |
| |
| Released under the terms and conditions of the GNU General Public License Version 3 (http://gnu.org) |
| |
|-------------------------------------------------------------------------------------------------------------
| [ EDITOR STYLE SETTINGS: LUCIDA CONSOLE, SIZE 10, TAB = 2 SPACES, BOLD GLOBALLY TURNED OFF ] |
\-----------------------------------------------------------------------------------------------------------*/

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

require "lgsl_class.php";

$server_list = lgsl_query_cached_all("s");
$server_list = lgsl_sort_servers($server_list);

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

$output .= "
<div style='text-align:center; font-size:10px; font-face:arial'>
<table cellpadding='4' cellspacing='2' style='margin:auto'>";

foreach ($server_list as $server)
{
$misc = lgsl_server_misc($server);
$server = lgsl_server_html($server);

$output .= "
<tr style='".lgsl_bg().";table-layout:fixed'>

<td>
<img alt='' src='{$misc['icon_game']}' title='{$misc['text_type_game']}' />
</td>

<td title='{$lgsl_config['text']['slk']}' style='text-align:right'>
<a href='{$misc['software_link']}' style='text-decoration:none'>
{$server['b']['ip']}:{$server['b']['c_port']}
</a>
</td>

<td title='{$server['s']['name']}' style='text-align:left'>
<div style='width:100%; overflow:hidden; height:1.3em'>
{$misc['name_filtered']}
</div>
</td>

<td style='white-space:nowrap; text-align:left'>
{$server['s']['map']}
</td>


<td style='white-space:nowrap; text-align:left'>
{$server['sp']['name']}
</td>

<td style='white-space:nowrap; text-align:right'>
{$server['s']['players']} / {$server['s']['playersmax']}
</td>




<td style='white-space:nowrap; text-align:center'>
<a href='".lgsl_link($server['o']['id'])."'>
<img alt='' src='{$misc['icon_details']}' style='border:none' title='{$lgsl_config['text']['vsd']}' />
</a>
</td>

</tr>";
}

$output .= "
</table>
</div>";

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

if ($lgsl_config['list']['totals'])
{
$total = lgsl_cached_totals();

$output .= "
<div>
<br />
</div>
<div style='text-align:center'>
<table cellpadding='4' cellspacing='4' style='margin:auto'>
<tr style='".lgsl_bg()."'>
<td> {$lgsl_config['text']['tns']} {$total['servers']} </td>
<td> {$lgsl_config['text']['tnp']} {$total['players']} </td>
<td> {$lgsl_config['text']['tmp']} {$total['playersmax']} </td>
<td> {$lgsl_config['text']['sp']} {$total['playersmax']} </td>
</tr>
</table>
</div>";
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//------ PLEASE MAKE A DONATION OR SIGN THE GUESTBOOK AT GREYCUBE.COM IF YOU REMOVE THIS CREDIT ---------------------------------------------------------------------------------------------------+
$output .= "<div style='text-align:center; font-family:tahoma; font-size:9px'><br /><br /><br /><a href='http://www.greycube.com' style='text-decoration:none'>".lgsl_version()."</a><br /></div>";
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

?>
Website
Rich
Thu Mar 18 2010, 06:25PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

OK, looks like your need a bit more detailed explanation.


$server_list = lgsl_query_cached_all("s");

To

$server_list = lgsl_query_cached_all("sp");

Which lets the LGSL know you want player information.


<td style='white-space:nowrap; text-align:left'>";
foreach ($server['p'] as $player_key => $player)
{
  $output .= "{$player['name']} ";
}
$output .= "
</td>

This loops through the player array, displaying the names.
Website
caspy
Thu Mar 18 2010, 06:50PM
Posts: 32
Joined: Sun Mar 30 2008, 07:50AM
Registered Member #3889
Hello

Thankyou for the continued help however i have added your code to the file


==========================

<?php

/*----------------------------------------------------------------------------------------------------------\
| |
| [ LIVE GAME SERVER LIST ] [ © RICHARD PERRY FROM GREYCUBE.COM ] |
| |
| Released under the terms and conditions of the GNU General Public License Version 3 (http://gnu.org) |
| |
|-------------------------------------------------------------------------------------------------------------
| [ EDITOR STYLE SETTINGS: LUCIDA CONSOLE, SIZE 10, TAB = 2 SPACES, BOLD GLOBALLY TURNED OFF ] |
\-----------------------------------------------------------------------------------------------------------*/

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

require "lgsl_class.php";

$server_list = lgsl_query_cached_all("sp");
$server_list = lgsl_sort_servers($server_list);

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

$output .= "
<div style='text-align:center; font-size:10px; font-face:arial'>
<table cellpadding='4' cellspacing='2' style='margin:auto'>";

foreach ($server_list as $server)
{
$misc = lgsl_server_misc($server);
$server = lgsl_server_html($server);

$output .= "
<tr style='".lgsl_bg().";table-layout:fixed'>

<td>
<img alt='' src='{$misc['icon_game']}' title='{$misc['text_type_game']}' />
</td>

<td title='{$lgsl_config['text']['slk']}' style='text-align:right'>
<a href='{$misc['software_link']}' style='text-decoration:none'>
{$server['b']['ip']}:{$server['b']['c_port']}
</a>
</td>

<td title='{$server['s']['name']}' style='text-align:left'>
<div style='width:100%; overflow:hidden; height:1.3em'>
{$misc['name_filtered']}
</div>
</td>

<td style='white-space:nowrap; text-align:left'>
{$server['s']['map']}
</td>


<td style='white-space:nowrap; text-align:left'>
{$server['sp']['name']}
</td>

<td style='white-space:nowrap; text-align:right'>
{$server['s']['players']} / {$server['s']['playersmax']}
</td>

<td style='white-space:nowrap; text-align:left'>";
foreach ($server['p'] as $player_key => $player)

{
$output .= "{$player['name']]} ";
}
$output .= "

</td>


<td style='white-space:nowrap; text-align:center'>
<a href='".lgsl_link($server['o']['id'])."'>
<img alt='' src='{$misc['icon_details']}' style='border:none' title='{$lgsl_config['text']['vsd']}' />
</a>
</td>

</tr>";
}

$output .= "
</table>
</div>";

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

if ($lgsl_config['list']['totals'])
{
$total = lgsl_cached_totals();

$output .= "
<div>
<br />
</div>
<div style='text-align:center'>
<table cellpadding='4' cellspacing='4' style='margin:auto'>
<tr style='".lgsl_bg()."'>
<td> {$lgsl_config['text']['tns']} {$total['servers']} </td>
<td> {$lgsl_config['text']['tnp']} {$total['players']} </td>
<td> {$lgsl_config['text']['tmp']} {$total['playersmax']} </td>
<td> {$lgsl_config['text']['sp']} {$total['playersmax']} </td>
</tr>
</table>
</div>";
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
//------ PLEASE MAKE A DONATION OR SIGN THE GUESTBOOK AT GREYCUBE.COM IF YOU REMOVE THIS CREDIT ---------------------------------------------------------------------------------------------------+
$output .= "<div style='text-align:center; font-family:tahoma; font-size:9px'><br /><br /><br /><a href='http://www.greycube.com' style='text-decoration:none'>".lgsl_version()."</a><br /></div>";
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

?>

================================


However i get the error
Parse error: syntax error, unexpected ']', expecting '}' in /home/jtfcom/public_html/lgsl/lgsl_files/lgsl_list.php on line 67
Website
Rich
Thu Mar 18 2010, 07:04PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

Oops, I did a typo:
$output .= "{$player['name']]} ";
To
$output .= "{$player['name']} ";
Website
caspy
Fri Mar 19 2010, 07:33AM
Posts: 32
Joined: Sun Mar 30 2008, 07:50AM
Registered Member #3889
Hello that does its job

Now i'm looking to change how the information is displayed
As i have them stacked i'm looking to have all 3 server show up as blocks

As it shows up on your website

Again could you point me in the right direction to where i need to change this display and if you have time an example of the code i would need to use to show all 2 servers that i have in block format
Website
Rich
Fri Mar 19 2010, 02:23PM
Posts: 1717
Joined: Wed Nov 26 2003, 04:30PM

If you want them in a block format, why not just use and edit the lgsl_zone.php code which is already in that format ?

Load the zone, if you want them in a horizontal format, you can just change the grid option in the lgsl_config.php
Website
caspy
Sat Mar 20 2010, 07:11AM
Posts: 32
Joined: Sun Mar 30 2008, 07:50AM
Registered Member #3889
Hello

So i copy the code from that file and put it into lgsl_list.php
as far as im aware you cannot see the zone file directly
Website
Dodgeitorelse
Mon Dec 27 2010, 02:44PM
Posts: 244
Joined: Sun Dec 12 2010, 09:16AM
Registered Member #6457
is this what you are looking for?

http://chevys-place.game-server.cc/servertrackerlgsl.php

lack of effort on your part requires less effort on my part
Website
 

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