Хороший скрипт отображения чата для сайта - Не работет.

задавайте Ваши вопросы
Правила форума
СНАЧАЛА ПОЛЬЗУЙТЕСЬ ПОИСКОМ!!!

При обращении просим Вас сразу указывать:
Вашу ОСь? Видео? Звук? DirectX? Логи Мамбл, Мурмур?
Это поможет быстрей и более точно ответить на Ваши вопросы.
Ответить
DjoniBrave
Сообщения: 12
Зарегистрирован: 17 ноя 2009, 01:32

Хороший скрипт отображения чата для сайта - Не работет.

Сообщение DjoniBrave »

Нашел очень классный скрипт, вроде бы даже здесь, на форуме.
Но он не работает с murmurd 1.2.2 :sorry: подскажите что необходимо переделать.
Или в какую сторону копать.
ICE есть и работает, murmur.ice из дистрибутива 1.2.2 брал.
Никаких ошибок скрипт не выдает, просто белый лист.
Вот сам скрипт:

Код: Выделить всё

<!--
// Mumble Viewer
// Copyright (C) 2008  Dominik Radner (aka Urmel)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License (GPL)  as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

//Configuration can be made on Line 112ff.
-->

<html>
<head>
<title>Mumbleviewer</title>
<meta http-equiv="content-type" content="text/html; charset=UTF8">
<style> 
.div_channel {
margin: 0px;
padding: 0px;
position:relative; top:0px;
border-width: 0.1em;
border-style: hidden;
border-color: blue;
font-family: Tahoma,Helvetica;
font-size: 10px;
}
.div_player {
margin: 0px;
padding: 0px;
position:relative; top:0px;
border-width: 0.1em;
border-style: hidden;
border-color: red;
font-family: Tahoma,Helvetica;
font-size: 10px;
}

a:link {
color:black; text-decoration:none;
}
a:visited {
color:black; text-decoration:none;
}
a:active {
color:black; text-decoration:none;
}
a:hover {
color:black; text-decoration:underline
}

</style> 
<script type="text/javascript">

IE4 = (document.all) ? 1 : 0;
NS6 = (document.getElementById) ? 1 : 0;

function set_Layer(layername){

	theImage = layername;

	if (document.images[theImage].src.match('mid2'))
	{
		document.images[theImage].src = './images/list_tree_mid3.gif';
	} 
	else if (document.images[theImage].src.match('mid3'))
	{
		document.images[theImage].src = './images/list_tree_mid2.gif';
	} 
	else if (document.images[theImage].src.match('end2'))
	{
		document.images[theImage].src = './images/list_tree_end3.gif';
	} 
	else if (document.images[theImage].src.match('end3'))
	{
		document.images[theImage].src = './images/list_tree_end2.gif';
	} 

	theLayer = layername;
	if(IE4) {
		theStatus = document.all(theLayer).style.display;
		if (theStatus == 'none') {
			document.all(theLayer).style.display = "inline"; }
		else {
			document.all(theLayer).style.display = "none";} }
	if(NS6) {
		theStatus = document.getElementById(theLayer).style.display;
		if (theStatus == 'none') {
			document.getElementById(theLayer).style.display = "inline"; }
		else {
			document.getElementById(theLayer).style.display = "none"; } } }

</script>


</head>

<body>
<?php

Ice_loadProfile();

// Configuration Start
// Set here your Server IP or DNS
$url='mumble://myserverip:'; 
// Configuration End

function printmainchannel($channelobject,$url,$servername) 
{
	$channeldepth = 0;
	$menustatus = array("1","1");

	$channelobject->c->name = $servername;

	echo "<a href=\"".$url."\">".$channelobject->c->name."</a><br>\n";
	if (count($channelobject->children) + count($channelobject->players) > 0)
	{
		echo "<div class=div_channel id=div_channel_".$channelobject->c->id.">\n";
		foreach ($channelobject->children as $children) {
		printchannel($children,$channelobject->children[count($channelobject->children)-1]->c->id,$channeldepth+1,$menustatus,$url); }
		
		foreach ($channelobject->players as $players) {
		printplayers($players,$channelobject->players[count($channelobject->players)-1]->playerid,$channeldepth+1,$menustatus,$url); }
		echo "</div>\n";
	}
}

