|
From: FlorinCB <ory...@us...> - 2008-09-18 00:25:21
|
Update of /cvsroot/mxbb/mx_music In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv6040 Modified Files: db_install.php db_upgrade.php music.php Log Message: version 2.9.4 Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/db_install.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** db_install.php 10 Sep 2008 12:26:14 -0000 1.13 --- db_install.php 18 Sep 2008 07:24:44 -0000 1.14 *************** *** 33,37 **** } ! $mx_module_version = '2.9.3'; $mx_module_copy = 'Mx-Publisher <i> - Music Center</i> module by Cf Manager & <a href="http://www.mx-publisher.com/" target="_blank">OryNider</a>'; --- 33,37 ---- } ! $mx_module_version = '2.9.4'; $mx_module_copy = 'Mx-Publisher <i> - Music Center</i> module by Cf Manager & <a href="http://www.mx-publisher.com/" target="_blank">OryNider</a>'; Index: music.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music.php,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** music.php 18 Sep 2008 03:31:37 -0000 1.28 --- music.php 18 Sep 2008 07:24:45 -0000 1.29 *************** *** 383,387 **** $allowed_cat = ''; // For Recent Public Songs below ! // // $catrows now stores all categories which this user can view. Dump them out! --- 383,387 ---- $allowed_cat = ''; // For Recent Public Songs below ! // // $catrows now stores all categories which this user can view. Dump them out! *************** *** 392,399 **** // Build allowed category-list (for recent songs after here) // -------------------------------- - $allowed_cat .= ($allowed_cat == '') ? $catrows[$i]['cat_id'] : ',' . $catrows[$i]['cat_id']; - - // -------------------------------- // Build moderators list --- 392,396 ---- *************** *** 405,409 **** $grouprows= array(); ! if( $catrows[$i]['cat_moderator_groups'] != '') { switch (PORTAL_BACKEND) --- 402,406 ---- $grouprows= array(); ! if(intval($catrows[$i]['cat_moderator_groups'])) { switch (PORTAL_BACKEND) *************** *** 423,427 **** WHERE " . $sql_where . " 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) ) --- 420,424 ---- WHERE " . $sql_where . " AND group_type <> ". GROUP_HIDDEN ." ! AND group_id IN (". intval($catrows[$i]['cat_moderator_groups']) .") ORDER BY group_name ASC"; if ( !$result = $db->sql_query($sql) ) *************** *** 451,455 **** // Get Last song of this Category // ------------------------------------------ - if ($catrows[$i]['cat_type'] == 0) { --- 448,451 ---- *************** *** 533,536 **** --- 529,534 ---- // END of Last Song + //while ($catrows[$i]['cat_id'] = 4) { die("4"); } + $template->assign_block_vars('catrow', array( 'U_VIEW_CAT' => mx_append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=". $catrows[$i]['cat_id'])), *************** *** 547,551 **** 'MODERATORS' => $moderators_list, 'LAST_SONG_INFO' => $last_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 --- 545,549 ---- 'MODERATORS' => $moderators_list, 'LAST_SONG_INFO' => $last_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 *************** *** 614,618 **** else { ! // this is a parent category $sc_sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." --- 612,616 ---- else { ! // this is a parent category cat_type = 1 $sc_sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." *************** *** 675,682 **** } } // ------------------------------------------ // Parse to template the info of the current Category // ------------------------------------------ ! if ($catrows[$i]['cat_type'] == 0) { // ------------------------------------ --- 673,701 ---- } } + } + + + if (!$mx_request_vars->is_empty_request('c')) + { + $sql = "SELECT c.cat_type, c.cat_id + FROM ". MUSIC_CAT_TABLE ." AS c + WHERE cat_id = " . $cat_id . " + LIMIT 1"; + if( !($result = $db->sql_query($sql)) ) + { + mx_message_die(GENERAL_ERROR, 'Could not query subcategories list', '', __LINE__, __FILE__, $sql); + } + + $cat_root = array(); + + while( $row_ = $db->sql_fetchrow($result) ) + { + $cat_root[] = $row_root; + } + // ------------------------------------------ // Parse to template the info of the current Category // ------------------------------------------ ! if (($cat_root['cat_type'] == 0) || ($cat_root['cat_type'] == 1)) { // ------------------------------------ *************** *** 686,691 **** FROM ". MUSIC_CAT_TABLE ." AS c LEFT JOIN ". MUSIC_TABLE ." AS s ON c.cat_id = s.song_cat_id WHERE c.cat_id = " . $cat_id . " ! GROUP BY c.cat_id ! ORDER BY cat_order"; if( !($result = $db->sql_query($sql)) ) { --- 705,709 ---- FROM ". MUSIC_CAT_TABLE ." AS c LEFT JOIN ". MUSIC_TABLE ." AS s ON c.cat_id = s.song_cat_id WHERE c.cat_id = " . $cat_id . " ! LIMIT 1"; if( !($result = $db->sql_query($sql)) ) { *************** *** 699,703 **** while( $row_items = $db->sql_fetchrow($result) ) { ! $music_user_access = music_user_access($cat_id, $row_items, 1, 0, 0, 0, 0, 0); // VIEW if ($music_user_access['view'] == 1) { --- 717,721 ---- while( $row_items = $db->sql_fetchrow($result) ) { ! $music_user_access = music_user_access($catrows[$i]['cat_id'], $row_items, 1, 0, 0, 0, 0, 0); // VIEW if ($music_user_access['view'] == 1) { *************** *** 705,709 **** $thiscat_items = $row_items; ! $auth_data_items = music_user_access($cat_id, $row_items, 1, 1, 1, 1, 1, 1); // ALL $total_songs = $thiscat_items['count']; } --- 723,727 ---- $thiscat_items = $row_items; ! $auth_data_items = music_user_access($catrows[$i]['cat_id'], $row_items, 1, 1, 1, 1, 1, 1); // ALL $total_songs = $thiscat_items['count']; } *************** *** 1552,1559 **** ) ); } else { ! $template->assign_block_vars('no_songs', array()); } // --- 1570,1578 ---- ) ); + } else { ! $template->assign_block_vars('no_songs', array()); } // *************** *** 1607,1610 **** --- 1626,1630 ---- + /* +---------------------------------------------------------- *************** *** 1809,1813 **** } } ! for ($i = 0; $i < count($catsrow); $i++) { --- 1829,1835 ---- } } ! ! $allowed_cats = ''; ! for ($i = 0; $i < count($catsrow); $i++) { *************** *** 1816,1823 **** // -------------------------------- ! $allowed_cat .= ($allowed_cat == '') ? $catsrow[$i]['cat_id'] : ',' . $catsrow[$i]['cat_id']; } ! if ( ($allowed_cat != '') && ($music_config['top'] > '0') ) { $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 --- 1838,1845 ---- // -------------------------------- ! $allowed_cats .= ($allowed_cats == '') ? $catsrow[$i]['cat_id'] : ',' . $catsrow[$i]['cat_id']; } ! if ( ($allowed_cats != '') && ($music_config['top'] > '0') ) { $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 Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/db_upgrade.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** db_upgrade.php 10 Sep 2008 06:36:35 -0000 1.10 --- db_upgrade.php 18 Sep 2008 07:24:44 -0000 1.11 *************** *** 30,34 **** } ! $mx_module_version = '2.9.3'; $mx_module_copy = 'Mx-Publisher <i> - Music Center</i> module by Cf Manager & <a href="http://www.mx-publisher.com/" target="_blank">OryNider</a>'; $sql = array(); --- 30,34 ---- } ! $mx_module_version = '2.9.4'; $mx_module_copy = 'Mx-Publisher <i> - Music Center</i> module by Cf Manager & <a href="http://www.mx-publisher.com/" target="_blank">OryNider</a>'; $sql = array(); |