|
From: OryNider <ory...@us...> - 2008-03-13 10:36:16
|
Update of /cvsroot/mxbb/mx_music In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32467 Modified Files: Tag: core28x db_install.php db_upgrade.php music.php music_center.pak music_lists.php mx_install_readme.htm release.txt Added Files: Tag: core28x music_flv.php Log Message: upgrade version for core28x branch Index: release.txt =================================================================== RCS file: /cvsroot/mxbb/mx_music/Attic/release.txt,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** release.txt 25 Aug 2007 03:30:26 -0000 1.4 --- release.txt 13 Mar 2008 10:34:54 -0000 1.4.2.1 *************** *** 1,17 **** ! [b][Release][mx_music]: Music Center[/b] [b][Authors]: Cf Manager, OryNider[/b] ! [b][Version]: 2.0.7 [/b] ! ! [b]Designed for mxBB Version: 2.8.0[/b] ! [b][Support]:[/b] [u]Here[/u] [b][DEMO]:[/b] [url=http://atcer.ministry.ro/board/?page=16]Here[/url] - [b][Note]:[/b] - [color=red]If you upgrade from 2.7.x and you have mx_musiconline, the posibility of migration to mx_music it's just teoretical with unknown rezult, and you do it at your own risc!!! A mx_musiconline module for 2.8.0 may be relesed by Selven.[/color] - [b][Description]:[/b] This Module allows you create the Music Center Page/Block where users can upload, listen, rate and comment on songs. --- 1,12 ---- ! [[b][RELEASE NOTES]:[/b] Media Center Module [b][Authors]: Cf Manager, OryNider[/b] ! [b][Version]: 2.1.0 [/b] ! [b]Designed for mxBB Version: 2.8.1[/b] [b][DEMO]:[/b] [url=http://atcer.ministry.ro/board/?page=16]Here[/url] [b][Description]:[/b] This Module allows you create the Music Center Page/Block where users can upload, listen, rate and comment on songs. *************** *** 35,39 **** In version 2.0.2 and above if you are posting a radio stream that ends with "/listen.pls" on music_page will be swiched to music_stream mode and will make traffic on your website, but if it's submited like a normal url with no "/listen.pls" will make traffic on the shotcast server who is brotcasting the stream. But if it's submited with "/listen.pls" can be listened with your favorite player and the original stream informations will he hidden To do this copy the link from Download/Listen in your player on the website or local computer such as WinAMP :wink: But do not try to save the file couse you will just make not needed traffic and get a very large file!!![/color] ! [b][Download]:[/b] [URL=http://www.mx-system.com/modules/mx_pafiledb/dload.php?action=download&file_id=368]mx_music_center.zip[/URL] [b][Languages]:[/b] --- 30,34 ---- In version 2.0.2 and above if you are posting a radio stream that ends with "/listen.pls" on music_page will be swiched to music_stream mode and will make traffic on your website, but if it's submited like a normal url with no "/listen.pls" will make traffic on the shotcast server who is brotcasting the stream. But if it's submited with "/listen.pls" can be listened with your favorite player and the original stream informations will he hidden To do this copy the link from Download/Listen in your player on the website or local computer such as WinAMP :wink: But do not try to save the file couse you will just make not needed traffic and get a very large file!!![/color] ! [b][Download]:[/b] [URL=http://www.mx-system.com/index.php?page=4&action=file&file_id=368]Mx_Media_Center.zip[/URL] [b][Languages]:[/b] *************** *** 48,50 **** [b][Chinese Language][/b]: [url=http://pubory.uv.ro/portal/modules/mx_pafiledb/dload.php?action=download&file_id=47]mx_music_lang_chinese.zip[/url] ! [b][Vietnamese Language][/b]: [url=http://pubory.uv.ro/portal/modules/mx_pafiledb/dload.php?action=download&file_id=48]mx_music_lang_vietnamese.zip[/url] \ No newline at end of file --- 43,48 ---- [b][Chinese Language][/b]: [url=http://pubory.uv.ro/portal/modules/mx_pafiledb/dload.php?action=download&file_id=47]mx_music_lang_chinese.zip[/url] ! [b][Vietnamese Language][/b]: [url=http://pubory.uv.ro/portal/modules/mx_pafiledb/dload.php?action=download&file_id=48]mx_music_lang_vietnamese.zip[/url] ! ! [b][Note]:[/b] ! [color=red]If you upgrade from 2.7.x and you have mx_musiconline, the posibility of migration to mx_music it's just teoretical with unknown rezult, and you do it at your own risc!!! A mx_musiconline module for 2.8.0 may be relesed by Selven.[/color] \ No newline at end of file --- NEW FILE: music_flv.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_flv.php,v 1.1.2.2 2008/03/13 10:34:55 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!!!'); } */ include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_post.' . $phpEx); } 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%'; $flv_file = $mx_block->get_parameters('flv_file') ? $mx_block->get_parameters('flv_file') : $music_root_path . 'upload/default.flv'; $flv_img = $mx_block->get_parameters('flv_img') ? $mx_block->get_parameters('flv_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']; if ( !$is_block ) { include($mx_root_path . 'includes/page_header.'.$phpEx); } $template->set_filenames(array( 'body' => 'music_flv_body.tpl') ); if (is_numeric($flv_file)) { $song_id = $flv_file; // ------------------------------------ // PREVIOUS & NEXT // ------------------------------------ if( isset($HTTP_GET_VARS['mode']) ) { if( ($HTTP_GET_VARS['mode'] == 'next') or ($HTTP_GET_VARS['mode'] == 'previous') ) { $sql = "SELECT song_id, song_cat_id, song_user_id FROM ". MUSIC_TABLE ." WHERE song_id = $song_id"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query song information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); if( empty($row) ) { mx_message_die(GENERAL_ERROR, 'Bad song_id'); } $sql = "SELECT new.song_id, new.song_time FROM ". MUSIC_TABLE ." AS new, ". MUSIC_TABLE ." AS cur WHERE cur.song_id = $song_id AND new.song_id <> cur.song_id AND new.song_cat_id = cur.song_cat_id"; $sql .= ($HTTP_GET_VARS['mode'] == 'next') ? " AND new.song_time >= cur.song_time" : " AND new.song_time <= cur.song_time"; $sql .= ($HTTP_GET_VARS['mode'] == 'next') ? " ORDER BY song_time ASC LIMIT 1" : " ORDER BY song_time DESC LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query song information', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); if( empty($row) ) { mx_message_die(GENERAL_ERROR, $lang['Song_not_exist']); } $song_id = $row['song_id']; // NEW song_id } } // ------------------------------------ // Get this song info // ------------------------------------ $sql = "SELECT s.*, u.user_id, u.username, r.rate_song_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments FROM ". MUSIC_TABLE ." AS s LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id LEFT JOIN ". MUSIC_RATE_TABLE ." AS r ON s.song_id = r.rate_song_id LEFT JOIN ". MUSIC_COMMENT_TABLE ." AS c ON s.song_id = c.comment_song_id WHERE song_id = '$song_id' GROUP BY s.song_id"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query song information', '', __LINE__, __FILE__, $sql); } $thissong = $db->sql_fetchrow($result); $cat_id = $thissong['song_cat_id']; $user_id = $thissong['song_user_id']; if( empty($thissong['song_url']) && !file_exists(MUSIC_UPLOAD_PATH . $thissong['song_filename']) ) { mx_message_die(GENERAL_ERROR, $lang['Song_not_exist']); } if ( $thissong['song_imagename'] == '' ) { $img_id = $song_image_default; } else { $img_id = $song_image_path . $thissong['song_imagename']; } if ( $thissong['song_url'] == '' ) { $song_filetype = substr($thissong['song_filename'], strlen($thissong['song_filename']) - 3, 3); $song_filename = ( !empty($thissong['song_filename']) ? $thissong['song_filename'] : '' ); } else { $song_filetype = substr($thissong['song_url'], strlen($thissong['song_url']) - 3, 3); $song_url = $thissong['song_url']; } // ------------------------------------ // Get the current Category Info // ------------------------------------ $sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." WHERE cat_id = '$cat_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql); } $thiscat = $db->sql_fetchrow($result); if (empty($thiscat)) { mx_message_die(GENERAL_ERROR, $lang['Category_not_exist']); } // ------------------------------------ // Check the permissions // ------------------------------------ $music_user_access = music_user_access($cat_id, $thiscat, 1, 0, 0, 0, 0, 0); // UPLOAD if ($music_user_access['view'] == 0) { if (!$userdata['session_logged_in']) { mx_redirect(mx_append_sid($mx_root_path . "login.php?redirect=" . this_mo_loginurl("music_mode=music_page&song_id=$song_id"), true)); } else { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } // ------------------------------------ // Check song Approval // ------------------------------------ if ($userdata['user_level'] != ADMIN) { if( ($thiscat['cat_approval'] == ADMIN) or (($thiscat['cat_approval'] == MOD) and !$music_user_access['moderator']) ) { if ($thissong['song_approval'] != 1) { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } } // ------------------------------------ // Increase view counter // ------------------------------------ $sql = "UPDATE ". MUSIC_TABLE ." SET song_view_count = song_view_count + 1 WHERE song_id = '$song_id'"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not update song information', '', __LINE__, __FILE__, $sql); } /* +---------------------------------------------------------- | Main work here... +---------------------------------------------------------- */ if( ($thissong['song_user_id'] == MUSIC_GUEST) or ($thissong['username'] == '') ) { $poster = ($thissong['song_username'] == '') ? $lang['Guest'] : $thissong['song_username']; } else { $poster = '<a href="'. mx_append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $thissong['song_user_id']) .'">'. $thissong['song_username'] .'</a>'; } if ($music_config['rate']) { $template->assign_block_vars('rate_switch', array()); } if ($music_config['comment']) { $template->assign_block_vars('comment_switch', array()); } if ($music_config['download']) { $template->assign_block_vars('download_switch', array()); } $url_player = ''; // // Media Center // if ( $song_filetype == 'swf' ) { $template->assign_block_vars('flash', array()); $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; } else if ( $song_filetype == 'ram' ) { $template->assign_block_vars('ram', array()); $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; } else if ( $song_filetype == '.rm' ) { $template->assign_block_vars('rm', array()); $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; } else if ( $song_filetype == '.qt' ) { $template->assign_block_vars('qt', array()); $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $url_download; } 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('flv', array()); $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $music_root_path . 'music_player.swf'; } else if ( ( $song_filetype == 'jpg' ) || ( $song_filetype == 'gif' ) || ( $song_filetype == 'png' ) ) { $url_download = !empty($thissong['song_url']) ? $thissong['song_url'] : mx_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']) ) { $template->assign_block_vars('media', array()); $url_download = mx_append_sid($module_root_path . 'galerie_media.' . $phpEx . '?music_mode=music_stream&song_id=' . $song_id); $lang['Download'] = ( !empty($lang['Listen']) ? $lang['Listen'] : 'Listen URL' ); $url_video = $url_download; } else if(!empty($thissong['song_url'])) { $host = explode("//", $thissong['song_url']); $host = $host[1]; $host = explode("/", $host); $domain = $host[0]; $counthost = count($host) - 1; $docid2 = $host[$counthost]; // $domaintmp = explode(".", $domain, -1); // Php 5 only // $sitename = implode(".", $domaintmp); function mx_music_sitename($domain) { $domaintmp = explode(".", $domain); $y = count($domaintmp) - 1; $r = ""; for ($a = 0; $y > $a; $a++) { $r .= ".".$domaintmp[$a]; } return $r; } $sitename = substr(mx_music_sitename($domain), 1); function mx_music_sitesufix($domain) { $domaintmp = explode(".", $domain); $y = count($domaintmp) - 1; $r = $domaintmp[$y];; return $r; } $sitesufix = mx_music_sitesufix($domain); if (!empty($sitesufix) ) { if ($sitesufix == 'de') { $sitelngprefix = 'de.'; } else { $sitelngprefix = 'en.'; } } else { $sitelngprefix = ''; } if ($sitename == 'video.google') { $videoid['song_url'] = explode("-", $thissong['song_url']); if (empty($videoid['song_url'][1]) ) { $docid['song_url'] = explode("?", $thissong['song_url']); if (empty($docid['song_url'][1]) ) { $template->assign_block_vars('flashvideo', array()); $url_video = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/googleplayer.swf?' . $docid['song_url'][1] : $thissong['song_url'] ); $url_download = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/videoplay?' . $docid['song_url'][1] : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); } else { $template->assign_block_vars('youtube', array()); $url_video = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/googleplayer.swf?' . $docid['song_url'][1] : $thissong['song_url'] ); $url_download = ( !empty($docid['song_url'][1]) ? 'http://' . $domain . '/videoplay?' . $docid['song_url'][1] : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Share']) ? $lang['Watch'] : 'Watch URL' ); } } else { $template->assign_block_vars('youtube', array()); $url_video = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/googleplayer.swf?docId=-' . $videoid['song_url'][1] : $thissong['song_url'] ); $url_download = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/videoplay?docid=-' . $videoid['song_url'][1] : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Watch']) ? $lang['Watch'] : 'Watch URL' ); } } else if ( ($sitename == 'www.youtube') || ($sitename == 'youtube') ) { $videoid['song_url'] = explode("=", $thissong['song_url']); if (empty($videoid['song_url'][1]) ) { $videoid['song_url'] = explode("/v/", $thissong['song_url']); } if (empty($videoid['song_url'][1]) ) { $template->assign_block_vars('flashvideo', array()); } else { $template->assign_block_vars('youtube', array()); } if ($sitename == 'www.youtube') { $domain = 'youtube.' . $sitesufix; } $url_download = mx_append_sid($thissong['song_url']); $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); $img_id = !empty($thissong['song_imagename']) ? $thissong['song_imagename'] : 'http://img.' . $domain . '/vi/' . $videoid['song_url'][1] . '/default.jpg'; $url_video = !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/v/' . $videoid['song_url'][1] : $url_download; //$url_player = !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/player2.swf?video_id=' . $videoid['song_url'][1] : $url_download; } else if ( ($sitename == 'www.clipfish') || ($sitename == 'clipfish') ) { $thisvid['song_url'] = explode("videoid", $thissong['song_url']); $videoid['song_url'] = explode("=", $thisvid['song_url'][1]); if (empty($videoid['song_url'][1]) ) { $template->assign_block_vars('flashvideo', array()); $url_download = mx_append_sid($thissong['song_url']); $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; } else { $template->assign_block_vars('youtube', array()); $url_download = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/player.php?videoid=' . $videoid['song_url'][1] : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Watch']) ? $lang['Watch'] : 'Watch URL' ); $url_video = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/videoplayer.swf?as=0&videoid=' . $videoid['song_url'][1] : $url_download ); } } else if ( ($sitename == 'www.myvideo') || ($sitename == 'myvideo') ) { if (empty($docid2) ) { $template->assign_block_vars('flashvideo', array()); $url_download = mx_append_sid($thissong['song_url']); $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; } else { $template->assign_block_vars('youtube', array()); $url_download = ( !empty($docid2) ? 'http://' . $domain . '/watch/' . $docid2 : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); $url_video = ( !empty($docid2) ? 'http://' . $domain . '/movie/' . $docid2 : $url_download ); } } else if ( ($sitename == 'de.sevenload') || ($sitename == 'sevenload') || ($sitename == 'page.sevenload') || ($sitename == 'www.sevenload') ) { $videoid['song_url'] = explode("=", $thissong['song_url']); if (empty($videoid['song_url'][1]) ) { if (empty($docid2) ) { $template->assign_block_vars('flashvideo', array()); $url_download = mx_append_sid($thissong['song_url']); $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; } else { $template->assign_block_vars('youtube', array()); $url_download = ( !empty($docid2) ? 'http://' . $sitelngprefix . 'sevenload.' . 'com' . '/videos/' . $docid2 : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); $url_video = ( !empty($docid2) ? 'http://' . $domain . '/swf/player.swf?id=' . $docid2 : $url_download ); } } else { $template->assign_block_vars('youtube', array()); $url_download = ( !empty($videoid['song_url'][1]) ? 'http://' . $sitelngprefix . 'sevenload.'. 'com' . '/videos/' . $videoid['song_url'][1] : $thissong['song_url'] ); $lang['Download'] = ( !empty($lang['Share']) ? $lang['Share'] : 'Share URL' ); $url_video = ( !empty($videoid['song_url'][1]) ? 'http://' . $domain . '/swf/player.swf?id=' . $videoid['song_url'][1] : $url_download ); } } else { $template->assign_block_vars('media', array()); $url_download = mx_append_sid($thissong['song_url']); $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; } } else { $template->assign_block_vars('media', array()); //$url_download = mx_append_sid($module_root_path . 'galerie_media.' . $phpEx . '?music_mode=music_download&song_id=' . $song_id); $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=" . $song_id)); $url_video = $url_download; } if ( $song_filetype == 'flv' ) { $url_song = PORTAL_URL . MUSIC_UPLOAD_PATH . $thissong['song_filename']; } else { $url_song = mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $song_id, true)); } $template->assign_vars(array( 'CAT_TITLE' => $thiscat['cat_title'], 'U_VIEW_CAT' => mx_append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=$cat_id")), 'U_SONG' => $url_song, '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']), 'SINGER' => $thissong['song_singer'], 'POSTER' => $poster, 'SONG_TIME' => (@function_exists( 'create_date' )) ? create_date($board_config['default_dateformat'], $thissong['song_time'], $board_config['board_timezone']) : phpBB2::create_date($board_config['default_dateformat'], $thissong['song_time'], $board_config['board_timezone']), 'SONG_VIEW' => $thissong['song_view_count'], 'SONG_DOWNLOAD' => ( !empty($thissong['song_download_count']) ? $thissong['song_download_count'] : '0' ), 'SONG_RATING' => ($thissong['rating'] != 0) ? round($thissong['rating'], 2) : $lang['Not_rated'], 'SONG_COMMENTS' => $thissong['comments'], 'U_RATE' => mx_append_sid(this_mo_mxurl("music_mode=music_rate&song_id=$song_id")), 'U_COMMENT' => mx_append_sid(this_mo_mxurl("music_mode=music_comment&song_id=$song_id")), 'U_DOWNLOAD' => $url_download, 'U_NEXT' => mx_append_sid(this_mo_mxurl("music_mode=music_page&song_id=$song_id&mode=next")), 'U_PREVIOUS' => mx_append_sid(this_mo_mxurl("music_mode=music_page&song_id=$song_id&mode=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 : '228' ), 'HEIGHT' => ( !empty($media_height) ? $media_height : '300' ), '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']) ); } else { $template->assign_block_vars('flv', array()); $url_download = ''; $url_video = $music_root_path . 'music_player.swf'; if (@file_exists($mx_root_path . $flv_file)) { $url_song = PORTAL_URL . $flv_file; } elseif (@file_exists($mx_root_path . 'modules/mx_music/upload/' . $flv_file)) { $url_song = PORTAL_URL . 'modules/mx_music/upload/' . $flv_file; } else { $url_song = $flv_file; } if (@file_exists($mx_root_path . $flv_img)) { $img_id = PORTAL_URL . $flv_img; } elseif (@file_exists($mx_root_path . 'modules/mx_music/upload/song_image/' . $flv_img)) { $img_id = PORTAL_URL . 'modules/mx_music/upload/song_image/' . $flv_img; } else { $img_id = $flv_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' => $flv_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 : '228' ), 'HEIGHT' => ( !empty($media_height) ? $media_height : '300' ), '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'); if (!$is_block) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } ?> Index: music.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music.php,v retrieving revision 1.8.2.5 retrieving revision 1.8.2.6 diff -C2 -d -r1.8.2.5 -r1.8.2.6 *** music.php 8 Mar 2008 15:42:44 -0000 1.8.2.5 --- music.php 13 Mar 2008 10:34:51 -0000 1.8.2.6 *************** *** 144,150 **** else { if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! define('IN_PORTAL', true); $mx_root_path = '../../'; // --- 144,151 ---- else { + if( !defined('IN_PORTAL') || !is_object($mx_block)) { ! @define("IN_PORTAL", true); $mx_root_path = '../../'; // *************** *** 166,170 **** if(!$result = $db->sql_query($sql)) { ! message_die(GENERAL_ERROR, "Could not query Music Center module information", "", __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); --- 167,171 ---- 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); *************** *** 175,187 **** else { - // // Read block Configuration // - $title = $mx_block->block_info['block_title']; $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); ! if( is_object($mx_block)) { $is_block = TRUE; --- 176,186 ---- else { // // Read block Configuration // $title = $mx_block->block_info['block_title']; $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); ! if(is_object($mx_block)) { $is_block = TRUE; *************** *** 190,193 **** --- 189,194 ---- global $images; } + @define("MXBB_MODULE", true); + @define("MXBB_27x", file_exists($mx_root_path . "mx_login.$phpEx")); } Index: music_center.pak =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_center.pak,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** music_center.pak 12 Sep 2007 23:49:16 -0000 1.2.2.1 --- music_center.pak 13 Mar 2008 10:34:52 -0000 1.2.2.2 *************** *** 1,10 **** ! module=+:57=+:Media Center=+:modules/mx_music/=+:mxBB Media Center=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:57=+:60=+:music_center=+:Media Center=+:music.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Media Center=+:Demo block=+:60=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:57=+:61=+:Music_list=+:Media toplists=+:music_lists.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! block=+:=+:Media Toplist=+:Demo block=+:61=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 ! function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- 1,16 ---- ! module=+:74=+:Media Center=+:modules/mx_music/=+:mxBB Media Center=+:1 New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 ! function=+:74=+:89=+:music_center=+:Media Center=+:music.php=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 ! 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=+:199=+:flv_file=+:Text=+:no_image.flv=+:=+:1=+:0 ! parameter=+:91=+:200=+: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=+: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 |