function printchannel($channelobject,$lastid,$channeldepth,$menustatus,$url) 
{
	$menustatus[$channeldepth] = 1;
	if ($channelobject->c->id == $lastid)
	{
		$menustatus[$channeldepth] = 0;
	}
	
	$count = 1;
	while($count < $channeldepth)
    {
		if ($menustatus[$count] == 0)
		{
			echo "<img border=0 src=./images/list_tree_space.gif>";
		}
		else
		{
			echo "<img border=0 src=./images/list_tree_line.gif>";
		}
	    $count++;
    }

	if (count($channelobject->children) + count($channelobject->players) > 0)
	{
		if ($channelobject->c->id != $lastid)
		{
			echo "<a href=\"javascript:set_Layer('div_channel_".$channelobject->c->id."')\"><img border=0 name=div_channel_".$channelobject->c->id." src=./images/list_tree_mid2.gif></a>";
		}
		else
		{
			echo "<a href=\"javascript:set_Layer('div_channel_".$channelobject->c->id."')\"><img border=0 name=div_channel_".$channelobject->c->id." src=./images/list_tree_end2.gif></a>";
		}
	}
	else {
		if ($channelobject->c->id != $lastid)
		{
			echo "<img border=0 src=./images/list_tree_mid.gif>";
		}
		else
		{
			echo "<img border=0 src=./images/list_tree_end.gif>";
		}
	}
	echo "<img border=0 src=./images/list_channel.gif>";
	echo "<a href=\"".$url."".str_replace(" ","%20",$channelobject->c->name)."\">".$channelobject->c->name."</a><br>\n";

	if (count($channelobject->children) + count($channelobject->players) > 0)
	{
		echo "<div class=div_channel id=div_channel_".$channelobject->c->id.">\n";
		foreach ($channelobject->children as $children) {
		printchannel($children,$channelobject->children[count($channelobject->children)-1]->c->id,$channeldepth+1,$menustatus,$url); }
		
		foreach ($channelobject->players as $players) {
		printplayers($players,$channelobject->players[count($channelobject->players)-1]->playerid,$channeldepth+1,$menustatus,$url); }
		echo "</div>\n";
	}
	return $menustatus;
}

function printplayers($playerobject,$lastid,$channeldepth,$menustatus) 
{
	echo "<div class=div_player id=div_player>\n";

	$menustatus[$channeldepth] = 1;
	if ($channelobject->c->id == $lastid)
	{
		$menustatus[$channeldepth] = 0;
	}
	
	$count = 1;
	while($count < $channeldepth)
    {
		if ($menustatus[$count] == 0)
		{
			echo "<img border=0 src=./images/list_tree_space.gif>";
		}
		else
		{
			echo "<img border=0 src=./images/list_tree_line.gif>";
		}
	    $count++;
    }
	if ($playerobject->playerid == $lastid) echo "<img border=0 src=./images/list_tree_end.gif>";
	else echo "<img border=0 src=./images/list_tree_mid.gif>";
	echo "<img border=0 src=./images/list_player.gif>";
	echo $playerobject->name;
	if ($playerobject->playerid != -1)
	{
		echo "<img border=0 src=./images/player_auth.gif>";	
	}
	if ($playerobject->mute)
	{
		echo "<img border=0 src=./images/player_unknown.gif>";	
	}
	if ($playerobject->deaf)
	{
		echo "<img border=0 src=./images/player_unknown2.gif>";	
	}
	if ($playerobject->suppressed)
	{
		echo "<img border=0 src=./images/player_suppressed.gif>";	
	}
	if ($playerobject->selfMute)
	{
		echo "<img border=0 src=./images/player_selfmute.gif>";	
	}
	if ($playerobject->selfDeaf)
	{
		echo "<img border=0 src=./images/player_selfdeaf.gif>";	
	}
	echo "<br></div>\n"; 
	return $menustatus;
}

$serverid = filter_input(INPUT_GET, 'serverid', FILTER_VALIDATE_INT);

