|
From: FlorinCB <ory...@us...> - 2008-09-17 20:32:11
|
Update of /cvsroot/mxbb/mx_music In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26934 Modified Files: music.php Log Message: Fixes and phpBB images Index: music.php =================================================================== RCS file: /cvsroot/mxbb/mx_music/music.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** music.php 18 Sep 2008 00:28:07 -0000 1.27 --- music.php 18 Sep 2008 03:31:37 -0000 1.28 *************** *** 538,542 **** 'U_VIEW_MEDIA_CAT' => mx_append_sid(this_mo_mxurl("music_mode=music_media_cat&cat_id=". $catrows[$i]['cat_id'])), 'CAT_TITLE' => $catrows[$i]['cat_title'], ! 'CAT_IMG' => $images['folder'], 'CAT_DESC' => $catrows[$i]['cat_desc'], 'SONGS' => $catrows[$i]['count'], --- 538,542 ---- 'U_VIEW_MEDIA_CAT' => mx_append_sid(this_mo_mxurl("music_mode=music_media_cat&cat_id=". $catrows[$i]['cat_id'])), 'CAT_TITLE' => $catrows[$i]['cat_title'], ! 'CAT_IMG' => $images['forum'], 'CAT_DESC' => $catrows[$i]['cat_desc'], 'SONGS' => $catrows[$i]['count'], *************** *** 693,710 **** } ! $thiscat = array(); // this category ! $catrows = array(); // all categories for jumpbox ! $auth_data = array(); //album auth ! while( $row = $db->sql_fetchrow($result) ) { ! $music_user_access = music_user_access($cat_id, $row, 1, 0, 0, 0, 0, 0); // VIEW if ($music_user_access['view'] == 1) { ! $catrows[] = $row; ! $thiscat = $row; ! $auth_data = music_user_access($cat_id, $row, 1, 1, 1, 1, 1, 1); // ALL ! $total_songs = $thiscat['count']; } } --- 693,710 ---- } ! $thiscat_items = array(); // this category ! $catrows_items = array(); // all categories for jumpbox ! $auth_data_items = array(); //album auth ! 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) { ! $catrows_items[] = $row_items; ! $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']; } } *************** *** 714,721 **** { $template->assign_vars(array( ! 'U_VIEW_CAT' => mx_append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=". $catrows[$i]['cat_id'])), ! 'CAT_TITLE' => $thiscat['cat_title'], ! 'CAT_VIEWS' => $thiscat['cat_views'], ! 'CAT_DESC' => $thiscat['cat_desc'], 'WIDTH' => ( !empty($media_width) ? $media_width : '425' ), 'HEIGHT' => ( !empty($media_height) ? $media_height : '350' ), --- 714,721 ---- { $template->assign_vars(array( ! 'U_VIEW_CAT' => mx_append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=". $catrows_items[$i]['cat_id'])), ! 'CAT_TITLE' => $thiscat_items['cat_title'], ! 'CAT_VIEWS' => $thiscat_items['cat_views'], ! 'CAT_DESC' => $thiscat_items['cat_desc'], 'WIDTH' => ( !empty($media_width) ? $media_width : '425' ), 'HEIGHT' => ( !empty($media_height) ? $media_height : '350' ), *************** *** 726,733 **** { $template->assign_vars(array( ! 'U_VIEW_CAT' => mx_append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=". $catrows[$i]['cat_id'])), ! 'CAT_TITLE' => $thiscat['cat_title'], ! 'CAT_VIEWS' => $thiscat['cat_views'], ! 'CAT_DESC' => $thiscat['cat_desc'], 'WIDTH' => ( !empty($media_width) ? $media_width : '425' ), 'HEIGHT' => ( !empty($media_height) ? $media_height : '350' ), --- 726,733 ---- { $template->assign_vars(array( ! 'U_VIEW_CAT' => mx_append_sid(this_mo_mxurl("music_mode=music_cat&cat_id=". $catrows_items[$i]['cat_id'])), ! 'CAT_TITLE' => $thiscat_items['cat_title'], ! 'CAT_VIEWS' => $thiscat_items['cat_views'], ! 'CAT_DESC' => $thiscat_items['cat_desc'], 'WIDTH' => ( !empty($media_width) ? $media_width : '425' ), 'HEIGHT' => ( !empty($media_height) ? $media_height : '350' ), *************** *** 767,771 **** } ! if ($auth_data['upload']) { $enable_soung_upload_switch = true; --- 767,771 ---- } ! if ($auth_data_items['upload']) { $enable_soung_upload_switch = true; *************** *** 776,783 **** // 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 { // --- 776,783 ---- // Build Auth List // ------------------------------------ ! $auth_key = array_keys($auth_data_items); ! $auth_list_items = ''; ! for ($i = 0; $i < (count($auth_data_items) - 1); $i++) // ignore MODERATOR in this loop { // *************** *** 789,800 **** } ! $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>'); } // --- 789,800 ---- } ! $auth_list_items .= ($auth_data_items[$auth_key[$i]] == 1) ? $lang['Music_'. $auth_key[$i] .'_can'] : $lang['Music_'. $auth_key[$i] .'_cannot']; ! $auth_list_items .= '<br />'; } // add Moderator Control Panel here ! if( ($userdata['user_level'] == ADMIN) or ($auth_data_items['moderator'] == 1) ) { ! $auth_list_items .= sprintf($lang['Music_moderate_can'], '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_modcp&cat_id=$cat_id")) .'">', '</a>'); } // *************** *** 810,814 **** $moderators_list = ''; ! if ($thiscat['cat_moderator_groups'] != '') { switch (PORTAL_BACKEND) --- 810,814 ---- $moderators_list = ''; ! if ($thiscat_items['cat_moderator_groups'] != '') { switch (PORTAL_BACKEND) *************** *** 828,832 **** 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) ) --- 828,832 ---- WHERE " . $sql_where . " AND group_type <> ". GROUP_HIDDEN ." ! AND group_id IN (". $thiscat_items['cat_moderator_groups'] .") ORDER BY group_name ASC"; if ( !$result = $db->sql_query($sql) ) *************** *** 985,991 **** $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 = ''; --- 985,991 ---- $song_approval_sql = 'AND s.song_approval = 1'; ! if ($thiscat_items['cat_approval'] != MUSIC_USER) { ! if( ($userdata['user_level'] == ADMIN) or (($auth_data_items['moderator'] == 1) and ($thiscat_items['cat_approval'] == MUSIC_MOD)) ) { $song_approval_sql = ''; *************** *** 1050,1056 **** $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'; --- 1050,1056 ---- $approval_link = ''; ! if ($thiscat_items['cat_approval'] != MUSIC_USER) { ! if( ($userdata['user_level'] == ADMIN) or (($auth_data_items['moderator'] == 1) and ($thiscat_items['cat_approval'] == MUSIC_MOD)) ) { $approval_mode = ($songrow[$j]['song_approval'] == 0) ? 'approval' : 'unapproval'; *************** *** 1530,1540 **** 'COMMENTS' => ($music_config['comment'] == 1) ? ( '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_comment&song_id=". $songrow[$j]['song_id'])) . '">' . $songrow[$j]['comments'] . '</a>' ) : '', ! 'EDIT' => ( ( $auth_data['edit'] and ($songrow[$j]['song_user_id'] == $userdata['user_id']) ) or ($auth_data['moderator'] and ($thiscat['cat_edit_level'] != MUSIC_ADMIN) ) or ($userdata['user_level'] == ADMIN) ) ? '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_edit&song_id=". $songrow[$j]['song_id'])) . '">' . $lang['Edit_song'] . '</a>' : '', ! 'DELETE' => ( ( $auth_data['delete'] and ($songrow[$j]['song_user_id'] == $userdata['user_id']) ) or ($auth_data['moderator'] and ($thiscat['cat_delete_level'] != MUSIC_ADMIN) ) or ($userdata['user_level'] == ADMIN) ) ? '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_delete&song_id=". $songrow[$j]['song_id'])) . '">' . $lang['Delete_song'] . '</a>' : '', ! 'MOVE' => ($auth_data['moderator']) ? '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_modcp&mode=move&song_id=". $songrow[$j]['song_id'])) .'">'. $lang['Move'] .'</a>' : '', ! 'LOCK' => ($auth_data['moderator']) ? '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_modcp&mode=". (($songrow[$j]['song_lock'] == 0) ? 'lock' : 'unlock') ."&song_id=". $songrow[$j]['song_id'])) .'">'. (($songrow[$j]['song_lock'] == 0) ? $lang['Lock'] : $lang['Unlock']) .'</a>' : '', 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . $song_user_ip . '" target="_blank">' . $song_user_ip .'</a><br />' : '', --- 1530,1540 ---- 'COMMENTS' => ($music_config['comment'] == 1) ? ( '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_comment&song_id=". $songrow[$j]['song_id'])) . '">' . $songrow[$j]['comments'] . '</a>' ) : '', ! 'EDIT' => ( ( $auth_data_items['edit'] and ($songrow[$j]['song_user_id'] == $userdata['user_id']) ) or ($auth_data_items['moderator'] and ($thiscat_items['cat_edit_level'] != MUSIC_ADMIN) ) or ($userdata['user_level'] == ADMIN) ) ? '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_edit&song_id=". $songrow[$j]['song_id'])) . '">' . $lang['Edit_song'] . '</a>' : '', ! 'DELETE' => ( ( $auth_data_items['delete'] and ($songrow[$j]['song_user_id'] == $userdata['user_id']) ) or ($auth_data_items['moderator'] and ($thiscat_items['cat_delete_level'] != MUSIC_ADMIN) ) or ($userdata['user_level'] == ADMIN) ) ? '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_delete&song_id=". $songrow[$j]['song_id'])) . '">' . $lang['Delete_song'] . '</a>' : '', ! 'MOVE' => ($auth_data_items['moderator']) ? '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_modcp&mode=move&song_id=". $songrow[$j]['song_id'])) .'">'. $lang['Move'] .'</a>' : '', ! 'LOCK' => ($auth_data_items['moderator']) ? '<a href="'. mx_append_sid(this_mo_mxurl("music_mode=music_modcp&mode=". (($songrow[$j]['song_lock'] == 0) ? 'lock' : 'unlock') ."&song_id=". $songrow[$j]['song_id'])) .'">'. (($songrow[$j]['song_lock'] == 0) ? $lang['Lock'] : $lang['Unlock']) .'</a>' : '', 'IP' => ($userdata['user_level'] == ADMIN) ? $lang['IP_Address'] . ': <a href="http://www.nic.com/cgi-bin/whois.cgi?query=' . $song_user_ip . '" target="_blank">' . $song_user_ip .'</a><br />' : '', *************** *** 1566,1574 **** $music_jumpbox = '<form name="jumpbox" action="'. mx_append_sid(this_mo_mxurl("music_mode=music_cat")) .'" method="get">'; $music_jumpbox .= $lang['Jump_to'] . ': <select name="cat_id" onChange="forms[\'jumpbox\'].submit()">'; ! for ($i = 0; $i < count($catrows); $i++) { ! $music_jumpbox .= '<option value="'. $catrows[$i]['cat_id'] .'"'; ! $music_jumpbox .= ($catrows[$i]['cat_id'] == $cat_id) ? 'selected="selected"' : ''; ! $music_jumpbox .= '>' . $catrows[$i]['cat_title'] .'</option>'; } $music_jumpbox .= '</select>'; --- 1566,1574 ---- $music_jumpbox = '<form name="jumpbox" action="'. mx_append_sid(this_mo_mxurl("music_mode=music_cat")) .'" method="get">'; $music_jumpbox .= $lang['Jump_to'] . ': <select name="cat_id" onChange="forms[\'jumpbox\'].submit()">'; ! for ($i = 0; $i < count($catrows_items); $i++) { ! $music_jumpbox .= '<option value="'. $catrows_items[$i]['cat_id'] .'"'; ! $music_jumpbox .= ($catrows_items[$i]['cat_id'] == $cat_id) ? 'selected="selected"' : ''; ! $music_jumpbox .= '>' . $catrows_items[$i]['cat_title'] .'</option>'; } $music_jumpbox .= '</select>'; |