Ventrilo Tech Support

Ventrilo Tech Support (http://forum.ventrilo.com/index.php)
-   Server (http://forum.ventrilo.com/forumdisplay.php?f=8)
-   -   Ventrilo server status work around (http://forum.ventrilo.com/showthread.php?t=3756203)

zbyke 10-09-2014 04:59 PM

Ventrilo server status work around
 
I wanted to post this for anyone looking to show their server's ventrilo status on their site, when you can't use the files provided by ventrilo due to how your host is set up.

Things you will need to do:
1.) Find a site that will output an xml of your ventrilo status (just use a search engine and search for ventrilo server xml)
2.) Create a file named "index.php"
3.) Add the code below to the file and save it
4.) Upload the file to your server, from there you can use the include function to call the ventrilo status file.



PHP Code:

<?PHP
//START THE TABLE, YOU CAN CHANGE THE TABLE BACKGROUND COLOE HERE
echo "<table width=\"209\" bgcolor=\"#0d0d0d\">";
//SITE YOU FOUND OUTPUTTING THE XML OF YOUR VENTRILO SERVER
$xml simplexml_load_file('http://LINK-CONTAINING-YOUR-VENTRILO-XML'); // for files



//EACH CHANNEL COLOR IS WHITE (#ffffff), YOU CAN CHANGE TO WHAT SUITS YOU
//EACH USER NAME IS GREEN (#009e1a), YOU CAN CHANGE TO WHAT SUITS YOU
//EACH "(ADMIN)" is RED (#ff0000),YOU CAN CHANGE TO WHAT SUITS YOU

foreach($xml->channel as $lobby) {
echo 
"<tr><td>";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/server_icon.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$lobby->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";
}

//ALL CHANNELS UNDER LOBBY
foreach($xml->channel->channel as $channel) {
if(
$channel->attributes()->prot == "0"){
echo 
"<tr><td>&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_0_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$channel->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";    
                                        }else{
echo 
"<tr><td>&nbsp;&nbsp;";                                            
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_1_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$channel->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";                                          
  }

if(
$channel->client){
for ( 
$i 0$i count($channel->client); $i++ ){
$client $channel->client$i ];

        if ( 
$client->attributes()->cid != $client->attributes()->cid )

            continue;
echo 
"<tr><td>&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/player.gif' /><font color=\"#009e1a\">";
if(
$client->attributes()->admin == "1"){ 

     echo 
$client->attributes()->name
     echo 
"&nbsp;<font color=\"#ff0000\">(Admin)</font>";
     }else{
     echo 
$client->attributes()->name;
     }

echo 
"</td></tr>";
}
}

//LOBBY=>CHANNEL=>SUB CHANNEL
foreach($channel->channel as $subchannel) {
if(
$subchannel->attributes()->prot == "0"){
echo 
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_0_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$subchannel->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";    
                                        }else{
echo 
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;";                                            
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_1_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$subchannel->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";                                          
  }

if(
$subchannel->client){
for ( 
$i 0$i count($subchannel->client); $i++ ){
$client $subchannel->client$i ];

        if ( 
$client->attributes()->cid != $client->attributes()->cid )

            continue;
echo 
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/player.gif' /><font color=\"#009e1a\">";
if(
$client->attributes()->admin == "1"){ 

     echo 
$client->attributes()->name
     echo 
"&nbsp;<font color=\"#ff0000\">(Admin)</font>";
     }else{
     echo 
$client->attributes()->name;
     }

echo 
"</td></tr>";
}
}