try
{
	$base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502");
	$meta = $base->ice_checkedCast("::Murmur::Meta");

	$servers = $meta->getBootedServers();
	$default = $meta->getDefaultConf();
	
	if($serverid) {
	    $s = $meta->getServer(intval($serverid));
	    $port = $s->getConf('port');
	    if (! $port)
		{
			$port =  $default['port']+$serverid -1;
	    }
	    $url = $url . $port . '/';

	    $name = $s->getConf("registername");
	    if (! $name) {
	      $name =  $default["registername"];
	    }
	   
		$tree = $s->getTree();
		
		echo "<div class=div_channel>\n";
		printmainchannel($tree,$url,$name); 
		echo "</div>\n";
		
		//Developers only!!!
		// If you wanna see the entire Mumbletree Object uncomment the following line.  
		//print_r($tree);
	}
	
	else
	{
	    $servers = $meta->getBootedServers();
	    
	    foreach($servers as $s)
		{
			$tmp_url = $url;
			$port = $s->getConf('port');
			if (! $port)
			{
				$port =  $default['port']+$s->id() - 1;;
			}
			$tmp_url = $url . $port . '/';
	    
			$name = $s->getConf("registername");
			if (! $name)
			{
				$name =  $default["registername"];
			}

			$tree = $s->getTree();
		
			echo "<div class=div_channel>\n";
			printmainchannel($tree,$tmp_url,$name); 
			echo "</div>\n";
		
			//Developers only!!!
			// If you wanna see the entire Mumbletree Object uncomment the following line.  
			//print_r($tree);
		}
	}
  
}

catch (Ice_LocalException $ex)
{
	print_r($ex);
}

?>
</body>
</html>
К скрипту еще папка с картинками прилагается.
Охото к сайту прикрутить...
Надеюсь на помощь.

B0nuse
Site Admin
Сообщения: 1588
Зарегистрирован: 27 июл 2009, 08:58
Благодарил (а): 40 раз
Поблагодарили: 363 раза
Контактная информация:

Re: Хороший скрипт отображения чата для сайта - Не работет.

Сообщение B0nuse »

DjoniBrave писал(а):Никаких ошибок скрипт не выдает, просто белый лист.
Так не бывает. Включите отображение ошибок на странице или посмотрите логи ошибок апача.
Мы в Telegramm https://t.me/mumbleru
Пожалуйста, при персональном обращении сразу формулируйте его цель. Спасибо.
Подпишитесь на Новости форума feed/news :rtfm:

Изображение <--- Хочешь себе такой? Читай тут

DjoniBrave
Сообщения: 12
Зарегистрирован: 17 ноя 2009, 01:32

Re: Хороший скрипт отображения чата для сайта - Не работет.

Сообщение DjoniBrave »

Ну вот такой вот скрипт нормально работает, и ошибки дает если их с эмулировать:

Код: Выделить всё

<html>

    <head>

    <title>Userlist</title>

    </head>

    <body>

    <?php

    

    Ice_loadProfile();

    

try {

   $base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502");

   $meta = $base->ice_checkedCast("::Murmur::Meta");

   $servers = $meta->getBootedServers();

   $default = $meta->getDefaultConf();

   foreach($servers as $s) {

   $name = $s->getConf("registername");
   if (! $name) {

    $name =  $default["registername"];

    }

     echo "<h1>SERVER #" . $s->id() . " " .$name ."</h1>\n";

    echo "<table><tr><th>Name</th><th>Channel</th></tr>\n";

    $channels = $s->getChannels();

     $players = $s->getUsers();

    foreach($players as $id => $state) {

      $chan = $channels[$state->channel];

        echo "<tr><td>".$state->name."</td><td>".$chan->name."</td></tr>\n";

    }

     echo "</table>\n";

   }

} catch (Ice_LocalException $ex) {

  print_r($ex);

 }



 ?>

</body>

</html>
Еще интересует вопрос:
Как я понимаю работу ICE:
Сервер ждет запросов по порту 6502 от PHP.
Возможно ли обратиться с другова хостинга где установлен ICE_PHP?
$base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502"); << Это строка задает подключение?
$base = $ICE->stringToProxy("Meta:tcp -h xxx.xxx.xxx.xxx -p 6502"); <<< Так возможно? Из другова места.
Например сервер мамблы у меня на одном адресе, а сайт, с которого я хочу делать запрос, находиться на другом хостинге.
Поправьте если я неправельно понимаю работу ICE.

Добавлено 16 фев 2010, 09:07
По первому скрипту Apache2 ругается на Undefine Property: Murmur_Tree::players (126 строка)
Как понимаю - необявленное свойство Murmur_Tree::players?

B0nuse
Site Admin
Сообщения: 1588
Зарегистрирован: 27 июл 2009, 08:58
Благодарил (а): 40 раз
Поблагодарили: 363 раза
Контактная информация:

Re: Хороший скрипт отображения чата для сайта - Не работет.

Сообщение B0nuse »

