|
From: OryNider <ory...@us...> - 2008-03-21 12:26:31
|
Update of /cvsroot/mxbb/mx_radiocast/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv25795 Modified Files: Tag: core28x radiocast_add.php radiocast_cat.php Log Message: fix Index: radiocast_add.php =================================================================== RCS file: /cvsroot/mxbb/mx_radiocast/includes/radiocast_add.php,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** radiocast_add.php 6 Jun 2007 23:03:48 -0000 1.1 --- radiocast_add.php 21 Mar 2008 12:26:12 -0000 1.1.2.1 *************** *** 421,428 **** if( empty($station_url) ) { ! if( ($filesize == 0) or ($filesize > $radiocast_config['max_file_size']) ) ! { ! mx_message_die(GENERAL_MESSAGE, $lang['Bad_upload_file_size']); } } --- 421,485 ---- if( empty($station_url) ) { ! if( ($filesize == 0) or ($filesize > $radiocast_config['max_file_size']) ) ! { ! mx_message_die(GENERAL_MESSAGE, $lang['Bad_upload_file_size']); ! } } + else + { + $station_filetype = substr($station_url, strlen($station_url) - 3, 3); + + // Settings by lsn (hb...@ho...) + $hostandport = explode("//", $station_url); + + //Trasfer Protocol + if ($hostandport[0]) + { + $protocol_type = $hostandport[0]; + } + else + { + $protocol_type = 'http:'; + } + + //Domain + $hostname = $hostandport[1]; + + // Shoutcast Ip or Host + $host = explode(":", $hostname); + + if ($host[0]) + { + $ip = $host[0]; + } + elseif ($hostname) + { + $ip = $hostname; + } + else + { + $ip = '127.0.0.0'; //localhost + } + + // Shoutcast Port + $port = explode("/", $host[1]); + + if ($port[0]) + { + $port = $port[0]; + } + elseif ($host[1]) + { + $port = $host[1]; + } + else + { + $port = '80'; + } + + $mount = "/"; // Used for alternate path to "Streaming URL" -- leave as "/" for the default setup. + + $wmpmode = ($protocol_type == 'icyx:') ? 'icyx://' : 'http://'; // AAC VS MPEG + $mimetype = ($protocol_type == 'icyx:') ? 'audio/aacp' : 'audio/x-mpeg'; // AAC VS MPEG } *************** *** 433,672 **** if( empty($station_url) ) { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($radiocast_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($radiocast_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($radiocast_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($radiocast_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($radiocast_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($radiocast_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($radiocast_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($radiocast_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.qt'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($radiocast_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($radiocast_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($radiocast_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($radiocast_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.rm'; ! break; ! // End extra ! default: ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } } else { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($radiocast_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($radiocast_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($radiocast_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($radiocast_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($radiocast_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($radiocast_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($radiocast_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($radiocast_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.qt'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($radiocast_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($radiocast_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($radiocast_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($radiocast_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.rm'; ! break; ! default: ! $station_filetype = '.pls'; ! break; ! // End extra ! } } --- 490,763 ---- if( empty($station_url) ) { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($radiocast_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($radiocast_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($radiocast_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($radiocast_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($radiocast_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($radiocast_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($radiocast_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($radiocast_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.qt'; ! break; ! case 'video/x-flv': ! case 'video/flv': ! case 'application/octet-stream': ! if ($radiocast_config['flv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.flv'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($radiocast_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($radiocast_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($radiocast_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($radiocast_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.rm'; ! break; ! case 'image/jpeg': ! case 'image/jpg': ! case 'image/pjpeg': ! if ($radiocast_config['img_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.jpg'; ! break; ! ! case 'image/gif': ! if ($radiocast_config['img_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.gif'; ! break; ! ! case 'image/png': ! case 'image/x-png': ! if ($radiocast_config['img_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.png'; ! break; ! ! // End extra ! } } else { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($radiocast_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($radiocast_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($radiocast_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($radiocast_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($radiocast_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($radiocast_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($radiocast_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($radiocast_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.qt'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($radiocast_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($radiocast_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($radiocast_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($radiocast_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $station_filetype = '.rm'; ! break; ! default: ! $station_filetype = ($mimetype == 'audio/aacp') ? '.aac' : '.pls'; // AAC VS MPEG ! break; ! // End extra ! } } *************** *** 788,793 **** // -------------------------------- ! $sql3 = "INSERT INTO ". RADIOCAST_TABLE ." (station_filename, station_imagename, station_title, station_url, station_desc, station_singer, station_user_id, station_username, station_user_ip, station_time, station_cat_id, station_approval) ! VALUES ('$station_filename', '$station_imagename', '$station_title', '$station_url', '$station_desc', '$station_singer', '$station_user_id', '$station_username', '$station_user_ip', '$station_time', '$cat_id', '$station_approval')"; if( !$result = $db->sql_query($sql3) ) --- 879,884 ---- // -------------------------------- ! $sql3 = "INSERT INTO ". RADIOCAST_TABLE ." (station_filename, station_filetype, station_imagename, station_title, station_url, station_desc, station_singer, station_user_id, station_username, station_user_ip, station_time, station_cat_id, station_approval) ! VALUES ('$station_filename', '$station_filetype', '$station_imagename', '$station_title', '$station_url', '$station_desc', '$station_singer', '$station_user_id', '$station_username', '$station_user_ip', '$station_time', '$cat_id', '$station_approval')"; if( !$result = $db->sql_query($sql3) ) Index: radiocast_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_radiocast/includes/radiocast_cat.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** radiocast_cat.php 21 Mar 2008 08:57:09 -0000 1.1.2.1 --- radiocast_cat.php 21 Mar 2008 12:26:18 -0000 1.1.2.2 *************** *** 445,449 **** } ! if ( $thisstation['station_url'] == '' ) { $station_filetype = substr($thisstation['station_filename'], strlen($thisstation['station_filename']) - 3, 3); --- 445,449 ---- } ! if ($thisstation['station_url'] == '') { $station_filetype = substr($thisstation['station_filename'], strlen($thisstation['station_filename']) - 3, 3); *************** *** 454,457 **** --- 454,586 ---- $station_filetype = substr($thisstation['station_url'], strlen($thisstation['station_url']) - 3, 3); $station_url = $thisstation['station_url']; + + // Settings by lsn (hb...@ho...) + $hostandport = explode("//", $station_url); + + //Trasfer Protocol + if ($hostandport[0]) + { + $protocol_type = $hostandport[0]; + } + else + { + $protocol_type = 'http:'; + } + + //Domain + $hostname = $hostandport[1]; + + // Shoutcast Ip or Host + $host = explode(":", $hostname); + + if ($host[0]) + { + $ip = $host[0]; + } + elseif ($hostname) + { + $ip = $hostname; + } + else + { + $ip = '127.0.0.0'; //localhost + } + + // Shoutcast Port + $port = explode("/", $host[1]); + + if ($port[0]) + { + $port = $port[0]; + } + elseif ($host[1]) + { + $port = $host[1]; + } + else + { + $port = '80'; + } + + $mount = "/"; // Used for alternate path to "Streaming URL" -- leave as "/" for the default setup. + + $wmpmode = ($protocol_type == 'icyx:') ? 'icyx://' : 'http://'; // AAC VS MPEG + $mimetype = ($protocol_type == 'icyx:') ? 'audio/aacp' : 'audio/x-mpeg'; // AAC VS MPEG + + switch ($station_filetype) + { + case 'mp3': + $station_filetype = '.mp3'; + break; + + case 'wav': + $station_filetype = '.wav'; + break; + + case 'wma': + $station_filetype = '.wma'; + break; + + // + // Extra extensions + // + + case 'wmv': + $station_filetype = '.wmv'; + break; + + case 'mpg': + case 'peg': + $station_filetype = '.mpeg'; + break; + + case 'avi': + $station_filetype = '.avi'; + break; + + case 'swf': + $station_filetype = '.swf'; + break; + + case '.qt': + $station_filetype = '.qt'; + break; + + case 'flv': + $station_filetype = '.flv'; + break; + + case 'mid': + case 'idi': + $station_filetype = '.mid'; + break; + + case 'ram': + $station_filetype = '.ram'; + break; + + case '.au': + $station_filetype = '.au'; + break; + + case '.rm': + $station_filetype = '.rm'; + break; + + case 'jpg': + $station_filetype = '.jpg'; + break; + + case 'gif': + $station_filetype = '.gif'; + break; + + case 'png': + $station_filetype = '.png'; + break; + default: + $station_filetype = ($mimetype == 'audio/aacp') ? '.aac' : '.pls'; // AAC VS MPEG + // End extra + } } *************** *** 549,552 **** --- 678,697 ---- $row_type = 'media'; } + else if( ($station_filetype == 'mp3') && !empty($thisstation['station_url']) ) + { + $template->assign_block_vars('stationrow.media', array()); + $url_download = mx_append_sid($module_root_path . 'galerie_media.' . $phpEx . '?radiocast_mode=radiocast_stream&station_id=' . $station_id); + $lang['Download'] = ( !empty($lang['Listen']) ? $lang['Listen'] : 'Listen URL' ); + $url_video = $url_download; + $row_type = 'media'; + } + else if( ($station_filetype == 'aac') && !empty($thisstation['station_url']) ) + { + $template->assign_block_vars('stationrow.media', array()); + $url_download = mx_append_sid($module_root_path . 'galerie_media.' . $phpEx . '?radiocast_mode=radiocast_stream&station_id=' . $station_id); + $lang['Download'] = ( !empty($lang['Listen']) ? $lang['Listen'] : 'Listen URL' ); + $url_video = $url_download; + $row_type = 'media'; + } else if(!empty($thisstation['station_url'])) { *************** *** 819,823 **** 'HEIGHT' => ( !empty($media_height) ? $media_height : '350' ), ! 'TIME' => (@function_exists( 'create_date' )) ? create_date($board_config['default_dateformat'], $stationrow[$j]['station_time'], $board_config['board_timezone']) : phpBB2::create_date($board_config['default_dateformat'], $stationrow[$j]['station_time'], $board_config['board_timezone']), 'VIEW' => $stationrow[$j]['station_view_count'], --- 964,968 ---- 'HEIGHT' => ( !empty($media_height) ? $media_height : '350' ), ! 'TIME' => (@function_exists('create_date')) ? create_date($board_config['default_dateformat'], $stationrow[$j]['station_time'], $board_config['board_timezone']) : phpBB2::create_date($board_config['default_dateformat'], $stationrow[$j]['station_time'], $board_config['board_timezone']), 'VIEW' => $stationrow[$j]['station_view_count'], |