Server rentals :: NFOservers.com

Forums

All times are UTC - 8 hours



Author Message
PostPosted: Wed Aug 27, 2003 11:46 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9222
Location: Seattle
We have created a server query script to make it easy to add current information on your server's status to your website. We now also use this script on the status page in the control panel.

To take advantage of our script yourself, simply add code like the following to a webpage that we host:

Code:
<iframe src="http://rentals.nuclearfallout.net/query/stat.pl?id=chernobyl" width=400 height=600 frameborder=0 />

You would need to replace the value of "id" with your server's identifier (your login name for the control panel). That code there would produce this output.

You can also customize the output to match your site, because every part of the page the script generates can be controlled by a stylesheet. The default stylesheet is here -- you can right-click and select "Save As" to save it to your hard drive. After editing it, upload the file to your webspace. You can specify the customized stylesheet when you call our script by using the "style" parameter. For instance, if I were to create my own stylesheet named "white.css" and upload it to my webspace, I could use this in my webpage instead of what was given above:

Code:
<iframe src="http://rentals.nuclearfallout.net/query/stat.pl?id=chernobyl&style=white" width=400 height=600 frameborder=0 />

In fact, I did copy default.css to a new file, white.css, and changed the background color to white, got rid of the server information block and player list heading, changed some colors, altered the spacing in the player table, and doubled the image size, all by editing that file. The resulting stylesheet is here and would give this output.

You can even get rid of everything but a couple of lines if you want, to fit just the essentials in a small spot on your site. For example, this, which uses my minimal.css stylesheet.

This site provides more information on iframe options (such as specifying the width and height, or taking away the scrollbar). You could also use a standard frame instead of an iframe, if you prefer.

Advanced users may prefer to retrieve the status information via a script and embed it directly into their page, instead of bothering with frames. For example, this short Perl script would do that:

Code:
#!/usr/bin/perl

use LWP::Simple;

print qq|
Content-type: text/html

<html>
<head>
  <title>Example script with server status inclusion</title>
</head>
<body>
This is Chernobyl's server status:<p />
|;

getprint "http://rentals.nuclearfallout.net/query/stat.pl?id=chernobyl&style=white&no-body=1";

print "<p /><i>Copyright (c) 2003 Nuclearfallout Enterprises, Inc.</i>";

That script's output would look something like this.

You'll note that in the code fragment we used another parameter -- "no-body". A "1" for that parameter indicates to our query script that no <body> tag should be included in the page output, and it is needed because placing two body tags in one document can be unnecessary and problematic.

A PHP version of that script would look like this:

Code:
<html>
<head>
  <title>Example script with server status inclusion</title>
</head>
<body>
This is Chernobyl's server status:<p />

<?php
echo(implode("", file("http://rentals.nuclearfallout.net/query/stat.pl?id=chernobyl&style=white&no-body=1")));
?>

<p /><i>Copyright (c) 2003 Nuclearfallout Enterprises, Inc.</i>

And would give the same output.


Last edited by Edge100x on Thu Aug 28, 2003 9:33 pm, edited 7 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 10:02 am 
Offline
This is my homepage
This is my homepage

Joined: Tue May 13, 2003 7:54 am
Posts: 105
Thanks for doing this. This is much better than the serverspy because you don't have to deal with those dumbass popups. I took serverspy off my sight because I hate popups so much and I couldn't stand to be responsible for them on someone else's computer.

I did have an issue using this code though. When I used the code for a site hosted by nfo, it didn't work, and my site is hosted by nfo. However, when I used the code for a site hosted elsewhere it worked perfectly.

http://myclan.nuclearfallout.net


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 10:38 am 
Offline
This is my homepage
This is my homepage
User avatar

Joined: Sat Jul 26, 2003 8:56 pm
Posts: 118
Location: California, USA
I don't use NFo's website at all, but was using the script and I can't get the style to work right, I added &style=white for example and it'd use the one you have up, then I tried &style=custom and uploaded a custom css to my site for NFo but it didn't register at all, it used default settings (white background black text etc.)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 11:30 am 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9222
Location: Seattle
Templisk: Make sure the .css file is in the same directory you are calling the script from -- otherwise it won't be able to find it.

