|
From: FlorinCB <ory...@us...> - 2008-09-10 06:06:04
|
Update of /cvsroot/mxbb/mx_music/music_box/modules In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26047/music_box/modules Modified Files: music_cat.php music_comment.php music_image.php music_media_cat.php music_page.php music_upload.php Log Message: get ready for release Index: music_upload.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_box/modules/music_upload.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** music_upload.php 9 Sep 2008 10:38:34 -0000 1.4 --- music_upload.php 10 Sep 2008 06:05:25 -0000 1.5 *************** *** 289,301 **** // -------------------------------- ! $song_title = str_replace("\'", "''", htmlspecialchars(trim($_POST['song_title']))); ! $song_url = str_replace("\'", "''", htmlspecialchars(trim($_POST['song_url']))); ! $image_system = str_replace("\'", "''", htmlspecialchars(trim($_POST['image_system']))); ! $song_desc = str_replace("\'", "''", htmlspecialchars(substr(trim($_POST['song_desc']), 0, $music_config['desc_length']))); ! $song_singer = str_replace("\'", "''", htmlspecialchars(trim($_POST['song_singer']))); $song_username = (!$userdata['session_logged_in']) ? substr(str_replace("\'", "''", htmlspecialchars(trim($_POST['song_username']))), 0, 32) : str_replace("'", "''", $userdata['username']); --- 289,303 ---- // -------------------------------- ! $song_title = str_replace("'", "`", htmlspecialchars(trim($_POST['song_title']))); ! $song_url = str_replace("'", "`", htmlspecialchars(trim($_POST['song_url']))); ! $image_system = str_replace("'", "`", htmlspecialchars(trim($_POST['image_system']))); ! $song_desc = str_replace("'", "`", htmlspecialchars(substr(trim($_POST['song_desc']), 0, $music_config['desc_length']))); ! $song_desc = htmlspecialchars(trim(stripslashes($song_desc))); ! ! $song_singer = str_replace("'", "`", htmlspecialchars(trim($_POST['song_singer']))); $song_username = (!$userdata['session_logged_in']) ? substr(str_replace("\'", "''", htmlspecialchars(trim($_POST['song_username']))), 0, 32) : str_replace("'", "''", $userdata['username']); *************** *** 330,333 **** --- 332,336 ---- $filesize = $_FILES['song_file']['size']; $filetmp = $_FILES['song_file']['tmp_name']; + $filename = strtolower(trim($_FILES['song_file']['name'])); // -------------------------------- *************** *** 338,341 **** --- 341,345 ---- $imagesize = ( !empty($_FILES['song_image']['size']) ) ? $_FILES['song_image']['size'] : 0; $imagetmp = ( !empty($_FILES['song_image']['tmp_name']) ) ? $_FILES['song_image']['tmp_name'] : ''; + $imagename = ( !empty($_FILES['song_image']['name']) ) ? $_FILES['song_image']['name'] : ''; // -------------------------------- *************** *** 572,575 **** --- 576,607 ---- mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type'] . ': ' . $filetype); } + + //Overwrite some types + $ext_filetype = substr($filename, strlen($filename) - 3, 3); + + switch ($ext_filetype) + { + case 'mod': + case 'MOD': + $song_filetype = '.mod'; + break; + + case 's3m': + case 'S3M': + $song_filetype = '.s3m'; + break; + + case 'ult': + case 'ULT': + $song_filetype = '.ult'; + break; + + case 'xm': + case '.xm': + case '.XM': + + $song_filetype = '.xm'; + break; + } } else *************** *** 579,583 **** if( empty($song_filetype) ) { ! $song_filetype = ''; } } --- 611,615 ---- if( empty($song_filetype) ) { ! $song_filetype = '.mp3'; } } Index: music_image.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_box/modules/music_image.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** music_image.php 7 Sep 2008 18:06:55 -0000 1.1 --- music_image.php 10 Sep 2008 06:05:23 -0000 1.2 *************** *** 49,66 **** $user_id = $thissong['song_user_id']; ! if ($thissong['song_url'] == '') ! { ! $song_filetype = substr($thissong['song_filename'], strlen($thissong['song_filename']) - 3, 3); ! $song_filename = $thissong['song_filename']; ! } ! else ! { ! $song_filetype = substr($thissong['song_url'], strlen($thissong['song_url']) - 3, 3); ! $song_url = $thissong['song_url']; ! } ! ! $pic_filetype = substr($thissong['song_imagename'], strlen($thissong['song_imagename']) - 3, 3); ! $pic_filename = $thissong['song_imagename']; ! // ------------------------------------ --- 49,55 ---- $user_id = $thissong['song_user_id']; ! $pic_filename = ($thissong['song_imagename']) ? $thissong['song_imagename'] : 'no_image.gif'; ! $song_url = $thissong['song_url']; ! $pic_filetype = $song_filetype = substr($pic_filename, strlen($pic_filename) - 3, 3); // ------------------------------------ *************** *** 158,162 **** // ------------------------------------ ! if ($thissong['song_imagename']) { switch ($pic_filetype) --- 147,151 ---- // ------------------------------------ ! if ($pic_filetype) { switch ($pic_filetype) Index: music_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_box/modules/music_cat.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** music_cat.php 9 Sep 2008 07:04:32 -0000 1.10 --- music_cat.php 10 Sep 2008 06:05:22 -0000 1.11 *************** *** 838,849 **** else if ( $song_filetype == 'flv' ) { - /* - if ( !is_object($mx_page) ) - { - $mx_page = new mx_page(); - } - $mx_page->add_footer_text( $music_root_path . 'music_player.js', true ); - */ - $template->assign_block_vars('songrow.flv', array()); $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); --- 838,841 ---- *************** *** 851,854 **** --- 843,853 ---- $row_type = 'flv'; } + else if ( ( $song_filetype == 'mod' ) || ( $song_filetype == 's3m' ) || ( $song_filetype == 'ult' ) || ( $song_filetype == '.xm' ) ) + { + $template->assign_block_vars('songrow.mod', array()); + $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); + $url_video = $music_root_path . 'modplayer.swf'; + $row_type = 'mod'; + } else if ( ( $song_filetype == '.jpg' ) || ( $song_filetype == '.gif' ) || ( $song_filetype == '.png' ) ) { *************** *** 1112,1124 **** $switch_row_type = 'media'; } ! ! if ($song_filetype == 'flv') ! { ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! } ! else { ! $url_song = mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $songrow[$j]['song_id'], true)); ! } $song_user_ip = (@function_exists( 'decode_ip' )) ? music_decode_ip($songrow[$j]['song_user_ip']) : phpBB2::decode_ip($songrow[$j]['song_user_ip']); --- 1111,1128 ---- $switch_row_type = 'media'; } ! ! switch ($song_filetype) { ! case 'flv': ! case 'mod': ! case 's3m': ! case 'ult': ! case '.xm': ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! break; ! ! default: ! $url_song = mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $songrow[$j]['song_id'], true)); ! } $song_user_ip = (@function_exists( 'decode_ip' )) ? music_decode_ip($songrow[$j]['song_user_ip']) : phpBB2::decode_ip($songrow[$j]['song_user_ip']); *************** *** 1128,1131 **** --- 1132,1137 ---- 'U_SONG' => $url_song, + + 'U_SONG_PAGE' => mx_append_sid(this_mo_mxurl("music_mode=music_page&song_id=". $songrow[$j]['song_id'])), 'SONG_TITLE' => $thissong['song_title'], *************** *** 1144,1147 **** --- 1150,1157 ---- 'U_IMG' => mx_append_sid($img_id), + + 'FLASH_PLAYER' => $music_root_path . 'mediaplayer.swf', + + 'DUMMY_FLV' => PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . 'no_image.flv', 'SINGER' => $songrow[$j]['song_singer'], *************** *** 1356,1359 **** --- 1366,1370 ---- 'QT' => 'qt', 'FLV' => 'flv', + 'MOD' => 'mod', 'IMG' => 'img', 'MEDIA' => 'media', Index: music_media_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_box/modules/music_media_cat.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** music_media_cat.php 9 Sep 2008 07:04:33 -0000 1.8 --- music_media_cat.php 10 Sep 2008 06:05:24 -0000 1.9 *************** *** 517,520 **** --- 517,524 ---- $row_type = 'flv'; } + else if ( ( $song_filetype == 'mod' ) || ( $song_filetype == 's3m' ) || ( $song_filetype == 'ult' ) || ( $song_filetype == '.xm' ) ) + { + $row_type = 'mod'; + } else if ( ( $song_filetype == 'jpg' ) || ( $song_filetype == 'gif' ) || ( $song_filetype == 'png' ) ) { *************** *** 705,712 **** break; ! case 'media': $switch_row_type = 'media'; break; case 'img': $switch_row_type = 'img'; --- 709,732 ---- break; ! case 'mod': ! $switch_row_type = 'media'; ! break; ! ! case 's3m': ! $switch_row_type = 'media'; ! break; ! ! case 'ult': $switch_row_type = 'media'; break; + case '.xm': + $switch_row_type = 'media'; + break; + + case 'media': + $switch_row_type = 'media'; + break; + case 'img': $switch_row_type = 'img'; *************** *** 808,811 **** --- 828,837 ---- $url_video = $music_root_path . 'mediaplayer.swf'; } + else if ( ( $song_filetype == 'mod' ) || ( $song_filetype == 's3m' ) || ( $song_filetype == 'ult' ) || ( $song_filetype == '.xm' ) ) + { + $template->assign_block_vars('songrow.mod', array()); + $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); + $url_video = $music_root_path . 'modplayer.swf'; + } else if ( ( $song_filetype == '.jpg' ) || ( $song_filetype == '.gif' ) || ( $song_filetype == '.png' ) ) { *************** *** 1043,1053 **** } ! if ( $song_filetype == 'flv' ) ! { ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! } ! else { ! $url_song = mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $songrow[$j]['song_id'], true)); } --- 1069,1084 ---- } ! switch ($song_filetype) { ! case 'flv': ! case 'mod': ! case 's3m': ! case 'ult': ! case '.xm': ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! break; ! ! default: ! $url_song = mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $songrow[$j]['song_id'], true)); } *************** *** 1058,1061 **** --- 1089,1094 ---- 'U_SONG' => $url_song, + + 'U_SONG_PAGE' => mx_append_sid(this_mo_mxurl("music_mode=music_page&song_id=". $songrow[$j]['song_id'])), 'SONG_TITLE' => $thissong['song_title'], *************** *** 1070,1073 **** --- 1103,1110 ---- 'U_IMG' => mx_append_sid("$img_id"), + + 'FLASH_PLAYER' => $music_root_path . 'mediaplayer.swf', + + 'DUMMY_FLV' => PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . 'no_image.flv', 'SINGER' => $songrow[$j]['song_singer'], Index: music_comment.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_box/modules/music_comment.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** music_comment.php 9 Sep 2008 10:38:33 -0000 1.7 --- music_comment.php 10 Sep 2008 06:05:23 -0000 1.8 *************** *** 60,66 **** // ------------------------------------ ! $sql = "SELECT s.*, u.user_id, u.username, COUNT(c.comment_id) as comments_count FROM ". MUSIC_TABLE ." AS s - LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id LEFT JOIN ". MUSIC_COMMENT_TABLE ." AS c ON s.song_id = c.comment_song_id WHERE song_id = '$song_id' --- 60,65 ---- // ------------------------------------ ! $sql = "SELECT s.*, c.*, s.song_username as username, s.song_user_id as user_id, COUNT(c.comment_id) as comments_count FROM ". MUSIC_TABLE ." AS s LEFT JOIN ". MUSIC_COMMENT_TABLE ." AS c ON s.song_id = c.comment_song_id WHERE song_id = '$song_id' Index: music_page.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_box/modules/music_page.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** music_page.php 9 Sep 2008 07:04:33 -0000 1.8 --- music_page.php 10 Sep 2008 06:05:24 -0000 1.9 *************** *** 296,299 **** --- 296,306 ---- $url_video = $music_root_path . 'mediaplayer.swf'; } + else if ( ( $song_filetype == 'mod' ) || ( $song_filetype == 's3m' ) || ( $song_filetype == 'ult' ) || ( $song_filetype == '.xm' ) ) + { + $template->assign_block_vars('mod', array()); + $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); + $url_video = $music_root_path . 'modplayer.swf'; + $row_type = 'mod'; + } else if ( ( $song_filetype == 'jpg' ) || ( $song_filetype == 'gif' ) || ( $song_filetype == 'png' ) ) { *************** *** 516,526 **** } ! if ( $song_filetype == 'flv' ) ! { ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! } ! else { ! $url_song = mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $song_id, true)); } --- 523,550 ---- } ! switch ($song_filetype) { ! case 'flv': ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! break; ! ! case 'mod': ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! break; ! ! case 's3m': ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! break; ! ! case 'ult': ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! break; ! ! case '.xm': ! $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; ! break; ! ! default: ! $url_song = mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $thissong['song_id'], true)); } *************** *** 543,556 **** 'U_IMG' => mx_append_sid("$img_id"), 'SONG_TITLE' => $thissong['song_title'], 'SONG_URL' => !empty($thissong['song_url']) ? $thissong['song_url'] : $url_song, - 'SONG_THUMB_URL' => !empty($thissong['song_url']) ? $thissong['song_url'] : mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $song_id . "&item_size=425", true)), - 'SONG_FULL_URL' => !empty($thissong['song_url']) ? $thissong['song_url'] : mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $song_id . "&item_size=800", true)), 'VIDEO_URL' => !empty($url_player) ? $url_player : $url_video, 'SONG_DESC' => nl2br($thissong['song_desc']), --- 567,586 ---- 'U_IMG' => mx_append_sid("$img_id"), + + 'SONG_THUMB_URL' => ($thissong['song_imagename']) ? mx_append_sid(this_mo_mxurl("music_mode=music_image&width=425&song_id=". $thissong['song_id'], true)) : $img_id, 'SONG_TITLE' => $thissong['song_title'], + + 'U_SONG_PAGE' => mx_append_sid(this_mo_mxurl("music_mode=music_page&song_id=". $thissong['song_id'])), 'SONG_URL' => !empty($thissong['song_url']) ? $thissong['song_url'] : $url_song, 'SONG_FULL_URL' => !empty($thissong['song_url']) ? $thissong['song_url'] : mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $song_id . "&item_size=800", true)), 'VIDEO_URL' => !empty($url_player) ? $url_player : $url_video, + + 'FLASH_PLAYER' => $music_root_path . 'mediaplayer.swf', + + 'DUMMY_FLV' => PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . 'no_image.flv', 'SONG_DESC' => nl2br($thissong['song_desc']), *************** *** 600,603 **** --- 630,634 ---- 'QT' => 'qt', 'FLV' => 'flv', + 'MOD' => 'mod', 'IMG' => 'img', 'MEDIA' => 'media', |