У Вас меню сайта не работает. Вам нужно его скачать или обновить. Скачайте его ниже.
[CSLUCK mp3 плеер · Новые сообщения · Участники · Правила форума · Поиск · RSS ]


  • Страница 1 из 1
  • 1
Модератор форума: Lexx  
Скрипт TeamSpeak
projectДата: Понедельник, 06/Июл/2009, 16:32:10 | Сообщение # 1

-10th-
Группа: PowerUser
Сообщений: 16
Наград: 0 +
« »

Всем привет админ у меня к тебе есть вопрос как можно сделать такой скрипт? пытаюсь и нечего не получается

Вот скрипт

Code
...........................

// Main function (queries, sorts and displays the teamspeak serverinfo). Its code is not
// very readable... well what shall I say about it... it was hard to write so it should
// be hard to read >
function displayTeamspeak($serverAddress, $serverUDPPort=8767, $serverQueryPort=51234) {
$serverInfo = $this->queryTeamspeakServer($serverAddress, $serverUDPPort, $serverQueryPort);

print("<tr>\n<td class=\"alt1\">\n<table id=\"teamspeakdisplay\" name=\"teamspeakdisplay\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n<td>\n");
if ($serverInfo["queryerror"] != 0) {
$popupInfo = "Server address: " . $serverAddress . (($serverUDPPort != 8767) ? (":" . $serverUDPPort): "");
if ($serverInfo["queryerror"] == 1) {
$popupInfo .= ", Error: could not connect to query port";
} else {
$popupInfo .= ", Error: no server running on port " . $serverUDPPort;
}
print("<table><tr><td>");
print("<img src=\"teamspeakdisplay/teamspeak_offline.png\" alt=\"\" title=\"" . $popupInfo . "\">");
print("</td><td class=\"teamspeakserver\" title=\"" . $popupInfo . "\">");
print("Server offline");
print("</td></tr></table>\n");
} else {
$this->sortServerInfo($serverInfo);

// Generate javascript for teamspeak hyperlinks
$jsTeamspeakId = str_replace(".", "_", $serverAddress) . "_" . $serverUDPPort;
print("<script type=\"text/javascript\">\n<!--\n");
print("function enterServer_" . $jsTeamspeakId . "() {\n");
print(" enterSubChannel_" . $jsTeamspeakId . "(null, false, null);\n");
print("}\n");
print("function enterChannel_" . $jsTeamspeakId . "(channelName, channelPassworded) {\n");
print(" enterSubChannel_" . $jsTeamspeakId . "(channelName, channelPassworded, null);\n");
print("}\n");
print("function enterSubChannel_" . $jsTeamspeakId . "(channelName, channelPassworded, subChannelName) {\n");
print(" var serveraddress = 'teamspeak://" . $serverAddress . ":" . $serverUDPPort . "';\n");
print(" var nickname=window.prompt('Enter your nickname');\n");
print(" if (nickname == null) {\n");
print(" return;\n");
print(" } else if (nickname == \"\") {\n");
print(" window.alert('Could not enter the teamspeak server because you did not enter your nickname');\n");
print(" return;\n");
print(" }\n");
print(" serveraddress = serveraddress + \"/nickname=\" + nickname;\n");
if ($serverInfo["serverinfo"]["server_password"] == "1") {
print(" var password=window.prompt('Enter the teamspeak server password for " . $serverInfo["serverinfo"]["server_name"] . "');\n");
print(" if (password == null) {\n");
print(" return;\n");
print(" } else if (password == \"\") {\n");
print(" window.alert('Could not enter the teamspeak server because you did not enter a server password');\n");
print(" return;\n");
print(" }\n");
print(" serveraddress = serveraddress + \"?password=\" + password;\n");
}
print(" if (channelName != null) { serveraddress = serveraddress + \"?channel=\" + channelName; }\n");
print(" if (channelPassworded) {\n");
print(" var channelpassword=window.prompt('Enter the channel password for channel ' + channelName);\n");
print(" if (channelpassword == null) {\n");
print(" return;\n");
print(" } else if (channelpassword == \"\") {\n");
print(" window.alert('Could not enter the teamspeak server because you did not enter a channel password');\n");
print(" return;\n");
print(" }\n");
print(" serveraddress = serveraddress + \"?channelpassword=\" + channelpassword;\n");
print(" }\n");
print(" if (subChannelName != null) { serveraddress = serveraddress + \"?subchannel=\" + subChannelName; }\n");
print(" window.location=serveraddress;\n");
print("}\n");
print("//--></script>\n");

$popupInfo = "Server address: " . $serverAddress . (($serverUDPPort != 8767) ? (":" . $serverUDPPort): "") . ", Max players: " . $serverInfo["serverinfo"]["server_maxusers"] . ", Uptime: " . $this->_formatTime($serverInfo["serverinfo"]["server_uptime"]);

// Print the topmost element of the teamspeak tree
print("<table><tr><td>");
print("<img src=\"teamspeakdisplay/teamspeak_online.png\" alt=\"\" title=\"" . $popupInfo . "\">");
print("</td><td class=\"teamspeakserver\" title=\"" . $popupInfo . "\">");
print("<a class=\"teamspeakserver\" href=\"javascript:enterServer_" . $jsTeamspeakId . "();\">");
print(str_replace(" ", " ", htmlspecialchars($serverInfo["serverinfo"]["server_name"])));
print("</a>");
print("</td></tr></table>\n");

// Count the number of channels to be listed:
$currentchannels = 0;
foreach($serverInfo["channellist"] as $channelInfo) {
if ($channelInfo["parent"] == -1) {
$currentchannels++;
}
}

// Initialize the channelcounter to zero
$counter = 0;

// Loop through all channels:
foreach($serverInfo["channellist"] as $channelInfo) { if ($channelInfo["parent"] == -1) {

// determine number of players in channel
$currentplayers = 0;
foreach($serverInfo["playerlist"] as $playerInfo) {
if($playerInfo[channelid] == $channelInfo["channelid"]) $currentplayers++;
}

// Count the number of channels to be listed:
$currentplayersandsubchannels = $currentplayers;
foreach($serverInfo["channellist"] as $subchannelInfo) {
if ($subchannelInfo["parent"] == $channelInfo["channelid"]) {
$currentplayersandsubchannels++;
}
}

$popupInfo = "Max players: " . $channelInfo["maxplayers"] . ", Codec: " . $this->_getCodecName($channelInfo["codec"]);
if ($channelInfo["topic"] != "") { $popupInfo = $popupInfo . ", Topic: " . $channelInfo["topic"]; }

// Display channel:
print("<table><tr><td>");
print("<img src=\"teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "3" : "2") . ".png\" alt=\"\">");
print("<img src=\"teamspeakdisplay/channel.png\" alt=\"\" title=\"" . $popupInfo . "\">");
print("</td><td class=\"teamspeakchannel\" title=\"" . $popupInfo . "\">");
print("<a class=\"teamspeakchannel\" href=\"javascript:enterChannel_" . $jsTeamspeakId . "('" . $channelInfo["channelname"] . "', " . (($channelInfo["password"]) == "1" ? "true" : "false") . ");\">");
print(str_replace(" ", " ", htmlspecialchars($channelInfo["displayname"])));
print("</a>");
print("</td></tr></table>\n");

// Initialize the playercounter for this channel to zero
$counter_playerandsubchannels = 0;

// Loop through all players in the current channel:
foreach($serverInfo["playerlist"] as $playerInfo) {

// Is the current player in the current channel?
if ($playerInfo[channelid] == $channelInfo[channelid]) {

$popupInfo = "Time online: " . $this->_formatTime($playerInfo["totaltime"]) . ", Time idle: " . $this->_formatTime($playerInfo["idletime"]) . ", Ping: " . $playerInfo["pingtime"] . "ms";

// Display player:
print("<table><tr><td>");
print("<img src=\"teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "4" : "1") . ".png\" alt=\"\">");
print("<img src=\"teamspeakdisplay/treeimage" . ((($counter_playerandsubchannels + 1) == $currentplayersandsubchannels) ? "3" : "2") . ".png\" alt=\"\">");
print("<img src=\"teamspeakdisplay/player_" . $playerInfo["displayimage"] . ".png\" alt=\"" . $playerInfo["displayimage"] . "\" title=\"" . $popupInfo . "\">");
print("</td><td class=\"teamspeakplayer\" title=\"" . $popupInfo . "\">");
print(str_replace(" ", " ", htmlspecialchars($playerInfo["displayname"])));
print("</td></tr></table>\n");

// Increase the player counter:
$counter_playerandsubchannels++;
}
}

// Loop through all channels:
foreach($serverInfo["channellist"] as $subchannelInfo) { if ($subchannelInfo["parent"] == $channelInfo["channelid"]) {
// determine number of players in channel
$currentplayers = 0;
foreach($serverInfo["playerlist"] as $playerInfo) {
if($playerInfo[channelid] == $subchannelInfo["channelid"]) $currentplayers++;
}

$popupInfo = "Max players: " . $subchannelInfo["maxplayers"] . ", Codec: " . $this->_getCodecName($subchannelInfo["codec"]);
if ($subchannelInfo["topic"] != "") { $popupInfo = $popupInfo . ", Topic: " . $subchannelInfo["topic"]; }

// Display channel:
print("<table><tr><td>");
print("<img src=\"teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "4" : "1") . ".png\" alt=\"\">");
print("<img src=\"teamspeakdisplay/treeimage" . ((($counter_playerandsubchannels + 1) == $currentplayersandsubchannels) ? "3" : "2") . ".png\" alt=\"\">");
print("<img src=\"teamspeakdisplay/channel.png\" alt=\"\" title=\"" . $popupInfo . "\">");
print("</td><td class=\"teamspeaksubchannel\" title=\"" . $popupInfo . "\">");
print("<a class=\"teamspeaksubchannel\" href=\"javascript:enterSubChannel_" . $jsTeamspeakId . "('" . $channelInfo["channelname"] . "', " . (($channelInfo["password"]) == "1" ? "true" : "false") . ", '" . $subchannelInfo["channelname"] . "');\">");
print(str_replace(" ", " ", htmlspecialchars($subchannelInfo[channelname])));
print("</a>");
print("</td></tr></table>\n");

// Initialize the playercounter for this channel to zero
$counter_player = 0;

// Loop through all players in the current channel:
foreach($serverInfo["playerlist"] as $playerInfo) {

// Is the current player in the current channel?
if ($playerInfo[channelid] == $subchannelInfo[channelid]) {

$popupInfo = "Time online: " . $this->_formatTime($playerInfo["totaltime"]) . ", Time idle: " . $this->_formatTime($playerInfo["idletime"]) . ", Ping: " . $playerInfo["pingtime"] . "ms";

// Display player:
print("<table><tr><td>");
print("<img src=\"teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "4" : "1") . ".png\" alt=\"\">");
print("<img src=\"teamspeakdisplay/treeimage" . ((($counter_playerandsubchannels + 1) == $currentplayersandsubchannels) ? "4" : "1") . ".png\" alt=\"\">");
print("<img src=\"teamspeakdisplay/treeimage" . ((($counter_player + 1) == $currentplayers) ? "3" : "2") . ".png\" alt=\"\">");
print("<img src=\"teamspeakdisplay/player_" . $playerInfo["displayimage"] . ".png\" alt=\"" . $playerInfo["displayimage"] . "\" title=\"" . $popupInfo . "\">");
print("</td><td class=\"teamspeakplayer\" title=\"" . $popupInfo . "\">");
print(str_replace(" ", " ", htmlspecialchars($playerInfo["displayname"])));
print("</td></tr></table>\n");

// Increase the player counter:
$counter_player++;
}
}

// Increase the channelcounter
$counter_playerandsubchannels++;
} }

// Increase the channelcounter
$counter++;
} }
}
print("</tr></td></table>");
}
}

