function VentriloDisplayEX1(&$stat, $name, $cid, $bgidx) { global $colors; $chan = $stat->ChannelFind($cid); echo "<name>" . $name . "</name>"; for ($i = 0; $i < count($stat->m_clientlist); $i++) { $client = $stat->m_clientlist[$i]; if ($client->m_cid != $cid) { continue; } echo "<user>"; $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 "</user>"; } // 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 .= ")"; } VentriloDisplayEX1($stat, $cn, $stat->m_channellist[$i]->m_cid, $bgidx + 1); } } }
function VentriloDisplayEX1(&$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. echo "<tr><td></td></tr>"; 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='#999999'>"; $flags = ""; if ($client->m_admin) { $flags .= "A"; } if ($client->m_phan) { $flags .= "P"; } if (strlen($flags)) { $content .= $flags; } $content .= " "; 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 .= ")"; } VentriloDisplayEX1($stat, $cn, $stat->m_channellist[$i]->m_cid, $bgidx + 1); } } echo "</table>\n"; echo "</td>\n"; echo "</tr>\n"; }
VentriloInfoEX1($stat); echo "</table></center>\n"; ?> <table class="table"> <tr> <td width='30%'><strong>Hostname or IP</strong></td> <td width='70%'>{{ vent.hostname }}</td> </tr> <tr> <td><strong>Port number</strong></td> <td>{{ vent.port }}</td> </tr> <tr> <td width='30%'><strong>Password</strong></td> <td width='70%'><button type="button" class="btn btn-sm btn-info" data-toggle="popover" data-placement="top" title="Ventrilo Server Password" data-content="{{ vent.password }}">Show Password</button></td> </tr> <tr> <td width='30%'><strong>Current Users</strong></td> <td width='70%'> <?php echo "<br>\n"; echo "<center><table width=\"95%\" border=\"0\">\n"; VentriloDisplayEX1($stat, "MoneyTreesHQ", 0, 0); echo "</table></center>\n"; ?> </td> </tr> </table> </div> </div> </section>
<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>
function VentriloDisplayEX1(&$stat, $name, $cid, $bgidx) { $chan = $stat->ChannelFind($cid); $bg = "#000000"; $fg = "#FE7200"; if ($chan->m_prot == "0") { if ($bgidx % 2) { $img = "pub_min"; } else { $img = "pub_exp"; } } else { if ($chan->m_prot == "1") { if ($bgidx % 2) { $img = "pass_min"; } else { $img = "pass_exp"; } } else { if ($chan->m_prot == "2") { if ($bgidx % 2) { $img = "auth_min"; } else { $img = "auth_exp"; } } } } $disp_out .= " <tr>\n"; if ($name != 'nil232143241432432131') { $disp_out .= " <td style=\"padding-left:20px;border:0;\"><img src=\"" . IMAGE_PATH . "/ventrilo/" . $img . ".gif\" alt=\"\" class=\"tsicon\"/> <span style=\"color:{$fg};font-weight:bold;\">"; $disp_out .= $name; $disp_out .= "</span>\n"; } else { $disp_out .= '<td style="padding-left:20px;">'; } $clientcount = count($stat->m_clientlist); $chancount = count($stat->m_channellist); // Display Client for this channel. $found = 1; for ($i = 0; $i < $clientcount; $i++) { $client = $stat->m_clientlist[$i]; if ($client->m_cid != $cid) { continue; } if ($found == 1) { $disp_out .= " <table>\n"; } $found++; $disp_out .= " <tr>\n"; $disp_out .= " <td style=\"border:0;\"><img src=\"" . IMAGE_PATH . "/ventrilo/user.gif\" alt=\"\" class=\"tsicon\"/> "; $flags = ""; if ($client->m_admin) { $flags .= "A"; } if ($client->m_phan) { $flags .= "P"; } if (strlen($flags)) { $disp_out .= "\"{$flags}\" "; } $disp_out .= $client->m_name; if ($client->m_comm) { $disp_out .= " ({$client->m_comm})"; } $disp_out .= " </td>\n"; $disp_out .= " </tr>\n"; } // Display sub-channels for this channel. for ($i = 0; $i < $chancount; $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 .= ")"; } $disp_out .= VentriloDisplayEX1($stat, $cn, $stat->m_channellist[$i]->m_cid, $bgidx + 1); } } if ($found > 1) { $disp_out .= " </table>\n"; } $disp_out .= " </td>\n"; $disp_out .= " </tr>\n"; return $disp_out; }