|
From: OryNider <ory...@us...> - 2007-08-01 23:33:41
|
Update of /cvsroot/mxbb/mx_music In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv19941 Modified Files: db_install.php db_uninstall.php db_upgrade.php music.php music_center.pak release.txt Added Files: music_lists.php Log Message: This will add a new block for recent songs :D Index: release.txt =================================================================== RCS file: /cvsroot/mxbb/mx_music/release.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** release.txt 6 Jun 2007 20:43:56 -0000 1.2 --- release.txt 1 Aug 2007 23:33:27 -0000 1.3 *************** *** 1,6 **** ! Jon ! [b][Release][mx_music]: Music Center[/b] ! [b][Authors]: Cf Manager, OryNider[/b] [b][Version]: 2.0.6 [/b] --- 1,5 ---- ! [b][Release][mx_music]: Music Center[/b] ! [b][Authors]: Cf Manager, OryNider[/b] [b][Version]: 2.0.6 [/b] *************** *** 12,27 **** [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. ! Beside that, users can link URL of the song from the another server without uploading. ! You have an admin panel that allows you to manage the features of the module. Some modifications on the original MODS have been applied to make this package more integrated, flexible and multilanguage. Allowed files: MP3, WMA, WMV, WAV, MIDI, MPEG, AVI, AU, SWF, QT, RAM, RM and others. [b]Additionaly:[/b] ! [list] [*][u]Music Song Image[/u] - You can add the Song Image to the section of each song. (Maybe CD Cover, Artist Photo or any image you want ;) ) Maximum image size is configurable in adminCP :D --- 11,26 ---- [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. ! Beside that, users can link URL of the song from the another server without uploading. ! You have an admin panel that allows you to manage the features of the module. Some modifications on the original MODS have been applied to make this package more integrated, flexible and multilanguage. Allowed files: MP3, WMA, WMV, WAV, MIDI, MPEG, AVI, AU, SWF, QT, RAM, RM and others. [b]Additionaly:[/b] ! [list] [*][u]Music Song Image[/u] - You can add the Song Image to the section of each song. (Maybe CD Cover, Artist Photo or any image you want ;) ) Maximum image size is configurable in adminCP :D *************** *** 34,38 **** [b]Special Note:[/b] [color=blue] ! 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] --- 33,37 ---- [b]Special Note:[/b] [color=blue] ! 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] Index: music.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** music.php 6 Jun 2007 20:32:28 -0000 1.1 --- music.php 1 Aug 2007 23:33:26 -0000 1.2 *************** *** 67,71 **** // Get general music information // ! include($music_root_path . 'music_common.'.$phpEx); // --- 67,71 ---- // Get general music information // ! include_once($music_root_path . 'music_common.'.$phpEx); // Index: music_center.pak =================================================================== RCS file: /cvsroot/mxbb/mx_music/music_center.pak,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** music_center.pak 6 Jun 2007 20:32:29 -0000 1.1 --- music_center.pak 1 Aug 2007 23:33:27 -0000 1.2 *************** *** 4,6 **** --- 4,10 ---- parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 block=+:=+:Music Center=+:Demo block=+:60=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 + New_function=+:---------------------------=+:0=+:0=+:0=+:0=+:0 + function=+:57=+:61=+:Music_list=+:Music toplists=+:music_lists.php=+: + parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 + block=+:=+:Music Toplist=+:Demo block=+:61=+:0=+:5=+:0=+:0=+:0=+:0=+:1=+:1 function=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- NEW FILE: music_lists.php --- <?php /** * * @package mxBB Portal Module - mx_music * @version $Id: music_lists.php,v 1.1 2007/08/01 23:33:27 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 ); if( !defined('IN_PORTAL') || !is_object($mx_block)) { die("Hacking attempt"); } else { define( 'MXBB_MODULE', true ); $is_block = TRUE; } // // Read block Configuration // $title = $mx_block->block_info['block_title']; $block_size = ( isset($block_size) && !empty($block_size) ? $block_size : '100%' ); $bullet_full = '<span class="genmed" style="color:#FFA34F"><b>›</b> </span>'; //global $images, $mx_images; $music_root_path = $module_root_path . 'music_box/'; // // Get general music information // include_once($music_root_path . 'music_common.'.$phpEx); // // Nav switch for mx // // --------------------- // Check $album_user_id // --------------------- if (isset ($_POST['user_id'])) { $music_user_id = intval($_POST['user_id']); } elseif (isset ($_GET['user_id'])) { $music_user_id = intval($_GET['user_id']); } else { $music_user_id = $userdata['user_id']; } /* +---------------------------------------------------------- | Build Categories Index +---------------------------------------------------------- */ $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 <> 0 GROUP BY cat_id ORDER BY cat_order ASC"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); } $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 if ($music_user_access['view'] == 1) { $catrows[] = $row; } } $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']; // -------------------------------- // Build moderators list // -------------------------------- $l_moderators = ''; $moderators_list = ''; $grouprows= array(); if( $catrows[$i]['cat_moderator_groups'] != '') { // We have usergroup_ID, now we need usergroup name $sql = "SELECT group_id, group_name FROM " . GROUPS_TABLE . " WHERE group_single_user <> 1 AND group_type <> ". GROUP_HIDDEN ." AND group_id IN (". $catrows[$i]['cat_moderator_groups'] .") ORDER BY group_name ASC"; if ( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not obtain usergroups data', '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $grouprows[] = $row; } } if( count($grouprows) > 0 ) { $l_moderators = $lang['Moderators']; for ($j = 0; $j < count($grouprows); $j++) { $group_link = '<a href="'. append_sid($phpbb_root_path. "groupcp.$phpEx?". POST_GROUPS_URL .'='. $grouprows[$j]['group_id']) .'">'. $grouprows[$j]['group_name'] .'</a>'; $moderators_list .= ($moderators_list == '') ? $group_link : ', ' . $group_link; } } // ------------------------------------------ // Get Last song of this Category // ------------------------------------------ if ($catrows[$i]['count'] == 0) { // // Oh, this category is empty // $last_song_info = $lang['No_Songs']; $u_last_song = ''; $last_song_title = ''; } else { // ---------------------------- // Check Song Approval // ---------------------------- if(($catrows[$i]['cat_approval'] == MUSIC_ADMIN) or ($catrows[$i]['cat_approval'] == MUSIC_MOD)) { $song_approval_sql = 'AND s.song_approval = 1'; // song Approval ON } else { $song_approval_sql = ''; // song Approval OFF } // ---------------------------- // OK, we may do a query now... // ---------------------------- $sql = "SELECT s.song_id, s.song_title, s.song_singer, s.song_user_id, s.song_username, s.song_time, s.song_cat_id, u.user_id, u.username FROM ". MUSIC_TABLE ." AS s LEFT JOIN ". USERS_TABLE ." AS u ON s.song_user_id = u.user_id WHERE s.song_cat_id = '". $catrows[$i]['cat_id'] ."' $song_approval_sql ORDER BY s.song_time DESC LIMIT 1"; if ( !$result = $db->sql_query($sql) ) { mx_message_die(GENERAL_ERROR, 'Could not get last song information', '', __LINE__, __FILE__, $sql); } $lastrow = $db->sql_fetchrow($result); // ---------------------------- // Write the Date // ---------------------------- $last_song_info = create_date($board_config['default_dateformat'], $lastrow['song_time'], $board_config['board_timezone']); $last_song_info .= '<br />'; // ---------------------------- // Write username of last poster // ---------------------------- if( ($lastrow['user_id'] == MUSIC_GUEST) or ($lastrow['username'] == '') ) { $last_song_info .= ($lastrow['song_username'] == '') ? $lang['Guest'] : $lastrow['song_username']; } else { $last_song_info .= $lang['Poster'] .': <a href="'. append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $lastrow['user_id']) .'">'. $lastrow['username'] .'</a>'; } // ---------------------------- // Write the last song's title. // Truncate it if it's too long // ---------------------------- if( !isset($music_config['last_song_title_length']) ) { $music_config['last_song_title_length'] = 25; } $lastrow['song_title'] = $lastrow['song_title']; if (strlen($lastrow['song_title']) > $music_config['last_song_title_length']) { $lastrow['song_title'] = substr($lastrow['song_title'], 0, $music_config['last_song_title_length']) . '...'; } $last_song_info .= '<br />'. $lang['Song_Title'] .': <a href="'; $last_song_info .= append_sid(this_mo_mxurl("music_mode=music_page&song_id=". $lastrow['song_id'])) .'">' ; $last_song_info .= $lastrow['song_title'] .'</a>'; } // END of Last Song // ------------------------------------------ // Parse to template the info of the current Category // ------------------------------------------ $template->assign_block_vars('catrow_lists', array( 'U_VIEW_CAT' => append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=". $catrows[$i]['cat_id'])), 'CAT_TITLE' => $catrows[$i]['cat_title'], 'CAT_DESC' => $catrows[$i]['cat_desc'], 'CAT_VIEWS' => $catrows[$i]['cat_views'], 'L_MODERATORS' => $l_moderators, 'MODERATORS' => $moderators_list, 'SONGS' => $catrows[$i]['count'], 'LAST_SONG_INFO' => $last_song_info) ); } // END of Categories Index /* +---------------------------------------------------------- | Top Song +---------------------------------------------------------- */ if( isset($HTTP_GET_VARS['sort_method']) ) { switch ($HTTP_GET_VARS['sort_method']) { case 'song_time': $sort_method = 'song_time'; 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_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']; } // Song limit if( isset($HTTP_GET_VARS['song_limit']) ) { switch ($HTTP_GET_VARS['song_limit']) { case '5': $song_limit = '5'; break; case '10': $song_limit = '10'; break; case '15': $song_limit = '15'; break; case '20': $song_limit = '20'; break; default: $song_limit = $music_config['top']; } } else if( isset($HTTP_POST_VARS['song_limit']) ) { switch ($HTTP_POST_VARS['song_limit']) { case '5': $song_limit = '5'; break; case '10': $song_limit = '10'; break; case '15': $song_limit = '15'; break; case '20': $song_limit = '20'; break; default: $song_limit = $music_config['top']; } } else { $song_limit = $music_config['top']; } // // We may do query now // if ($allowed_cat != '') { $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 $sort_method DESC LIMIT $song_limit"; if( !($result = $db->sql_query($sql)) ) { mx_message_die(GENERAL_ERROR, 'Could not query top songs information', '', __LINE__, __FILE__, $sql); } $topsongrow = array(); while( $row = $db->sql_fetchrow($result) ) { $topsongrow[] = $row; } $template->assign_block_vars('music_recent', array()); if (count($topsongrow) > 0) { for ($i = 0; $i < count($topsongrow); $i += $music_config['rows_per_page']) { for ($j = $i; $j < ($i + $music_config['rows_per_page']); $j++) { if( $j >= count($topsongrow) ) { break; } if(!$topsongrow[$j]['rating']) { $topsongrow[$j]['rating'] = $lang['Not_rated']; } else { $topsongrow[$j]['rating'] = round($topsongrow[$j]['rating'], 2); } if( ($topsongrow[$j]['user_id'] == MUSIC_GUEST) or ($topsongrow[$j]['username'] == '') ) { $top_poster = ($topsongrow[$j]['song_username'] == '') ? $lang['Guest'] : $topsongrow[$j]['song_username']; } else { $top_poster = '<a href="'. append_sid($phpbb_root_path . "profile.$phpEx?mode=viewprofile&". POST_USERS_URL .'='. $topsongrow[$j]['user_id']) .'">'. $topsongrow[$j]['username'] .'</a>'; } $template->assign_block_vars('music_recent_lists', array( 'BULLET' => $bullet_full, 'TITLE' => '<a href="'. append_sid(this_mo_mxurl("music_mode=music_page&song_id=". $topsongrow[$j]['song_id'])) . '">' . $topsongrow[$j]['song_title'] . '</a>', 'SINGER' => $topsongrow[$j]['song_singer'], 'POSTER' => $top_poster, 'L_SONG_LIMIT' => $lang['Song_Limit'], 'L_NO_SONGS' => $lang['No_Songs'], 'L_SONG_TITLE' => $lang['Song_Title'], 'L_SINGER' => $lang['Singer'], 'L_POSTER' => $lang['Poster'], 'L_POSTED' => $lang['Posted'], 'L_RATING' => $lang['Rating'], 'L_COMMENTS' => $lang['Comments'], 'TIME' => create_date($board_config['default_dateformat'], $topsongrow[$j]['song_time'], $board_config['board_timezone']), 'VIEW' => $topsongrow[$j]['song_view_count'], 'RATING' => ($music_config['rate'] == 1) ? ( '<a href="'. append_sid(this_mo_mxurl("music_mode=music_rate&song_id=". $topsongrow[$j]['song_id'])) . '">' . $topsongrow[$j]['rating'] . '</a>' ) : '', 'COMMENTS' => ($music_config['comment'] == 1) ? ( '<a href="'. append_sid(this_mo_mxurl("music_mode=music_comment&song_id=". $topsongrow[$j]['song_id'])) . '">' . $topsongrow[$j]['comments'] . '</a>' ) : '', 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . decode_ip($topsongrow[$j]['song_user_ip']) . '" target="_blank">' . decode_ip($topsongrow[$j]['song_user_ip']) .'</a><br />' : '', 'U_SONG' => append_sid(this_mo_mxurl("music_mode=music_page&song_id=". $topsongrow[$j]['song_id'])), 'DESC' => $topsongrow[$j]['song_desc'], 'S_ROW_COUNT' => $j) ); } } } else { // // No songs Found // $template->assign_block_vars('music_lists_no_songs', array()); } } else { // // No Cats Found // $template->assign_block_vars('music_lists_no_songs', array()); } // ------------------------------------ // additional sorting options // ------------------------------------ $sort_rating_option = ''; $sort_comments_option = ''; if( $music_config['rate'] == 1 ) { $sort_rating_option = '<option value="rating" '; $sort_rating_option .= ($sort_method == 'rating') ? 'selected="selected"' : ''; $sort_rating_option .= '>' . $lang['Rating'] .'</option>'; } if( $music_config['comment'] == 1 ) { $sort_comments_option = '<option value="comments" '; $sort_comments_option .= ($sort_method == 'comments') ? 'selected="selected"' : ''; $sort_comments_option .= '>' . $lang['Comments'] .'</option>'; $sort_new_comment_option = '<option value="new_comment" '; $sort_new_comment_option .= ($sort_method == 'new_comment') ? 'selected="selected"' : ''; $sort_new_comment_option .= '>' . $lang['New_Comment'] .'</option>'; } /* +---------------------------------------------------------- | Start output the page +---------------------------------------------------------- */ //$page_title = $lang['Music']; if ( !is_object($mx_block)) { include($mx_root_path . 'includes/page_header.'.$phpEx); } $template->set_filenames(array( 'music_lists_body' => 'music_lists.tpl') ); $template->assign_vars(array( 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ), 'L_TOP_SONGS' => $lang['Top_Songs'], 'L_RECENT_SONGS' => $lang['Recent_Songs'], 'L_NO_SONGS' => $lang['No_Songs']) ); // // Generate the page // $template->pparse('music_lists_body'); if ( !is_object($mx_block)) { include($mx_root_path . 'includes/page_tail.'.$phpEx); } // +------------------------------------------------------+ // | Powered by Music Online 2.0 (c) 2003 Cf Manager | // +------------------------------------------------------+ ?> |