DjoniBrave писал(а):Возможно ли обратиться с другова хостинга где установлен ICE_PHP?
$base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502"); << Это строка задает подключение?
$base = $ICE->stringToProxy("Meta:tcp -h xxx.xxx.xxx.xxx -p 6502"); <<< Так возможно? Из другова места.
...
Добавлено 16 фев 2010, 09:07
По первому скрипту Apache2 ругается на Undefine Property: Murmur_Tree::players (126 строка)
Как понимаю - необявленное свойство Murmur_Tree::players?
Уважаемый, DjoniBrave, я так понимаю Вы сами способны во всем разобраться (хотябы методом проб и ошибок). Не ждите от Администрации поддержки разного рода скриптов, которые мы сами не писали.
Если у Вас есть желание заняться разработкой и поддержкой скриптов для управления сервером Мурмур (при помощи Ice или DBus) и представления информации по серверу, то рекомендую Вам использовать для этих целей одну из созданных Вами тем, где Вы сможете делиться своими решениями и осуществлять их поддержку.
Мы в Telegramm https://t.me/mumbleru
Пожалуйста, при персональном обращении сразу формулируйте его цель. Спасибо.
Подпишитесь на Новости форума feed/news :rtfm:

Изображение <--- Хочешь себе такой? Читай тут

DjoniBrave
Сообщения: 12
Зарегистрирован: 17 ноя 2009, 01:32

Re: Хороший скрипт отображения чата для сайта - Не работет.

Сообщение DjoniBrave »

Как в точку уважаемый BOnuse!
Скрипт уже расковырял и настроил, прикрутил пока во Frame на сайт. Да, действительно я разбираюсь дастоточно хорошо в подобных вещах, правдо быват застреваю на незнакомых мне технологиях (в данной ситуации ICE). Но уже поверхностно разобрался, как пользоваться сей технологией, почитав зарубежные мануалы! =)
Описать какую либо тему можно, если будет время, попробую грамотно оформить что нибудь из своих действий.

B0nuse
Site Admin
Сообщения: 1588
Зарегистрирован: 27 июл 2009, 08:58
Благодарил (а): 40 раз
Поблагодарили: 363 раза
Контактная информация:

Re: Хороший скрипт отображения чата для сайта - Не работет.

Сообщение B0nuse »

DjoniBrave писал(а):Описать какую либо тему можно, если будет время, попробую грамотно оформить что нибудь из своих действий.
Обычно, у большинства пользователей все так и остается на словах :jokingly: Но это уже не по теме...
Мы в Telegramm https://t.me/mumbleru
Пожалуйста, при персональном обращении сразу формулируйте его цель. Спасибо.
Подпишитесь на Новости форума feed/news :rtfm:

Изображение <--- Хочешь себе такой? Читай тут

viktor6
Сообщения: 23
Зарегистрирован: 17 авг 2011, 16:16
Поблагодарили: 1 раз

Re: Хороший скрипт отображения чата для сайта - Не работет.

Сообщение viktor6 »

