|
From: FlorinCB <ory...@us...> - 2009-02-02 01:51:25
|
Update of /cvsroot/mxbb/mx_music In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv29243 Modified Files: music_center.pak Added Files: music_midi.php Log Message: fix Index: music_center.pak =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_center.pak,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** music_center.pak 10 Sep 2008 06:05:21 -0000 1.5 --- music_center.pak 2 Feb 2009 01:51:19 -0000 1.6 *************** *** 5,18 **** block=+:=+:music_center=+:Demo block=+:89=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:74=+:91=+:music_flv=+:flv_player=+:music_flv.php=+: ! parameter=+:91=+:196=+:flv_file=+:Text=+:no_image.flv=+:=+:1=+:0 ! parameter=+:91=+:197=+:flv_img=+:Text=+:no_image.gif=+:=+:1=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:music_flv=+:Demo block=+:91=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:74=+:90=+:Music_list=+:Media toplists=+:music_lists.php=+: ! parameter=+:90=+:198=+:num_of_rows=+:Number=+:2=+:=+:0=+:0 ! parameter=+:90=+:199=+:num_of_cols=+:Number=+:1=+:=+:0=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Music_list=+:Demo block=+:90=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 \ No newline at end of file --- 5,24 ---- block=+:=+:music_center=+:Demo block=+:89=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:74=+:90=+:music_flv=+:flv_player=+:music_flv.php=+: ! parameter=+:90=+:194=+:flv_file=+:Text=+:no_image.flv=+:=+:1=+:0 ! parameter=+:90=+:195=+:flv_img=+:Text=+:no_image.gif=+:=+:1=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:music_flv=+:Demo block=+:90=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:74=+:91=+:random_midi=+:random_midi=+:music_midi.php=+: ! parameter=+:91=+:196=+:msc_file=+:Text=+:default.mid=+:=+:1=+:0 ! parameter=+:91=+:197=+:msc_img=+:Text=+:no_image.gif=+:=+:1=+:0 parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:random_midi=+:Demo block=+:91=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 ! New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:74=+:92=+:Music_list=+:Media toplists=+:music_lists.php=+: ! parameter=+:92=+:198=+:num_of_rows=+:Number=+:2=+:=+:0=+:0 ! parameter=+:92=+:199=+:num_of_cols=+:Number=+:1=+:=+:0=+:0 ! parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Music_list=+:Demo block=+:92=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 \ No newline at end of file --- NEW FILE: music_midi.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_midi.php,v 1.1 2009/02/02 01:51:19 orynider Exp $ * @copyright (c) 2003 [ory...@rd..., OryNider] mxBB Development Team * @license http://opensource.org/licenses/gpl-license.php GNU General Public License v2 * */ // // ERROR HANDLING // //error_reporting( E_ALL ); @ini_set( 'display_errors', '1' ); $phpEx = substr(strrchr(__FILE__, '.'), 1); if ( !defined('PORTAL_BACKEND') && @file_exists( './viewtopic.' . $phpEx ) ) // -------------------------------------------- phpBB MOD MODE { define('MXBB_MODULE', false); define('IN_PHPBB', true); $phpbb_root_path = $module_root_path = './'; $mx_mod_path = $phpbb_root_path . 'mx_mod/'; include($phpbb_root_path . 'common.' . $phpEx); include($mx_mod_path . "includes/functions_required.$phpEx"); //Check if forum_hack is installed if (!isset($mx_root_path)) { $mx_root_path = './'; @define('IN_PORTAL', true); include_once($mx_mod_path . "includes/mx_constants.$phpEx"); include_once($mx_mod_path . "includes/shared/phpbb2/includes/functions.$phpEx"); } else { @define('IN_PORTAL', true); include_once($mx_root_path . "includes/mx_constants.$phpEx"); include_once($mx_root_path . "includes/shared/phpbb2/includes/functions.$phpEx"); //Redefine mx_root_path to include phpbb page_tail.php $mx_root_path = $phpbb_root_path; } require($mx_mod_path . "includes/functions_core.$phpEx"); require($mx_mod_path . "includes/functions_styles.$phpEx"); //Check for cash mod if (file_exists($phpbb_root_path . 'includes/functions_cash.'.$phpEx)) { define('IN_CASHMOD', true); } //@ini_set( 'display_errors', '1' ); error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables //error_reporting(E_ALL & ~E_NOTICE); define( 'PAGE_KB', -502 ); // If this id generates a conflict with other mods, change it ;) // // Instatiate the mx_cache class // $mx_cache = new mx_cache(); // // Get mxBB config settings // //$portal_config = $mx_cache->obtain_mxbb_config(); // // instatiate the mx_request_vars class // $mx_request_vars = new mx_request_vars(); // // Page selector // $page_id = $mx_request_vars->request('page', MX_TYPE_INT, 1); $is_block = false; // // instatiate the mx_user class // $mx_user = new mx_user(); if (file_exists("./modcp.$phpEx")) // phpBB2 { define('PORTAL_BACKEND', 'phpbb2'); $tplEx = 'tpl'; // // Start user session // - populate $userdata and $lang // $mx_user->init($user_ip, $page_id, false); //init_userprefs($userdata); $mx_user->init_style(); //Overwrite template class /* $mx_user->set_module_default_style('_core'); // For compatibility with core 2.8.x if (!$userdata['user_level'] == ADMIN) { die('Only admins may run this script!!!'); } */ mx_cache::load_file('bbcode'); mx_cache::load_file('functions_post'); } else if (@file_exists("./mcp.$phpEx")) // phpBB3 { define('PORTAL_BACKEND', 'phpbb3'); $tplEx = 'html'; // // Start user session // - populate $userdata and $lang // $mx_user->init($user_ip, $page_id, false); $user->setup(); // // End session management // /* $mx_user->set_module_default_style('_core'); // For compatibility with core 2.8.x if ($userdata['user_type'] != USER_FOUNDER) { die('Only admins may run this script!!!'); } */ include_once($mx_mod_path . "includes/shared/phpbb2/includes/bbcode.$phpEx"); include_once($mx_mod_path . "includes/shared/phpbb2/includes/functions_post.$phpEx"); } else { die('Copy this file in phpbb_root_path were is your viewtopic.php file!!!'); } } else { if( !defined('IN_PORTAL') || !is_object($mx_block)) { @define("IN_PORTAL", true); $mx_root_path = '../../'; // // Let's include some stuff... // $phpEx = substr(strrchr(__FILE__, '.'), 1); include_once($mx_root_path . 'common.' . $phpEx); // // Start session management // $mx_user->init($user_ip, PAGE_INDEX); // // End session management // $block_id = ( !empty($HTTP_GET_VARS['block_id']) ) ? $HTTP_GET_VARS['block_id'] : $HTTP_POST_VARS['id']; if( empty($block_id) ) { $sql = "SELECT * FROM " . BLOCK_TABLE . " WHERE block_title = 'Music Center' LIMIT 1"; if(!$result = $db->sql_query($sql)) { mx_message_die(GENERAL_ERROR, "Could not query Music Center module information", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); $block_id = $row['block_id']; } $is_block = FALSE; } else { // // Read block Configuration // $title = $mx_block->block_info['block_title']; $block_size = isset($block_size) && !empty($block_size) ? $block_size : '100%'; $msc_file = $music_root_path . 'upload/default.mid'; $msc_img = $images['no_image']; if(is_object($mx_block)) { $is_block = TRUE; } global $images; } @define("MXBB_MODULE", true); @define("MXBB_27x", file_exists($mx_root_path . "mx_login.$phpEx")); } $music_root_path = $module_root_path . 'music_box/'; // // Get general music information // include_once($module_root_path . "music_box/music_common.$phpEx"); $song_image_path = MUSIC_IMAGE_PATH; $song_image_default = $images['no_image']; // The default image // // Start output of page // $page_title = $lang['Music']; $template->set_filenames(array( 'body' => 'music_midi_body.'.$tplEx) ); $fullpath = $module_root_path . 'upload/random_midi/'; $exts = 'mid midi'; $random = array(); $i = -1; $handle = opendir($fullpath); $exts = explode(' ', $exts); while (false !== ($file = readdir($handle))) { foreach($exts as $ext) { if (preg_match('/\.'.$ext.'$/i', $file, $test)) { $random[] = $file; ++$i; } } } closedir($handle); // $msc_file = $avatars[mt_rand(0, count($avatars)-1)]; $msc_file = $random[mt_rand(0, $i)]; $msc_fullpath = $module_root_path . 'upload/random_midi/' . $msc_file; $msc_filetype = strtolower(substr($msc_file, strlen($msc_file) - 4, 4)); if ($msc_file) { $template->assign_block_vars('media', array()); $url_download = ''; $url_video = PORTAL_URL . 'modules/mx_music/music_box/mediaplayer.swf'; if (@file_exists($mx_root_path . $msc_fullpath)) { $url_song = PORTAL_URL . $msc_fullpath; } elseif (@file_exists($msc_fullpath)) { $url_song = PORTAL_URL . $msc_fullpath; } else { $url_song = $msc_file; } if (@file_exists($mx_root_path . $msc_img)) { $img_id = PORTAL_URL . $msc_img; } elseif (@file_exists($mx_root_path . 'modules/mx_music/upload/song_image/' . $msc_img)) { $img_id = PORTAL_URL . 'modules/mx_music/upload/song_image/' . $msc_img; } else { $img_id = $msc_img; } $template->assign_vars(array( 'CAT_TITLE' => '', 'U_VIEW_CAT' => '', 'U_SONG' => $url_song, 'U_IMG' => mx_append_sid("$img_id"), 'SONG_TITLE' => '', 'SONG_URL' => $url_song, 'SONG_THUMB_URL' => $msc_img, 'SONG_FULL_URL' => '', 'VIDEO_URL' => $url_video, 'SONG_DESC' => '', 'SINGER' => '', 'POSTER' => '', 'SONG_TIME' => '', 'SONG_VIEW' => '', 'SONG_DOWNLOAD' => '', 'SONG_RATING' => '', 'SONG_COMMENTS' => '', 'U_RATE' => '', 'U_COMMENT' => '', 'U_DOWNLOAD' => '', 'U_NEXT' => '', 'U_PREVIOUS' => '', 'L_NEXT' => $lang['Next'], 'L_PREVIOUS' => $lang['Previous'], 'NAV_SEP' => $lang['Nav_Separator'], 'NAV_DOT' => '•', 'MUSIC_VERSION' => '2' . $music_config['music_version'], 'L_INDEX' => '<<', 'U_INDEX' => mx_append_sid($mx_root_path . "index.".$phpEx), 'L_MUSIC_INDEX' => $lang['Music'], 'L_MUSIC' => $lang['Music'], 'U_MUSIC' => mx_append_sid(this_mo_mxurl()), 'U_MX_MUSIC' => mx_append_sid(this_mo_portalurl()), 'WIDTH' => ( !empty($media_width) ? $media_width : '600' ), 'HEIGHT' => ( !empty($media_height) ? $media_height : '200' ), 'FLASH' => 'flash', 'RAM' => 'ram', 'FLASHVIDEO' => 'flashvideo', 'YOUTUBE' => 'youtube', 'QT' => 'qt', 'FLV' => 'flv', 'IMG' => 'img', 'MEDIA' => 'media', 'L_RATING' => $lang['Rating'], 'L_SONG_TITLE' => $lang['Song_Title'], 'L_SONG_DESC' => $lang['Song_Desc'], 'L_SINGER' => $lang['Singer'], 'L_POSTER' => $lang['Poster'], 'L_POSTED' => $lang['Posted'], 'L_VIEW' => $lang['View'], 'L_DOWNLOAD' => $lang['Download'], 'L_COMMENTS' => $lang['Comments']) ); } // // Generate the page // $template->pparse('body'); ?> |