|
From: OryNider <ory...@us...> - 2007-09-01 05:38:59
|
Update of /cvsroot/mxbb/mx_music/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19743/includes Modified Files: music_cat.php music_download.php music_page.php music_song.php music_upload.php Log Message: This will allow to upload images for those who to not whan't to have separate module for this. Index: music_upload.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_upload.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** music_upload.php 25 Aug 2007 00:15:14 -0000 1.3 --- music_upload.php 1 Sep 2007 05:38:52 -0000 1.4 *************** *** 408,527 **** if( empty($song_url) ) { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($music_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($music_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($music_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($music_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($music_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($music_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($music_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($music_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.qt'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($music_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($music_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($music_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($music_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.rm'; ! break; ! // End extra ! default: ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } } --- 408,554 ---- if( empty($song_url) ) { ! switch ($filetype) ! { ! case 'audio/mpeg': ! case 'audio/x-mpeg': ! case 'audio/mp3': ! case 'audio/mpg': ! if ($music_config['mp3_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.mp3'; ! break; ! case 'audio/wav': ! if ($music_config['wav_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.wav'; ! break; ! case 'audio/x-ms-wma': ! if ($music_config['wma_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.wma'; ! break; ! // ! // Extra extensions ! // ! case 'video/x-ms-wmv': ! if ($music_config['wmv_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.wmv'; ! break; ! case 'video/mpeg': ! if ($music_config['mpeg_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.mpeg'; ! break; ! case 'video/avi': ! case 'video/x-msvideo': ! if ($music_config['avi_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.avi'; ! break; ! case 'application/x-shockwave-flash': ! if ($music_config['swf_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.swf'; ! break; ! case 'video/quicktime': ! if ($music_config['qt_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.qt'; ! break; ! case 'audio/x-midi': ! case 'audio/mid': ! case 'audio/midi': ! if ($music_config['mid_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.mid'; ! break; ! case 'audio/x-pn-realaudio': ! if ($music_config['ram_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.ram'; ! break; ! case 'audio/basic': ! if ($music_config['au_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.au'; ! break; ! case 'audio/vnd.rn-realmedia': ! case 'application/vnd.rn-realmedia': ! case 'video/vnd.rn-realvideo': ! case 'application/vnd': ! if ($music_config['rm_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.rm'; ! break; ! case 'image/jpeg': ! case 'image/jpg': ! case 'image/pjpeg': ! if ($music_config['img_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.jpg'; ! break; ! case 'image/gif': ! if ($music_config['img_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.gif'; ! break; ! ! case 'image/png': ! case 'image/x-png': ! if ($music_config['img_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $song_filetype = '.png'; ! break; ! ! // End extra ! ! default: ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } } Index: music_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_cat.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** music_cat.php 28 Aug 2007 23:01:09 -0000 1.5 --- music_cat.php 1 Sep 2007 05:38:51 -0000 1.6 *************** *** 460,467 **** else if ( ( $song_filetype == '.jpg' ) || ( $song_filetype == '.gif' ) || ( $song_filetype == '.png' ) ) { - $template->assign_block_vars('songrow.img', array()); $url_download = !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; $row_type = 'img'; } else if( ($song_filetype == 'pls') && !empty($thissong['song_url']) ) --- 460,482 ---- else if ( ( $song_filetype == '.jpg' ) || ( $song_filetype == '.gif' ) || ( $song_filetype == '.png' ) ) { $url_download = !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; $row_type = 'img'; + + $template->assign_block_vars('songrow.img', array( + 'VIDEO_URL' => $url_video, + 'SONG_URL' => $url_video + )); + } + else if ( ( $song_filetype == 'jpg' ) || ( $song_filetype == 'gif' ) || ( $song_filetype == 'png' ) ) + { + $url_download = !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); + $url_video = $url_download; + $row_type = 'img'; + + $template->assign_block_vars('songrow.img', array( + 'VIDEO_URL' => $url_video, + 'SONG_URL' => $url_video + )); } else if( ($song_filetype == 'pls') && !empty($thissong['song_url']) ) *************** *** 695,699 **** 'SONG_TITLE' => $thissong['song_title'], ! 'SONG_URL' => $thissong['song_url'], 'VIDEO_URL' => $url_video, --- 710,714 ---- 'SONG_TITLE' => $thissong['song_title'], ! 'SONG_URL' => !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $song_id)), 'VIDEO_URL' => $url_video, Index: music_download.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_download.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** music_download.php 1 Aug 2007 23:33:27 -0000 1.2 --- music_download.php 1 Sep 2007 05:38:52 -0000 1.3 *************** *** 124,128 **** // ------------------------------------ if ( $thissong['song_url'] == '' ) ! { switch ( $song_filetype ) { --- 124,128 ---- // ------------------------------------ if ( $thissong['song_url'] == '' ) ! { switch ( $song_filetype ) { *************** *** 163,166 **** --- 163,178 ---- header('Content-type: application/vnd.rn-realmedia'); break; + case '.jpg': + case 'jpg': + header('Content-type: image/jpeg'); + break; + case '.gif': + case 'gif': + header('Content-type: image/gif'); + break; + case '.png': + case 'png': + header('Content-type: image/png'); + break; default: die('The filename data in the DBs was corrupted'); *************** *** 168,174 **** header("Content-Disposition: attachment; filename=\"$song_title - $song_singer\""); readfile(MUSIC_UPLOAD_PATH . $thissong['song_filename']); ! } else ! { switch ( $song_filetype_url ) { --- 180,186 ---- header("Content-Disposition: attachment; filename=\"$song_title - $song_singer\""); readfile(MUSIC_UPLOAD_PATH . $thissong['song_filename']); ! } else ! { switch ( $song_filetype_url ) { *************** *** 209,212 **** --- 221,236 ---- header('Content-type: application/vnd.rn-realmedia'); break; + case '.jpg': + case 'jpg': + header('Content-type: image/jpeg'); + break; + case '.gif': + case 'gif': + header('Content-type: image/gif'); + break; + case '.png': + case 'png': + header('Content-type: image/png'); + break; default: die('The URL of song data in the DBs was corrupted'); *************** *** 214,218 **** header("Content-Disposition: attachment; filename=\"$song_title - $song_singer\""); readfile($thissong['song_url']); ! } exit; --- 238,242 ---- header("Content-Disposition: attachment; filename=\"$song_title - $song_singer\""); readfile($thissong['song_url']); ! } exit; Index: music_page.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_page.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** music_page.php 28 Aug 2007 23:01:09 -0000 1.4 --- music_page.php 1 Sep 2007 05:38:52 -0000 1.5 *************** *** 290,296 **** else if ( ( $song_filetype == '.jpg' ) || ( $song_filetype == '.gif' ) || ( $song_filetype == '.png' ) ) { - $template->assign_block_vars('img', array()); $url_download = !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; } else if( ($song_filetype == 'pls') && !empty($thissong['song_url']) ) --- 290,312 ---- else if ( ( $song_filetype == '.jpg' ) || ( $song_filetype == '.gif' ) || ( $song_filetype == '.png' ) ) { $url_download = !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; + $row_type = 'img'; + + $template->assign_block_vars('img', array( + 'VIDEO_URL' => $url_video, + 'SONG_URL' => $url_video + )); + } + else if ( ( $song_filetype == 'jpg' ) || ( $song_filetype == 'gif' ) || ( $song_filetype == 'png' ) ) + { + $url_download = !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); + $url_video = $url_download; + $row_type = 'img'; + + $template->assign_block_vars('img', array( + 'VIDEO_URL' => $url_video, + 'SONG_URL' => $url_video + )); } else if( ($song_filetype == 'pls') && !empty($thissong['song_url']) ) *************** *** 508,512 **** 'SONG_TITLE' => $thissong['song_title'], ! 'SONG_URL' => $thissong['song_url'], 'VIDEO_URL' => $url_video, --- 524,528 ---- 'SONG_TITLE' => $thissong['song_title'], ! 'SONG_URL' => !empty($thissong['song_url']) ? $thissong['song_url'] : append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $song_id)), 'VIDEO_URL' => $url_video, Index: music_song.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/includes/music_song.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** music_song.php 1 Aug 2007 23:33:28 -0000 1.2 --- music_song.php 1 Sep 2007 05:38:52 -0000 1.3 *************** *** 221,224 **** --- 221,236 ---- header('Content-type: application/vnd.rn-realmedia'); break; + case '.jpg': + case 'jpg': + header('Content-type: image/jpeg'); + break; + case '.gif': + case 'gif': + header('Content-type: image/gif'); + break; + case '.png': + case 'png': + header('Content-type: image/png'); + break; default: die('The filename data in the DB was corrupted'); *************** *** 231,235 **** { case 'pls': ! die(PORTAL_URL . 'modules/mx_music/' . 'music.' . $phpEx . '?music_mode=music_stream&song_id=' . $song_id); break; default: --- 243,247 ---- { case 'pls': ! die(PORTAL_URL . 'modules/mx_music/' . 'galerie_media.' . $phpEx . '?music_mode=music_stream&song_id=' . $song_id); break; default: |