EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   Chit-Chat (https://www.eq2interface.com/forums/forumdisplay.php?f=2)
-   -   Server-Side Network Status (https://www.eq2interface.com/forums/showthread.php?t=8782)

Buyirugh 07-25-2007 10:36 AM

Server-Side Network Status
 
1 Attachment(s)
Hey, all!

I'm not a UI programmer (yet ;) ), but I do dabble in PHP a little bit. While the servers were down today for an update to the spam filtering, I wrote a little PHP script that folks/guilds that host there own websites might be able to use. It's pretty straight foward. You need to have PHP on the server (obviously). Upload the images (or make your own), then, on the page that you want to network status on, just either place the code that I made or use the PHP command:
Code:

include("network_status.php");
If you have any problems, just let me know.

Take care

krisla 07-25-2007 10:51 AM

Quote:

Originally Posted by Buyirugh (Post 60852)
Hey, all!

I'm not a UI programmer (yet ;) ), but I do dabble in PHP a little bit. While the servers were down today for an update to the spam filtering, I wrote a little PHP script that folks/guilds that host there own websites might be able to use. It's pretty straight foward. You need to have PHP on the server (obviously). Upload the images (or make your own), then, on the page that you want to network status on, just either place the code that I made or use the PHP command:
Code:

include("network_status.php");
If you have any problems, just let me know.

Take care

I just tried it, and it almost worked!
http://rodgerhyatt.com/web/network_status.php
keep it up though, your getting closer :)

jonathn2875 07-25-2007 07:16 PM

anyway to make this as a windows vista sidebar gadget?

Buyirugh 07-26-2007 05:58 AM

Vista Sidebar
 
Let me work on a Vista sidebar... or also a Yahoo! Sidebar (for those of us still using XP :) )

Buyirugh 07-26-2007 09:53 AM

Vista Sidebar Gadget - Going to need some help
 
1 Attachment(s)
I've written what I THINK will work as a sidebar gadget. "Think"? Why only "Think"? Well... I don't have Windows Vista. :)

Is there anyone out there would could take a look at this and see if it works as a sidebar? There is an HTML file which parses the network status page on EQ2Players using VBScript. There are also the original images that I had before.... all packaged in a gadget archive.

If there are problems or what-not, please snap some screenshots and post them here so I can see what I might need to fix.

Thanks

deaddog4201 07-26-2007 12:46 PM

doesnt install on vista 64bit
 
doesnt install on vista 64bit. No error other then said the installer could not be verified did i still want to install i said yes but nothing else happens and i cant find it anyplace.

jonathn2875 07-26-2007 03:29 PM

same on 32 bit vista. acts like its installing but then nothing happens

Buyirugh 07-27-2007 05:33 AM

I'm trying to figure out if I missed a step.

According to MSDN, after creating a working HTML file (or files), all I should have to do is ZIP the files up, then rename the .ZIP file to a .GADGET file. I did that. To upload to EQ2Interface, I needed to again zip up the .GADGET file so that I could upload it. On the other end, you would have to extract the .GADGET file from the .ZIP file, then double click it to add it to the sidebar archive. Next you would click the + sign to add a gadget and it show in the archive. If this isn't happening, then Microsoft lied in their instructions:

MSDN Sidebar Gadgets Quickie

I will have to do further research to find out what might be missing in the steps to disallow this.

Thanks for your feedback. It really does help.

jonathn2875 07-27-2007 09:28 AM

1 Attachment(s)
Ok taking a look at your files, and remember I have no clue about any of this :)

You had for the last couple of lines:

<platform minPlatformVersion="1.0" />
</hosts>

when it should have been:

<platform minPlatformVersion="1.0" />
</host>
</hosts>

Note the two differant </host ...

So I added that line in repacked it and now it installs but this is what it looks like installed

Ill try to work on it some as well if you dont mind. I would like to learn how to make these.

jonathn2875 07-27-2007 09:57 AM

4 Attachment(s)
Ok

Changed the first html file to reflect as:

Code:

<html>
<head>
    <title>Everquest 2 Server Status</title>
    <style>
        body
        {
            margin: 0;
            width: 115px;
            height: 65px;
        }
        #gadgetContent
        {
            width: 115px;
            top: 10px;
            text-align: center;
            font-family: Tahoma;
            font-size: 10pt;
            position: absolute;
        }
        #background
        {
            width: 130px;
            height: 65px;
            position: absolute;
            z-index: -1;
            background-repeat: no-repeat;
        }
    </style>
</head>
<body>
<g:background
        src="background.png"
        id="EQ2statusBG" 
        style="position:absolute;width:130px;height:65px;z-index:-1"/>
    <span
        id="gadgetContent"
        style="font-family: Tahoma; font-size: 12pt;">
        <a href="checkEQ2status.html">Check Server Status</a>
    </span>
