|
From: Florin C B. <ory...@us...> - 2013-04-19 17:55:53
|
Update of /cvsroot/mxbb/mx_music/music_box/mp3 In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv16154 Added Files: get_mp3_files.php get_mp3_files_pop.php index.htm Log Message: fixed mp3 play in categories using jw flash player and media player in music page --- NEW FILE: get_mp3_files_pop.php --- <?php /** * * @package MX-Publisher Module - mx_music * @credit Michael O'Toole - aka Michaelo at Stargate Portal * @begin Saturday, Jan 22, 2005 * @copyright (c) 2003 [ory...@rd..., OryNider] MXP Development Team * @home http://mxpcms.souceforge.net/ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id: get_mp3_files_pop.php,v 1.1 2013/04/19 17:55:51 orynider Exp $ * Updated: Mike, OryNider * */ /** * @ignore */ if( !defined('IN_PORTAL') || !is_object($mx_block)) { define('IN_PORTAL', true); $mx_root_path = "../../../../"; $module_root_path = "./../../"; $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 // $title = 'Media Player Radio'; $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '315' ); $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%' ); if( is_object($mx_block)) { $is_block = TRUE; } else { $is_block = FALSE; } } // // Get general music information // $music_root_path = $module_root_path . 'music_box/'; require_once($music_root_path . 'music_common.'.$phpEx); header('Expires: Mon, 31 Aug 1996 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); if (!defined('IN_MO')) { exit; //define('IN_MO', true); } // ------------------------------------ // Check the request // ------------------------------------ if (!$mx_request_vars->is_empty_request('cat_id')) { $cat_id = $mx_request_vars->request('cat_id', MX_TYPE_INT, 0); $cat_parent = $mx_request_vars->request('c', MX_TYPE_INT, 0); $cat_where = ($cat_id != 0) ? "cat_parent = $cat_parent" : "cat_id <> 0"; $sql = "SELECT c.*, COUNT(s.song_id) AS count FROM ". MUSIC_CAT_TABLE ." AS c LEFT JOIN ". MUSIC_TABLE ." AS s ON c.cat_id = s.song_cat_id WHERE cat_id = $cat_id GROUP BY cat_id ORDER BY cat_order ASC"; if( !($result = $db->sql_query($sql)) ) { die("Could not query this category"); } } else { $cat_id = 0; $cat_parent = 0; $cat_where = "cat_id <> 0"; $sql = "SELECT c.*, COUNT(s.song_id) AS count FROM ". MUSIC_CAT_TABLE ." AS c LEFT JOIN ". MUSIC_TABLE ." AS s ON c.cat_id = s.song_cat_id WHERE $cat_where GROUP BY cat_id ORDER BY cat_order ASC"; if( !($result = $db->sql_query($sql)) ) { die("No category specified && Could not query categories list"); } } // --------------------------------------------- // Ckeck is category has subcats start // --------------------------------------------- $catrows = array(); while($row = $db->sql_fetchrow($result)) { $music_user_access = music_user_access($row['cat_id'], $row, 1, 0, 0, 0, 0, 0); // VIEW // ------------------------------------ // Get this cat info // ------------------------------------ if ($music_user_access['view'] == 1) { $auth_data = music_user_access($cat_id, $row, 1, 1, 1, 1, 1, 1); // ALL } $catrows[] = $row; if($row['cat_id'] == $cat_id ) { $thiscat = $row; $total_songs = $thiscat['count']; } else { $thiscat = ''; $total_songs = false; } } $db->sql_freeresult($result); $allowed_cat = ''; // For Recent Public Songs below // // $catrows now stores all categories which this user can view. Dump them out! // for ($i = 0; $i < count($catrows); $i++) { // -------------------------------- // Build allowed category-list (for recent songs after here) // -------------------------------- $allowed_cat .= ($allowed_cat == '') ? $catrows[$i]['cat_id'] : ',' . $catrows[$i]['cat_id']; } // -------------------------------------------- // Ckeck is category has subcats end // -------------------------------------------- //User Control Pannel $u_group_cp = $u_group_cp ? $u_group_cp : (($portal_config['portal_backend'] == 'phpbb3') ? "ucp.$phpEx?i=167&" : "groupcp.$phpEx?"); //Here mx_message_die can be used sicne xml headers are not set if (empty($thiscat)) { mx_message_die(GENERAL_MESSAGE, $lang['Category_not_exist']); } $cat_parent = $thiscat['cat_parent']; if ($cat_parent != 0) { //Here support can be added for parent category if any } // // END cat info // // ------------------------------------ // Check permissions // ------------------------------------ if( !$auth_data['view'] ) { if (!$userdata['session_logged_in']) { mx_redirect(mx_append_sid($mx_root_path . "login.php?redirect=" . this_mo_loginurl("music_mode=music_cat&cat_id=$cat_id"), true)); } else { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } if ( $auth_data['upload'] ) { $enable_soung_upload_switch = true; } // // END check permissions // // ------------------------------------ // Build Auth List // ------------------------------------ $auth_key = array_keys($auth_data); $auth_list = ''; for ($i = 0; $i < (count($auth_data) - 1); $i++) // ignore MODERATOR in this loop { // // we should skip a loop if RATE and COMMENT is disabled // if( ( ($music_config['rate'] == 0) and ($auth_key[$i] == 'rate') ) or ( ($music_config['comment'] == 0) and ($auth_key[$i] == 'comment') ) ) { continue; } $auth_list .= ($auth_data[$auth_key[$i]] == 1) ? $lang['Music_'. $auth_key[$i] .'_can'] : $lang['Music_'. $auth_key[$i] .'_cannot']; $auth_list .= '<br />'; } // add Moderator Control Panel here if( ($userdata['user_level'] == ADMIN) or ($auth_data['moderator'] == 1) ) { $auth_list .= sprintf($lang['Music_moderate_can'], '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_modcp&cat_id=$cat_id")) .'">', '</a>'); } // // END Auth List // // ------------------------------------ // Build Moderators List // ------------------------------------ $grouprows = array(); $moderators_list = ''; if ($thiscat['cat_moderator_groups'] != '') { switch (PORTAL_BACKEND) { case 'internal': case 'phpbb2': $sql_where = 'group_single_user <> " . true . "'; break; case 'phpbb3': $sql_where = 'group_id <> " . true . "'; break; } // Get the namelist of moderator usergroups $sql = "SELECT * FROM " . GROUPS_TABLE . " WHERE " . $sql_where . " AND group_type <> ". GROUP_HIDDEN ." AND group_id IN (". $thiscat['cat_moderator_groups'] .") ORDER BY group_name ASC"; if ( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $grouprows[] = $row; } $db->sql_freeresult($result); if( count($grouprows) > 0 ) { for ($j = 0; $j < count($grouprows); $j++) { $group_link = '<a href="'. mx_append_sid($phpbb_root_path . $u_group_cp . POST_GROUPS_URL .'='. $grouprows[$j]['group_id']) .'">'. $grouprows[$j]['group_name'] .'</a>'; $moderators_list .= ($moderators_list == '') ? $group_link : ', ' . $group_link; } } } if( empty($moderators_list) ) { $moderators_list = $lang['None']; } // // END Moderator List // // ------------------------------------ // Build the thumbnail page // ------------------------------------ if( isset($HTTP_GET_VARS['start']) ) { $start = intval($HTTP_GET_VARS['start']); } else if( isset($HTTP_POST_VARS['start']) ) { $start = intval($HTTP_POST_VARS['start']); } else { $start = 0; } if( isset($HTTP_GET_VARS['sort_method']) ) { switch ($HTTP_GET_VARS['sort_method']) { case 'song_time': $sort_method = 'song_time'; break; case 'song_title': $sort_method = 'song_title'; break; case 'song_singer': $sort_method = 'song_singer'; break; case 'username': $sort_method = 'username'; break; case 'song_view_count': $sort_method = 'song_view_count'; break; case 'rating': $sort_method = 'rating'; break; case 'comments': $sort_method = 'comments'; break; case 'new_comment': $sort_method = 'new_comment'; break; default: $sort_method = $music_config['sort_method']; } } else if( isset($HTTP_POST_VARS['sort_method']) ) { switch ($HTTP_POST_VARS['sort_method']) { case 'song_time': $sort_method = 'song_time'; break; case 'song_title': $sort_method = 'song_title'; break; case 'song_singer': $sort_method = 'song_singer'; break; case 'username': $sort_method = 'username'; break; case 'song_view_count': $sort_method = 'song_view_count'; break; case 'rating': $sort_method = 'rating'; break; case 'comments': $sort_method = 'comments'; break; case 'new_comment': $sort_method = 'new_comment'; break; default: $sort_method = $music_config['sort_method']; } } else { $sort_method = $music_config['sort_method']; } if( isset($HTTP_GET_VARS['sort_order']) ) { switch ($HTTP_GET_VARS['sort_order']) { case 'ASC': $sort_order = 'ASC'; break; case 'DESC': $sort_order = 'DESC'; break; default: $sort_order = $music_config['sort_order']; } } else if( isset($HTTP_POST_VARS['sort_order']) ) { switch ($HTTP_POST_VARS['sort_order']) { case 'ASC': $sort_order = 'ASC'; break; case 'DESC': $sort_order = 'DESC'; break; default: $sort_order = $music_config['sort_order']; } } else { $sort_order = $music_config['sort_order']; } $songs_per_page = $music_config['rows_per_page'] * $music_config['cols_per_page']; // // Start output of page // $page_title = $lang['Music'] . " PHP Generated Playlist"; /** * PHP Generated Playlist * @credit Michael O'Toole - aka Michaelo * @begin Saturday, Jan 22, 2005 * @copyright (c) 2005-2008 phpbbireland * @home http://www.phpbbireland.com * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ // XML and nocaching headers header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // Format: xspf format Add an xml header and the opening tags .. header("Content-Type:text/xml;charset=utf-8"); if ($total_songs > 0) { //$limit_sql = ($start == 0) ? $songs_per_page : $start .','. $songs_per_page; $title_cat = make_xml_compatible($thiscat['cat_title']); $url_cat = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_cat&" . "cat_id=" . $thiscat['cat_id'])); $description_cat = $lang['Category_songs'] . ': ' . nl2br($thiscat['cat_desc']); // If not set, set the output count to 50 $count = ( isset($HTTP_GET_VARS['c']) ) ? intval($HTTP_GET_VARS['c']) : $total_songs; $count = ( $count == 0 ) ? $total_songs : $count; echo "<?xml version='1.0' encoding='UTF-8' ?>\n"; echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n"; echo " <title>" . $page_title . "</title>\n"; echo " <info><![CDATA[" . $description_cat ."]]></info>\n"; echo " <trackList>\n"; $song_approval_sql = 'AND s.song_approval = 1'; if ($thiscat['cat_approval'] != MUSIC_USER) { if( ($userdata['user_level'] == ADMIN) or (($auth_data['moderator'] == 1) and ($thiscat['cat_approval'] == MUSIC_MOD)) ) { $song_approval_sql = ''; } } /* $sql = "SELECT s.song_id, s.song_title, s.song_desc, s.song_singer, s.song_user_id, s.song_user_ip, s.song_username, s.song_time, s.song_cat_id, s.song_view_count, s.song_lock, s.song_approval, u.user_id, u.username, r.rate_song_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment 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 s.song_cat_id = '$cat_id' $song_approval_sql GROUP BY s.song_id ORDER BY $sort_method $sort_order LIMIT $count"; */ $sql = "SELECT s.song_id, s.song_title, s.song_desc, s.song_singer, s.song_user_id, s.song_user_ip, s.song_username, s.song_time, s.song_cat_id, s.song_view_count, u.user_id, u.username, r.rate_song_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment FROM ". MUSIC_TABLE ." AS s LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id LEFT JOIN ". MUSIC_CAT_TABLE ." AS ct ON s.song_cat_id = ct.cat_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 s.song_cat_id IN ($allowed_cat) AND ( s.song_approval = 1 OR ct.cat_approval = 0 ) GROUP BY s.song_id ORDER BY song_time DESC LIMIT $count"; if(!$result = $db->sql_query($sql)) { die("Failed obtaining list of active songs"); } // // Update the music view counter // $sql = "UPDATE " . MUSIC_CAT_TABLE . " SET cat_views = cat_views + 1 WHERE cat_id = $cat_id"; $db->sql_query($sql); $songrow = array(); while($row = $db->sql_fetchrow($result)) { $songrow[] = $row; } $db->sql_freeresult($result); //Start song cols songrow for ($i = 0; $i < count($songrow); $i += $music_config['cols_per_page']) { echo " <track>\n"; //Start song cols songcol for ($j = $i; $j < ($i + $music_config['cols_per_page']); $j++) { if( $j >= count($songrow) ) { break; } if(!$songrow[$j]['rating']) { $songrow[$j]['rating'] = $lang['Not_rated']; } else { $songrow[$j]['rating'] = round($songrow[$j]['rating'], 2); } $approval_link = ''; if ($thiscat['cat_approval'] != MUSIC_USER) { if( ($userdata['user_level'] == ADMIN) or (($auth_data['moderator'] == 1) and ($thiscat['cat_approval'] == MUSIC_MOD)) ) { $approval_mode = ($songrow[$j]['song_approval'] == 0) ? 'approval' : 'unapproval'; $approval_link .= '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_modcp&mode=$approval_mode&song_id=". $songrow[$j]['song_id'])) .'">'; $approval_link .= ($songrow[$j]['song_approval'] == 0) ? '<b>'. $lang['Approve'] .'</b>' : $lang['Unapprove']; $approval_link .= '</a>'; } } $song_poster = music_get_profile_url('full', $songrow[$j]['user_id'], $songrow[$j]['username'], false); // ------------------------------------ // Get this song info // ------------------------------------ $song_id = $songrow[$j]['song_id']; $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)) ) { die("Could not query song information"); } $thissong = $db->sql_fetchrow($result); $db->sql_freeresult($result); $cat_id = $thissong['song_cat_id']; $user_id = $thissong['song_user_id']; //Image Edit Added by OryNider from Radio Cast $thispattern = '/^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/'; if ($result = preg_match($thispattern, $thissong['station_imagename'])) { $img_id = $thissong['station_imagename']; } else if (!empty($thissong['station_imagename'])) { $img_id = (PORTAL_URL . str_replace('./', '/', MUSIC_IMAGE_PATH) . $thissong['station_imagename']); } else { $img_id = $song_image_default; } 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']; } if ( ($thissong['song_filetype'] == '') || ($song_filetype) && ($thissong['song_filetype'] != $song_filetype) ) { // // Update the song filetype // $sql = "UPDATE " . MUSIC_TABLE . " SET song_filetype = '" . $song_filetype . "' WHERE song_id = '" . $song_id . "'"; $db->sql_query($sql); } $url_player = ''; $host = ''; $host_protocol = ''; //$host = explode("//", $thissong['song_url']); //$host_protocol = $host[0] . '//'; // // Media Center // $url_video = $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=" . $song_id)); $title = make_xml_compatible($thissong['song_title']); $url_cat = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_cat&" . "cat_id=" . $thissong['song_cat_id'])); $url_page = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_page&" . "song_id=" . $thissong['song_id'])); $url_song = !empty($thissong['song_url']) ? $thissong['song_url'] : mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_song&" . "song_id=" . $thissong['song_id'], true)); $url_flv = !empty($thissong['song_url']) ? $thissong['song_url'] : PORTAL_URL . MUSIC_UPLOAD_PATH . $thissong['song_filename']; $url_comment = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_comment&" . "song_id=" . $thissong['song_id'])); //We return the media url via "Music Song" Addon if(!empty($thissong['song_url']) && !file_exists(MUSIC_UPLOAD_PATH . $thissong['song_filename']) ) { $url_song = $thissong['song_url']; } //We return the media url via "Music Song" Addon if(!empty($thissong['song_url']) && @file_exists(MUSIC_UPLOAD_PATH . $thissong['song_filename']) ) { $url_song = mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $thissong['song_id'], true)); } //We return the media direct from upload folder if(empty($thissong['song_url']) && @file_exists(MUSIC_UPLOAD_PATH . $thissong['song_filename']) ) { $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename'] . "?song_id=" . $thissong['song_id']; } if(!empty($thissong['song_url'])) { $url_download = mx_append_sid($thissong['song_url']); $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; $mime_type = $mime_type ? $mime_type : 'application/x-mplayer2'; $row_type = 'media'; } $url_thumb_song = !empty($thissong['song_url']) ? $thissong['song_url'] : mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $thissong['song_id'] . "&item_size=425", true)); $url_full_song = !empty($thissong['song_url']) ? $thissong['song_url'] : mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $thissong['song_id'] . "&item_size=800", true)); echo " <annotation>" . ($j + 1) . " (" . $songrow[$j]['song_id'] . ") " . $title . "</annotation>\n"; if(!empty($song_filetype)) { switch ($song_filetype) { case 'ram': $html_code = '<embed src="' . $url_song . '" id="VideoPlayback" type="audio/x-pn-realaudio-plugin" wmode="transparent" width="425" height="350"></embed>'; $enclosure = 'url="' . $url_song . '" ' . 'type="audio/x-pn-realaudio-plugin" length="1024000"'; $row_type = 'ram'; break; case 'flv': $html_code = '<embed src="' . $url_video . '" flashvars="file=' . $url_flv . '&image=' . $img_id . '&shuffleOnLoad=no" loop="false" allowfullscreen="true" menu="false" quality="high" width="425" height="350" scale="noscale" salign="lt" name="flvplayer" align="center" bgcolor="000000" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'; $enclosure = 'url="' . $url_song . '" ' . 'type="application/x-shockwave-flash" length="1024000"'; $row_type = 'flv'; break; case 'qt': $html_code = '<embed src="templates/_core/images/uneedqt41.jpg" qtsrc="' . $url_song . '" width="377" height="212" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" controller="true" loop="false" autoplay="false" kioskmode="true" cache="false"></embed>'; $enclosure = 'url="' . $url_song . '" ' . 'type="video/quicktime" length="1024000"'; $row_type = 'qt'; break; case 'jpg': case 'jpeg': case 'gif': case 'png': case 'bmp': $html_code = '<a href="' . $url_page . '">' . '<img src="' . $url_thumb_song . '" border="1" vspace="2" hspace="2" align="left" width="425" height="350" />' . '</a>'; $enclosure = 'url="' . $url_song . '" ' . 'type="image/png" length="1024000"'; $row_type = 'img'; break; case 'mp3': case 'mp2': default: $html_code = '<embed type="audio/mpeg" height="70" width="300" AUTOSTART="0" filename="' . $url_song . '" src="' . $url_song . '" ></embed>'; $enclosure = 'url="' . $url_song . '" ' . 'type="audio/mpeg" length="1024000"'; $row_type = 'mp3'; } if ($song_filetype == 'mp3') { $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $music_root_path . 'mp3player.swf'; $mime_type = 'audio/x-mpeg'; //application/x-mplayer2 echo " <location>" . $url_song . "</location>\n"; } else { $url_download = mx_append_sid($module_root_path . 'galerie_media.' . $phpEx . '?music_mode=music_stream&song_id=' . $song_id); $url_video = $url_download; $mime_type = 'audio/x-' . $song_filetype; //application/x-mplayer2 } } else { $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=" . $song_id)); $url_video = $url_download; $row_type = 'media'; } $song_user_ip = (@function_exists( 'decode_ip' )) ? music_decode_ip($songrow[$j]['song_user_ip']) : phpBB2::decode_ip($songrow[$j]['song_user_ip']); $html_code = trim($html_code); $description_code = $lang['Song_Desc'] . ': ' . nl2br($thissong['song_desc']); $description = $html_code . $description_code; if (strlen($description) > 2000) { $description_encoded = '<div>' . substr($html_code, 0, 1957) . '</div><br /><div>' . $description_code . '</div><div> </div>'; } else { $description_encoded = '<div>' . $html_code . '</div><br /><div>' . $description_code . '</div><div> </div>'; } echo " <info><![CDATA[" . $description_encoded ."]]></info>\n"; } echo " </track>\n"; } // Add closing tags echo " </trackList>\n"; echo "</playlist>\n"; } else { $title_cat = make_xml_compatible($lang['No_Songs'] . "@ " . $thiscat['cat_title']); $url_cat = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_cat&" . "cat_id=" . $thiscat['cat_id'])); $description_cat = $lang['Category_songs'] . ': ' . nl2br($thiscat['cat_desc']); echo "<?xml version='1.0' encoding='UTF-8' ?>\n"; echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n"; echo " <title>" . $page_title . "</title>\n"; echo " <info><![CDATA[" . $description_cat ."]]></info>\n"; echo " <trackList>\n"; echo " <track>\n"; echo " <annotation>" . $title_cat . "</annotation>\n"; echo " <location>" . $url_cat . "</location>\n"; echo " <info><![CDATA[" . $description_encoded ."]]></info>\n"; echo " </track>\n"; // Add closing tags echo " </trackList>\n"; echo "</playlist>\n"; } // // END thumbnails table // ?> --- NEW FILE: get_mp3_files.php --- <?php /** * * @package MX-Publisher Module - mx_music * @credit Michael O'Toole - aka Michaelo at Stargate Portal * @begin Saturday, Jan 22, 2005 * @copyright (c) 2003 [ory...@rd..., OryNider] MXP Development Team * @home http://mxpcms.souceforge.net/ * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @version $Id: get_mp3_files.php,v 1.1 2013/04/19 17:55:51 orynider Exp $ * Updated: Mike, OryNider * */ /** * @ignore */ if( !defined('IN_PORTAL') || !is_object($mx_block)) { define('IN_PORTAL', true); $mx_root_path = "../../../../"; $module_root_path = "./../../"; $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 // $title = 'Media Player Radio'; $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '315' ); $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%' ); if( is_object($mx_block)) { $is_block = TRUE; } else { $is_block = FALSE; } } // // Get general music information // $music_root_path = $module_root_path . 'music_box/'; require_once($music_root_path . 'music_common.'.$phpEx); header('Expires: Mon, 31 Aug 1996 05:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); if (!defined('IN_MO')) { exit; //define('IN_MO', true); } // ------------------------------------ // Check the request // ------------------------------------ if (!$mx_request_vars->is_empty_request('cat_id')) { $cat_id = $mx_request_vars->request('cat_id', MX_TYPE_INT, 0); $cat_parent = $mx_request_vars->request('c', MX_TYPE_INT, 0); $cat_where = ($cat_id != 0) ? "cat_parent = $cat_parent" : "cat_id <> 0"; $sql = "SELECT c.*, COUNT(s.song_id) AS count FROM ". MUSIC_CAT_TABLE ." AS c LEFT JOIN ". MUSIC_TABLE ." AS s ON c.cat_id = s.song_cat_id WHERE cat_id = $cat_id GROUP BY cat_id ORDER BY cat_order ASC"; if( !($result = $db->sql_query($sql)) ) { die("Could not query this category"); } } else { $cat_id = 0; $cat_parent = 0; $cat_where = "cat_id <> 0"; $sql = "SELECT c.*, COUNT(s.song_id) AS count FROM ". MUSIC_CAT_TABLE ." AS c LEFT JOIN ". MUSIC_TABLE ." AS s ON c.cat_id = s.song_cat_id WHERE $cat_where GROUP BY cat_id ORDER BY cat_order ASC"; if( !($result = $db->sql_query($sql)) ) { die("No category specified && Could not query categories list"); } } // --------------------------------------------- // Ckeck is category has subcats start // --------------------------------------------- $catrows = array(); while($row = $db->sql_fetchrow($result)) { $music_user_access = music_user_access($row['cat_id'], $row, 1, 0, 0, 0, 0, 0); // VIEW // ------------------------------------ // Get this cat info // ------------------------------------ if ($music_user_access['view'] == 1) { $auth_data = music_user_access($cat_id, $row, 1, 1, 1, 1, 1, 1); // ALL } $catrows[] = $row; if($row['cat_id'] == $cat_id ) { $thiscat = $row; $total_songs = $thiscat['count']; } else { $thiscat = ''; $total_songs = false; } } $db->sql_freeresult($result); $allowed_cat = ''; // For Recent Public Songs below // // $catrows now stores all categories which this user can view. Dump them out! // for ($i = 0; $i < count($catrows); $i++) { // -------------------------------- // Build allowed category-list (for recent songs after here) // -------------------------------- $allowed_cat .= ($allowed_cat == '') ? $catrows[$i]['cat_id'] : ',' . $catrows[$i]['cat_id']; } // -------------------------------------------- // Ckeck is category has subcats end // -------------------------------------------- //User Control Pannel $u_group_cp = $u_group_cp ? $u_group_cp : (($portal_config['portal_backend'] == 'phpbb3') ? "ucp.$phpEx?i=167&" : "groupcp.$phpEx?"); //Here mx_message_die can be used sicne xml headers are not set if (empty($thiscat)) { mx_message_die(GENERAL_MESSAGE, $lang['Category_not_exist']); } $cat_parent = $thiscat['cat_parent']; if ($cat_parent != 0) { //Here support can be added for parent category if any } // // END cat info // // ------------------------------------ // Check permissions // ------------------------------------ if( !$auth_data['view'] ) { if (!$userdata['session_logged_in']) { mx_redirect(mx_append_sid($mx_root_path . "login.php?redirect=" . this_mo_loginurl("music_mode=music_cat&cat_id=$cat_id"), true)); } else { mx_message_die(GENERAL_ERROR, $lang['Not_Authorised']); } } if ( $auth_data['upload'] ) { $enable_soung_upload_switch = true; } // // END check permissions // // ------------------------------------ // Build Auth List // ------------------------------------ $auth_key = array_keys($auth_data); $auth_list = ''; for ($i = 0; $i < (count($auth_data) - 1); $i++) // ignore MODERATOR in this loop { // // we should skip a loop if RATE and COMMENT is disabled // if( ( ($music_config['rate'] == 0) and ($auth_key[$i] == 'rate') ) or ( ($music_config['comment'] == 0) and ($auth_key[$i] == 'comment') ) ) { continue; } $auth_list .= ($auth_data[$auth_key[$i]] == 1) ? $lang['Music_'. $auth_key[$i] .'_can'] : $lang['Music_'. $auth_key[$i] .'_cannot']; $auth_list .= '<br />'; } // add Moderator Control Panel here if( ($userdata['user_level'] == ADMIN) or ($auth_data['moderator'] == 1) ) { $auth_list .= sprintf($lang['Music_moderate_can'], '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_modcp&cat_id=$cat_id")) .'">', '</a>'); } // // END Auth List // // ------------------------------------ // Build Moderators List // ------------------------------------ $grouprows = array(); $moderators_list = ''; if ($thiscat['cat_moderator_groups'] != '') { switch (PORTAL_BACKEND) { case 'internal': case 'phpbb2': $sql_where = 'group_single_user <> " . true . "'; break; case 'phpbb3': $sql_where = 'group_id <> " . true . "'; break; } // Get the namelist of moderator usergroups $sql = "SELECT * FROM " . GROUPS_TABLE . " WHERE " . $sql_where . " AND group_type <> ". GROUP_HIDDEN ." AND group_id IN (". $thiscat['cat_moderator_groups'] .") ORDER BY group_name ASC"; if ( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not get group list', '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $grouprows[] = $row; } if( count($grouprows) > 0 ) { for ($j = 0; $j < count($grouprows); $j++) { $group_link = '<a href="'. mx_append_sid($phpbb_root_path . $u_group_cp . POST_GROUPS_URL .'='. $grouprows[$j]['group_id']) .'">'. $grouprows[$j]['group_name'] .'</a>'; $moderators_list .= ($moderators_list == '') ? $group_link : ', ' . $group_link; } } } if( empty($moderators_list) ) { $moderators_list = $lang['None']; } // // END Moderator List // // ------------------------------------ // Build the thumbnail page // ------------------------------------ if( isset($HTTP_GET_VARS['start']) ) { $start = intval($HTTP_GET_VARS['start']); } else if( isset($HTTP_POST_VARS['start']) ) { $start = intval($HTTP_POST_VARS['start']); } else { $start = 0; } if( isset($HTTP_GET_VARS['sort_method']) ) { switch ($HTTP_GET_VARS['sort_method']) { case 'song_time': $sort_method = 'song_time'; break; case 'song_title': $sort_method = 'song_title'; break; case 'song_singer': $sort_method = 'song_singer'; break; case 'username': $sort_method = 'username'; break; case 'song_view_count': $sort_method = 'song_view_count'; break; case 'rating': $sort_method = 'rating'; break; case 'comments': $sort_method = 'comments'; break; case 'new_comment': $sort_method = 'new_comment'; break; default: $sort_method = $music_config['sort_method']; } } else if( isset($HTTP_POST_VARS['sort_method']) ) { switch ($HTTP_POST_VARS['sort_method']) { case 'song_time': $sort_method = 'song_time'; break; case 'song_title': $sort_method = 'song_title'; break; case 'song_singer': $sort_method = 'song_singer'; break; case 'username': $sort_method = 'username'; break; case 'song_view_count': $sort_method = 'song_view_count'; break; case 'rating': $sort_method = 'rating'; break; case 'comments': $sort_method = 'comments'; break; case 'new_comment': $sort_method = 'new_comment'; break; default: $sort_method = $music_config['sort_method']; } } else { $sort_method = $music_config['sort_method']; } if( isset($HTTP_GET_VARS['sort_order']) ) { switch ($HTTP_GET_VARS['sort_order']) { case 'ASC': $sort_order = 'ASC'; break; case 'DESC': $sort_order = 'DESC'; break; default: $sort_order = $music_config['sort_order']; } } else if( isset($HTTP_POST_VARS['sort_order']) ) { switch ($HTTP_POST_VARS['sort_order']) { case 'ASC': $sort_order = 'ASC'; break; case 'DESC': $sort_order = 'DESC'; break; default: $sort_order = $music_config['sort_order']; } } else { $sort_order = $music_config['sort_order']; } $songs_per_page = $music_config['rows_per_page'] * $music_config['cols_per_page']; // // Start output of page // $page_title = $lang['Music'] . " PHP Generated Playlist"; /** * PHP Generated Playlist * @credit Michael O'Toole - aka Michaelo * @begin Saturday, Jan 22, 2005 * @copyright (c) 2005-2008 phpbbireland * @home http://www.phpbbireland.com * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ // XML and nocaching headers header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // Format: xspf format Add an xml header and the opening tags .. header("Content-Type:text/xml;charset=utf-8"); if ($total_songs > 0) { //$limit_sql = ($start == 0) ? $songs_per_page : $start .','. $songs_per_page; $title_cat = make_xml_compatible($thiscat['cat_title']); $url_cat = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_cat&" . "cat_id=" . $thiscat['cat_id'])); $description_cat = $lang['Category_songs'] . ': ' . nl2br($thiscat['cat_desc']); // If not set, set the output count to 50 $count = ( isset($HTTP_GET_VARS['c']) ) ? intval($HTTP_GET_VARS['c']) : $total_songs; $count = ( $count == 0 ) ? $total_songs : $count; echo "<?xml version='1.0' encoding='UTF-8' ?>\n"; echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n"; echo " <title>" . $page_title . "</title>\n"; echo " <info><![CDATA[" . $description_cat ."]]></info>\n"; echo " <trackList>\n"; $song_approval_sql = 'AND s.song_approval = 1'; if ($thiscat['cat_approval'] != MUSIC_USER) { if( ($userdata['user_level'] == ADMIN) or (($auth_data['moderator'] == 1) and ($thiscat['cat_approval'] == MUSIC_MOD)) ) { $song_approval_sql = ''; } } /* $sql = "SELECT s.song_id, s.song_title, s.song_desc, s.song_singer, s.song_user_id, s.song_user_ip, s.song_username, s.song_time, s.song_cat_id, s.song_view_count, s.song_lock, s.song_approval, u.user_id, u.username, r.rate_song_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment 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 s.song_cat_id = '$cat_id' $song_approval_sql GROUP BY s.song_id ORDER BY $sort_method $sort_order LIMIT $count"; */ $sql = "SELECT s.song_id, s.song_title, s.song_desc, s.song_singer, s.song_user_id, s.song_user_ip, s.song_username, s.song_time, s.song_cat_id, s.song_view_count, u.user_id, u.username, r.rate_song_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment FROM ". MUSIC_TABLE ." AS s LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id LEFT JOIN ". MUSIC_CAT_TABLE ." AS ct ON s.song_cat_id = ct.cat_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 s.song_cat_id IN ($allowed_cat) AND ( s.song_approval = 1 OR ct.cat_approval = 0 ) GROUP BY s.song_id ORDER BY song_id ASC LIMIT $count"; if(!$result = $db->sql_query($sql)) { die("Failed obtaining list of active songs"); } // // Update the music view counter // $sql = "UPDATE " . MUSIC_CAT_TABLE . " SET cat_views = cat_views + 1 WHERE cat_id = $cat_id"; $db->sql_query($sql); $songrow = array(); while($row = $db->sql_fetchrow($result)) { $songrow[] = $row; } //Start song cols songrow for ($i = 0; $i < count($songrow); $i += $music_config['cols_per_page']) { echo " <track>\n"; //Start song cols songcol for ($j = $i; $j < ($i + $music_config['cols_per_page']); $j++) { if( $j >= count($songrow) ) { break; } if(!$songrow[$j]['rating']) { $songrow[$j]['rating'] = $lang['Not_rated']; } else { $songrow[$j]['rating'] = round($songrow[$j]['rating'], 2); } $approval_link = ''; if ($thiscat['cat_approval'] != MUSIC_USER) { if( ($userdata['user_level'] == ADMIN) or (($auth_data['moderator'] == 1) and ($thiscat['cat_approval'] == MUSIC_MOD)) ) { $approval_mode = ($songrow[$j]['song_approval'] == 0) ? 'approval' : 'unapproval'; $approval_link .= '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_modcp&mode=$approval_mode&song_id=". $songrow[$j]['song_id'])) .'">'; $approval_link .= ($songrow[$j]['song_approval'] == 0) ? '<b>'. $lang['Approve'] .'</b>' : $lang['Unapprove']; $approval_link .= '</a>'; } } $song_poster = music_get_profile_url('full', $songrow[$j]['user_id'], $songrow[$j]['username'], false); // ------------------------------------ // Get this song info // ------------------------------------ $song_id = $songrow[$j]['song_id']; $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)) ) { die("Could not query song information"); } $thissong = $db->sql_fetchrow($result); $cat_id = $thissong['song_cat_id']; $user_id = $thissong['song_user_id']; //Image Edit Added by OryNider from Radio Cast $thispattern = '/^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/'; if ($result = preg_match($thispattern, $thissong['station_imagename'])) { $img_id = $thissong['station_imagename']; } else if (!empty($thissong['station_imagename'])) { $img_id = (PORTAL_URL . str_replace('./', '/', MUSIC_IMAGE_PATH) . $thissong['station_imagename']); } else { $img_id = $song_image_default; } 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']; } if ( ($thissong['song_filetype'] == '') || ($song_filetype) && ($thissong['song_filetype'] != $song_filetype) ) { // // Update the song filetype // $sql = "UPDATE " . MUSIC_TABLE . " SET song_filetype = '" . $song_filetype . "' WHERE song_id = '" . $song_id . "'"; $db->sql_query($sql); } $url_player = ''; $host = ''; $host_protocol = ''; //$host = explode("//", $thissong['song_url']); //$host_protocol = $host[0] . '//'; // // Media Center // $url_video = $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=" . $song_id)); $title = make_xml_compatible($thissong['song_title']); $url_cat = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_cat&" . "cat_id=" . $thissong['song_cat_id'])); $url_page = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_page&" . "song_id=" . $thissong['song_id'])); $url_song = !empty($thissong['song_url']) ? $thissong['song_url'] : mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_song&" . "song_id=" . $thissong['song_id'], true)); $url_flv = !empty($thissong['song_url']) ? $thissong['song_url'] : PORTAL_URL . MUSIC_UPLOAD_PATH . $thissong['song_filename']; $url_comment = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_comment&" . "song_id=" . $thissong['song_id'])); //We return the media url via "Music Song" Addon if(!empty($thissong['song_url']) && !file_exists(MUSIC_UPLOAD_PATH . $thissong['song_filename']) ) { $url_song = $thissong['song_url']; } //We return the media url via "Music Song" Addon if(!empty($thissong['song_url']) && @file_exists(MUSIC_UPLOAD_PATH . $thissong['song_filename']) ) { $url_song = mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $thissong['song_id'], true)); } //We return the media direct from upload folder if(empty($thissong['song_url']) && @file_exists(MUSIC_UPLOAD_PATH . $thissong['song_filename']) ) { $url_song = PORTAL_URL. str_replace('./', '/', MUSIC_UPLOAD_PATH) . $thissong['song_filename']; } if(!empty($thissong['song_url'])) { $url_download = mx_append_sid($thissong['song_url']); $lang['Download'] = ( !empty($lang['Direct_url']) ? $lang['Direct_url'] : 'Direct URL' ); $url_video = $url_download; $mime_type = $mime_type ? $mime_type : 'application/x-mplayer2'; $row_type = 'media'; } $url_thumb_song = !empty($thissong['song_url']) ? $thissong['song_url'] : mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $thissong['song_id'] . "&item_size=425", true)); $url_full_song = !empty($thissong['song_url']) ? $thissong['song_url'] : mx_append_sid(this_mo_mxurl("music_mode=music_song&song_id=" . $thissong['song_id'] . "&item_size=800", true)); echo " <annotation>" . ($j + 1) . " (" . $songrow[$j]['song_id'] . ") " . $title . "</annotation>\n"; if(!empty($song_filetype)) { switch ($song_filetype) { case 'ram': $html_code = '<embed src="' . $url_song . '" id="VideoPlayback" type="audio/x-pn-realaudio-plugin" wmode="transparent" width="425" height="350"></embed>'; $enclosure = 'url="' . $url_song . '" ' . 'type="audio/x-pn-realaudio-plugin" length="1024000"'; $row_type = 'ram'; break; case 'flv': $html_code = '<embed src="' . $url_video . '" flashvars="file=' . $url_flv . '&image=' . $img_id . '&shuffleOnLoad=no" loop="false" allowfullscreen="true" menu="false" quality="high" width="425" height="350" scale="noscale" salign="lt" name="flvplayer" align="center" bgcolor="000000" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'; $enclosure = 'url="' . $url_song . '" ' . 'type="application/x-shockwave-flash" length="1024000"'; $row_type = 'flv'; break; case 'qt': $html_code = '<embed src="templates/subSilver/images/uneedqt41.jpg" qtsrc="' . $url_song . '" width="377" height="212" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" controller="true" loop="false" autoplay="false" kioskmode="true" cache="false"></embed>'; $enclosure = 'url="' . $url_song . '" ' . 'type="video/quicktime" length="1024000"'; $row_type = 'qt'; break; case 'jpg': case 'jpeg': case 'gif': case 'png': case 'bmp': $html_code = '<a href="' . $url_page . '">' . '<img src="' . $url_thumb_song . '" border="1" vspace="2" hspace="2" align="left" width="425" height="350" />' . '</a>'; $enclosure = 'url="' . $url_song . '" ' . 'type="image/png" length="1024000"'; $row_type = 'img'; break; case 'mp3': case 'mp2': default: $html_code = '<embed type="audio/mpeg" height="70" width="300" AUTOSTART="0" filename="' . $url_song . '" src="' . $url_song . '" ></embed>'; $enclosure = 'url="' . $url_song . '" ' . 'type="audio/mpeg" length="1024000"'; $row_type = 'mp3'; } if ($song_filetype == 'mp3') { $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=$song_id")); $url_video = $music_root_path . 'mp3player.swf'; $mime_type = 'audio/x-mpeg'; //application/x-mplayer2 echo " <location>" . $url_song . "</location>\n"; } else { $url_download = mx_append_sid($module_root_path . 'galerie_media.' . $phpEx . '?music_mode=music_stream&song_id=' . $song_id); $url_video = $url_download; $mime_type = 'audio/x-' . $song_filetype; //application/x-mplayer2 } } else { $url_download = mx_append_sid(this_mo_mxurl("music_mode=music_download&song_id=" . $song_id)); $url_video = $url_download; $row_type = 'media'; } $song_user_ip = (@function_exists( 'decode_ip' )) ? music_decode_ip($songrow[$j]['song_user_ip']) : phpBB2::decode_ip($songrow[$j]['song_user_ip']); $html_code = trim($html_code); $description_code = $lang['Song_Desc'] . ': ' . nl2br($thissong['song_desc']); $description = $html_code . $description_code; if (strlen($description) > 2000) { $description_encoded = '<div>' . substr($html_code, 0, 1957) . '</div><br /><div>' . $description_code . '</div><div> </div>'; } else { $description_encoded = '<div>' . $html_code . '</div><br /><div>' . $description_code . '</div><div> </div>'; } echo " <info><![CDATA[" . $description_encoded ."]]></info>\n"; } echo " </track>\n"; } // Add closing tags echo " </trackList>\n"; echo "</playlist>\n"; } else { $title_cat = make_xml_compatible($lang['No_Songs'] . "@ " . $thiscat['cat_title']); $url_cat = mx_append_sid(PORTAL_URL . this_mo_rssurl("music_mode=music_cat&" . "cat_id=" . $thiscat['cat_id'])); $description_cat = $lang['Category_songs'] . ': ' . nl2br($thiscat['cat_desc']); echo "<?xml version='1.0' encoding='UTF-8' ?>\n"; echo "<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n"; echo " <title>" . $page_title . "</title>\n"; echo " <info><![CDATA[" . $description_cat ."]]></info>\n"; echo " <trackList>\n"; echo " <track>\n"; echo " <annotation>" . $title_cat . "</annotation>\n"; echo " <location>" . $url_cat . "</location>\n"; echo " <info><![CDATA[" . $description_encoded ."]]></info>\n"; echo " </track>\n"; // Add closing tags echo " </trackList>\n"; echo "</playlist>\n"; } // // END thumbnails table // ?> --- NEW FILE: index.htm --- <html> <head> <title>Autumn_2 created by Michael O'Toole Design</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0"> <tr> <td align="center" valign="middle"><a href="http://www.phpbbireland.com/" target="_new"><img src="created_by.jpg" width="400" height="300" border="0" alt="Created by Michael O'Toole Design" /></a></td> </tr> </table> </body> </html> |