I’ve recently developed a pretty flexible, basic, WordPress Widget for showing a Ventrilo server status. It’s written in PHP, is Object Orientated and uses XML style sheets (XSLT) to allow for easy customisation of the look and feel.
A while back I was setting up a Left4Dead Ventrilo server for a few friends, after I got it up and running, I went searching for a Widget that would let me add a server status to my home page. I just wanted to show is the server was up, who was currently connect and what channel they were in; I didn’t have much luck.
I decided to write one myself in PHP. I wanted it to be flexible enough to support multiple methods of retrieval but also allow to easy changing of the UI.
- It’s asynchronous and won’t affect the load time of the home page as the work is done after page load
- Clear separate of logic between parsing the RCON command out of the server, the Widget code and the UI
- Any information that a UI designer might want in styling the Widget is available in the XML, all they need to do is update the XSLT to hook into it
The widget currently supports: –
- Direct interrogation of the Server – each page load the server is queried in real time to get the status (not suggested).
- CRON interrogation – the server is interrogated from a CRON task, the result is stored in a cache XML file that’s served up locally.
- Support for obtaining the status via: –
- The official Ventrilo status binary file (doesn’t normally work on shared hosting due to permissions)
- A HTTP request to the Ventrilo Spy tool (http://eetara.com/tools/ventrilospy)
I’m sure there’s better ways of implementing it so I’m open to suggestions but I’ve stopped playing at the moment, so lost interest in finishing off the plugin and making it pretty; if anyone wants the code I can hand it over.
- Grab the latest version from github (git clone https://github.com/SoulRob/WP_Ventrilo)
- Place the WP_Ventrilo folder inside the wp-content/plugins directory
- Activate the plugin from the Plugins section of the WordPress Dashboard
- Add the “Ventrilo Status Widget” from the Widgets page to the desired section of the page
- Enter the host name and port of the server to display the status of
- You’ll need to add the following scheduled CRON task on your hosting company, to avoid VentSpy from getting DDOSed. It will generate the XML for the status on a regular basis that the widget will use to render.
cd /path/to/wordpress/wp-content/plugins/WP_Ventrilo/service/cron/; php CronTaskVentSpy.php -h HOSTNAME -o 3784 >/dev/null 2>&1
Plugin is still in development with more options coming eventually. Feel free to tweak the ventrilo_status.xsl file to change how the widget renders.