</body>
</html>

Installed it and woohoo it kinda works now. The first part works perfect on the side bar but when you go to actually see the status you get cut off again. I poked in to that html file but that one is gonna take me a while to figure out what it all means hehe



Update**

I have been able to get the second html file to "center" but the information length wise is still cut off do to the size. Gonna try later to teach myself how to do the fly out option for it.

Buyirugh 07-28-2007 05:18 AM

Quote:

Originally Posted by jonathn2875 (Post 60899)
Ok taking a look at your files, and remember I have no clue about any of this :)

You had for the last couple of lines:

<platform minPlatformVersion="1.0" />
</hosts>

when it should have been:

<platform minPlatformVersion="1.0" />
</host>
</hosts>

Note the two differant </host ...

So I added that line in repacked it and now it installs but this is what it looks like installed

Ill try to work on it some as well if you dont mind. I would like to learn how to make these.


By all means... any help would be wonderful!

Dolby 07-28-2007 10:34 PM

Nice work Buyirugh, thanks for posting this. May just use it on my guilds website.

Buyirugh 07-31-2007 10:31 AM

Today's downtime gave me a chance to pick up some variables that I had missed before. This is the code for the file network_status.php (for the online/PHP version of the app). I have made changes to the gadget version as well, but until I can figure out how to display the resulting page in a format that is actually viewable, I'm gonna hold onto that. Hopefully by the end of the week I will have a working gadget.

Code:

<html>
<header><title>EQ2 Network Status</title>
<style type="text/css">
        body {
                background-color: #FFFFFF;
                color: #000000;
                font-family:Arial, Helvetica, sans-serif;
                font-size: 10pt;
        }
       
        h1 {
                font-size: 140%;
        }
</style>
</header>
<body>
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr><td><h1>EQ2 Network Status</h1></td></tr>
<tr><td>
<?php

$get_server = "eq2players.station.sony.com";
$get_page  = "/en/network_status.vm";

$get_file = fsockopen($get_server, 80, $errno, $errstr, 12);

fputs($get_file, "GET ".$get_page." HTTP/1.0\r\n");
fputs($get_file, "Host: ".$get_server."\r\n");
fputs($get_file, "Referer: http://".$get_server."\r\n");
fputs($get_file, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n\r\n");

//$get_file = fopen("http://".$get_server.$get_page, "r");

while(!feof($get_file)) {
        $get_data .= fread($get_file, 4096);
}

$result_parse1 = explode("<!-- NEW STATUS TOOL -->",$get_data);
$result_parse2 = explode("</td>",$result_parse1[1]);

$dirty_content1 = $result_parse2[0];

$dirty_content2 = str_replace("<span class=\"NewsSelectionHeaders\"><strong>&nbsp;</strong> - &nbsp;</span><br>","",$dirty_content1);

$dirty_content3 = str_replace("<span class=\"server_status_locked\">","<img src=\"images\locked.gif\">&nbsp;&nbsp;",$dirty_content2);

$dirty_content4 = str_replace("<span class=\"serverunavailable\">","<img src=\"images\locked.gif\">&nbsp;&nbsp;",$dirty_content3);

$dirty_content5 = str_replace("<span class=\"serverup\">","<img src=\"images\up.gif\">&nbsp;&nbsp;",$dirty_content4);

$dirty_content6 = str_replace("<span class=\"serverdown\">","<img src=\"images\down.gif\">&nbsp;&nbsp;",$dirty_content5);

$dirty_content6b = str_replace("<span class=\"server_status_down\">","<img src=\"images\down.gif\">&nbsp;&nbsp;",$dirty_content6);

$dirty_content7 = str_replace("(is locked)","",$dirty_content6b);

$dirty_content7b = str_replace("<span class=\"server_status_partial\">All servers are up except for</span>","",$dirty_content7);

$dirty_content8 = str_replace("<span class=\"server_status_all_up\">All Servers Are Up</span><br>","<img src=\"images\up.gif\">&nbsp;&nbsp;Guk<br><img src=\"images\up.gif\">&nbsp;&nbsp;The Bazaar<br><img src=\"images\up.gif\">&nbsp;&nbsp;Lucan DLere<br><img src=\"images\up.gif\">&nbsp;&nbsp;Butcherblock<br><img src=\"images\up.gif\">&nbsp;&nbsp;Nektulos<br><img src=\"images\up.gif\">&nbsp;&nbsp;Kithicor<br><img src=\"images\up.gif\">&nbsp;&nbsp;Unrest<br><img src=\"images\up.gif\">&nbsp;&nbsp;Crushbone<br><img src=\"images\up.gif\">&nbsp;&nbsp;Blackburrow<br><img src=\"images\up.gif\">&nbsp;&nbsp;Najena<br><img src=\"images\up.gif\">&nbsp;&nbsp;Everfrost<br><img src=\"images\up.gif\">&nbsp;&nbsp;Befallen<br><img src=\"images\up.gif\">&nbsp;&nbsp;Permafrost<br><img src=\"images\up.gif\">&nbsp;&nbsp;Mistmoore<br><img src=\"images\up.gif\">&nbsp;&nbsp;Oasis<br><img src=\"images\up.gif\">&nbsp;&nbsp;Venekor PVP<br><img src=\"images\up.gif\">&nbsp;&nbsp;Antonia Bayle<br><img src=\"images\up.gif\">&nbsp;&nbsp;Nagafen PVP<br><img src=\"images\up.gif\">&nbsp;&nbsp;Vox PVP<br>",$dirty_content7b);

$clean_content = str_replace("</div>","",$dirty_content8);

print $clean_content;

?>
</td></tr>
</table>
</body>
</html>


jonathn2875 07-31-2007 10:57 AM

Ya i am still trying to figure out how to do the "fly out" version of it. Ive been to so many sites reading posts my eyes have exploded 8 or 9 times now

Buyirugh 08-04-2007 06:50 AM

I'm going to attempt to use Javascript to write a flyout page that really doesn't exist. (document.write maybe?) I'll let you know how it turns out. If that doesn't work, I'm really going to have to dissect another gadget to see how they do it.

therealmosha 08-14-2007 02:32 PM

erm... looks like you forgot several servers... especially valor

justinx 08-31-2007 08:57 PM

Guild Portal
 
Im very interested in this project, is there anyway to get this to work on the guildportal websites ?

I was thinking of adding an icon that would light up or change, when just our server was up / down / locked.

I know very little about html, but i believe guild portal only allows html on the non subscriber sites.

Thanks for reading.

Buyirugh 05-22-2008 09:34 AM

Quote:

Originally Posted by therealmosha (Post 61377)
erm... looks like you forgot several servers... especially valor

Gimme a little bit and I will remedy this.

Narzoo 05-22-2008 09:48 AM

It's very easy to add more servers to the "Up" list. Just copy and paste the up image link and add the server name to it.

I added Splitpaw and Runnyeye to it and have it displayed on my guilds page

http://www.truewatchguild.co.uk/forum/portal.php

I only cared about 3 of the servers (Splitpaw, runnyeye and Antonius) so I sized the box to show just those 3....but now that some servers are down, I can see it needs some editing so it fits :)

