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

Guests: 33

173.208.x.x forum
178.159.x.x forum
34.228.x.x forum
35.192.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x forum
46.229.x.x dilbertplus
46.229.x.x user
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.4.x.x forum
51.255.x.x dilbertplus
54.36.x.x forum
54.36.x.x dilbertplus
54.36.x.x dilbertplus
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
54.36.x.x forum
91.242.x.x forum

Last Seen

»Stefan Wed 17:17
Gagi2 Tue 04:39
tltneon Wed 17:22
Nouton^ Wed 20:07
mrstipfan Wed 10:54

Newest Members

Forums
Possible to add color?
Nouton^
Thu Aug 22 2013, 01:03PM

Posts: 22
Joined: Thu Aug 01 2013, 10:18PM
Registered Member #7778
is it possible to add color to this:

orginal color for: zero players/offline game,
green color: one or more players are in the game,
red color: Server full.

//Nouton^

NgSwe.se
Website
game_stats.eu
Thu Aug 22 2013, 03:47PM

Posts: 15
Joined: Sun Jan 13 2013, 08:23AM
Registered Member #7520
function player_colors($plaeyr,$maxplayer) 
{
$percent = ceil($plaeyr/($maxplayer/100));
if($percent == 0) { $return = "<font color='#006600'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent > 0 && $percent < 20) { $return = "<font color='#FFFF66'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent > 20 && $percent < 25) { $return = "<font color='#FFCC66'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent > 25 && $percent < 50) { $return = "<font color='#FF9933'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent > 50 && $percent < 75) { $return = "<font color='#FF6633'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent == 75 && $percent > 75) { $return = "<font color='#FF0000'>{$plaeyr} / {$maxplayer}</font>"; }
return $return;
}

Nouton^
Thu Aug 22 2013, 05:36PM

Posts: 22
Joined: Thu Aug 01 2013, 10:18PM
Registered Member #7778
game_stats.eu wrote ...

function player_colors($plaeyr,$maxplayer) 
{
$percent = ceil($plaeyr/($maxplayer/100));
if($percent == 0) { $return = "<font color='#006600'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent > 0 && $percent < 20) { $return = "<font color='#FFFF66'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent > 20 && $percent < 25) { $return = "<font color='#FFCC66'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent > 25 && $percent < 50) { $return = "<font color='#FF9933'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent > 50 && $percent < 75) { $return = "<font color='#FF6633'>{$plaeyr} / {$maxplayer}</font>"; }
if($percent == 75 && $percent > 75) { $return = "<font color='#FF0000'>{$plaeyr} / {$maxplayer}</font>"; }
return $return;
}




Please tutorial

should i put it in lgsl_list?

//Nouton^

NgSwe.se
Website
game_stats.eu
Thu Aug 22 2013, 06:32PM

Posts: 15
Joined: Sun Jan 13 2013, 08:23AM
Registered Member #7520
not a speak english,sory
Nouton^
Thu Aug 22 2013, 06:39PM

Posts: 22
Joined: Thu Aug 01 2013, 10:18PM
Registered Member #7778
game_stats.eu wrote ...

not a speak english,sory

oki hope someone else can help me.

//Nouton^

NgSwe.se
Website
qwas
Fri Aug 23 2013, 12:16PM

Posts: 46
Joined: Sat Sep 08 2012, 05:20PM
Registered Member #7384
Nouton^ wrote ...

oki hope someone else can help me.


1. Backup file lgsl_class.php and lgsl_list.php
2. Open with notepad++ file lgsl_class.php, go to the latest line, but before closing "?>" and add this code:

function player_colors($players, $playersmax) 
{
if ($playersmax > '0') {
    $percent = ceil($players / ($playersmax / '100'));
if ($percent == 0) { $return = "{$players} / {$playersmax}"; } 
elseif($percent > 0 && $percent <= 20) { $return = "<font color='#FFFF66'>{$players} / {$playersmax}</font>"; }
elseif($percent > 20 && $percent <= 25) { $return = "<font color='#FFCC66'>{$players} / {$playersmax}</font>"; }
elseif($percent > 25 && $percent <= 50) { $return = "<font color='#FF9933'>{$players} / {$playersmax}</font>"; }
elseif($percent > 50 && $percent <= 75) { $return = "<font color='#FF6633'>{$players} / {$playersmax}</font>"; }
elseif($percent > 75 && $percent <= 100) { $return = "<font color='#FF0000'>{$players} / {$playersmax}</font>"; }
} else {$return = "N/A";}
return $return;
}   

save changes in lgsl_class.php

3. Open with notepad++ file lgsl_list.php, find the string:

$server = lgsl_server_html($server);

and insert AFTER:

$players = $server['s']['players'];
$playersmax = $server['s']['playersmax'];


4. find the string:
{$server['s']['players']} / {$server['s']['playersmax']}


and replace it with:
".player_colors($players, $playersmax)."

save changes in lgsl_list.php

5. Check the result and drink some beer, or orange juice

p.s Tested on lgsl standalone 5.8.

http://bigshooter.ru
Website
Nouton^
Fri Aug 23 2013, 12:27PM

Posts: 22
Joined: Thu Aug 01 2013, 10:18PM
Registered Member #7778
Admin please delete!

thanks for the support =)

