| Code: |
<?php
// This blocks anyone from accessing the file directly
if (eregi("block-Ventrilo_Status.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$content .= "<sc ript type=\"text/javascript\" src=\"./ventrilo/ventrilo_chan.js\"></scri pt>\n";
$content .= "<table width=\"100%\" align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n <tr>\n";
include("./ventrilo/ventrilostatus.php");
function VentriloDisplayEX1( &$stat, $name, $cid, $bgidx )
{
$chan = $stat->ChannelFind( $cid );
$content .= "<li><strong>";
$content .= "<a href=\"ventrilo://xxx:xxx/servername=xxx&channelname=$name\">$name</a>";
$content .= "</strong>\n";
$content .= "<ul>\n";
// Display Client for this channel.
for ( $i = 0; $i < count( $stat->m_clientlist ); $i++ )
{
$client = $stat->m_clientlist[ $i ];
if ( $client->m_cid != $cid )
continue;
$content .= "<li>";
$flags = "";
if ( $client->m_admin )
$flags .= "A";
if ( $client->m_phan )
$flags .= "P";
if ( strlen( $flags ) )
$content .= "\"$flags\"";
$content .= $client->m_name;
$content .= "</li>\n";
}
// Display sub-channels for this channel.
for ( $i = 0; $i < count( $stat->m_channellist ); $i++ )
{
if ( $stat->m_channellist[ $i ]->m_pid == $cid )
{
$content .= $stat->m_channellist[ $i ]->m_name;
VentriloDisplayEX1( $stat, $cn, $stat->m_channellist[ $i ]->m_cid, $bgidx + 1 );
}
}
$content .= "</ul>\n</li>\n";
}
$stat = new CVentriloStatus;
$stat->m_cmdprog = "/home/xxx/public_html/ventrilo/ventrilo_status"; // Adjust accordingly.
$stat->m_cmdcode = "2";
$stat->m_cmdhost = "xxx"; // server IP or host name
$stat->m_cmdport = "xxx"; // Port to be statused.
$stat->m_cmdpass = ""; // Status password if necessary.
$rc = $stat->Request();
if ( $rc ) {
$content .= "<td width=\"100%\" align=\"center\"><strong>$stat->m_error</strong></td>\n";
}
$content .= "<td width=\"100%\" align=\"center\"><b>$stat->m_clientcount/$stat->m_maxclients</b></td>\n";
//$name = $stat->m_name;
//if ( strlen( $stat->m_comment ) )
// $name .= " ($stat->m_comment)";
$name = "Lobby";
$content .= "</tr>\n<tr>\n";
$content .= "<td width=\"100%\" align=\"left\">\n<ul id=\"ventrilo\">\n";
VentriloDisplayEX1( $stat, $name, $cid, $bgidx );
$content .= "</ul>\n";
$content .= "<scr ipt type=\"text/javascript\">initiate();</scr ipt>\n";
$content .= "</td>\n";
$content .= " </tr>\n</table>";
?> |