// Create an instance of the Teamspeak Display Class
$teamspeakDisplay = new teamspeakDisplayClass;

?>

И должно получиться следуюшие

Помогите очень надо такой сделать smile

 
LexxДата: Понедельник, 20/Июл/2009, 21:54:08 | Сообщение # 2

AdministratoR
Группа: PowerUser
Сообщений: 2009
Наград: 44 +
« »

shampoo, он реализовывается на php, это сделать на uCoz очень сложно, ищи другой скрипт...

Самый лучший способ сказать "Спасибо" - это или
 
projectДата: Среда, 22/Июл/2009, 06:41:13 | Сообщение # 3

-10th-
Группа: PowerUser
Сообщений: 16
Наград: 0 +
« »

Lexx, а у тебя подобия этого скрипта не чего нету ?
 
LexxДата: Среда, 22/Июл/2009, 12:29:52 | Сообщение # 4

AdministratoR
Группа: PowerUser
Сообщений: 2009
Наград: 44 +
« »

shampoo, нет

Самый лучший способ сказать "Спасибо" - это или
 
projectДата: Среда, 22/Июл/2009, 15:25:23 | Сообщение # 5

-10th-
Группа: PowerUser
Сообщений: 16
Наград: 0 +
« »

Lexx, Запечатывай тогда тему smile
 