Crab: My instructions were incorrect and you have to always use it with the http://rentals part, sorry about that.

Does anyone have suggestions for modifications to the default.css file? I'd be happy to add more of them for people to choose from, or to change the default to look more interesting.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 3:55 pm 
Offline
This is my homepage
This is my homepage
User avatar

Joined: Sat Jul 26, 2003 8:56 pm
Posts: 118
Location: California, USA
It's much too wide. You should try a black/blue and black/red and a few variations of grey.(backgrounds) Those seem to be the most commonly used colors on the net. Other than that it looks pretty good, nice work :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 5:07 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9222
Location: Seattle
Well, it's width can be easily adjusted with the css file, as can the colors. Do you have a modified file ready that I could consider putting in its place instead? :D


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 5:10 pm 
Offline
This is my homepage
This is my homepage
User avatar

Joined: Sat Jul 26, 2003 8:56 pm
Posts: 118
Location: California, USA
I was just talking about the default one, most of the sites I've seen use navbars with a width of 150 or less, mine is 150 and resizing everything didn't help no matter where I put the modified css. Where do I put the css anyways? I put the iframe on my site, http://www.thedarklegacy.net/beta.php and I changed the iframe source to match the css' name but it doesn't seem to change at all even with the css on my site and on the NFo site...

If you want, I'll mess around with a few versions of it and email them to rentals@nuclearfallout.net they probably won't be really good but will give you a general idea of what I meant =P


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 5:39 pm 
Offline
This is my homepage
This is my homepage
User avatar

Joined: Sat Jul 26, 2003 8:56 pm
Posts: 118
Location: California, USA
I fixed it, I have a request though instead of showing IP as darklegacy.nuclearfallout.net:27015 can we choose generic IP? 66.117.18.16:27015? I can't find anything in the css that would control it. And is there a way to get rid of specific parts of the information table such as "Currently Locked?"


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 7:27 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9222
Location: Seattle
I'll work on adding additional options to the stylesheet to control those.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 28, 2003 9:49 pm 
Offline
Founder
Founder
User avatar

Joined: Thu Apr 18, 2002 11:04 pm
Posts: 9222
Location: Seattle
Done. IP can be displayed now and each section in the first table can be eliminated.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 12:46 am 
Offline
Former staff
Former staff
User avatar

Joined: Sun Mar 30, 2003 1:56 pm
Posts: 2252
Location: 127.0.0.1
hmm I was playing with it and I couldnt get it to call my own css file, either locally just viewing the file on my hard drive, or on the internet on my webspace :/

kept going to the white background with black lettering


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 5:05 am 
Offline
This is my homepage
This is my homepage
User avatar

Joined: Sat Jul 26, 2003 8:56 pm
Posts: 118
Location: California, USA
it worked for me when I put at the end:
&style=http://www.thedarklegacy.net/style.css

Maybe you have to specify the exact location o_O


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 7:59 am 
Offline
Former staff
Former staff
User avatar

Joined: Sun Mar 30, 2003 1:56 pm
Posts: 2252
Location: 127.0.0.1
dL-Templisk wrote:
it worked for me when I put at the end:
&style=http://www.thedarklegacy.net/style.css

Maybe you have to specify the exact location o_O


ya I was thinking of doing that, then I said, it must be something Im doing wrong


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 9:09 am 
Offline
Former staff
Former staff
User avatar

Joined: Sun Mar 30, 2003 1:56 pm
Posts: 2252
Location: 127.0.0.1
is there anyway to get the ping working to our server perhaps?

It said it works for bf194, q3 etc, not cs?

Also: cant get the show ip working :/ I deleted the display:none in it

Code:
row-ip { }


thats what it looks like, but no IP shows :( everything else works


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 05, 2003 9:34 am 
Offline
Former staff
Former staff
User avatar

Joined: Sun Mar 30, 2003 1:56 pm
Posts: 2252
Location: 127.0.0.1
rawr!!

I fixed the server ip, had to delete some stuff with the key-ip etc etc

anyways, think we can have the ping similar to the locations link perhaps?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
It is currently Sun May 19, 2013 11:36 am
Powered by phpBB® Forum Software © phpBB Group