Buyirugh 05-29-2008 10:38 AM

Quote:

Originally Posted by therealmosha (Post 61377)
erm... looks like you forgot several servers... especially valor

Ok... I've fixed it. I have made modifications so it uses regular expression matching, instead of string replacing. Also, I have made it so that it is easy to plop in as a PHPNuke block.

Code:

<?php

// If using as stand-along code, comment out the next four lines
if (eregi("block-Network_Status.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}


$get_server = "eq2players.station.sony.com";
$get_page  = "/en/network_status.vm";

$US_Servers = array("Befallen","Blackburrow","Butcherblock","Crushbone","Everfrost","Guk","Kithicor","Mistmoore","Nagafen","Najena","Nektulos","Oasis","Permafrost","Unrest");

$Ex_Servers = array("The Bazaar","Vox");

$RP_Servers = array("Antonia Bayle","Lucan DLere","Venekor");

$Int_Servers = array("Innovation","Runnyeye","Sebilis","Splitpaw","Storms","Valor");

$locked_string = "<span class=\"server_status_locked\">";
$unavail_string = "<span class=\"serverunavailable\">";
$locked_image = "&nbsp;&nbsp;<img align=\"middle\" src=\"/images/netstat-locked.gif\">&nbsp;&nbsp;";

$up_string = "<span class=\"serverup\">";
$up_image = "&nbsp;&nbsp;<img align=\"middle\" src=\"/images/netstat-up.gif\">&nbsp;&nbsp;";

$down_string1 = "<span class=\"serverdown\">";
$down_string2 = "<span class=\"server_status_down\">";
$down_image = "&nbsp;&nbsp;<img align=\"middle\" src=\"/images/netstat-down.gif\">&nbsp;&nbsp;";

$get_file = fsockopen($get_server, 80, $errno, $errstr, 12);

fputs($get_file, "GET ".$get_page." HTTP/1.0\r\n");
fputs($get_file, "Host: ".$get_server."\r\n");
fputs($get_file, "Referer: http://".$get_server."\r\n");
fputs($get_file, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\r\n\r\n");

//$get_file = fopen("http://".$get_server.$get_page, "r");

while(!feof($get_file)) {
        $get_data .= fread($get_file, 4096);
}


$clean_content = "<b>US Servers:</b><br>";

for ($i = 0; $i < count($US_Servers); $i++) {
        if (strpos($get_data, $locked_string.$US_Servers[$i])) {
                $clean_content .= $locked_image.$US_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $unavail_string.$US_Servers[$i])) {
                $clean_content .= $locked_image.$US_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $up_string.$US_Servers[$i])) {
                $clean_content .= $up_image.$US_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $down_string1.$US_Servers[$i])) {
                $clean_content .= $down_image.$US_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $down_string2.$US_Servers[$i])) {
                $clean_content .= $down_image.$US_Servers[$i]."<br/>";
        } else {
                $clean_content .= $up_image.$US_Servers[$i]."<br/>";
        }
}


