<?php
require_once "../../maincore.php";
require_once "infusion_db.php";
require_once "sw_functions.php";

// Check if locale file is available matching the current site locale setting.
if (file_exists(INFUSIONS."sw_streamstatus".$sw_streamstatus_number."_panel/locale/".$settings['locale'].".php")) {
	// Load the locale file matching the current site locale setting.
	include INFUSIONS."sw_streamstatus".$sw_streamstatus_number."_panel/locale/".$settings['locale'].".php";
} else {
	// Load the infusion's default locale file.
	include INFUSIONS."sw_streamstatus".$sw_streamstatus_number."_panel/locale/English.php";
}

// Load default settings
$ssp_setting[$sw_streamstatus_number] = @dbarray(dbquery("SELECT * FROM `".$streamstatus_db[$sw_streamstatus_number]['table_settings']."` WHERE `profile` = 'default' LIMIT 1"));

if(!FUSION_V6) { 
	if (!checkrights("SSP".($sw_streamstatus_number=='' ? '0' : $sw_streamstatus_number)) || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../../index.php"); }
	require_once THEMES."templates/admin_header.php";
	include LOCALE.LOCALESET."admin/infusions.php";
}
else {
	if (!checkrights("IP")) fallback("../../index.php");
	require_once BASEDIR."subheader.php";
	require_once ADMIN."navigation.php";
}

// save new settings
if(IsSet($_POST['savesettings'])) {	
		unset($save_error);
		$connect = explode("|",stripinput($_POST['sp_connect']));
		$query = "UPDATE `".$streamstatus_db[$sw_streamstatus_number]['table_settings']."` SET
		`sp_folder` = '".$connect[1]."',
		`sp_number` = '".$connect[0]."',
		";
		for($i=1;$i<=3;$i++) {
			$query.= "
			`sc_name_".$i."` = '".stripinput($_POST['sc_name_'.$i])."',
			`sc_server_".$i."` = '".stripinput(str_replace("http://","",$_POST['sc_server_'.$i]))."',
			`sc_port_".$i."` = '".($_POST['sc_port_'.$i]*1)."',
			`sc_adminpw_".$i."` = '".stripinput($_POST['sc_adminpw_'.$i])."',
			`sc_id_".$i."` = '".($_POST['sc_id_'.$i]*1)."',
			`enable_streamkick_".$i."` = '".($_POST['enable_streamkick_'.$i]*1)."',
			`enable_songupdate_".$i."` = '".($_POST['enable_songupdate_'.$i]*1)."',
			`use_winamp_".$i."` = '".($_POST['use_winamp_'.$i]*1)."',
			`use_mediaplayer_".$i."` = '".($_POST['use_mediaplayer_'.$i]*1)."',
			`use_realplayer_".$i."` = '".($_POST['use_realplayer_'.$i]*1)."',
			`use_flashplayer_".$i."` = '".stripinput(str_replace("http://","",$_POST['use_flashplayer_'.$i]))."',
			`use_flashplayer_".$i."_popup` = '".($_POST['use_flashplayer_'.$i.'_popup']*1)."',
			`use_flashplayer_".$i."_popup_height` = '".($_POST['use_flashplayer_'.$i.'_popup_height']*1)."',
			`use_flashplayer_".$i."_popup_width` = '".($_POST['use_flashplayer_'.$i.'_popup_width']*1)."',
			`use_javaplayer_".$i."` = '".stripinput(str_replace("http://","",$_POST['use_javaplayer_'.$i]))."',
			`use_javaplayer_".$i."_popup` = '".($_POST['use_javaplayer_'.$i.'_popup']*1)."',
			`use_javaplayer_".$i."_popup_height` = '".($_POST['use_javaplayer_'.$i.'_popup_height']*1)."',
			`use_javaplayer_".$i."_popup_width` = '".($_POST['use_javaplayer_'.$i.'_popup_width']*1)."',
			`use_nsvplayer_".$i."` = '".stripinput(str_replace("http://","",$_POST['use_nsvplayer_'.$i]))."',
			`use_nsvplayer_".$i."_popup` = '".($_POST['use_nsvplayer_'.$i.'_popup']*1)."',
			`use_nsvplayer_".$i."_popup_height` = '".($_POST['use_nsvplayer_'.$i.'_popup_height']*1)."',
			`use_nsvplayer_".$i."_popup_width` = '".($_POST['use_nsvplayer_'.$i.'_popup_width']*1)."',
			";
		}
		$query.= "
		`listeners_visible` = '".(stripinput($_POST['listeners_visible']))."',		
		`phonostar_id` = '".($_POST['phonostar_id']*1)."',
		`studiobox` = '".(stripinput($_POST['studiobox']))."',
		`phonepublisher_live` = '".stripinput($_POST['phonepublisher_live'])."',
		`dj_group` = '".($_POST['dj_group']*1)."',
		`refresh_time` = '".($_POST['refresh_time']*1)."'		
		WHERE `profile` = 'default' LIMIT 1";
		$result = dbquery($query);

		// Config abspeichern in Datei, zur Verwendung in Ajax/Javascripts ohne erneute DB Requests:
		$fd=@fopen("./listen/streamconfig.php","w+");
		if($fd) {
		fputs($fd, '<?php'."\n");
		fputs($fd, "/*\n");		
		fputs($fd, "#####################################\n");
		fputs($fd, "## This file ist auto-generated by ##\n");
		fputs($fd, "##        Streamstatus-Admin       ##\n");
		fputs($fd, "## DO NOT EDIT THIS FILE BY HAND!  ##\n");
		fputs($fd, "#####################################\n");
		fputs($fd, "*/\n");
		fputs($fd, 'if (preg_match("/streamconfig.php/i", ');
		fputs($fd, '$');
		fputs($fd, "_SERVER['PHP_SELF'])) { die(); }");
		fputs($fd, "\n");
		fputs($fd, "\n// init arrays\n");
		fputs($fd, '$');
		fputs($fd, "sc_server = array();\n");
		fputs($fd, '$');
		fputs($fd, "sc_port = array();\n");
		fputs($fd, '$');
		fputs($fd, "sc_adminpw = array();\n");
		fputs($fd, '$');
		fputs($fd, "sc_id = array();\n");
		for($i=1;$i<=3;$i++) {
			fputs($fd, "\n// stream #".$i."\n");
			fputs($fd, '$');
			fputs($fd, 'sc_server['.$i.'] = "'.stripinput(str_replace("http://","",$_POST['sc_server_'.$i])).'";');
			fputs($fd, "\n");
			fputs($fd, '$');
			fputs($fd, 'sc_port['.$i.'] = '.($_POST['sc_port_'.$i]*1).';');
			fputs($fd, "\n");
			fputs($fd, '$');
			fputs($fd, 'sc_adminpw['.$i.'] = "'.stripinput(str_replace("http://","",$_POST['sc_adminpw_'.$i])).'";');
			fputs($fd, "\n");
			fputs($fd, '$');
			fputs($fd, 'sc_id['.$i.'] = '.($_POST['sc_id_'.$i]*1).';');
			fputs($fd, "\n");
		}
		fputs($fd, "\n// global settings\n");
		fputs($fd, '$');
		//fputs($fd, "ss_url = \"infusions/sw_streamstatus".$sw_streamstatus_number."_panel\";\n");
		fputs($fd, "ss_url = \"".str_replace('/sw_streamstatus_admin.php','',$_SERVER['SCRIPT_NAME'])."\";\n");
		fputs($fd, '$');
		fputs($fd, "sp_url = \"".stripinput($connect[1])."\";\n");
		fputs($fd, '$');
		fputs($fd, "sb_url = \"".(stripinput($_POST['studiobox'])!='' ? stripinput($_POST['studiobox']) : "")."\";\n");
		fputs($fd, '$');
		fputs($fd, "sp_id = \"".$connect[0]."\";\n");
		fputs($fd, '$');
		fputs($fd, 'refreshtime = ');
		fputs($fd, ($_POST['refresh_time']*1));
		fputs($fd, ';'."\n");
		fputs($fd, "?");
		fputs($fd, '>');
		@fclose($fd);
		redirect(FUSION_SELF.$aidlink."&status=success");
		exit;
		}
		else {
			// config konnte nicht gepeichert werden:
			$save_error = "<strong>FEHLER: Die Konfigurationsdatei konnte nicht gespeichert werden!</strong><br />\nDer Ordner &quot;<strong>".dirname($_SERVER["PHP_SELF"])."/listen/</strong>&quot; ben&ouml;tigt Schreibrechte (CHMOD 777).<br />\nSollte sich in diesem Ordner bereits eine Datei &quot;streamconfig.php&quot; befinden, setzen Sie diese ebenfalls auch CHMOD 777.";
		}
}

// look for scheduler folders in infusions directory
if ($handle = opendir(INFUSIONS)) {
	$sp_folders = array();
	$sp_install_numbers = array();
	$sp_names = array();
	$s = 0;
    while (false !== ($file = readdir($handle))) {		
        if ($file != "." && $file != ".." && is_dir(INFUSIONS.$file) && file_exists(INFUSIONS.$file."/sendeplan.php") && file_exists(INFUSIONS.$file."/infusion_db.php")) {
			// check if installed and right version
			unset($sp_install_number,$sp_channelname,$tmp);
			include(INFUSIONS.$file."/infusion_db.php");
			if(IsSet($sp_install_number)) {
				$result = dbquery("SHOW TABLES LIKE '".DB_PREFIX."sendeplan".($sp_install_number>0 ? $sp_install_number : '')."_settings'");
				if (dbrows($result)== 1) {
					$tmp = dbarray(dbquery("SELECT `version` FROM `".DB_PREFIX."sendeplan".($sp_install_number>0 ? $sp_install_number : '')."_settings` WHERE `profile` = 'default' LIMIT 1"));
					if(IsSet($tmp['version']) && $tmp['version']>=3.02) {				
						$sp_folders[$s] = $file;
						$sp_install_numbers[$s] = $sp_install_number;
						$sp_names[$s] = $sp_channelname;
						$s++;
					}
				}
			}
		}
    }
    closedir($handle);
}

// look for studiobox folders in infusions directory
if ($handle = opendir(INFUSIONS)) {
	$sb_folders = array();
	$s = 0;
    while (false !== ($file = readdir($handle))) {		
       if ($file != "." && $file != ".." && is_dir(INFUSIONS.$file) && file_exists(INFUSIONS.$file."/studiobox_popup.php") && file_exists(INFUSIONS.$file."/infusion_db.php")) {
		$sb_folders[$s] = $file;
		$s++;
	}
    }
    closedir($handle);
}


opentable("Streamstatus-Einstellungen".($sw_streamstatus_number!="" ? " &raquo; Streamstatus #".$sw_streamstatus_number : ''));
if(IsSet($_GET['status']) && $_GET['status']=="success") {
	echo "<div class='admin-message'>Die &Auml;nderungen wurden gespeichert.</div>";
}

if(count($sp_folders)==0) {
	echo "<div class='admin-message'>Es wurde kein installierter Sendeplan ab v3.02 gefunden. Ohne diesen ist der Streamstatus nicht nutzbar!<br />N&auml;here Infos bei: [<a href='https://www.systemweb.de/' target='_blank' title='zur Homepage des Entwicklers'>www.systemweb.de</a>]</div>\n";
	$sw_requirements=false;
}
else {
	$sw_requirements=true;
}
if(IsSet($save_error)) {
	echo "<div class='admin-message'>".$save_error."</div>\n";
}

if($sw_requirements && !is_folder_writable("./listen/")) {
	echo "<div class='admin-message'>
	Der Ordner &quot;infusions/sw_streamstatus".$sw_streamstatus_number."_panel/listen&quot; existiert nicht oder ist schreibgesch&uuml;tzt!<br />
	Bitte &auml;ndern Sie die Eigenschaften dieses Ordners und aller darin befindlicher Dateien (CHMOD 777).</div>
	";
	$sw_requirements = false;
}

if($sw_requirements==true) {
	// get usergroups
	$result = dbquery("SELECT * FROM `".DB_PREFIX."user_groups` ORDER BY `group_name`");
	$rows = dbrows($result);
	$group_name = array();
	$group_id = array();
		if ($rows != 0) {
		while ($groups = dbarray($result)) {
			$group_name[] = $groups['group_name'];
			$group_id[] = $groups['group_id'];			
		}
	}
echo "
<form method='post' action='".FUSION_SELF."?aid=".iAUTH."'>
<table width='100%' class='tbl-border' cellpadding='0' cellspacing='1' border='0' align='center'>
	<tr>
		<td>
			<div align='center'>
				<h4>Allgemeine Voreinstellungen</h4>
			</div>
			 <table width='100%' cellspacing='0' cellpadding='0' border='0'>
			 	<tr>
					<td class='tbl2'>
						Mit welcher Sendeplan-Installation soll der Streamstatus verkn&uuml;pft werden?<br />
                        			<small>(Hier werden nur installierte Sendepl&auml;ne ab v3.02 angezeigt)</small>
                    			</td>
					<td class='tbl2' style='width: 280px;'>
						<select name='sp_connect' class='textbox' size='1' style='width: 220px;'>";
							for($s=0;$s<count($sp_install_numbers);$s++) {
								echo "
								<option value='".($sp_install_numbers[$s]!='' ? $sp_install_numbers[$s] : '0')."|".$sp_folders[$s]."'".($ssp_setting[$sw_streamstatus_number]['sp_number']==($sp_install_numbers[$s]!='' ? $sp_install_numbers[$s] : '0')."|".$sp_folders[$s] ? " selected" : "").">Sendeplan ".($sp_install_numbers[$s]=='' ? '' : $sp_install_numbers[$s])." ".(IsSet($sp_names[$s]) && $sp_names[$s]!="" ? "(".$sp_names[$s].")" : "(kein Sendeplanname definiert)")."</option>";
							}							
							echo "
						</select>
                     		</td>
				</tr>
				<tr>
					<td class='tbl1'>
						Sendeplan-Addon &quot;Studiobox&quot; verlinken?<br />
                        			<small>(Nur m&ouml;glich, wenn Studiobox-Installation bereits vorhanden)</small>                       
                    			</td>
					<td class='tbl1'>
						<select name='studiobox' class='textbox' size='1' style='width: 220px;'>
							<option value=''>- nicht gew&auml;hlt-</option>";
							for($s=0;$s<count($sb_folders);$s++) {
								echo "
								<option value='".($sb_folders[$s])."'".($ssp_setting[$sw_streamstatus_number]['studiobox']==$sb_folders[$s] ? " selected" : "").">infusions/".$sb_folders[$s]."/...</option>";
							}							
							echo "
						</select>						
						".(count($sb_folders)==0 ? "<br /><small>(Keine Studiobox-Installation gefunden)</small>" : "")."
                     		</td>
				</tr>
                		<tr>
					<td class='tbl2'>
						Moderatoren-Gruppe<br />
                        			<small>(In dieser Gruppe befinden sich alle sendenden DJs &amp; Moderatoren)</small>                       
                    			</td>
					<td class='tbl2'>
						<select name='dj_group' class='textbox' size='1' style='width: 220px;'>						  
							<option value='-1'>-nicht gew&auml;hlt-</option>
							";
							for($i=0; $i<(count($group_name)); $i++) {
								echo "<option value='".$group_id[$i]."'".($ssp_setting[$sw_streamstatus_number]['dj_group']==$group_id[$i] ? " selected" : "").">".$group_name[$i]."</option>
								";
							}
							echo "
						</select>
                     		</td>
				</tr>
                		<tr>
					<td class='tbl1'>
						Refreshzeit der Anzeige:<br />
                        			<small>(Je kleiner desto mehr Serverlast! 30 Sek. reichen aus, da der Stream ohnehin stets verz&ouml;gert beim H&ouml;rer ankommt!)</small>                       
                    			</td>
					<td class='tbl1'>
						<select name='refresh_time' class='textbox' size='1' style='width: 220px;'>						  
							<option value='5000'".($ssp_setting[$sw_streamstatus_number]['refresh_time']=="5000" ? " selected" : "").">05 Sekunden</option>
                            			<option value='10000'".($ssp_setting[$sw_streamstatus_number]['refresh_time']=="10000" ? " selected" : "").">10 Sekunden</option>
                            			<option value='15000'".($ssp_setting[$sw_streamstatus_number]['refresh_time']=="15000" ? " selected" : "").">15 Sekunden</option>
                            			<option value='30000'".($ssp_setting[$sw_streamstatus_number]['refresh_time']=="30000" ? " selected" : "").">30 Sekunden (empfohlen)</option>
                            			<option value='60000'".($ssp_setting[$sw_streamstatus_number]['refresh_time']=="60000" ? " selected" : "").">60 Sekunden</option>
						</select>
                     		</td>
				</tr>
                		<tr>
					<td class='tbl2'>
						Userlevel f&uuml;r Anzeige der Zuh&ouml;rerzahlen:                     
                    			</td>
					<td class='tbl2'>
						<select name='listeners_visible' class='textbox' size='1' style='width: 220px;'>						  
							<option value='0'".($ssp_setting[$sw_streamstatus_number]['listeners_visible']=="0" ? " selected" : "").">-deaktiviert-</option>
							<option value='guest'".($ssp_setting[$sw_streamstatus_number]['listeners_visible']=="guest" ? " selected" : "").">Gast</option>
                            			<option value='member'".($ssp_setting[$sw_streamstatus_number]['listeners_visible']=="member" ? " selected" : "").">Mitglied</option>
                            			";
							for($i=0; $i<(count($group_name)); $i++) {
								echo "<option value='".$group_id[$i]."'".($ssp_setting[$sw_streamstatus_number]['listeners_visible']==$group_id[$i] ? " selected" : "").">Gruppe: ".$group_name[$i]."</option>
								";
							}
							echo "
							<option value='admin'".($ssp_setting[$sw_streamstatus_number]['listeners_visible']=="admin" ? " selected" : "").">Administrator</option>
							<option value='superadmin'".($ssp_setting[$sw_streamstatus_number]['listeners_visible']=="superadmin" ? " selected" : "").">Super-Admin</option>
						</select>
					</td>
				</tr>
				<tr>
					<td class='tbl1'>
						Streamkick-Feature f&uuml;rs DJ-Team aktivieren?<br />
					</td>
					<td class='tbl1'>					  
						<input name='enable_streamkick_1' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['enable_streamkick_1']==true ? " checked" : "")." />Stream 1<br />
						<input name='enable_streamkick_2' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['enable_streamkick_2']==true ? " checked" : "")." />Stream 2<br />
						<input name='enable_streamkick_3' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['enable_streamkick_3']==true ? " checked" : "")." />Stream 3
					</td>
				</tr>
				<tr>
					<td class='tbl2'>
						Manuelles Titelupdate freischalten?<br />
						<small>(Inaktiv wenn nichts gew&auml;hlt)</small></td>
					<td class='tbl2'>					  
						<input name='enable_songupdate_1' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['enable_songupdate_1']==true ? " checked" : "")." />an Stream 1 senden<br />
						<input name='enable_songupdate_2' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['enable_songupdate_2']==true ? " checked" : "")." />an Stream 2 senden<br />
						<input name='enable_songupdate_3' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['enable_songupdate_3']==true ? " checked" : "")." />an Stream 3 senden
					</td>
				</tr>
				<tr>
					<td class='tbl1'>
						Telefonnummer f&uuml;r Telefonstream<br />
                     			<small>(Wird bei Stream 1 verlinkt, wenn ausgef&uuml;llt)</small>
                    			</td>
					<td class='tbl1'>
						<input name='phonepublisher_live' type='text' class='textbox' size='50' maxlength='50' value='".($ssp_setting[$sw_streamstatus_number]['phonepublisher_live'])."' style='width: 100px;' />
                     		</td>
				</tr>
              		<tr>
					<td class='tbl2'>
						Phonostar-ID<br />
                     			<small>(Falls vorhanden, sonst frei lassen)</small>
                    			</td>
					<td class='tbl2'>
						<input name='phonostar_id' type='text' class='textbox' size='10' maxlength='10' value='".($ssp_setting[$sw_streamstatus_number]['phonostar_id'])."' style='width: 100px;' />
                     		</td>
				</tr>
			</table>
		";
	for($number=1;$number<=3;$number++) {
		echo "
		</td></tr>
		<tr><td>
		
		<div align='center'>
			<h4>Daten des ".$number.". Shoutcast-Streams</h4>
			<small>(".($number==1 ? "Diese Angaben m&uuml;ssen gemacht werden. Andernfalls ist keine Titelanzeige m&ouml;glich!" : "Falls kein ".$number.". Stream vorhanden einfach die Felder frei lassen").")</small>
		</div>
		<table width='100%' cellspacing='0' cellpadding='0' border='0'>
              <tr>
			<td class='tbl2'>
				Streamname (Bezeichnung) f&uuml;r Shoutcast-Server ".$number."<br />
                     	<small>(z.B. &quot;Mainstream - 128 kbit/s&quot;)</small>
                    	</td>
			<td class='tbl2' style='width: 280px;'>
				<input name='sc_name_".$number."' type='text' class='textbox' size='100' maxlength='100' value='".($ssp_setting[$sw_streamstatus_number]['sc_name_'.$number])."' style='width: 220px;' />
                     </td>
		</tr>
               <tr>
			<td class='tbl1'>
				URL zum Shoutcast-Server ".$number."<br />
                     	<small>(Angabe der IP oder des Server-Namens)</small>
                    	</td>
			<td class='tbl1' style='width: 280px;'>
				<input name='sc_server_".$number."' type='text' class='textbox' size='100' maxlength='100' value='".($ssp_setting[$sw_streamstatus_number]['sc_server_'.$number])."' style='width: 220px;' />
                     </td>
		</tr>
              <tr>
			<td class='tbl2'>
				Portnummer des Shoutcast-Streams ".$number."
			</td>
			<td class='tbl2'>
				<input name='sc_port_".$number."' type='text' class='textbox' size='5' maxlength='5' value='".($ssp_setting[$sw_streamstatus_number]['sc_port_'.$number])."' style='width: 100px;' />
                     </td>
		</tr>
              <tr>
			<td class='tbl1'>
				Admin-Passwort des Shoutcast-Streams ".$number."
                    </td>
			<td class='tbl1'>
				<input name='sc_adminpw_".$number."' type='text' class='textbox' size='25' maxlength='25' value='".($ssp_setting[$sw_streamstatus_number]['sc_adminpw_'.$number])."' style='width: 100px;' />
                     </td>
		</tr>
              <tr>
			<td class='tbl2'>
				Shoutcast-Version 2.x: Stream-ID des Streams  ".$number." angeben<br />
				<small>(Shoutcast-Version 1.x: unbedingt 0 eintragen!)</small>
                    </td>
			<td class='tbl2'>
				<input name='sc_id_".$number."' type='text' class='textbox' size='3' maxlength='3' value='".($ssp_setting[$sw_streamstatus_number]['sc_id_'.$number])."' style='width: 100px;' />
                     </td>
		</tr>
              <tr>
			<td class='tbl1'>
				Welche Playerlinks sollen verf&uuml;gbar sein?                        
                    </td>
			<td class='tbl1'>
				<input name='use_winamp_".$number."' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['use_winamp_'.$number]==true ? " checked" : "")." />Winamp<br />
                        	<input name='use_mediaplayer_".$number."' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['use_mediaplayer_'.$number]==true ? " checked" : "")." />Mediaplayer (nicht bei NSV verwendbar)<br />
                        	<input name='use_realplayer_".$number."' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['use_realplayer_'.$number]==true ? " checked" : "")." />Realplayer (nicht bei NSV verwendbar)<br />
                        	
                    	</td>
		</tr>
		<tr>
			<td class='tbl2'>
				Flashplayer ".$number."<br />
                     	<small>(frei lassen wenn nicht vorhanden)</small>
                    	</td>
			<td class='tbl2'>
				http://<input name='use_flashplayer_".$number."' type='text' class='textbox' size='50' maxlength='250' value='".$ssp_setting[$sw_streamstatus_number]['use_flashplayer_'.$number]."' style='width: 220px;' /><br />
				<input name='use_flashplayer_".$number."_popup' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['use_flashplayer_'.$number.'_popup']==true ? " checked" : "")." />im Popup &ouml;ffnen<br />
				Popup-Breite:<input name='use_flashplayer_".$number."_popup_width' type='text' class='textbox' size='5' maxlength='4' value='".$ssp_setting[$sw_streamstatus_number]['use_flashplayer_'.$number.'_popup_width']."' style='width: 35px;' />
				Popup-H&ouml;he:<input name='use_flashplayer_".$number."_popup_height' type='text' class='textbox' size='5' maxlength='4' value='".$ssp_setting[$sw_streamstatus_number]['use_flashplayer_'.$number.'_popup_height']."' style='width: 35px;' />
                     </td>
		</tr>
              <tr>
			<td class='tbl1'>
				Javascript-Player ".$number."<br />
                     	<small>(frei lassen wenn nicht vorhanden)</small>
                    	</td>
			<td class='tbl1'>
				http://<input name='use_javaplayer_".$number."' type='text' class='textbox' size='50' maxlength='250' value='".$ssp_setting[$sw_streamstatus_number]['use_javaplayer_'.$number]."' style='width: 220px;' /><br />
				<input name='use_javaplayer_".$number."_popup' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['use_javaplayer_'.$number.'_popup']==true ? " checked" : "")." />im Popup &ouml;ffnen<br />
				Popup-Breite:<input name='use_javaplayer_".$number."_popup_width' type='text' class='textbox' size='5' maxlength='4' value='".$ssp_setting[$sw_streamstatus_number]['use_javaplayer_'.$number.'_popup_width']."' style='width: 35px;' />
				Popup-H&ouml;he:<input name='use_javaplayer_".$number."_popup_height' type='text' class='textbox' size='5' maxlength='4' value='".$ssp_setting[$sw_streamstatus_number]['use_javaplayer_'.$number.'_popup_height']."' style='width: 35px;' />
                     </td>
		</tr>
              <tr>
			<td class='tbl2'>
				NSV-Player ".$number."<br />
                     	<small>(frei lassen wenn nicht vorhanden)</small>
                    	</td>
			<td class='tbl2'>
				http://<input name='use_nsvplayer_".$number."' type='text' class='textbox' size='50' maxlength='250' value='".$ssp_setting[$sw_streamstatus_number]['use_nsvplayer_'.$number]."' style='width: 220px;' /><br />
				<input name='use_nsvplayer_".$number."_popup' type='checkbox' class='textbox' value='1'".($ssp_setting[$sw_streamstatus_number]['use_nsvplayer_'.$number.'_popup']==true ? " checked" : "")." />im Popup &ouml;ffnen<br />
				Popup-Breite:<input name='use_nsvplayer_".$number."_popup_width' type='text' class='textbox' size='5' maxlength='4' value='".$ssp_setting[$sw_streamstatus_number]['use_nsvplayer_'.$number.'_popup_width']."' style='width: 35px;' />
				Popup-H&ouml;he:<input name='use_nsvplayer_".$number."_popup_height' type='text' class='textbox' size='5' maxlength='4' value='".$ssp_setting[$sw_streamstatus_number]['use_nsvplayer_'.$number.'_popup_height']."' style='width: 35px;' />
                     </td>
		</tr>              		
		</table>
		";
	}
	?>		
             <div align='center' style='padding: 10px;'><input type='submit' value='Einstellungen speichern' name='savesettings' class='button' /></div>		
		</td>
	</tr>
</table>
</form>
<?php
}
closetable();

if(!FUSION_V6) { require_once THEMES."templates/footer.php"; }
else {
	require_once BASEDIR."side_right.php";
	require_once BASEDIR."footer.php";
}
?>