Server Status - Advice?

Status
Not open for further replies.
Newbie Spellweaver
Joined
Dec 23, 2009
Messages
7
Reaction score
0
Hi there.. =)

To start.. I'd like to throw it out there that I'm a new member here..

To get to the point:

Currently, I have a "guild site" through a free host..
(http://www.guildlaunch.com/)

My guild currently belongs to an Ultima Online free server.

I was curious, on how to go about getting a server status script, that can query the online/offline status of the server I play for, and show it in an html widget on my site?

I'm almost positive this html widget supports php scripts..

I'm not too picky on text or image online/offline statuses.. I just want to show my guild members if its even online or not..

Something similar to WoW's server status page..
(http://www.worldofwarcraft.com/realmstatus/)

Any help would be GREATLY appreciated!!

________________________

I'd like to apologize in advance, for any confusion.. and the length of this post.. =)
 
C'mon, it's this simple :p
I mean, if it was a whole user cp or something like that I'd go rule 5 on him too, but this is just like 5 lines...

PHP:
<?php
	$server_ip = "74.125.77.99"; //Your server's IP address
	$server_port = 80; //Your server's port
	$x = "The server is: ";
	$x .= (fsockopen($server_ip, $server_port, $errno, $errstr, 30) ? "<b style=\"color:green;\">Online</b>." : "<b style=\"color:red;\">Offline</b>.");
	echo $x;
?>
As you see, I'm using a short if/else statement (look here: http://www.lizjamieson.co.uk/2007/08/20/short-if-statement-in-php/)
That code is equal to:

PHP:
<?php
	$server_ip = "74.125.77.99"; //Your server's IP address
	$server_port = 80; //Your server's port
	$x = "The server is: ";

	if(fsockopen($server_ip, $server_port, $errno, $errstr, 30))
	{
		$x .= "<b style=\"color:green;\">Online</b>.";
	}
	else
	{
		$x .= "<b style=\"color:red;\">Offline</b>.";
	}

	echo $x;
?>
 
Last edited:
~holthelper...
I'm terribly sorry if it came across as though I were handing you a "problem" and asking you to "fix it"... I certainly was not asking for you to write a script for me.. I may not be a genius when it comes to scripting, but I'm quite positive there are pre-made scripts for this sort of request.. I was simply asking for someone to post one (that's functional) or point me in the right direction..


~EliteGM...
I greatly appreciate your contribution. Now, I'm well aware that these scripts are PhP; however, is there any way to make these functional with HTML boxes? Sadly.. the site I'm trying to add this "server status" to, doesn't currently support PhP...

Any ideas?

_________________________

Also.. I'm assuming that I need to edit this string:

$x = "The server is: ";

I was doing some research and saw that I need to show what my variable is (being "online"), that way if the value of $x is anything other than online, it comes up, offline.. Correct?
 
Last edited:
Aaah okay... I suppose I read too much into my "research".. lol :laugh:

I've changed the server IP and port, and after adding the script into the widget and clicking "update".. this is what appeared in the widget itself on the homepage:

Online." : "Offline."); echo $x; ?>

That would be my key indicator that PhP isn't supported..

Well.. I've spoke with the dev team for guildlaunch and they're working on enabling PhP in the widgets.. if I need future help regarding the script.. I suppose I'll dig this thread back up..

Thanks for all the help Elite.. Sorry if I've been a nuisance.. :blush:
 
C'mon, it's this simple :p
I mean, if it was a whole user cp or something like that I'd go rule 5 on him too, but this is just like 5 lines...

PHP:
<?php
    $server_ip = "74.125.77.99"; //Your server's IP address
    $server_port = 80; //Your server's port
    $x = "The server is: ";
    $x .= (fsockopen($server_ip, $server_port, $errno, $errstr, 30) ? "<b style=\"color:green;\">Online</b>." : "<b style=\"color:red;\">Offline</b>.");
    echo $x;
?>
As you see, I'm using a short if/else statement (look here: http://www.lizjamieson.co.uk/2007/08/20/short-if-statement-in-php/)
That code is equal to:

PHP:
<?php
    $server_ip = "74.125.77.99"; //Your server's IP address
    $server_port = 80; //Your server's port
    $x = "The server is: ";

    if(fsockopen($server_ip, $server_port, $errno, $errstr, 30))
    {
        $x .= "<b style=\"color:green;\">Online</b>.";
    }
    else
    {
        $x .= "<b style=\"color:red;\">Offline</b>.";
    }

    echo $x;
?>
yes but they learn nothing if you hand-feed scripts to people. point them in the right direction and they will get it. and if they dont, find some tuts.
 
Aaah okay... I suppose I read too much into my "research".. lol :laugh:

I've changed the server IP and port, and after adding the script into the widget and clicking "update".. this is what appeared in the widget itself on the homepage:

Online." : "Offline."); echo $x; ?>

That would be my key indicator that PhP isn't supported..

Well.. I've spoke with the dev team for guildlaunch and they're working on enabling PhP in the widgets.. if I need future help regarding the script.. I suppose I'll dig this thread back up..

Thanks for all the help Elite.. Sorry if I've been a nuisance.. :blush:

Make sure you save your pages as .php instead of .html if you use PHP in them!
 
yes but they learn nothing if you hand-feed scripts to people. point them in the right direction and they will get it. and if they dont, find some tuts.

Indeed, you are correct there. But I didn't make a request for a custom script. There's a huge difference, between me asking you to script me a code tailored specifically to my website, and me asking for a widely used, rather popular, script.

Don't take this as me being disrespectful; but I feel that EliteGM was perfectly within reason.

I design .cs scripts for use by members of RunUO.com (a site that offers server emulation for Ultima Online), and have many people ask me for custom items, decorations, and statics.. But I never disregard, nor chastise a request for a common script; such as a banker NPC.

I'm not sure if you're "reprimanding" Elite, or what-not.. but in his defense; he was of enormous help and was in no way, out of line.. :thumbup1:



Make sure you save your pages as .php instead of .html if you use PHP in them!

Thanks for that tip.. lol..

Btw, I've been doing some searching regarding converting PhP code into HTML.. so far I've found 2 "converters", but as far as I can tell.. they both suck.. :thumbdown:

Ah, well.. I'll see if there's even a way to "reverse-engineer" it, so-to-speak..
 
there is no way to *convert* php to html

Well.. I've figured out that advertised "converters" that are much like online language translators; and they definitely do not work.

As far as reworking the script so that its functional for HTML use; that is definitely possible. I've found literally dozens of accredited sites that say that you can. Sadly, most don't offer tips or directions on how to, just that it's possible and a short brief as to how its done.
 
Hmm..

I'm clueless on Flash as well..

Any idea "how" to go about searching for it?

Well.. not so much how, more more over, what to use as a search reference..

Not really sure what to look for.. lol
 
Flash doesn't support it from what I can see, surprisingly. (Maybe it does and I haven't seen it)

I thought at one point I found one, but it was really connected to a PHP file, so it doesn't work without PHP.

On a side-note, why not just buy good hosting? Get HostGator, or 1and1, or something, it's cheap and easy for crying out loud

As for the little "dispute" thing going on in here, quit it.

@gmd_uo, you came here asking for a script to be written for you, rather than providing one that needs repair. However you are not in violation of rule 5 (in my eyes) because you did provide enough insight to show that you actually were trying. You didn't dump a bunch of code and tell us to make it work, etc.

@EliteGM, Good show, I think you should make a tutorial. ;)

holthelper... It appears you're having a bad day already, so I won't get involved any further. Thanks for watching out for us ;)
 
Last edited:
Flash doesn't support it from what I can see, surprisingly. (Maybe it does and I haven't seen it)

I thought at one point I found one, but it was really connected to a PHP file, so it doesn't work without PHP.

On a side-note, why not just buy good hosting? Get HostGator, or 1and1, or something, it's cheap and easy for crying out loud

-Yea.. I'm not all that verbose in Flash, unfortunately. As far as purchasing a host.. that's just a bit far fetched for me. This is a free game that I enjoy putting my time into, but I'm certainly not going to put money into purchasing a PhP based site for a simple guild. I'm also a 5+ year vet of WoW, and I won't even purchase hosting for my guild there; and I actually pay money to play it.. lol



s-p-n;5439644As for the little "dispute" thing going on in here said:
-"Dispute"? To be quite honest, I have no clue what you're insinuating? I clearly stated that I intended no disrespect toward anyone. So as far as I'm concerned, there's no dispute here.



@gmd_uo, you came here asking for a script to be written for you, rather than providing one that needs repair. However you are not in violation of rule 5 (in my eyes) because you did provide enough insight to show that you actually were trying. You didn't dump a bunch of code and tell us to make it work, etc.

-Exactly.. I felt as though Elite was being reprimanded for assisting me, when really he just offered a pretty popular script, that's easily obtainable by someone who knows what they're looking for..

As I said before, I do not intend any disrespect. If you still think there is some sort of dispute here somehow, maybe I should reconsider using this forum. If there is any form of "dispute", it's the one between you and I regarding my alleged contentiousness.

That being said.. thanks again to everyone who contributed. Merry Christmas to those who celebrate it!
 
Flash doesn't support it from what I can see, surprisingly. (Maybe it does and I haven't seen it)

I thought at one point I found one, but it was really connected to a PHP file, so it doesn't work without PHP.

On a side-note, why not just buy good hosting? Get HostGator, or 1and1, or something, it's cheap and easy for crying out loud

As for the little "dispute" thing going on in here, quit it.

@gmd_uo, you came here asking for a script to be written for you, rather than providing one that needs repair. However you are not in violation of rule 5 (in my eyes) because you did provide enough insight to show that you actually were trying. You didn't dump a bunch of code and tell us to make it work, etc.

@EliteGM, Good show, I think you should make a tutorial. ;)

holthelper... It appears you're having a bad day already, so I won't get involved any further. Thanks for watching out for us ;)
lol nah. it would be nice for people to learn the material they are requesting in. when i started php scripting i asked around and read tuts. hardly ever did i ask people to make the script for me.

if others want to make the script for the requester, good for them.
 
Status
Not open for further replies.
Back