$clean_content .= "<hr size=\"1\"><b>Exchange Servers:</b><br>";

for ($i = 0; $i < count($Ex_Servers); $i++) {
        if (strpos($get_data, $locked_string.$Ex_Servers[$i])) {
                $clean_content .= $locked_image.$Ex_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $unavail_string.$Ex_Servers[$i])) {
                $clean_content .= $locked_image.$Ex_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $up_string.$Ex_Servers[$i])) {
                $clean_content .= $up_image.$Ex_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $down_string1.$Ex_Servers[$i])) {
                $clean_content .= $down_image.$Ex_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $down_string2.$Ex_Servers[$i])) {
                $clean_content .= $down_image.$Ex_Servers[$i]."<br/>";
        } else {
                $clean_content .= $up_image.$Ex_Servers[$i]."<br/>";
        }
}


$clean_content .= "<hr size=\"1\"><b>RP Servers:</b><br>";

for ($i = 0; $i < count($RP_Servers); $i++) {
        if (strpos($get_data, $locked_string.$RP_Servers[$i])) {
                $clean_content .= $locked_image.$RP_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $unavail_string.$RP_Servers[$i])) {
                $clean_content .= $locked_image.$RP_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $up_string.$RP_Servers[$i])) {
                $clean_content .= $up_image.$RP_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $down_string1.$RP_Servers[$i])) {
                $clean_content .= $down_image.$RP_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $down_string2.$RP_Servers[$i])) {
                $clean_content .= $down_image.$RP_Servers[$i]."<br/>";
        } else {
                $clean_content .= $up_image.$RP_Servers[$i]."<br/>";
        }
}


$clean_content .= "<hr size=\"1\"><b>International Servers:</b><br>";

for ($i = 0; $i < count($Int_Servers); $i++) {
        if (strpos($get_data, $locked_string.$Int_Servers[$i])) {
                $clean_content .= $locked_image.$Int_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $unavail_string.$Int_Servers[$i])) {
                $clean_content .= $locked_image.$Int_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $up_string.$Int_Servers[$i])) {
                $clean_content .= $up_image.$Int_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $down_string1.$Int_Servers[$i])) {
                $clean_content .= $down_image.$Int_Servers[$i]."<br/>";
        } elseif (strpos($get_data, $down_string2.$Int_Servers[$i])) {
                $clean_content .= $down_image.$Int_Servers[$i]."<br/>";
        } else {
                $clean_content .= $up_image.$Int_Servers[$i]."<br/>";
        }
}


$content = "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
$content .= "<tr><td>";

$content .= $clean_content;

$content .= "</td></tr>";
$content .= "</table>";

// If using as stand-along code, remove the two comment slashes on the next line.
//echo $content;

?>


Buyirugh 03-28-2009 01:02 AM

1 Attachment(s)
Had some time and was working on a new website with Joomla. Turned this into a little Joomla module.

Kennin 02-24-2010 09:38 PM

Could someone please explain this to the detail to an absolute nitwit in programming things?
Oh, btw, I use WinXP.

Minimichael 10-12-2010 11:12 AM

Since eq2players is no more, will simply changing the URL to everquest2.com make this usable again?

Buyirugh 10-12-2010 12:41 PM

No. The module was parsing the old network status page, which does not exist at all anymore. The module would need to be modified to reparse the new page on everquest2.com. I don't think it would be difficult, would just take a little time to run through the code.

Minimichael 10-12-2010 12:48 PM

Quote:

Originally Posted by Buyirugh (Post 93789)
No. The module was parsing the old network status page, which does not exist at all anymore. The module would need to be modified to reparse the new page on everquest2.com. I don't think it would be difficult, would just take a little time to run through the code.

LOL How much begging would it take for that to happen?

I've seen this working on a couple guild websites and just think it would be nice to have it on ours.

Thank you in advance if you have the time to take a gander at this again.


All times are GMT -5. The time now is 08:59 PM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI