Sign in to follow this  
Xyp

Wordpress Plugin to display server stats

Recommended Posts

Created a simple wordpress plugin. It just pulls the server stats and displays them in a more modern format than the stats.html that comes with the server software.


 


Currently the plugin relies on your sites css to display everything. I may add some fancy buttons to customize it later on.


 


get it here https://github.com/Dynarev/WUStats


 


This plugin assumes you know how to Administer a server, so that you can set up a webserver to push the xml file.


  • Like 1

Share this post


Link to post
Share on other sites

Cool. Could you generalize it into more general PHP code so it can be easily put on sites using other CMS software?


 


//edit: Basically remove all wordpress-specific bits and just put stats rendering so it could be even put on a otherwise static site, using iframe.


Edited by darkhog

Share this post


Link to post
Share on other sites

Oh I forgot to mention too, built into the code for both the wordpress plugin and the php is the ability for you to add notes to your server name. Like when you start your server, for your steam list name, you can make it YourServer (Some cool notes) anything in between () will be stripped out, including the () when listing the name of your server on your site.


  • Like 1

Share this post


Link to post
Share on other sites

Just to let people know if you have multiple servers on your cluster, there are ways to customize this to show the players on each server.

If you look into your stats.xml you will see a list of <servers> each in order will be 0 for the first 1 for the second 2 for the third etc.

Just for my server the following example takes place, to show how to add each server (note epic servers seem to get clumped into 1)

 

echo '<li>Prime Players: ' . $xml->servers->server[0]['players'] . '/' . $xml->servers->server[0]['maxplayers'] . '</li>';
echo '<li>Plains Players: ' . $xml->servers->server[1]['players'] . '/' . $xml->servers->server[1]['maxplayers'] . '</li>';
echo '<li>PVP Players: ' . $xml->servers->server[2]['players'] . '/' . $xml->servers->server[1]['maxplayers'] . '</li>';

 

I may look into updating the wordpress plugin later on to make this selectable with the plugin options. I currently have bit off way too many projects and need to try to actually finish some of them. Plus I am semi taking a break for the week of the 4th this week.

However if you are using the wordpress plugin and want to add this beforehand, you can use the plugin editor in the admin panel of wordpress and stick this in just fine.

 

If you need assistance or want help customizing it, I will find a few moments to help you, just pm me.

 

 

Share this post


Link to post
Share on other sites

Can you update this to include the maxranks and ranks files in a decent format?

Share this post


Link to post
Share on other sites

Unfortunately the ranks and maxranks is an html table generated by the software. There is also a stats.html that is done the same way, however for this case instance there is a stats.xml that is generated as well, which is what I parsed to create this. To fix the maxranks and ranks you would need a mod that changes the way those pages are generated, or some css overrides to change the way the table cells display away from the css that comes from wurmonline.com (which is what the generated file uses 

http://www.wurmonline.com/css/gameData.css )

 

The results you would get out of modifying the css would be limited at best, and the real problem is everytime the file regenerates it will take away your custom style sheet. So the only real solution is modding it to generate the file in a better way.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this