|
From: OryNider <ory...@us...> - 2007-09-08 13:28:34
|
Update of /cvsroot/mxbb/mx_music In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1601 Modified Files: db_install.php db_upgrade.php music.php Log Message: This will fix many bugs that commed with the new features. If you allready upgraded to 2.0.7 please upgrade manualy the database. :P Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/db_install.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** db_install.php 5 Sep 2007 23:37:44 -0000 1.6 --- db_install.php 8 Sep 2007 13:28:29 -0000 1.7 *************** *** 57,60 **** --- 57,61 ---- song_id int(11) UNSIGNED NOT NULL auto_increment, song_filename varchar(255) NOT NULL, + song_filetype varchar(255) NOT NULL, song_imagename varchar(255) NOT NULL, song_title varchar(255) NOT NULL, *************** *** 174,177 **** --- 175,184 ---- $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('index', '5')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('img_allowed', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('xs_enabled', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('show_index_subcats', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('rows_per_page_pic', '5')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('cols_per_page_pic', '5')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('rows_per_page_media', '10')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('cols_per_page_media', '1')"; $sql[] = "UPDATE " . $mx_table_prefix . "module" . " Index: music.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** music.php 5 Sep 2007 23:37:46 -0000 1.7 --- music.php 8 Sep 2007 13:28:29 -0000 1.8 *************** *** 188,204 **** if ($cat_id != 0) { ! $sql = "SELECT cat_id,cat_title FROM ". MUSIC_CAT_TABLE ." WHERE cat_id = $cat_id"; ! if ( $result = $db->sql_query($sql) ) ! { ! $row = $db->sql_fetchrow($result); ! ! $template->assign_vars(array( ! 'SUBCAT_NAV' => '-> <a class="nav" href="' . append_sid(this_mo_mxurl("c=" . $row['cat_id'])) . '">' . $row['cat_title'] . '</a>', ! ) ! ); ! } ! } $sql = "SELECT c.*, COUNT(s.song_id) AS count --- 188,207 ---- if ($cat_id != 0) { ! $sql = "SELECT cat_id,cat_title FROM ". MUSIC_CAT_TABLE ." WHERE cat_id = $cat_id"; ! if ( $result = $db->sql_query($sql) ) ! { ! $thiscat_parent = array(); ! $thiscat_parent = $db->sql_fetchrow($result); ! ! $template->assign_vars(array( ! 'U_VIEW_CAT_PARENT' => append_sid(this_mo_mxurl("c=" . $thiscat_parent['cat_id'])), ! 'SUBCAT_NAV' => ' ' . $lang['Nav_Separator'] . ' <a class="nav" href="' . append_sid(this_mo_mxurl("c=" . $thiscat_parent['cat_id'])) . '">' . $thiscat_parent['cat_title'] . '</a>', ! 'CAT_PARENT_TITLE' => $thiscat_parent['cat_title'], ! 'CAT_PARENT' => $thiscat_parent['cat_id']) ! ); ! } ! } $sql = "SELECT c.*, COUNT(s.song_id) AS count *************** *** 658,663 **** else { ! // this is a parent category ! $sc_sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." WHERE cat_parent = " . $catrows[$i]['cat_id'] . " --- 661,666 ---- else { ! // this is a parent category ! $sc_sql = "SELECT * FROM ". MUSIC_CAT_TABLE ." WHERE cat_parent = " . $catrows[$i]['cat_id'] . " *************** *** 665,699 **** ORDER BY cat_order ASC"; ! if ( !($sc_result = $db->sql_query($sc_sql)) ) ! { message_die(GENERAL_ERROR, 'Could not query sub categories', '', __LINE__, __FILE__, $sql); ! } ! $sql_count = "SELECT count(cat_id) as count FROM ". MUSIC_CAT_TABLE ." WHERE cat_parent = " . $catrows[$i]['cat_id']; ! if ( ($result_count = $db->sql_query($sql_count)) ) ! { $subcat_count = $db->sql_fetchrow($result_count); $subcat_count = $subcat_count['count'] . " sub catagories"; ! } ! else ! { $subcat_count = ""; ! } ! ! $subcats = "<br /><span class=\"gensmall\"><b>Sub-catagories:</b><br />"; ! while ( $subcatrow = $db->sql_fetchrow($sc_result) ) ! { ! $subcats .= " - <a class=\"gensmall\" href=\"" . append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=". $subcatrow['cat_id'])) . "\">" . $subcatrow['cat_title'] . "</a><br />"; ! } ! $subcats .= "</span><br />"; ! $template->assign_block_vars('catrow', array( 'U_VIEW_CAT' => append_sid(this_mo_mxurl("music_mode=music_index&c=". $catrows[$i]['cat_id'])), 'CAT_TITLE' => $catrows[$i]['cat_title'], 'CAT_DESC' => $catrows[$i]['cat_desc'], ! 'SONGS' => $subcat_count, ! 'SUBCATS' => $subcats, 'CAT_VIEWS' => $catrows[$i]['cat_views'], 'L_MODERATORS' => $l_moderators, --- 668,701 ---- ORDER BY cat_order ASC"; ! if ( !($sc_result = $db->sql_query($sc_sql)) ) ! { message_die(GENERAL_ERROR, 'Could not query sub categories', '', __LINE__, __FILE__, $sql); ! } ! $sql_count = "SELECT count(cat_id) as count FROM ". MUSIC_CAT_TABLE ." WHERE cat_parent = " . $catrows[$i]['cat_id']; ! if ( ($result_count = $db->sql_query($sql_count)) ) ! { $subcat_count = $db->sql_fetchrow($result_count); $subcat_count = $subcat_count['count'] . " sub catagories"; ! } ! else ! { $subcat_count = ""; ! } ! $subcats = '<br /><span class="gensmall"><b>' . $lang['Music_sub_categories'] . ':</b><br />'; ! while ( $subcatrow = $db->sql_fetchrow($sc_result) ) ! { ! $subcats .= ' - <a class="gensmall" href="' . append_sid(this_mo_mxurl('music_mode=music_cat&cat_id='. $subcatrow['cat_id'])) . '">' . $subcatrow['cat_title'] . '</a><br />'; ! } ! $subcats .= '</span><br />'; ! ! $template->assign_block_vars('catrow', array( 'U_VIEW_CAT' => append_sid(this_mo_mxurl("music_mode=music_index&c=". $catrows[$i]['cat_id'])), 'CAT_TITLE' => $catrows[$i]['cat_title'], 'CAT_DESC' => $catrows[$i]['cat_desc'], ! 'SONGS' => $subcat_count, 'CAT_VIEWS' => $catrows[$i]['cat_views'], 'L_MODERATORS' => $l_moderators, *************** *** 702,706 **** 'MODERATORS' => $moderators_list, 'LAST_SONG_INFO' => $last_song_info) ! ); } // ------------------------------------------ --- 704,716 ---- 'MODERATORS' => $moderators_list, 'LAST_SONG_INFO' => $last_song_info) ! ); ! ! if ($music_config['show_index_subcats'] == 1) ! { ! $template->assign_block_vars('catrow.subcat_link', array( ! 'L_SUBCATS' => $lang['Music_sub_categories'], ! 'SUBCATS' => $subcats) ! ); ! } } // ------------------------------------------ Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/db_upgrade.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** db_upgrade.php 30 Aug 2007 03:52:17 -0000 1.4 --- db_upgrade.php 8 Sep 2007 13:28:29 -0000 1.5 *************** *** 57,61 **** // validate before 2.07 // ! $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "music_config WHERE config_name = 'img_allowed'" ); if ( $db->sql_numrows( $result ) == 0 ) { --- 57,61 ---- // validate before 2.07 // ! $result = $db->sql_query( "SELECT config_value from " . $mx_table_prefix . "music_config WHERE config_name = 'xs_enabled'" ); if ( $db->sql_numrows( $result ) == 0 ) { *************** *** 83,88 **** $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_size', '10240')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_width', '300')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_height', '200')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('download', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('enable_integration', '1')"; --- 83,88 ---- $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_size', '10240')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_width', '800')"; ! $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('max_image_height', '600')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('download', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('enable_integration', '1')"; *************** *** 95,102 **** --- 95,109 ---- $message .= "<b>Upgrading to v. 2.0.7...</b><br/><br/>"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('xs_enabled', '1')"; $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('img_allowed', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('show_index_subcats', '1')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('rows_per_page_pic', '5')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('cols_per_page_pic', '5')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('rows_per_page_media', '10')"; + $sql[] = "INSERT INTO " . $mx_table_prefix . "music_config VALUES ('cols_per_page_media', '1')"; $sql[] = "ALTER TABLE " . $mx_table_prefix . "music_cat ADD cat_parent mediumint(8) UNSIGNED NOT NULL DEFAULT '0' AFTER cat_id"; $sql[] = "ALTER TABLE " . $mx_table_prefix . "music_cat ADD cat_type tinyint NOT NULL DEFAULT '0' AFTER cat_parent"; + $sql[] = "ALTER TABLE " . $mx_table_prefix . "music ADD song_filetype varchar(255) NOT NULL AFTER song_filename"; $sql[] = "UPDATE ". $mx_table_prefix ."music_config |