Code: Select all
// +---------------------------------------------------------------------------+
// | Overlib Stream Javascript |
// +---------------------------------------------------------------------------+
function OverlibStreamJavascript()
{
global $cfg;
$query = mysql_query('SELECT stream_id FROM configuration_users WHERE username = "' . mysql_escape_string($cfg['username']) . '"');
$users = mysql_fetch_array($query);
$array = '';
foreach ($cfg['stream_name'] as $name)
$array .= '"' . $name . '", ';
$array = substr($array, 0, -2);
$codecs = '"MP3", "OGG Vorbis"';
$bitrates = '"64", "96", "128", "256"';
?>
<script language="JavaScript" type="text/javascript">
<!--
function overlibs(url)
{
var name = new Array(<?php echo $array; ?>);
var codecs = new Array(<?php echo $codecs; ?>);
var bitrates = new Array(<?php echo $bitrates; ?>);
var list = '';
list += '<table style="text-align: center;"><tr><th><a href="' + url + '&stream_cfg=-1">direct</a></th>';
var i = 0;
var j = 0;
var k = 0;
for (i = 0; i < bitrates.length; i++)
{
list += '<th>' + bitrates[i] + '</th>';
}
list += '</tr>';
for (i = 0; i < codecs.length; i++)
{
list += '<tr><th>' + codecs[i] + '</th>';
for (j = 0; j < bitrates.length; j++)
{
list += '<td>';
if (k == <?php echo $users['stream_id']; ?>) list += '<strong>'
list += '<a href="' + url + '&stream_cfg=' + k++ + '"><img class="streamtt" src="bitmap/small_stream.gif" alt="" /></a>';
if (k == <?php echo $users['stream_id']; ?>) list += '</strong>'
list += '</td>';
}
list += '</tr>';
}
list += '</table>';
overlib(list, STICKY, NOCLOSE, WRAP, OFFSETX, 30, OFFSETY, -codecs.length*17, CAPTION, 'Stream:');
}
//-->
</script>
<?php
}