//Nouton^

NgSwe.se
Website
qwas
Fri Aug 23 2013, 02:32PM

Posts: 46
Joined: Sat Sep 08 2012, 05:20PM
Registered Member #7384
UPDATED: function player_colors
REASON: lost one line (sorry about that)
Now everything is working really well


http://bigshooter.ru
Website
Nouton^
Fri Aug 23 2013, 03:36PM

Posts: 22
Joined: Thu Aug 01 2013, 10:18PM
Registered Member #7778
Admin please delete!

thanks for the support =)

//Nouton^

NgSwe.se
Website
Nouton^
Fri Aug 23 2013, 03:38PM

Posts: 22
Joined: Thu Aug 01 2013, 10:18PM
Registered Member #7778
Admin please delete!

thanks for the support =)

//Nouton^

NgSwe.se
Website
Nouton^
Fri Aug 23 2013, 03:43PM

Posts: 22
Joined: Thu Aug 01 2013, 10:18PM
Registered Member #7778
qwas wrote ...

UPDATED: function player_colors
REASON: lost one line (sorry about that)
Now everything is working really well


oki, thanks for the support =)

//Nouton^

NgSwe.se
Website
game_stats.eu
Fri Aug 23 2013, 04:32PM

Posts: 15
Joined: Sun Jan 13 2013, 08:23AM
Registered Member #7520
qwas wrote ...

5. Check the result and drink some beer, or orange juice

Good job, thank you that I edited my code
qwas
Fri Aug 23 2013, 05:06PM

Posts: 46
Joined: Sat Sep 08 2012, 05:20PM
Registered Member #7384
game_stats.eu wrote ...
Good job, thank you that I edited my code

Thanks for the idea.

p.s English is not my native language too


http://bigshooter.ru
Website
wattz
Wed Oct 16 2013, 08:23AM
Posts: 16
Joined: Sun Oct 13 2013, 02:01AM
Registered Member #7821
nice added this to my browser is a nice addition tyvm ,how can i change the code to reflect empty servers, 0 to 10% to show as green ?i have tried the below but can't get it to work

elseif($percent > 0 && $percent <= 10) { $return = "<font color='#00FF00'>{$players} / {$playersmax}</font>"; } 
elseif($percent > 10 && $percent <= 20) { $return = "<font color='#FFFF66'>{$players} / {$playersmax}</font>"; }
elseif($percent > 20 && $percent <= 25) { $return = "<font color='#FFCC66'>{$players} / {$playersmax}</font>"; }
elseif($percent > 25 && $percent <= 50) { $return = "<font color='#FF9933'>{$players} / {$playersmax}</font>"; }
elseif($percent > 50 && $percent <= 75) { $return = "<font color='#FF6633'>{$players} / {$playersmax}</font>"; }
elseif($percent > 75 && $percent <= 100) { $return = "<font color='#FF0000'>{$players} / {$playersmax}</font>"; } 
 

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