The online racing simulator
I take it your using an iFrame to load the content onto your website!? Could you provide a link to what page your using your hosts stats on so I can see what you're seeing. Backgrounds within the iFrame take their color from the HTML document they are loaded from. Because of this your going to find the background color of your parent page, and copy it to your hosts css file. If your not sure you have the right color, you can use Google Tools. Right Click on the iFrame from your website, and then go to inspect element. From there you can edit the CSS on the fly until you find the right color, from there copy to your css file and upload here again.
Quote from luchian :..for refference, if needed, our forum is here RLR..

Yes, I use an iframe to show the stats. Q6: Is there another way ?
Yes, I probably sugested the wrong color code (I think the good one is #2f2e2e).. and this means that I have to trouble Victor AGAIN to make the modification..:ashamed:

Q7: In the css, I've set the target #Users {color: #FFA303; } This means that they should be orange-ish, but still they are green-ish. Is it because of the 4th line in body section of css (color: #9BC21B; ) or it has something to do with the fact that the user name it's actually a link ? (a href..)

I'm sorry if I returned to the stupid questions, but the users list cannot be tested locally (by trial and error). The list is apprearing only when showing real status server, thus taking into consideration only the css file on the server.

For easier understanding, attached a photo of what I wish to obtain:
Left side as it is >> Right side as I would wish it
Attached images
status_css_wannabe.jpg
Quote from luchian :Q7: In the css, I've set the target #Users {color: #FFA303; } This means that they should be orange-ish, but still they are green-ish. Is it because of the 4th line in body section of css (color: #9BC21B; ) or it has something to do with the fact that the user name it's actually a link ? (a href..)

yep, in the stylesheet there is a declaration for a (anchor) in which the colour #87A817 is defined. So that's what you see there. I've added a "User" class to those user links now though, so one can change the user links independently. I've done that, but there are currently no users on your host, so we'll see later how that turns out.

I've made the background transparent now. This should be the default in case background is omitted, but i've implicitely written it in the body section of the stylesheet anyway.
Good idea the transparent background >> problem solved.
Reagarding the user name color, still doesn't work; all connected users are shown in light green (only the comma between is orange ). Any suggestions ?

My thoughts (I might be totally "off", in that case don't mind them):
The target is a.User or a.Users ?
Q8: Could a target like #Users.field3 {color: #FFA303; } work ?

If no ideas, then could you please just change the orange (#Users {color: #FFA303; } ) to black (#Users {color: #000000; }), so the comma will also be black ? I could live with that also, looks pretty clean.

Thank you for your time Vic, sorry you had to re-look 3, 4 times my demand.
Think i forgot to the save the hoststatus file last night.
Now the users are orange.
YES !
Thanks a lot
Vic, can you detect when a client has admin on a server? Could you add an admin class to their username?
no i don't have that information.
Any problem with the page retrieving the host status ?
On our site it shows host offline, but when I run LFS I can connect just fine and the server is running ok. Thank you in advance.
no, everything's supposed to be working as normal. E.g. http://www.lfsworld.net/hoststatus/?h=Blackwood%20XFG%20XRG

Maybe the hostname changed (slightly) and so there's a discrepancy between the actual hostname and what you use for the hoststatus.

Or tell me the name of the host and i'll have a look.
! RLR - Racing League Romania
(wow, that was fast)
i don't see it in my hostlist data (is the host hidden now?). Can you join the host, so i can perhaps find out more?

oh, maybe it's a Z3x test host? In that case, please upgrade it to 0.6A3. The old test versions have been disabled in the master server now, so they'll no longer show up on lfsworld.
No, that's exactly this: the host is not hidden, it is open to everybody; and it runs like that for a few monthe now. Only from yesterday I see it reported as offline, and it's not listed in LFS host list anymore, as you say.
For testing purpose, you can try joining with Join Specific Host, by name, if that could help ?
Yes, it was Z30. Ok, I'll ask for an update. I apreciate your quick answer, thank you.
I see now that your host really is hidden. At least, that's what the data tells me here. Please double check.

oh - well in any case, it was stored like a hidden host. See how it goes after the upgrade then I guess.
That's odd; we've never set it as hidden; in any case we'll update host version and we'll see how it goes from there. Thanks a lot.
Lucian

LE: Problem solved after host update at 0.6A3. Cheers.
Ok i have a quick question ?

I have my server status on our website. www.rf1.moonfruit.com but there status has not updated its self ? any reason why ???? its still showing people who was in the server a hour ago lol
i need the server status in a html snippet form
Hi Victor,

We have just rented a new server to use for our league races.
Could you please copy the CSS file from the old to the new one, so the host status information gets a nice integration into our site ?

OLD server: ! RLR - Racing League Romania
NEW server: Racing League Romania

Thank you,
Lucian

LE: NVM, seems that using the same code, works already.
Quote from SJB :Just wrote a little script to get the hoststatus data into variables:


<?php 
php

set_include_path
(get_include_path() . PATH_SEPARATOR './library/');
require_once 
'JS/Extractor.php';

// insert the name of your server
$hostname "Blackwood XFG XRG";

$url "http://www.lfsworld.net/hoststatus/?h=".urlencode($hostname)."&c=1&onlycontent";

$extractor = new JS_Extractor(file_get_contents($url));
$body $extractor->query("body")->item(0);
$data $body->extract(array("div", array("div|span")));

// to see the array / for debug you can uncomment the following 3 lines
// echo "<pre>";
// print_r($data);
// echo "</pre>";

$host $data[0][0];
$mode $data[1][1];
$track $data[2][1];
$cars $data[3][1];
$settings $data[4][1];
$version $data[5][1];
$conns $data[6][1];
$user $data[7][0];

?>

It uses the JS_Extractor from http://jacksleight.com/old/code

Regards, SJB

Sorry for bring up this 4 Years old Thread but my little Question is how to Check from this Script if the Server is Online or Offline?
If a server is offline you would get something like that:

<div class="HostName">
<span style="color: black">burnoutcrew.net</span>
</div>
<div class="Message">Offline</div>

So I would read the file content into a variable first, before using the JS-Extractor.


<?php 
$answer 
file_get_contents($url);
if (
strpos($answer,'<div class="Message">')) {
//offline
} else {
// your code
}
?>

That should do the work...
Thank you. Now all works fine Smile

FGED GREDG RDFGDR GSFDG