WoW Realm Status

Description

Add your realm status to your PHP enabled website.

Having Issues or have a Suggestion?

  • Please don't use the comments to post trouble tickets or suggestions. Instead post a ticket on CurseForge. Thanks.
    • Any comments containing bug reports or feature requests will be deleted on sight and any comments asking where or why (referring to said comments) will also be deleted on sight.

Notice

  • Click here to see all realms on black background. Choose one from the drop-down to pin it to the top of the list. Included in the ZIP as realmstatus.php
  • Click here to see Blade's Edge on white background (used to debug single quotes). Included in the ZIP as rs_debug.php

Disclaimer

  • This is not an actual addon, it's a PHP script that is executed by a web server.

Instructions

  • Requires a webserver running PHP.
  • Upload the files to a web accessable directory, then point your browser to:
http://{your domain}/{path to files}/realmstatus.php

In-File Comments

   <array|string> wow_realm_status( [<string|boolean|null> server], [<string> return_string] )

   @optional <string|boolean|null> server: The server to check the status of.
       Default: Check all servers.
   @optional <string> return_string: If supplied, a string based on the format will be returned.
       This parameter is ignored if no <string> server is supplied.
       If server is passed <boolean> false or <null> null, the return array will contain strings based on the
           replacements below indexed by the server name.
       Replacements Table:
           %r => the server name.
           %s => the status of the server.
           %t => the type of server.
           %l => the population of the server.
       Default: Return an array.

   @return <array>: An array filled as such:
       If <string> server is a server name,
           [0] and ['s'] => Color coded status.
               Green "Up" if the server is online.
               Red "Down" if the server is offline.
           [1] and ['l'] => Color coded population.
               Green "Low".
               Aqua "Medium".
               Yellow "High".
               Red "Max (Queued)".
               Magenta "None" (only if the server is offline).
           [2] and ['t'] => Server type.
               Red "Normal".
               Red "PVP".
               Red "RP".
               Red "RPPVP".
       If <string> server is left out,
           [<zero-based numerical index>] and [<realm name>] =>
               [0] and ['s'] => Color coded status.
                   Green "Up" if the server is online.
                   Red "Down" if the server is offline.
               [1] and ['l'] => Color coded population.
                   Green "Low".
                   Aqua "Medium".
                   Yellow "High".
                   Red "Max (Queued)".
                   Magenta "None" (only if the server is offline).
               [2] and ['t'] => Server type.
                   Red "Normal".
                   Red "PVP".
                   Red "RP".
                   Red "RPPVP".
   @return <string>: A formatted string based on <string> return_string.

   Example Usage:
       // Check one server. Returns <array>
       $server = 'Your Server';
       list($stat, $pop, $type) = wow_realm_status($server);
       echo $server . '(' . $type . ') is ' . $stat . ($pop != 'None' ? ' with ' . $pop . ' population') . '.';

       // Check one server and format the string to your liking. Returns <string>
       $server = 'Your Server';
       $server_status = wow_realm_status($server, '%r (%t) is %s with %l population.');
       echo $server_status;

       // Check all servers. Returns <array> of <arrays>
       $realm_list = wow_realm_status();
       for ($i = 0; $status = $realm_list[$i]; $i++) {
           list($stat, $pop, $type) = $status;
           echo $server . '(' . $type . ') is ' . $stat . ($pop != 'None' ? ' with ' . $pop . ' population') . '.<br />' . "\n";
       }

       // Check all servers and format the string to your liking. Returns <array> of <strings>
       $realm_list = wow_realm_status(false, '%r (%t) is %s with %l population.<br />' . "\n");
       foreach ($realm_list AS $str) {
           echo $str;
       }

   Error Conditions:
       Cannot connect to the realm status page:
           Issue a PHP style warning and return to the calling script.
       Cannot find the supplied server on the realm status page:
           Issue a PHP style warning and return to the calling script. 

Donate

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
Nov 07, 2008
Category
Last update
Dec 07, 2010
Development stage
Release
License
Written or Edited by Eric Gingell
Curse link
WoW Realm Status
Downloads
3,511
Recent files

Authors