Example #1
0
         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";
         $display = "<center><table width=\"95%\" border=\"0\">\n";
         $display .= VentriloDisplay1($vstat, $name, 0, 0);
         $display .= "</table></center>\n";
     }
     return $display;
 } elseif ($addon['config']['guildspeak_vent_mode'] == 0) {
     require_once $addon['inc_dir'] . 'vent.inc.php';
     $vent = new Vent();
     $vent->setTimeout(300000);
     // 300 ms timeout
     if ($vent->makeRequest(2, $addon['config']['guildspeak_vent_host'], $addon['config']['guildspeak_vent_port'], $addon['config']['guildspeak_vent_pass'])) {
         $res = array('NAME' => '', 'PHONETIC' => '', 'COMMENT' => '', 'AUTH' => '', 'MAXCLIENTS' => '', 'VOICECODEC' => '', 'VOICEFORMAT' => '', 'UPTIME' => '', 'PLATFORM' => '', 'VERSION' => '', 'CHANNELCOUNT' => '', 'CLIENTCOUNT' => '', 'CLIENTFIELDS' => '', 'CLIENT:' => '');
         $clientarr = array();
         $cfields = array();
         $response = $vent->getResponse();
         // Start sorting and cleaning the string into an array
         foreach ($res as $key => $value) {
Example #2
0
function VentriloDisplay1(&$stat, $name, $cid, $bgidx)
{
    $chan = $stat->ChannelFind($cid);
    if ($bgidx % 2) {
        $bg = "#666666";
    } else {
        $bg = "#333333";
    }
    /*
      if ( $chan->m_prot )
        $fg = "#FF0000";
      else
        $fg = "#FFFFFF";
    */
    $fg = "#FFFFFF";
    if ($chan->m_prot) {
        if ($bgidx % 2) {
            $bg = "#660000";
        } else {
            $bg = "#330000";
        }
    }
    echo "  <tr>\n";
    echo "    <td bgcolor=\"{$bg}\"><font color=\"{$fg}\"><strong>";
    echo $name;
    echo "</strong></font>\n";
    echo "      <table width=\"95%\" border=\"0\" align=\"right\">\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;
        }
        echo "      <tr>\n";
        echo "        <td bgcolor=\"#FFFFFF\">";
        $flags = "";
        if ($client->m_admin) {
            $flags .= "A";
        }
        if ($client->m_phan) {
            $flags .= "P";
        }
        if (strlen($flags)) {
            echo "\"{$flags}\" ";
        }
        echo $client->m_name;
        if ($client->m_comm) {
            echo " ({$client->m_comm})";
        }
        echo "  </td>\n";
        echo "      </tr>\n";
    }
    // Display sub-channels for this channel.
    for ($i = 0; $i < count($stat->m_channellist); $i++) {
        if ($stat->m_channellist[$i]->m_pid == $cid) {
            $cn = $stat->m_channellist[$i]->m_name;
            if (strlen($stat->m_channellist[$i]->m_comm)) {
                $cn .= " (";
                $cn .= $stat->m_channellist[$i]->m_comm;
                $cn .= ")";
            }
            VentriloDisplay1($stat, $cn, $stat->m_channellist[$i]->m_cid, $bgidx + 1);
        }
    }
    echo "      </table>\n";
    echo "    </td>\n";
    echo "  </tr>\n";
}