Жаль что человек не описал как он и что правил в этом скрипте :(

viktor6
Сообщения: 23
Зарегистрирован: 17 авг 2011, 16:16
Поблагодарили: 1 раз

Re: Хороший скрипт отображения чата для сайта - Не работет.

Сообщение viktor6 »

Вот нашел

Код: Выделить всё

<!--
// Mumble Viewer
// Copyright (C) 2008  Dominik Radner (aka Urmel)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License (GPL)  as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

//Configuration can be made on Line 112ff.
-->

<html>
<head>
<title>Mumbleviewer</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style> 
.div_channel {
margin: 0px;
padding: 0px;
position:relative; top:0px;
border-width: 0.1em;
border-style: hidden;
border-color: blue;
font-family: Tahoma,Helvetica;
font-size: 10px;
}
.div_player {
margin: 0px;
padding: 0px;
position:relative; top:0px;
border-width: 0.1em;
border-style: hidden;
border-color: red;
font-family: Tahoma,Helvetica;
font-size: 10px;
}

a:link {
color:black; text-decoration:none;
}
a:visited {
color:black; text-decoration:none;
}
a:active {
color:black; text-decoration:none;
}
a:hover {
color:black; text-decoration:underline
}

</style> 
<script type="text/javascript">

IE4 = (document.all) ? 1 : 0;
IE8 = (document.all) ? 1 : 0;
NS6 = (document.getElementById) ? 1 : 0;

function set_Layer(layername){

	theImage = layername;

	if (document.images[theImage].src.match('mid2'))
	{
		document.images[theImage].src = './images/list_tree_mid3.gif';
	} 
	else if (document.images[theImage].src.match('mid3'))
	{
		document.images[theImage].src = './images/list_tree_mid2.gif';
	} 
	else if (document.images[theImage].src.match('end2'))
	{
		document.images[theImage].src = './images/list_tree_end3.gif';
	} 
	else if (document.images[theImage].src.match('end3'))
	{
		document.images[theImage].src = './images/list_tree_end2.gif';
	} 

	theLayer = layername;
	if(IE4) {
		theStatus = document.all(theLayer).style.display;
		if (theStatus == 'none') {
			document.all(theLayer).style.display = "inline"; }
		else {
			document.all(theLayer).style.display = "none";} }
	if(NS6) {
		theStatus = document.getElementById(theLayer).style.display;
		if (theStatus == 'none') {
			document.getElementById(theLayer).style.display = "inline"; }
		else {
			document.getElementById(theLayer).style.display = "none"; } } }

</script>


</head>

<body>
<?php

Ice_loadProfile();

// Configuration Start
// Set here your Server IP or DNS
$url='mumble://77.121.4.50:'; 
// Configuration End

function printmainchannel($channelobject,$url,$servername) 
{
	$channeldepth = 0;
	$menustatus = array("1","1");

	$channelobject->c->name = $servername;

	echo "<a href=\"".$url."?version=1.2.0\">".$channelobject->c->name."</a><br>\n";
	if (count($channelobject->children) + count($channelobject->users) > 0)
	{
		echo "<div class=div_channel id=div_channel_".$channelobject->c->id.">\n";
		foreach ($channelobject->children as $children) {
		printchannel($children,$channelobject->children[count($channelobject->children)-1]->c->id,$channeldepth+1,$menustatus,$url); }
		
		foreach ($channelobject->users as $players) {
		printplayers($players,$channelobject->users[count($channelobject->users)-1]->playerid,$channeldepth+1,$menustatus,$url); }
		echo "</div>\n";
	}
}

function printchannel($channelobject,$lastid,$channeldepth,$menustatus,$url) 
{
	$menustatus[$channeldepth] = 1;
	if ($channelobject->c->id == $lastid)
	{
		$menustatus[$channeldepth] = 0;
	}
	
	$count = 1;
	while($count < $channeldepth)
    {
		if ($menustatus[$count] == 0)
		{
			echo "<img border=0 src=./images/list_tree_space.gif>";
		}
		else
		{
			echo "<img border=0 src=./images/list_tree_line.gif>";
		}
	    $count++;
    }

	if (count($channelobject->children) + count($channelobject->users) > 0)
	{
		if ($channelobject->c->id != $lastid)
		{
		$java=$channelobject->c->id;
			echo "<a href=\"javascript:set_Layer('div_channel_".$channelobject->c->id."')\"><img border=0 name=div_channel_".$channelobject->c->id." src=./images/list_tree_mid2.gif></a>";
		}
		else
		{
			echo "<a href=\"javascript:set_Layer('div_channel_".$channelobject->c->id."')\"><img border=0 name=div_channel_".$channelobject->c->id." src=./images/list_tree_end2.gif></a>";
		}
	}
	else {
		if ($channelobject->c->id != $lastid)
		{
			echo "<img border=0 src=./images/list_tree_mid.gif>";
		}
		else
		{
			echo "<img border=0 src=./images/list_tree_end.gif>";
		}
	}
	echo "<img border=0 src=./images/list_channel.gif>";
	//echo "<a href=\"".$url."".str_replace(" ","%20",$channelobject->c->name)."\">".$channelobject->c->name."</a><br>\n";
	echo "<a href=\"".$url."".str_replace(" ","%20",$channelobject->c->name)."/?version=1.2.0\">".$channelobject->c->name."</a><br>\n";

	if (count($channelobject->children) + count($channelobject->users) > 0)
	{
		echo "<div class=div_channel id=div_channel_".$channelobject->c->id.">\n";
		foreach ($channelobject->children as $children) {
		printchannel($children,$channelobject->children[count($channelobject->children)-1]->c->id,$channeldepth+1,$menustatus,$url); }
		
		foreach ($channelobject->users as $players) {
		printplayers($players,$channelobject->users[count($channelobject->users)-1]->playerid,$channeldepth+1,$menustatus,$url); }
		echo "</div>\n";
	}
	return $menustatus;
}

function printplayers($playerobject,$lastid,$channeldepth,$menustatus) 
{
	echo "<div class=div_player id=div_player>\n";

	$menustatus[$channeldepth] = 1;
	if ($channelobject->c->id == $lastid)
	{
		$menustatus[$channeldepth] = 0;
	}
	
	$count = 1;
	while($count < $channeldepth)
    {
		if ($menustatus[$count] == 0)
		{
			echo "<img border=0 src=./images/list_tree_space.gif>";
		}
		else
		{
			echo "<img border=0 src=./images/list_tree_line.gif>";
		}
	    $count++;
    }
	if ($playerobject->playerid == $lastid) echo "<img border=0 src=./images/list_tree_end.gif>";
	else echo "<img border=0 src=./images/list_tree_mid.gif>";
	echo "<img border=0 src=./images/list_player.gif>";
	echo $playerobject->name;
	if ($playerobject->playerid != -1)
	{
		echo "<img border=0 src=./images/player_auth.gif>";	
	}
	if ($playerobject->mute)
	{
		echo "<img border=0 src=./images/player_unknown.gif>";	
	}
	if ($playerobject->deaf)
	{
		echo "<img border=0 src=./images/player_unknown2.gif>";	
	}
	if ($playerobject->suppressed)
	{
		echo "<img border=0 src=./images/player_suppressed.gif>";	
	}
	if ($playerobject->selfMute)
	{
		echo "<img border=0 src=./images/player_selfmute.gif>";	
	}
	if ($playerobject->selfDeaf)
	{
		echo "<img border=0 src=./images/player_selfdeaf.gif>";	
	}
	echo "<br></div>\n"; 
	return $menustatus;
}

$serverid = filter_input(INPUT_GET, 'serverid', FILTER_VALIDATE_INT);

try
{

	$base = $ICE->stringToProxy("Meta:tcp -h 127.0.0.1 -p 6502");
	$meta = $base->ice_checkedCast("::Murmur::Meta");

	$servers = $meta->getBootedServers();
	$default = $meta->getDefaultConf();
	
	if($serverid) {
	    $s = $meta->getServer(intval($serverid));
	    $port = $s->getConf('port');
	    if (! $port)
		{
			$port =  $default['port']+$serverid -1;
	    }
	    $url = $url . $port . '/';

	    $name = $s->getConf("registername");
	    if (! $name) {
	      $name =  $default["registername"];
	    }
	   
		$tree = $s->getTree();
		
		echo "<div class=div_channel>\n";
		printmainchannel($tree,$url,$name); 
		echo "</div>\n";
		
		//Developers only!!!
		// If you wanna see the entire Mumbletree Object uncomment the following line.  
		//print_r($tree);
	}
	
	else
	{
	    $servers = $meta->getBootedServers();
	    
	    foreach($servers as $s)
		{
			$tmp_url = $url;
			$port = $s->getConf('port');
			if (! $port)
			{
				$port =  $default['port']+$s->id() - 1;;
			}
			$tmp_url = $url . $port . '/';
	    
			$name = $s->getConf("registername");
			if (! $name)
			{
				$name =  $default["registername"];
			}

			$tree = $s->getTree();
			$players = $s->getUsers();
        $totaluser=count($players);
		
			echo "<div class=div_channel>\n";
			echo 'User : '.$totaluser.'<br><hr>';
			printmainchannel($tree,$tmp_url,$name); 
			echo "</div>\n";
			foreach($servers as $s) {

   $name = $s->getConf("registername");
   if (! $name) {

    $name =  $default["registername"];

    }

   }
		
			//Developers only!!!
			// If you wanna see the entire Mumbletree Object uncomment the following line.  
			//print_r($tree);
		}
	}
  
}

catch (Ice_LocalException $ex)
{
	print_r($ex);
}

?>
</body>
</html>

viktor6
Сообщения: 23
Зарегистрирован: 17 авг 2011, 16:16
Поблагодарили: 1 раз

Re: Хороший скрипт отображения чата для сайта - Не работет.

Сообщение viktor6 »

блин непойму нечего обновил сервер из 1,2,2 на 1,2,3 и скрипт перестал работать даже неработает cgi-bin скрипт кторый идет вместе из mumble-server-web
система свежа установленая может пакетов какихто не хватает
debian squeeze x64

Ответить