LexxДата: Среда, 22/Июл/2009, 15:25:56 | Сообщение # 6

AdministratoR
Группа: PowerUser
Сообщений: 2009
Наград: 44 +
« »

закрыто..)

Самый лучший способ сказать "Спасибо" - это или
 
  • Страница 1 из 1
  • 1
Поиск:
Реклама
Спонсоры проекта:
|
Последние новости Самые отвечаемые темы Последние сообщения
 Команда Mousespo...  04/Янв/2010
 tp.uSports стали...  04/Янв/2010
 10 самых пертых ...  04/Янв/2010
 Лучший кээсер де...  04/Янв/2010
 Les Seules объед...  14/Ноя/2009
 Считаем пока пос...  1303
 Слова  425
 Флудилка  395
 Игра в ассоциаци...  381
 Заказ venrilo ко...  162
Тема    Дата, Время  Автор
 Настройка клие...    03/Май/2012, 19:07:24 Lexx
 Проблемы в CS    15/Апр/2012, 15:01:16 Lexx
 CS 1.6 cstr1ke...    11/Апр/2012, 14:38:35 400kg(1337)
 Помогите    26/Мар/2012, 12:23:48 CaHeK2
 Конфиг сервера    26/Мар/2012, 12:22:45 Lexx
 Оказываю услуг...    26/Мар/2012, 12:21:24 Understand
 Обявление    26/Мар/2012, 12:20:59 NRJke
 ПОМГИТЕ АДМИНЫ...    26/Мар/2012, 12:20:23 xom9k
 Как сделать чт...    25/Мар/2012, 16:30:57 VIPP
 Fast Find Enem...    09/Мар/2012, 21:41:10 SKAJIbnEJIb
Новые пользователи Новые мувики
jeddjBallia  02/Фев/2016
ru7ya  19/Янв/2016
89281809606  18/Дек/2015
ChudickOi  09/Дек/2015
MichaelRat  25/Ноя/2015
Koper The Movie 25/Июл/2009
Inevitable 3 - Her... 24/Июл/2009
Incredible 23/Июл/2009
In memory of Ahl 22/Июл/2009
el HighLights 21/Июл/2009
COPYRIGHT © 2007-2010