Example #1
0
	be read if you are having problems making these scripts function properly.
	
	In it's current state this script is not usable. You MUST read the
	ventriloreadme.txt file if you do not know what needs to be changed.
	
	The location of the 'ventrilo_status' program must be accessible from
	PHP and what ever HTTP server you are using. This can be effected by
	PHP safemode and other factors. The placement, access rights and ownership
	of the file it self is your responsibility. Change to fit your needs.
*/
$stat = new CVentriloStatus();
$stat->m_cmdprog = $u->db->getSetting("vent_path");
// Adjust accordingly.
$stat->m_cmdcode = "2";
// Detail mode.
$stat->m_cmdhost = $u->db->getSetting("vent_server");
// Assume ventrilo server on same machine.
$stat->m_cmdport = $u->db->getSetting("vent_port");
// Port to be statused.
$stat->m_cmdpass = $u->db->getSetting("vent_pass");
// Status password if necessary.
echo "<ventrilo>";
if ($stat->Request()) {
    echo "<name>{$stat->m_error}</name>";
} else {
    if ($stat->m_clientcount == 0) {
        echo "<user>The Ventrilo server is lonely</user>";
    }
    VentriloDisplayEX1($stat, $stat->m_name, 0, 0);
}
echo "</ventrilo>";
            ?>
			</td>
		</tr>
<?php 
        }
    }
    if (isset($vent_servers)) {
        require_once PAGE_PATH . '/ventrilostatus.php';
        foreach ($vent_servers as $vent_server) {
            $ve_info = new CVentriloStatus();
            $ve_info->m_cmdcode = 2;
            // Detail mode.
            $ve_info->m_cmdhost = $vent_server['addr'];
            $ve_info->m_cmdport = $vent_server['queryPort'];
            /////////
            $rc = $ve_info->Request();
            //	if ($rc) {
            //		echo "CVentriloStatus->Request() failed. <strong>$ve_info->m_error</strong><br /><br />\n";
            //	} else {
            $ve_channels = $ve_info->m_channelcount;
            $ve_slots = $ve_info->m_clientcount . '/' . $ve_info->m_maxclients;
            //	}
            ?>
  
			<tr class="bg1">
				<td class="fHeading">
					<img src="<?php 
            echo IMAGE_PATH;
            ?>
/ventrilo/ventrilo.png" alt="venticon" />
					&nbsp;<a href="<?php 
Example #3
0
  <body>

<?php 
include "ventrilostatus.php";
include "ventrilodisplay_ex1.php";
$stat = new CVentriloStatus();
$stat->m_cmdprog = "C:/Storage/Web/Online/roster/addons/ventstatus/ventrilo_status";
// Adjust accordingly.
$stat->m_cmdcode = "2";
// Detail mode.
$stat->m_cmdhost = "127.0.0.1";
// Assume ventrilo server on same machine.
$stat->m_cmdport = "3784";
// Port to be statused.
$stat->m_cmdpass = "";
// Status password if necessary.
$rc = $stat->Request();
if ($rc) {
    echo "CVentriloStatus->Request() failed. <strong>{$stat->m_error}</strong><br><br>\n";
}
$name = $stat->m_name;
if (strlen($stat->m_comment)) {
    $name .= " ({$stat->m_comment})";
}
echo "<table width=\"100%\" border=\"0\">\n";
VentriloDisplayEX1($stat, $name, 0, 0);
echo "</table>\n";
?>
	</body>
</html>
Example #4
0
 if ($addon['config']['guildspeak_vent_mode'] == 1) {
     include $addon['inc_dir'] . 'ventrilostatus.php';
     include $addon['inc_dir'] . 'ventrilodisplay.php';
     // Set Ventrilo status settings
     $vstat = new CVentriloStatus();
     $vstat->m_cmdprog = $addon['config']['guildspeak_vent_prog'];
     // Adjust accordingly.
     $vstat->m_cmdcode = $addon['config']['guildspeak_vent_code'];
     // Detail mode.
     $vstat->m_cmdhost = $addon['config']['guildspeak_vent_host'];
     // Assume ventrilo server on same machine.
     $vstat->m_cmdport = $addon['config']['guildspeak_vent_port'];
     // Port to be statused.
     $vstat->m_cmdpass = $addon['config']['guildspeak_vent_pass'];
     // Status password if necessary.
     $rc = $vstat->Request();
     if ($rc) {
         roster_die("CVentriloStatus->Request() failed.<br>\n<strong>{$vstat->m_error}</strong><br>\n", "GuildSpeak Error", "sred");
     }
     // Create ventrilo web link
     $weblink = "ventrilo://{$vstat->m_cmdhost}:{$vstat->m_cmdport}/servername={$vstat->m_name}";
     if ($addon['config']['guildspeak_vent_disp'] == 1) {
         include $addon['inc_dir'] . 'ventriloinfo.php';
         $display = VentriloInfo1($vstat);
     } elseif ($addon['config']['guildspeak_vent_disp'] == 2) {
         $name = "";
         $display = "<center><table width=\"95%\" border=\"0\">\n";
         $display .= VentriloDisplay2($vstat, $name, 0, 0);
         $display .= "</table></center>\n";
     } elseif ($addon['config']['guildspeak_vent_disp'] == 3) {
         $name = "Lobby";
 public function getVentStatus()
 {
     $stat = new CVentriloStatus();
     $stat->m_cmdcode = "2";
     // Detail mode. 1=General Status, 2=Detail
     // change config below this line only
     $stat->m_cmdhost = $this->settingManager->get("ventaddress");
     // enter your vent server ip or hostname here
     $stat->m_cmdport = $this->settingManager->get("ventport");
     // enter your vent server port number
     $stat->m_cmdpass = $this->settingManager->get("ventpass");
     // Status password if necessary.
     $lobby = new CVentriloChannel();
     $lobby->m_cid = 0;
     // Channel ID.
     $lobby->m_pid = 0;
     // Parent channel ID.
     $lobby->m_prot = 0;
     // Password protected flag.
     $lobby->m_name = "Lobby";
     // Channel name.
     $lobby->m_comm = "This is the lobby";
     // Channel comment.
     $stat->m_channellist[] = $lobby;
     $msg = '';
     $rc = $stat->Request();
     if ($rc !== 0) {
         $msg = "<orange>Could not get ventrilo info: {$stat->m_error}<end>";
     } else {
         $page .= "Channels highlighted <orange>ORANGE<end> are password protected.\n\n";
         $page .= "Hostname: <highlight>{$stat->m_cmdhost}<end>\n";
         $page .= "Port Number: <highlight>{$stat->m_cmdport}<end>\n";
         if ($this->settingManager->get("showventpassword") == 1) {
             $page .= "Password: <highlight>{$stat->m_cmdpass}<end>\n";
         }
         $page .= "\nServer Name: <highlight>{$stat->m_name}<end>\n";
         $page .= "Users: <highlight>{$stat->m_clientcount} / {$stat->m_maxclients}<end>\n";
         if ($this->settingManager->get("showextendedinfo") == 1) {
             $page .= "Voice Encoder: <highlight>{$stat->m_voicecodec_code}<end> - {$stat->m_voicecodec_desc}\n";
             $page .= "Voice Format: <highlight>{$stat->m_voiceformat_code}<end> - {$stat->m_voiceformat_desc}\n";
             $page .= "Server Uptime: " . $this->util->unixtime_to_readable($stat->m_uptime, false) . "\n";
             $page .= "Server Platform: <highlight>{$stat->m_platform}<end>\n";
             $page .= "Server Version: <highlight>{$stat->m_version}<end>\n";
             $page .= "Number of channels: <highlight>{$stat->m_channelcount}<end>\n";
         }
         $page .= "\nChannels:\n";
         foreach ($stat->m_channellist as $channel) {
             $this->displayChannel($channel, $stat->m_clientlist, "", $page);
         }
         $msg = $this->text->make_blob("Ventrilo Info ({$stat->m_clientcount})", $page);
     }
     return $msg;
 }