Back to vBulletin 4.x Add-ons

Rift Shard Status Block
Mod Version: 1.01, by Jedric

vB Version: 4.x.x Rating: (1 vote - 5.00 average) Installs: 8
Released: 27 Feb 2011 Last Update: Never Downloads: 0
Not Supported Re-usable Code  

Want to add a shard status block for Rift to your forums or CMS?
  1. Go to Forums & Moderators, Forum Blocks Manager. Click "Add Block".
  2. For the title, name it something like "______ Shard Status".
  3. Cache Time = 1
  4. Active = Yes
  5. Content Type = PHP
  6. Content:
    PHP Code:
     // The URL of the official shard status feed
     
    define ('URL''http://www.riftgame.com/en/status/na-status.xml');
     
     
    // Change this to the name of your shard
     
    define ('SHARD''Deepstrike');
     if((
    $fp fopen(URL'r'))) {
            
    $respMsg '';
            while(!
    feof($fp)) {
                
    $buffer .= fgets($fp128); 
      }
            
    fclose($fp);
            
    $output '';
      
    $doc DOMDocument::loadXML($buffer);
      if (
    $doc) {
       
    $domXPath = new DOMXPath($doc);
       
    $filtered $domXPath->query('/status/shard[@name="' SHARD '"]');
       if (
    $filtered->length == 1) {
        
    $shardStatus $filtered->item(0);
        
    $shardIsUp = (strcasecmp($shardStatus->getAttribute('online'), 'True') == 0);
        
    $shardPopulation $shardStatus->getAttribute('population');
        if (
    strcasecmp($shardPopulation'high') == 0) {
         
    $shardPopulation '<span style="color: red;">High</span>';
        } else if (
    strcasecmp($shardPopulation'medium') == 0) {
         
    $shardPopulation '<span style="color: orange;">Medium</span>';
        } else if (
    strcasecmp($shardPopulation'low') == 0) {
         
    $shardPopulation '<span style="color: green;">Low</span>';
        }
        
    $shardIsLocked = (strcasecmp($shardStatus->getAttribute('locked'), 'True') == 0);
        
    $shardQueue $shardStatus->getAttribute('queued');
        
    $output .= '<center><p><b>Status:</b><br>';
        if (
    $shardIsLocked) {
         
    $output .= '<span style="color: red;">Locked</span>';
        } else if (
    $shardIsUp) {
         
    $shardIsUp $output .= '<span style="color: green;">Online</span>' $output .= '<span style="color: red;">Offline</span>';
         
    $output .= '</p><p><b>Population:</b><br>';
         
    $output .= $shardPopulation '<br></p><p><b>Queue:</b><br>' $shardQueue '</p>';
        }
        
    $output .= '<br />Code by <a href="http://nervehq.com" target="_blank">Nerve</a>.';
        
    $output .= '</center>';
        return 
    $output;
       }
      }
        } else {
         return 
    '';
        } 
  7. Change define ('SHARD', 'Deepstrike'); to define ('SHARD', 'YourShardName');
  8. Click "Save".
  9. You are done.

Example:
http://nervehq.com/forums/

Download

No files for download.

Similar Mods

Miscellaneous Hacks Ventrilo Status Block for vBulletin and vBadvanced vBulletin 3.8 Add-ons
Miscellaneous Hacks Warhammer Server Status Block for vBadvanced vBulletin 3.8 Add-ons
Profile Enhancements Show online/offline status in friends block vBulletin 3.7 Template Modifications

vblts.ru supports vBulletin®, 2022-2024