//LOBBY=>CHANNEL=>SUB CHANNEL=>SUB CHANNEL
foreach($subchannel->channel as $subchannel2) {
if(
$subchannel2->attributes()->prot == "0"){
echo 
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_0_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$subchannel2->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";    
                                        }else{
echo   
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";                                             
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_1_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$subchannel2->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";                                          
  }

if(
$subchannel2->client){
for ( 
$i 0$i count($subchannel2->client); $i++ ){
$client $subchannel2->client$i ];

        if ( 
$client->attributes()->cid != $client->attributes()->cid )

            continue;
echo 
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/player.gif' /><font color=\"#009e1a\">";
if(
$client->attributes()->admin == "1"){ 

     echo 
$client->attributes()->name
     echo 
"&nbsp;<font color=\"#ff0000\">(Admin)</font>";
     }else{
     echo 
$client->attributes()->name;
     }

echo 
"</td></tr>";
}
}

//LOBBY=>CHANNEL=>SUB CHANNEL=>SUB CHANNEL=>SUB CHANNEL
foreach($subchannel2->channel as $subchannel3) {
if(
$subchannel3->attributes()->prot == "0"){
echo 
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_0_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$subchannel3->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";    
                                        }else{
echo     
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";                                               
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_1_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$subchannel3->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";                                          
  }

if(
$subchannel3->client){
for ( 
$i 0$i count($subchannel3->client); $i++ ){
$client $subchannel3->client$i ];

        if ( 
$client->attributes()->cid != $client->attributes()->cid )

            continue;
echo 
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/player.gif' /><font color=\"#009e1a\">";
if(
$client->attributes()->admin == "1"){ 

     echo 
$client->attributes()->name
     echo 
"&nbsp;<font color=\"#ff0000\">(Admin)</font>";
     }else{
     echo 
$client->attributes()->name;
     }

echo 
"</td></tr>";
}
}
}


}
}
}
echo 
"</table>";
?>


This will output The lobby and all channels under your lobby and upto 3 sub channels.

Example:
  • Lobby
    • channel
      • sub channel
      • sub channel
        • sub channel
        • sub channel
          • sub channel
        • sub channel
    • another channel
      • sub channel
      • sub channel
        • sub channel
        • sub channel
          • sub channel
    • channel




etc.

zbyke 10-12-2014 02:54 PM

I updated the code, realized I posted the wrong file. If you have more sub channels, then I would suggest cleaning up your ventrilo server...

but you can add more sub channels here
PHP Code:

echo "</td></tr>";
}
}
//ADD MORE CODE HERE
}


}
}
}
echo 
"</table>";
?> 

where you would change the sub channel number like so
PHP Code:


//LOBBY=>CHANNEL=>SUB CHANNEL=>SUB CHANNEL
=>SUB CHANNEL=>SUB CHANNEL
foreach($subchannel3->channel as $subchannel4) {
if(
$subchannel4->attributes()->prot == "0"){
echo 
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_0_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$subchannel4->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";    
                                        }else{
echo     
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";                                               
echo 
"<img src='http://view.light-speed.com//images/s_vent2/channel_1_empty.gif' />";
echo 
"<font color=\"#ffffff\">";
echo 
$subchannel4->attributes()->name;
echo 
"</font>";
echo 
"</td></tr>";                                          
  }

if(
$subchannel4->client){
for ( 
$i 0$i count($subchannel4->client); $i++ ){
$client $subchannel4->client$i ];

        if ( 
$client->attributes()->cid != $client->attributes()->cid )

            continue;
echo 
"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo 
"<img src='http://view.light-speed.com//images/s_vent2/player.gif' /><font color=\"#009e1a\">";
if(
$client->attributes()->admin == "1"){ 

     echo 
$client->attributes()->name
     echo 
"&nbsp;<font color=\"#ff0000\">(Admin)</font>";
     }else{
     echo 
$client->attributes()->name;
     }

echo 
"</td></tr>";
}
}
//AND ADD MORE SUB CHANNELS HERE


</span></span></code></code>

HarpyWar 09-02-2017 11:33 AM

Where is a download link of the status tool for Ventrilo 4?

Prog-Rocker 09-02-2017 02:05 PM

I will try to find out and let you know


All times are GMT -5. The time now is 03:20 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.