Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Rift Shard Status Block Details »»
Rift Shard Status Block
Version: 1.01, by Jedric Jedric is offline
Developer Last Online: Dec 2012 Show Printable Version Email this Page

Category: vBulletin Forum Sideblocks - Version: 4.x.x Rating:
Released: 02-26-2011 Last Update: Never Installs: 8
Re-useable Code  
No support by the author.

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/

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-01-2011, 03:06 PM
reersh9 reersh9 is offline
 
Join Date: Feb 2011
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would I add this in as a widget to the frontpage?
Reply With Quote
  #3  
Old 03-02-2011, 01:00 AM
Jedric Jedric is offline
 
Join Date: Jan 2003
Location: Austin, TX
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Same code, except in a CMS PHP Widget.
Reply With Quote
  #4  
Old 03-08-2011, 01:39 PM
lucige lucige is offline
 
Join Date: Jan 2011
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any idea if this usable in vbadvanced? If so I'm newer to this so I must be missing something.
Reply With Quote
  #5  
Old 03-13-2011, 02:17 PM
reersh9 reersh9 is offline
 
Join Date: Feb 2011
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jedric View Post
Same code, except in a CMS PHP Widget.
I'm sorry Jedric. I'm very unfamiliar with all of this but I really would like to add this to the frontpage. So I add a PHP Direct Execution widget I'm guessing? Just put the code in that?

Edit: I tried creating both a PHP Direct Execution widget entitled Rift Shard Status with a similar description. I put that configured the widget entering the code in the field and calling it vbcms_widget_shard_status. I added a style with the same name (vbcms_widget_shard_status) and put the code in there too. Needless to say, it didn't work.

I'd appreciate some help for a vB noob.

See: www.metaredux.com
Reply With Quote
  #6  
Old 03-30-2011, 11:18 PM
overdriven12 overdriven12 is offline
 
Join Date: Mar 2011
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It got some Errors:

Warnung: fopen() [function.fopen]: URL file-access is disabled in the server configuration in [path]/includes/block/html.php(95) : eval()'d code (Zeile 6)

Warnung: fopen(http://www.riftgame.com/en/status/eu-status.xml) [function.fopen]: failed to open stream: no suitable wrapper could be found in [path]/includes/block/html.php(95) : eval()'d code (Zeile 6)

Warnung: fopen() [function.fopen]: URL file-access is disabled in the server configuration in [path]/includes/block/html.php(95) : eval()'d code (Zeile 6)

Warnung: fopen(http://www.riftgame.com/en/status/eu-status.xml) [function.fopen]: failed to open stream: no suitable wrapper could be found in [path]/includes/block/html.php(95) : eval()'d code (Zeile 6)
Reply With Quote
  #7  
Old 03-30-2011, 11:47 PM
Jedric Jedric is offline
 
Join Date: Jan 2003
Location: Austin, TX
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
URL file-access is disabled in the server configuration
It looks like you need to enable something in your server config. The problem is not with the code.
Reply With Quote
  #8  
Old 03-31-2011, 12:37 AM
overdriven12 overdriven12 is offline
 
Join Date: Mar 2011
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jedric View Post
It looks like you need to enable something in your server config. The problem is not with the code.
thx bro problem solved
Reply With Quote
  #9  
Old 05-26-2011, 11:09 PM
dune3000 dune3000 is offline
 
Join Date: Apr 2007
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not working for me . shows only date any help?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:28 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04618 seconds
  • Memory Usage 2,315KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete